PromptShop

Subagent Driven Development

This skill facilitates a development approach where tasks are delegated to specialized subagents with isolated contexts

Install

npx promptshop add subagent-driven-development

Details

What This Skill Does

This skill facilitates a development approach where tasks are delegated to specialized subagents with isolated contexts. It promotes high-quality code and fast iteration by using a fresh subagent for each task and implementing a two-stage review process after each task. This skill is ideal for projects with independent tasks and a clear implementation plan.

When to Use

  • Implementing a feature with a well-defined plan.
  • Breaking down a complex project into smaller, independent tasks.
  • Delegating tasks to specialized agents for focused execution.
  • Ensuring code quality through two-stage review processes.
  • Accelerating development cycles by isolating task contexts.
  • Managing projects within a single session without context switching.

Key Features

  • Uses fresh subagents for each task to avoid context pollution.
  • Implements a two-stage review process (spec compliance, code quality).
  • Supports faster iteration by eliminating human-in-loop between tasks.
  • Provides a structured approach to delegating and reviewing tasks.
  • Suitable for projects with mostly independent tasks.
  • Maintains session context while leveraging specialized agents.

When to Use

digraph when_to_use { "Have implementation plan?" [shape=diamond]; "Tasks mostly independent?" [shape=diamond]; "Stay in this session?" [shape=diamond]; "subagent-driven-development" [shape=box]; "executing-plans" [shape=box]; "Manual execution or brainstorm first" [shape=box];

"Have implementation plan?" -> "Tasks mostly independent?" [label="yes"];
"Have implementation plan?" -> "Manual execution or brainstorm first" [label="no"];
"Tasks mostly independent?" -> "Stay in this session?" [label="yes"];
"Tasks mostly independent?" -> "Manual execution or brainstorm first" [label="no - tightly coupled"];
"Stay in this session?" -> "subagent-driven-development" [label="yes"];
"Stay in this session?" -> "executing-plans" [label="no - parallel session"];

}

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";

}

Model Selection

Use the least powerful model that can handle each role to conserve cost and increase speed.

Mechanical implementation tasks (isolated functions, clear specs, 1-2 files): use a fast, cheap model. Most implementation tasks are mechanical when the plan is well-specified.

Integration and judgment tasks (multi-file coordination, pattern matching, debugging): use a standard model.

Architecture, design, and review tasks: use the most capable available model.

Task complexity signals: Touches 1-2 files with a complete spec → cheap model Touches multiple files with integration concerns → standard model Requires design judgment or broad codebase understanding → most capable model

Handling Implementer Status

Implementer subagents report one of four statuses. Handle each appropriately:

DONE: Proceed to spec compliance review.

DONE_WITH_CONCERNS: The implementer completed the work but flagged doubts. Read the concerns before proceeding. If the concerns are about correctness or scope, address them before review. If they're observations (e.g., "this file is getting large"), note them and proceed to review.

NEEDS_CONTEXT: The implementer needs information that wasn't provided. Provide the missing context and re-dispatch.

BLOCKED: The implementer cannot complete the task. Assess the blocker: If it's a context problem, provide more context and re-dispatch with the same model If the task requires more reasoning, re-dispatch with a more capable model If the task is too large, break it into smaller pieces If the plan itself is wrong, escalate to the human

Never ignore an escalation or force the same model to retry without changes. If the im