Packaging and adaptation

Skills, hooks, and wrappers

These are the pieces that make raw capabilities easier, safer, and more reusable for agents.

Four different jobs

A tool can act. A skill can teach. A hook can enforce. A wrapper can adapt.

Tool

Does the work.

"Run git status."

Skill

Explains how and when to use tools.

"When reviewing a PR, inspect diff, tests, risky files, and CI."

Hook

Runs automatically at a lifecycle point.

"Before commit, scan for secrets."

Wrapper

Changes the interface to something easier to call.

"Expose this CLI as an MCP tool."

In practice

These layers make raw tools usable by agents.

If tools are the hands, these are the recipes, guardrails, and adapter plates around the hands.

Current default

Skill

ELI5: A recipe card that tells the apprentice how to do one kind of job well.

What it actually is: Reusable procedural knowledge: when to start, which tools to use, what order to follow, and how to check the result.

Try it: Read and adapt lab 04.

Real tools: Copilot/Claude-style skills, runbooks, repo instruction files, code-review procedures.

Current default

Hook

ELI5: A motion sensor that turns the light on whenever someone enters the room.

What it actually is: A lifecycle callback that runs automatically before or after key events so policy does not depend on the model remembering every rule.

Try it: Follow lab 05.

Real tools: Git hooks, pre-commit, CI checks, host approval hooks, secret scanners.

Current default Being absorbed

Wrapper

ELI5: Put a weird machine behind a cleaner front panel so the next person only has to push one labeled button.

What it actually is: A layer that reshapes an existing tool into a cleaner schema, protocol, or host experience.

Try it: Compare lab 02 and lab 03.

Real tools: JSON CLI wrappers, MCP adapters, LiteLLM gateways, host-specific tool shims.

Procedural memory

Skills are procedural memory.

A skill is not just a prompt. Good skills encode a repeatable way of doing a task: entry conditions, required context, steps, tool choices, validation, and common failure modes.

When skills help

Use a skill when the same kind of task comes up repeatedly and the agent benefits from domain-specific instructions.

What skills contain

Instructions, examples, scripts, templates, checklists, tool-routing guidance, and validation criteria.

What skills are not

They are not necessarily executable by themselves. They may call tools, but their main job is to package know-how.

Lifecycle automation

Hooks are lifecycle automation.

Hooks fire before or after something important happens. They are useful when you want consistent behavior without depending on the model to remember every rule.

Security companion: API key security explains why hooks help at the boundary but do not replace a real secret split.

Hook point Possible use Risk to manage
Before a tool call Block dangerous commands, require approval, add credentials safely. Over-blocking legitimate work or leaking policy details.
After a file edit Format, lint, run targeted tests, update generated files. Unexpected edits or slow feedback loops.
Before commit or deploy Run tests, scan for secrets, check changelog, enforce policy. False confidence if checks are too shallow.
When context loads Inject project instructions, fetch docs, add relevant memory. Context bloat or stale instructions.

Interface reshaping

Wrappers reshape one interface into another.

Thin wrapper

Adds a friendlier command, schema, or output format around an existing capability.

Example: a script that converts messy CLI output into JSON.

Thick wrapper

Adds state, retries, permissions, caching, routing, or an agent loop around existing tools.

Example: a CLI AI suite that wraps shell tools, memory, and approvals.

Category drift

Tool categories often absorb each other.

Pattern What happens Example
CLI becomes MCP A server wraps shell commands and exposes them as typed tools. rg or gh behind tools/call.
Skill becomes workflow A skill starts as instructions, then gains scripts, checks, and reusable state. A release skill that tests, updates a changelog, tags, and publishes.
Hook becomes policy engine Lifecycle callbacks grow into approvals, linting, logging, and enforcement. Block destructive shell commands or secrets in commits.
Host absorbs protocol features A CLI suite ships native tools that overlap with what MCP servers provide. Built-in file read, search, shell, and GitHub tools.
Persistent agent wraps other agents A daemon delegates work to specialized CLI agents or subagents. A long-running assistant launching coding agents for isolated tasks.

Walkthrough

One test command, four layers

1

Tool: npm test runs the test suite. It does the work directly.

2

Wrapper: a script runs only affected tests and returns stable JSON for an agent.

3

Skill: instructions tell the agent when to run tests, how to interpret failures, and when to stop.

4

Hook: the test command runs automatically before commit or after a file edit.