code-subagents
Skill46 starsChanged 6 months agoMITView on GitHub
Implementation subagent dispatch patterns. Use when independent implementation work is available and subagents can execute it. Covers parallel dispatch, shared-tree patch snapshots, one combined review per completed batch, and serial integration.
In this repository14 other files it gives its agents.
- AGENTS.mdAGENTS.md
- atelier-orchestratorSkill
- atelier-setupSkill
- code-commitSkill
- code-handoffSkill
- code-pull-requestSkill
- code-reviewSkill
- oracle-debugSkill
- oracle-domain-modellingSkill
- oracle-grill-meSkill
- spec-brainstormSkill
- spec-finishSkill
- spec-implementSkill
- spec-planSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
14 rules. About 0 are common, 14 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈14
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 52
If no to both, dispatch in parallel.
- Distinctive: line 57
Do not let implementers stage or commit changes
- Distinctive: line 60
Run tasks sequentially if their file ownership overlaps or cannot be isolated
- Distinctive: line 66
Use these templates when dispatching subagents.
- Distinctive: line 94
Run one combined review after every completed batch, not separate reviews for each task.
- Distinctive: line 106
Every requirement and acceptance criterion is implemented
- Distinctive: line 108
No unrequested work or out-of-scope files are included
- Distinctive: line 112
Use references/batch-reviewer-prompt.md as written.
- Distinctive: line 114
If the reviewer finds Critical or Important issues, send each issue back to the relevant implementer, refresh its path-scoped patch, and …
- Distinctive: line 127
Don't rush them into implementation
- Distinctive: line 128
If the question reveals a gap in the plan, that's valuable — note it
- Distinctive: line 134
After subagents complete (especially parallel dispatch):
- Distinctive: line 143
If there are conflicts between parallel results, resolve them manually.
- Distinctive: line 150
If a subagent fails a task:
≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Implementation Subagents
Fresh subagent per task. One combined review per completed batch. Parallel when independent, sequential when dependent.
When to Use Subagents
Use when:
- 2+ independent work items do not share state or files
- Each work item has explicit requirements, constraints, files, and validation
- Each problem can be understood without context from the other work items
Don't use when:
- Tasks are tightly coupled (editing the same files)
- You need to understand full system state across tasks
- Failures are related (fixing one might fix others)
- Exploratory work where the problem isn't well-defined yet
Dispatch Modes
Sequential (dependent tasks)
Tasks with dependencies execute one at a time. Each gets a fresh subagent — no context pollution from previous tasks.
Task 1 (Entity) → review → complete
Task 2 (Repository, depends on T1) → review → complete
Task 3 (Service, depends on T2) → review → completeParallel (independent tasks)
Independent tasks dispatch simultaneously. One agent per problem domain.
Task A (auth tests) ──→ review → complete
Task B (billing tests) ──→ review → complete ← concurrent
Task C (notification tests) ──→ review → completeIndependence check: Would fixing Task A affect Task B? Would they edit the same files? If no to both, dispatch in parallel.
For shared-tree parallel work:
- Assign each task an exclusive file list before dispatch
- Do not let implementers stage or commit changes
- Capture full
git status, including untracked files, before and after each task - Capture the task's path-scoped patch and reject changes outside its assigned paths
- Run tasks sequentially if their file ownership overlaps or cannot be isolated
Prompt Templates
Use these templates when dispatching subagents. Each template is battle-tested — don't improvise, use them as-is and fill in the variables.
- references/implementor-prompt.md — Dispatch an implementer. Includes self-review checklist.
- references/batch-reviewer-prompt.md — Combined plan and code-quality review for one completed batch.
Prompt quality rules
- Focused — one task, one problem domain
- Self-contained — all context needed is in the prompt. Provide the complete work-item requirements; do not make the subagent recover context
- Specific about files — exact paths, not "the relevant files"
- Specific about output — what should the subagent return?
- Constrained — what should they NOT touch?
Common mistakes
| Mistake | Fix |
| "Fix all the tests" | "Fix the 3 failures in user.test.ts" |
| No context about codebase | Paste the relevant patterns and conventions |
| No constraints | "Do NOT change production code" or scope to specific files |
| Vague output expectations | "Return: root cause, changes made, test results" |
Batch Review
Run one combined review after every completed batch, not separate reviews for each task.
Give one fresh reviewer:
- The complete requirements for work items in the batch
- The relevant constraints
- The path-scoped patch captured for each task
- The full changed-file inventory, including untracked files
- The implementers' reports and validation results
The reviewer checks both requirements compliance and code quality:
- Every requirement and acceptance criterion is implemented
- The batch follows the supplied constraints
- No unrequested work or out-of-scope files are included
- Tests are meaningful and cover the right boundaries
- The code follows existing patterns without unnecessary complexity
Use references/batch-reviewer-prompt.md as written.
If the reviewer finds Critical or Important issues, send each issue back to the relevant implementer, refresh its path-scoped patch, and review the batch again. Minor issues may be noted and moved past.
Handling Subagent Questions
Subagents may ask questions before or during implementation. This is good — it means they're thinking rather than guessing.
- Answer clearly and completely
- Provide additional context if needed
- Don't rush them into implementation
- If the question reveals a gap in the plan, that's valuable — note it
Integrating Results
After subagents complete (especially parallel dispatch):
- Read each summary — understand what changed
- Capture task patches — use each task's exclusive file list
- Review the batch — one combined requirements and quality review
- Run full test suite — verify all changes work together
- Commit — the coordinator commits the reviewed batch serially
- Update progress tracking — when the caller uses it
If there are conflicts between parallel results, resolve them manually. Don't dispatch another subagent to merge — that requires too much context.
When Subagents Fail
If a subagent fails a task:
- Don't fix it manually — that pollutes your context
- Dispatch a fix subagent with specific instructions about what went wrong
- If it fails twice, stop and escalate to the human. The requirements or constraints may need revision.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

