subagent-prompt-designlisted
Install: claude install-skill sardonyx0827/dotfiles
# SubAgent Prompt Design
Companion to `iterative-retrieval`. That skill solves _what context to gather_;
this skill solves _how to commission the agent that does the work_.
---
## 1. The Core Problem: Subagents Are Born Amnesiac
A SubAgent starts with **zero conversation history**. The only thing it knows is
what you wrote in its prompt. The only thing that returns to you is its **final
message** — everything intermediate is discarded.
Consequences:
- Anything you discussed with the user but did not include in the prompt **does not
exist** for the SubAgent.
- Any file content the SubAgent read but did not include in its return **is lost**.
- Any reasoning the SubAgent did but expressed only mid-conversation **is silent**.
Design every prompt as if you are handing a task to a contractor you have never
met, via written brief, with no follow-up possible.
---
## 2. Anatomy of a Good SubAgent Prompt
A complete prompt has five parts. Include all of them.
### 2.1 Task (one sentence)
State the single concrete outcome. Use a verb + object + constraint.
```
❌ "Look into the auth code."
✅ "Identify all call sites of `verifyToken()` in /Users/me/proj/src and return
the file path and line number of each one."
```
The one-sentence limit forces you to split bloated tasks before you write the
prompt, not after the agent wastes cycles.
### 2.2 Context (absolute paths + decided constraints)
Include every piece of information the agent needs that is not on disk:
- **Abs