This is chapter 5 of my book **Building Autonomous AI Agents with Claude Code* — a field guide to turning Claude Code from a coding assistant into an agent that remembers, verifies its own work, and knows when to stop. Everything below is from a system I actually run every day on one Windows PC.*
1. A Skill = A Procedure Turned into a File
Take a work procedure you used to explain verbally every time (a review checklist, a deployment sequence, a logging format) and save it as a file, and a single invocation loads the entire procedure. The key effect is that the quality of the procedure is decoupled from how you're doing that day.
---
---
There are three signals that something is worth turning into a skill.
① You've repeated the same explanation three or more times ② Skipping a step causes an incident
③ It can be used in other projects too.
2. A Subagent = Delegating to Another "Head"
A subagent is a lower-level AI that works independently in a separate context and returns only the result.
There are two criteria for deciding what to split off.
① Contamination isolation. Work that clutters the context — mass searches, long log analysis — should be done by a subagent that brings back only the conclusion. The main agent's thinking space stays clean.
② Role isolation. Work where "the person who builds and the person who checks must be different" — verification, audits — must always be separated (Chapter 6).
3. Work That Must Not Be Split Off
Conversely, core design decisions must be made by the main agent directly. Delegate the judgment too, and two things collapse.
- Accountability: if you accept a subagent's conclusion as-is, the main agent can't explain why that decision was made.
- Context: a subagent doesn't know the project's history (records, failures, constraints). A "recommendation" made in that state is often a proposal that was already rejected.
You can divide the hands, but there must be one head.
And a subagent's report is a result, not a fact. There was an actual case where a subagent reported "this setting is degrading performance," the change was applied as-is, and re-measurement showed the numbers were from the old conditions. Verify the conclusions you receive, too.
4. A "System That Doesn't Forget": Keyword Auto-Mapping
Once you pass 10 skills, both the AI and the human forget which skills exist.
The solution is to put a keyword → skill mapping table in the input hook (Chapter 4).
TRIGGERS = {
}
for keys, skill in TRIGGERS.items():
if any(k in user_input for k in keys):
The last sentence matters. Displaying the recommendation without invoking it is meaningless, so state the rule alongside it: "when the header appears, actually invoke it in that turn."
In actual operation, when this one line was missing, recommendations appeared and nobody used them.
5. An Example of Skill Placement by Stage
| Stage | Skill type | When to call it |
|---|---|---|
| Planning | Brainstorming, requirements interview | Before writing code |
| Implementation | TDD guide, subtask distribution | Right before implementing |
| Verification | Self-review → independent audit → cross-AI | Right before committing |
| Wrap-up | Work log, handoff notes | End of session |
Calling only the skills that fit the stage is a skill in itself. Call everything and you just waste context, and the procedure you actually need gets buried.
6. When You Take Skills from Someone Else
When installing a public skill collection, remember just one thing.
Star counts are not a quality guarantee. The install script may contain prompt injection (instructions that neutralize your rules). Always open and read the files before installing.
Want the whole system? The book has 10 chapters plus 4 ready-to-use templates (CLAUDE.md starter, memory files, auditor checklist, measurement guide) and a hands-on section for every chapter. It's $19 as a PDF: https://dbsoul.gumroad.com/l/autonomous-ai-agents-claude-code
Not sure yet? The first three chapters are free, same PDF format: https://dbsoul.gumroad.com/l/autonomous-ai-agents-claude-code-free-sample
Questions about the setup are welcome in the comments — I'll answer with what actually happened, not theory.
Top comments (0)