skills/code-subagents/SKILL.md
Subagent dispatch patterns for implementation tasks. Use when spec-implement has multiple tasks to execute and subagents are available. Covers parallel dispatch for independent work, the two-stage review cycle (spec compliance then code quality), focused prompt construction, and integration of results. Trigger when executing plan tasks with subagent support, when facing 2+ independent problems, or when the user asks to use subagents for implementation.
npx skillsauth add martinffx/claude-code-atelier code-subagentsInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Fresh subagent per task. Two-stage review after each. Parallel when independent, sequential when dependent.
Use when:
Don't use when:
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
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.
Use these templates when dispatching subagents. Each template is battle-tested — don't improvise, use them as-is and fill in the variables.
| 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" |
Every completed task gets two reviews in order. Do not skip either. Do not reverse the order.
Does the implementation match what was specified?
## Spec Review
Review the implementation against the task specification:
**Task spec:** [paste task from plan.json]
**Files changed:** [list from subagent output]
Check:
1. Are all requirements from the task spec implemented?
2. Is anything implemented that wasn't specified? (over-building)
3. Do tests cover the specified acceptance criteria?
4. Does the implementation match the design in design.md?
Report: List any gaps or extras. Mark ✅ if compliant, ❌ if not.
If the spec reviewer finds issues → the implementer subagent fixes them → spec reviewer reviews again. Repeat until ✅.
Is the implementation well-built?
## Code Quality Review
Review the implementation for code quality:
**Files changed:** [list]
Check:
1. Does the code follow existing patterns and conventions?
2. Are tests meaningful (not just asserting true)?
3. Is there unnecessary complexity?
4. Are edge cases handled?
5. Is the code clean (no dead code, no unnecessary comments)?
Rate issues as Critical (blocks merge), Important (should fix), or Minor (nice to have).
If the quality reviewer finds Critical or Important issues → implementer fixes → reviewer reviews again. Minor issues can be noted and moved past.
Spec compliance first because there's no point polishing code that doesn't meet the spec. Quality second because compliant code still needs to be well-built.
Subagents may ask questions before or during implementation. This is good — it means they're thinking rather than guessing.
After subagents complete (especially parallel dispatch):
bd close <id>, or harness todo listIf there are conflicts between parallel results, resolve them manually. Don't dispatch another subagent to merge — that requires too much context.
If a subagent fails a task:
If failure reveals a design problem:
"This task is failing because [reason]. The design in design.md may need to change. Want me to go back to spec-brainstorm?"
development
Security architecture and threat modeling knowledge. Auto-invokes when designing features that handle untrusted data, authentication, authorization, external integrations, file uploads, or sensitive data. Provides risk assessment frameworks, trust boundary analysis, and security design principles — not implementation code.
testing
Adversarial review of non-trivial decisions using fresh-context scrutiny. Use when correctness matters more than speed, when stakes are high (production, security-sensitive logic, irreversible operations), or before committing significant architectural or implementation choices.
development
Compact the current conversation into a handoff document for another agent to pick up.
testing
Socratic interrogation of plans against the project's domain model and documented decisions. Use when the user wants to stress-test a plan, clarify terminology, or validate assumptions against existing domain language. Updates CONTEXT.md and ADRs inline as decisions crystallise.