🎁 Get the FREE AI Skills Starter Guide β€” Subscribe β†’
BytesAgainBytesAgain
πŸ¦€ ClawHub

Subagent Driven Development

by @wpank

Execute implementation plans by dispatching a fresh subagent per task with two-stage review (spec compliance then code quality). Use when you have an implementation plan with mostly independent tasks and want high-quality, fast iteration within a single session.

Versionv0.1.0
Downloads1,125
Installs4
TERMINAL
clawhub install subagent-driven-development-2

πŸ“– About This Skill


name: subagent-driven-development model: standard description: Execute implementation plans by dispatching a fresh subagent per task with two-stage review (spec compliance then code quality). Use when you have an implementation plan with mostly independent tasks and want high-quality, fast iteration within a single session. version: 1.0.0

Subagent-Driven Development

Execute a plan by dispatching a fresh subagent per task, with two-stage review after each β€” spec compliance first, then code quality.

Core principle: Fresh subagent per task + two-stage review = no context pollution, high quality, fast iteration.

Installation

OpenClaw / Moltbot / Clawbot

npx clawhub@latest install subagent-driven-development

When to Use This Skill

  • You have an implementation plan with discrete, mostly independent tasks
  • You want to execute the plan within a single session (no human-in-the-loop between tasks)
  • Tasks can be implemented and reviewed sequentially without tight coupling
  • | Condition | This Skill | Alternative | | ----------------------------- | -------------- | ----------------------------------- | | Have a plan, same session | Yes | β€” | | Have a plan, parallel session | No | executing-plans | | No plan yet | No | Write a plan first | | Tasks tightly coupled | No | Manual execution or decompose more |

    The Process

    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
    β”‚  1. Read plan, extract ALL tasks with full text      β”‚
    β”‚  2. Note shared context (arch, deps, conventions)    β”‚
    β”‚  3. Create TodoWrite with all tasks                  β”‚
    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                           β–Ό
              β”Œβ”€β”€β”€β”€β”€β”€ Per Task ──────┐
              β”‚                      β”‚
              β”‚  Dispatch Implementer (references/implementer-prompt.md)
              β”‚       β”‚                                β”‚
              β”‚       β–Ό                                β”‚
              β”‚  Questions?──yes──► Answer, re-dispatchβ”‚
              β”‚       β”‚no                              β”‚
              β”‚       β–Ό                                β”‚
              β”‚  Implement + test + commit + self-reviewβ”‚
              β”‚       β”‚                                β”‚
              β”‚       β–Ό                                β”‚
              β”‚  Dispatch Spec Reviewer (references/spec-reviewer-prompt.md)
              β”‚       β”‚                                β”‚
              β”‚       β–Ό                                β”‚
              β”‚  Compliant?──no──► Implementer fixesβ”€β”€β”˜
              β”‚       β”‚yes             then re-review
              β”‚       β–Ό
              β”‚  Dispatch Code Reviewer (references/code-quality-reviewer-prompt.md)
              β”‚       β”‚
              β”‚       β–Ό
              β”‚  Approved?──no──► Implementer fixes, re-review
              β”‚       β”‚yes
              β”‚       β–Ό
              β”‚  Mark task complete
              β””β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                      β–Ό
              More tasks? ──yes──► next task
                      β”‚no
                      β–Ό
              Final cross-task code review
                      β–Ό
              Finish development branch
    

    Prompt Templates

    Three reference prompts are provided for the subagent roles:

    | Role | File | Purpose | | ------------------ | ------------------------------------------- | -------------------------------------- | | Implementer | references/implementer-prompt.md | Implement, test, commit, self-review | | Spec reviewer | references/spec-reviewer-prompt.md | Verify code matches spec exactly | | Code reviewer | references/code-quality-reviewer-prompt.md| Verify code is clean and maintainable |

    Example Workflow

    Controller: Reading plan β€” 5 tasks extracted, TodoWrite created.

    ─── Task 1: Hook installation script ───

    [Dispatch implementer with full task text + context]

    Implementer: "Should the hook be installed at user or system level?" Controller: "User level (~/.config/hooks/)"

    Implementer: βœ… Implemented install-hook command - Added tests (5/5 passing) - Self-review: missed --force flag, added it - Committed

    [Dispatch spec reviewer] Spec reviewer: βœ… Spec compliant β€” all requirements met

    [Dispatch code reviewer with git SHAs] Code reviewer: βœ… Approved β€” clean, good coverage

    [Mark Task 1 complete]

    ─── Task 2: Recovery modes ───

    [Dispatch implementer]

    Implementer: βœ… Added verify/repair modes (8/8 tests passing)

    [Dispatch spec reviewer] Spec reviewer: ❌ Issues: - Missing: progress reporting ("report every 100 items") - Extra: added --json flag (not in spec)

    [Implementer fixes: remove --json, add progress reporting] Spec reviewer: βœ… Spec compliant

    [Dispatch code reviewer] Code reviewer: Important β€” magic number 100, extract constant

    [Implementer fixes: extract PROGRESS_INTERVAL] Code reviewer: βœ… Approved

    [Mark Task 2 complete]

    ... (tasks 3-5) ...

    [Final cross-task code review] Final reviewer: βœ… All requirements met, ready to merge

    Controller Responsibilities

    The controller (you) orchestrates the flow. Key duties:

    | Responsibility | Detail | | --------------------------------- | --------------------------------------------------------- | | Extract tasks upfront | Read plan once, extract all task text β€” subagents never read the plan file | | Provide full context | Give each subagent the complete task text + architectural context | | Answer questions | Respond clearly and completely before letting subagent proceed | | Enforce review order | Spec compliance first, code quality second β€” never reversed | | Track progress | Update TodoWrite after each task completes | | Dispatch sequentially | One implementation subagent at a time to avoid conflicts |

    Quality Gates

    Each task passes through three quality checks:

    | Gate | Who | What | | ------------------ | --------------- | ------------------------------------------------- | | Self-review | Implementer | Completeness, naming, YAGNI, test quality | | Spec review | Spec reviewer | Matches requirements exactly β€” nothing more, less | | Code review | Code reviewer | Clean code, maintainability, test coverage |

    Advantages

    vs. manual execution:

  • Fresh context per task (no confusion from accumulated state)
  • Subagents follow TDD naturally
  • Questions surfaced before work begins, not after
  • vs. parallel-session plans:

  • No handoff overhead
  • Continuous progress
  • Review checkpoints are automatic
  • Cost trade-off: More subagent invocations (implementer + 2 reviewers per task), but catches issues early β€” cheaper than debugging later.

    NEVER Do

  • Skip either review β€” both spec compliance and code quality are mandatory
  • Start code review before spec review passes β€” wrong order wastes effort on code that doesn't meet spec
  • Dispatch multiple implementers in parallel β€” causes merge conflicts and context corruption
  • Make subagents read the plan file β€” provide full task text directly
  • Skip scene-setting context β€” subagent needs to understand where the task fits architecturally
  • Ignore subagent questions β€” answer fully before they proceed
  • Accept "close enough" on spec compliance β€” if the reviewer found issues, it's not done
  • Skip re-review after fixes β€” reviewer found issues β†’ implementer fixes β†’ reviewer reviews again
  • Let self-review replace actual review β€” self-review is a first pass, not a substitute
  • Move to next task with open review issues β€” current task must be fully approved first
  • Fix issues manually instead of through a subagent β€” manual fixes pollute controller context
  • Handling Failures

    | Situation | Response | | ---------------------------- | ----------------------------------------------------- | | Subagent asks questions | Answer clearly, provide additional context if needed | | Reviewer finds issues | Same implementer subagent fixes, reviewer re-reviews | | Subagent fails task entirely | Dispatch a new fix subagent with specific instructions | | Task blocked by dependency | Reorder remaining tasks or resolve dependency first |