code-subagents
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.
Install
npx skills add https://github.com/martinffx/atelier/tree/main/skills/code-subagents
claude plugin marketplace add https://llmmart.ai/marketplace.json && claude plugin install martinffx-atelier@llmmart
git clone https://github.com/martinffx/atelier.git
The skills CLI installs just this skill, for any of its supported agents. Claude Code installs the whole martinffx/atelier collection as a plugin from our marketplace. Git is the plain clone.
Skill manifest
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 → complete
Parallel (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 → complete
Independence 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.
Files (atelier)
-
references
-
batch-reviewer-prompt.md 1.3 KB
# Batch Reviewer Prompt Template Use this template after all tasks in an implementation batch report completion. Review the captured task patches, not a commit range. ## Template ``` You are reviewing one completed implementation batch for requirements compliance and code quality. You are read-only: do not modify files, stage changes, or create commits. ## Working Directory {WORKING_DIRECTORY} ## Batch Requirements {BATCH_REQUIREMENTS} ## Constraints {CONSTRAINTS} ## Task Patches {BATCH_PATCHES} ## Complete Changed-File Inventory {CHANGED_FILES} ## Implementer Reports and Validation {IMPLEMENTER_REPORTS} ## CRITICAL: Verify the Patches Do not trust the implementer reports. Review the captured patches and relevant code directly. Check: 1. Every requirement and acceptance criterion is implemented 2. The implementation follows the supplied constraints 3. No unrequested work or out-of-scope files are included 4. Tests are meaningful and cover the right boundaries 5. The code follows existing patterns without unnecessary complexity 6. Error cases and edge conditions are handled ## Report - **Strengths:** What was done well - **Issues:** Critical, Important, or Minor findings with file:line references and fixes - **Assessment:** Approved, Approved with minor issues, or Changes requested ``` -
implementor-prompt.md 2.2 KB
# Implementer Prompt Template Use this template when dispatching an implementer subagent. Paste the complete work-item requirements. Do not make the subagent recover context. ## Template ``` You are implementing {WORK_ITEM_NAME} ## Work Item Requirements {WORK_ITEM_REQUIREMENTS} ## Context {Scene-setting: where this fits in the work, what was built before it, constraints, and existing patterns to follow} ## File Ownership - **Owned files:** {OWNED_FILES} - **Forbidden files:** {FORBIDDEN_FILES} Do not modify files outside the owned list. Report immediately if the work requires one. ## Before You Begin If you have questions about: - The requirements or acceptance criteria - The approach or implementation strategy - Dependencies or assumptions - Anything unclear in the task description **Ask them now.** Raise any concerns before starting work. ## Your Job Once you're clear on requirements: 1. Implement exactly what the task specifies 2. Write tests following TDD (failing test → verify fail → implement → verify pass) 3. Verify implementation works 4. Self-review (see below) 5. Report back. Do not commit; the coordinator integrates and commits reviewed work serially. Work from: {WORKING_DIRECTORY} **While you work:** If you encounter something unexpected or unclear, ask questions. It's always OK to pause and clarify. Don't guess or make assumptions. ## Before Reporting Back: Self-Review Review your work with fresh eyes: **Completeness:** - Did I fully implement every requirement? - Did I miss any requirements? - Are there edge cases I didn't handle? **Quality:** - Is this my best work? - Are names clear and accurate? - Is the code clean and maintainable? **Discipline:** - Did I avoid overbuilding (YAGNI)? - Did I only build what was requested? - Did I follow existing patterns in the codebase? **Testing:** - Do tests actually verify behaviour (not just mock behaviour)? - Did I follow TDD? - Are tests comprehensive? If you find issues during self-review, fix them before reporting. ## Report Format When done, report: - What you implemented - What you tested and test results - Files changed - Self-review findings (if any) - Any issues or concerns ```
-
-
SKILL.md 5.5 KB
--- name: code-subagents description: > 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. user-invocable: false --- # 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 → complete ``` ### Parallel (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 → complete ``` **Independence 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: 1. Assign each task an exclusive file list before dispatch 2. Do not let implementers stage or commit changes 3. Capture full `git status`, including untracked files, before and after each task 4. Capture the task's path-scoped patch and reject changes outside its assigned paths 5. 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](references/implementor-prompt.md)** — Dispatch an implementer. Includes self-review checklist. - **[references/batch-reviewer-prompt.md](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: 1. Every requirement and acceptance criterion is implemented 2. The batch follows the supplied constraints 3. No unrequested work or out-of-scope files are included 4. Tests are meaningful and cover the right boundaries 5. The code follows existing patterns without unnecessary complexity Use [references/batch-reviewer-prompt.md](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): 1. **Read each summary** — understand what changed 2. **Capture task patches** — use each task's exclusive file list 3. **Review the batch** — one combined requirements and quality review 4. **Run full test suite** — verify all changes work together 5. **Commit** — the coordinator commits the reviewed batch serially 6. **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.
Comments (0)
Sign in to join the conversation.
Reviews (0)
No reviews yet.
No comments yet.