agents/skills/dev/SKILL.md
Multi-agent iterative development with parallel testing and code review. Use for building features, implementing changes, or coding tasks that need testing and review.
npx skillsauth add drn/dots devInstall 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.
Orchestrate a team of agents to implement code, run tests, and review changes in parallel -- iterating until clean. Teammates communicate directly with each other for faster feedback loops.
Agent teams must be enabled in Claude Code settings:
CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1
If agent teams are not enabled, report: "Agent teams required. Add CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1 to your Claude Code settings (env section)." and stop.
$ARGUMENTS - Required: description of the development task to implementIf no arguments are provided, ask the user what they want to build.
git branch --show-currentgit status --shortpwdfind . -maxdepth 1 \( -name go.mod -o -name Gemfile -o -name package.json -o -name Cargo.toml -o -name pyproject.toml -o -name setup.py -o -name requirements.txt -o -name pom.xml -o -name build.gradle -o -name Makefile \) 2>/dev/null | head -5git log --oneline -5find . -maxdepth 4 -name "*_test.*" -o -name "*.test.*" -o -name "*_spec.*" 2>/dev/null | head -10This skill participates in a phase chain. Read ~/.claude/skills/_shared/resources/phase-protocol.md for the full protocol.
Before starting: Check .context/phases/ for prior artifacts:
plan-*.md (or think-*.md if no plan exists) for implementation context.After Phase 7 (summary): Write a build-{ts}.md artifact to .context/phases/ (create with mkdir -p .context/phases). The Detail section should list files changed and decisions made. The Handoff section should note: deviations from the plan, test results, and anything /review should pay attention to.
You are the lead coordinator for a multi-agent development team. Your job is to orchestrate an iterative cycle: plan, implement, test, review, iterate.
Task to implement: $ARGUMENTS
You do NOT write code yourself. You coordinate teammates, route feedback, and produce the final summary.
Team philosophy: Teammates talk to each other directly -- not everything goes through the lead. The reviewer validates the implementer's plan before coding starts. The reviewer asks the tester to verify suspected bugs. During iterations, the tester and reviewer send feedback directly to the implementer. The lead monitors, consolidates, and decides when to stop.
Clean working tree: If there are uncommitted changes, commit them with message "WIP: pre-dev-session state" before proceeding. This ensures clean diffs during the session.
Parse the task from $ARGUMENTS. If unclear, ask the user for clarification before proceeding.
Detect the project context from the Context section above:
Explore the codebase to understand relevant code, patterns, and conventions. Read key files related to the task. Understand the existing architecture before proposing changes.
Present a plan to the user for approval. Based on your exploration, write a concrete implementation plan and present it for the user to review. The plan must include:
Wait for the user to approve the plan before proceeding. If the user requests changes, revise and re-present until approved. Do NOT create the team or spawn agents until the user approves.
Create the team (clean up stale session first if needed):
TeamDelete() -- ignore if no existing team
TeamCreate(team_name: "dev-session", description: "Iterative dev: {brief task summary}")
Create the task list with TaskCreate:
Spawn all 3 teammates in a single message with 3 Task tool calls. Use the agent briefings below for each teammate's prompt. Use model: "sonnet" for the tester. Include the approved plan in the implementer's briefing so they can skip redundant exploration.
Initialize state:
iteration_round = 0
max_rounds = 3
Send the task and the user-approved plan to the implementer via SendMessage:
TASK: {full task description from $ARGUMENTS}
PROJECT CONTEXT:
- Language: {detected language}
- Framework: {detected framework}
- Test framework: {detected test framework}
- Build: {detected build tool}
- Lint: {detected linter}
APPROVED PLAN (already approved by the user):
{the plan approved in Phase 0, step 5}
INSTRUCTIONS:
1. Review the approved plan. You may refine implementation details, but the overall approach is set.
2. Send a brief implementation plan (specific code-level details) DIRECTLY to the reviewer for validation.
3. Wait for the reviewer's feedback before implementing.
Mark the "Plan" task as completed once your plan is sent.
Wait for the reviewer to validate the plan. The reviewer will message both the implementer and the lead with their verdict.
If the reviewer raises concerns, the lead tells the implementer to revise. Once the reviewer approves, proceed.
Send the go-ahead to the implementer via SendMessage:
Plan approved. Proceed with implementation.
INSTRUCTIONS:
1. Implement the changes following your approved plan.
2. Follow existing conventions.
3. Run a basic sanity check: compile, lint, or syntax check if applicable.
4. When done, message me (the lead) AND the tester with:
- Files changed (created/modified/deleted)
- Summary of your approach
- Any concerns or trade-offs you chose
Mark the "Implement" task as completed when done.
While the implementer works, send the tester a heads-up:
The implementer is working on: {brief task summary}
Their plan: {approved plan summary}
While you wait, explore the existing test suite to understand patterns, frameworks, and conventions. Be ready to run tests and write new ones as soon as the implementer finishes.
IMPORTANT: When writing new tests, create NEW test files rather than modifying files the implementer touched, to avoid conflicts.
Wait for the implementer to report back before proceeding.
Once the implementer finishes:
Gather the changes:
git diff to capture the full diffgit diff --name-only to list changed filesSend review requests to BOTH agents simultaneously via SendMessage:
Implementation complete. Here are the changes:
CHANGED FILES: {list}
DIFF:
{full git diff}
INSTRUCTIONS:
1. Run the existing test suite. Report pass/fail.
2. If tests fail, report which tests and why.
3. Identify changed code paths that lack test coverage.
4. Write new tests in NEW files (don't modify files the implementer changed).
5. Run all tests again and report final results.
6. The reviewer may also message you directly to write targeted tests for suspected bugs. Prioritize those.
Report to me (the lead) with:
- Test results: PASS or FAIL (with details)
- New tests written (if any)
- Coverage observations
Mark your task as completed.
TASK DESCRIPTION: {task}
CHANGED FILES WITH CONTENTS:
{file contents}
DIFF:
{full git diff}
Review the changes against ALL checklists in references/CODE_REVIEW.md (security, architecture, clarity).
For each finding, classify as:
- BLOCKING: Must fix before this code ships
- WARNING: Should fix, real but lower risk
- INFO: Suggestion for improvement
IMPORTANT: If you suspect a specific bug (nil dereference, race condition, off-by-one, etc.), message the tester DIRECTLY and ask them to write a targeted test to prove or disprove it. Don't just flag it -- get evidence.
If no issues found, say so explicitly.
Report your findings to me (the lead). Mark your task as completed.
Wait for both agents to report back.
Collect all reports and organize:
List each with: category (security/architecture/clarity), file, line/location, description.
List each with: category, file, description.
List each with: category, description.
IF no BLOCKING issues AND tests PASS:
IF diff is substantial (>50 lines changed OR touches auth/crypto/input-handling):
→ Proceed to Phase 6 (adversarial hardening)
ELSE:
→ Skip to Phase 7 (done -- hardening unnecessary for small changes)
IF BLOCKING issues exist AND iteration_round < max_rounds:
→ Proceed to Phase 5 (iteration)
IF iteration_round >= max_rounds:
→ Proceed to Phase 4b (escalation)
When iteration_round >= max_rounds with blocking issues remaining, present the user with escalation options:
## Escalation: {max_rounds} rounds exhausted with blocking issues
### Unresolved Blocking Issues
{numbered list with category, file, line, description for each}
### Escalation Options
1. **Reassign** -- spawn a second implementer (`implementer-b`) with a different approach to the blocked issues
2. **Decompose** -- break the remaining work into smaller tasks and address them individually
3. **Defer** -- accept the current state and create TODO comments for unresolved issues
4. **Extend** -- grant {max_rounds} more rounds (reset iteration counter)
Which option? (default: defer)
Wait for the user to choose. Then:
implementer-b with fresh context. Send it ONLY the blocking issues and the current code state. Route through the same QA loop (tester + reviewer). Max 2 additional rounds.// TODO: {issue description} comments at each flagged location. Note in the summary.iteration_round = 0 and return to Phase 5.iteration_round += 1
Create iteration tasks:
Send consolidated feedback directly to the implementer AND the tester simultaneously:
QA VERDICT: FAIL -- Round {N} of {max_rounds}
BLOCKING ISSUES (fix these -- each must be resolved to pass):
| # | Category | File | Line | Description | Fix Instruction |
|---|----------|------|------|-------------|-----------------|
{one row per blocking issue with a specific, actionable fix instruction}
WARNINGS (address if straightforward):
{numbered list}
TEST FAILURES:
{test name, failure message, and file:line for each}
INSTRUCTIONS:
1. Fix ONLY the issues listed above
2. Do NOT introduce new features or refactor unrelated code
3. When done, message me (the lead) AND the tester with your changes
4. This is attempt {N} of {max_rounds} -- if attempt {max_rounds} fails, the task escalates
ITERATION ROUND {N}: The implementer is fixing these issues:
{brief summary of blocking issues and test failures}
Wait for the implementer to finish, then re-run the full test suite.
Report results to me (the lead).
After implementer completes and tester re-tests: Gather the new diff.
Return to Phase 4.
This phase runs when tests pass, review is clean, AND the changes are substantial. Skip for trivial changes.
Send to the reviewer:
The implementation passed all tests and your initial review. Now switch to ADVERSARIAL mode.
Your job is to BREAK this code. Think like an attacker, a malicious user, or a chaotic system.
CHANGED FILES WITH CONTENTS:
{file contents}
Try to find:
- Edge cases: empty inputs, huge inputs, unicode, special characters
- Race conditions or concurrency issues
- Resource leaks (unclosed files, connections, goroutines)
- Error paths that aren't tested
- Assumptions that could be violated in production
For each attack vector you identify, message the tester DIRECTLY with a specific test case to write. For example:
"Write a test that passes an empty string to ParseConfig() -- I think it'll panic on line 42."
Report your attack vectors and results to me (the lead) when done.
Send to the tester:
ADVERSARIAL PHASE: The reviewer is trying to break the implementation. They will message you directly with specific test cases to write.
Write each test they suggest. Run it. Report back to the reviewer AND me (the lead) whether it passed or failed.
If a test fails (i.e., the reviewer found a real bug), report the details.
Wait for both to finish.
If new bugs found: Send them to the implementer as a final fix round, then re-run tests. If tests pass, proceed to Phase 7. If not, proceed to Phase 7 with remaining issues noted.
If no bugs found: Proceed to Phase 7.
Shut down all teammates:
For each of [implementer, tester, reviewer]:
SendMessage(type: "shutdown_request", recipient: {name}, content: "Work complete. Shutting down.")
Wait for confirmations.
Clean up the team with TeamDelete.
Produce the final summary:
## Development Summary
### Task
{original task description}
### Changes Made
| File | Action | Description |
|------|--------|-------------|
| path/to/file | created/modified/deleted | brief description |
### Test Results
- **Status:** PASS / FAIL / N/A
- **New tests written:** {count} -- {brief descriptions}
- **Coverage notes:** {observations from tester}
### Review Sign-off
| Category | Status | Key Notes |
|----------|--------|-----------|
| Security | APPROVED / CONCERNS | {1-line summary} |
| Architecture | APPROVED / CONCERNS | {1-line summary} |
| Clarity | APPROVED / CONCERNS | {1-line summary} |
### Adversarial Hardening
- **Status:** PERFORMED / SKIPPED (change too small)
- **Attack vectors tested:** {count}
- **Bugs found:** {count} -- {brief descriptions, or "None"}
### Iterations
- **Rounds completed:** {N}
- **First-pass QA:** {PASS or FAIL} (did the first implementation pass without iteration?)
- **Key feedback addressed:** {brief summary of what changed between rounds}
### Remaining Items
{Any unresolved warnings/suggestions, or "None -- all clear"}
### Diff
{git diff --stat output}
When spawning teammates in Phase 0, read references/BRIEFINGS.md for the full prompts for each role (implementer, tester, reviewer).
| Failure | Action |
|---------|--------|
| Agent fails to spawn | Retry once. If still fails, proceed without it and note in summary. |
| Tests not found / no test framework | Tester reports N/A. Lead marks test track as "No test framework detected." |
| Implementer stuck on same issue twice | Spawn a second implementer (implementer-b) with a different approach. Have the reviewer compare both solutions and pick the better one. Shut down the losing implementer. |
| Agent unresponsive | Send a follow-up message. If still no response after a second nudge, proceed without that agent's input and note in summary. |
| 3 rounds exhausted with blocking issues | Proceed to Phase 4b escalation -- present user with options: reassign, decompose, defer, or extend. |
| Team creation fails (teams not enabled) | Report the prerequisite and stop. |
development
Walk every unresolved review thread on a PR, triage each one, reply with a rationale of whether or not the comment will be acted upon, make the code change if warranted, and mark the thread resolved. Use when the user asks to address only the open PR comments without re-running CI, respond to review feedback, resolve review threads, or clear bot comments on a PR.
tools
Iteratively run /rereview, fix the findings, and loop until reviewers approve clean. Use for iterative automated review, when you want /rereview to loop until clean, or for a paranoid pre-merge review that auto-addresses every blocker.
development
Generate self-contained HTML visualizations with Plannotator theming. Use for implementation plans, PR explainers, architecture diagrams, data tables, slide decks, and any visual explanation of technical concepts. Plans and PR explainers follow Plannotator's prescriptive approach; all other visual content delegates to nicobailon/visual-explainer.
development
Create reviewed Codex goal setup packages for long-running /goal work. Use when the user wants to turn an idea, backlog, project mission, or vague objective into durable goal files under a project goals slug folder, with Plannotator review gates for brief, narrative plan with acceptance criteria, verification, blockers, and the final /goal prompt.