Get the FREE Ultimate OpenClaw Setup Guide →

subagent-driven-development

Scanned
npx machina-cli add skill parthalon025/autonomous-coding-toolkit/subagent-driven-development --openclaw
Files (1)
SKILL.md
5.1 KB

Subagent-Driven Development

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

Core principle: Fresh subagent per task + two-stage review (spec then quality) = high quality, fast iteration

When to Use

vs. Executing Plans (parallel session):

  • Same session (no context switch)
  • Fresh subagent per task (no context pollution)
  • Two-stage review after each task: spec compliance first, then code quality
  • Faster iteration (no human-in-loop between tasks)

The Process

digraph process {
    rankdir=TB;

    subgraph cluster_per_task {
        label="Per Task";
        "Dispatch implementer subagent (./implementer-prompt.md)" [shape=box];
        "Implementer subagent asks questions?" [shape=diamond];
        "Answer questions, provide context" [shape=box];
        "Implementer subagent implements, tests, commits, self-reviews" [shape=box];
        "Dispatch spec reviewer subagent (./spec-reviewer-prompt.md)" [shape=box];
        "Spec reviewer subagent confirms code matches spec?" [shape=diamond];
        "Implementer subagent fixes spec gaps" [shape=box];
        "Dispatch code quality reviewer subagent (./code-quality-reviewer-prompt.md)" [shape=box];
        "Code quality reviewer subagent approves?" [shape=diamond];
        "Implementer subagent fixes quality issues" [shape=box];
        "Mark task complete in TodoWrite" [shape=box];
    }

    "Read plan, extract all tasks with full text, note context, create TodoWrite" [shape=box];
    "More tasks remain?" [shape=diamond];
    "Dispatch final code reviewer subagent for entire implementation" [shape=box];
    "Use superpowers:finishing-a-development-branch" [shape=box style=filled fillcolor=lightgreen];

    "Read plan, extract all tasks with full text, note context, create TodoWrite" -> "Dispatch implementer subagent (./implementer-prompt.md)";
    "Dispatch implementer subagent (./implementer-prompt.md)" -> "Implementer subagent asks questions?";
    "Implementer subagent asks questions?" -> "Answer questions, provide context" [label="yes"];
    "Answer questions, provide context" -> "Dispatch implementer subagent (./implementer-prompt.md)";
    "Implementer subagent asks questions?" -> "Implementer subagent implements, tests, commits, self-reviews" [label="no"];
    "Implementer subagent implements, tests, commits, self-reviews" -> "Dispatch spec reviewer subagent (./spec-reviewer-prompt.md)";
    "Dispatch spec reviewer subagent (./spec-reviewer-prompt.md)" -> "Spec reviewer subagent confirms code matches spec?";
    "Spec reviewer subagent confirms code matches spec?" -> "Implementer subagent fixes spec gaps" [label="no"];
    "Implementer subagent fixes spec gaps" -> "Dispatch spec reviewer subagent (./spec-reviewer-prompt.md)" [label="re-review"];
    "Spec reviewer subagent confirms code matches spec?" -> "Dispatch code quality reviewer subagent (./code-quality-reviewer-prompt.md)" [label="yes"];
    "Dispatch code quality reviewer subagent (./code-quality-reviewer-prompt.md)" -> "Code quality reviewer subagent approves?";
    "Code quality reviewer subagent approves?" -> "Implementer subagent fixes quality issues" [label="no"];
    "Implementer subagent fixes quality issues" -> "Dispatch code quality reviewer subagent (./code-quality-reviewer-prompt.md)" [label="re-review"];
    "Code quality reviewer subagent approves?" -> "Mark task complete in TodoWrite" [label="yes"];
    "Mark task complete in TodoWrite" -> "More tasks remain?";
    "More tasks remain?" -> "Dispatch implementer subagent (./implementer-prompt.md)" [label="yes"];
    "More tasks remain?" -> "Dispatch final code reviewer subagent for entire implementation" [label="no"];
    "Dispatch final code reviewer subagent for entire implementation" -> "Use superpowers:finishing-a-development-branch";
}

Prompt Templates

  • ./implementer-prompt.md - Dispatch implementer subagent
  • ./spec-reviewer-prompt.md - Dispatch spec compliance reviewer subagent
  • ./code-quality-reviewer-prompt.md - Dispatch code quality reviewer subagent

Red Flags

Never:

  • Start implementation on main/master branch without explicit user consent
  • Skip reviews (spec compliance OR code quality)
  • Dispatch multiple implementation subagents in parallel (conflicts)
  • Make subagent read plan file (provide full text instead)
  • Start code quality review before spec compliance is ✅ (wrong order)

If subagent asks questions:

  • Answer clearly and completely
  • Don't rush them into implementation

If reviewer finds issues:

  • Implementer (same subagent) fixes them
  • Reviewer reviews again
  • Repeat until approved

Integration

Required workflow skills:

  • superpowers:using-git-worktrees - REQUIRED: Set up isolated workspace before starting
  • superpowers:writing-plans - Creates the plan this skill executes
  • superpowers:requesting-code-review - Code review template for reviewer subagents
  • superpowers:finishing-a-development-branch - Complete development after all tasks

Source

git clone https://github.com/parthalon025/autonomous-coding-toolkit/blob/main/skills/subagent-driven-development/SKILL.mdView on GitHub

Overview

Subagent-Driven Development dispatches a new subagent for every task in the plan and enforces a two-stage review after each task. This isolates work, prevents context pollution, and speeds iteration by validating specs before code quality.

How This Skill Works

The system reads the plan, extracts all tasks, and creates a TodoWrite. It then dispatches an implementer subagent for each task, followed by a spec-reviewer to verify spec alignment, and finally a code-quality reviewer to confirm quality. If gaps or issues are found, the implementer revises, and the task is marked complete before moving on.

When to Use It

  • Same session, no context switch and fresh subagents per task
  • Each task must be isolated to avoid context pollution
  • Two-stage reviews (spec first, then quality) after every task
  • Faster iteration with automated checks instead of human-in-the-loop between tasks
  • Multiple independent tasks to be executed sequentially within one session

Quick Start

  1. Step 1: Read plan, extract all tasks with full text, note context, create TodoWrite
  2. Step 2: Dispatch implementer subagent for the first task and handle any questions
  3. Step 3: After spec and quality reviews, mark the task complete and proceed to the next

Best Practices

  • Dispatch a fresh subagent for each task to avoid context bleed
  • Ensure clear, testable specs before the spec-reviewer runs
  • Conduct the spec review before the code-quality review
  • Keep tasks granular to maximize parallelizable review cycles
  • Use TodoWrite to track progress and mark completion before moving on

Example Use Cases

  • Implement a user-auth flow by splitting into 3 tasks, each with spec and quality reviews
  • Add a new API endpoint with tests, ensuring spec alignment at each step
  • Refactor a module by tackling small, isolated tasks with per-task reviews
  • Introduce a feature flag without global changes, validated task-by-task
  • Fix a small bug and verify through per-task spec and quality cycles

Frequently Asked Questions

Add this skill to your agents
Sponsor this space

Reach thousands of developers