Create Superpowers Lite fork

This commit is contained in:
mujing
2026-05-12 16:05:03 +08:00
parent f2cbfbefeb
commit dd2eb8b351
33 changed files with 221 additions and 399 deletions

View File

@@ -1,17 +1,17 @@
---
name: subagent-driven-development
description: Use when executing implementation plans with independent tasks in the current session
description: Manual-only skill. Activate only after an explicit user request for superpowers-lite:subagent-driven-development.
---
# 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.
Execute plan by dispatching fresh subagent per phase, where a phase may contain one or more related tasks. Run a two-stage review after each phase: spec compliance review first, then code quality review.
**Why subagents:** You delegate tasks to specialized agents with isolated context. By precisely crafting their instructions and context, you ensure they stay focused and succeed at their task. They should never inherit your session's context or history — you construct exactly what they need. This also preserves your own context for coordination work.
**Core principle:** Fresh subagent per task + two-stage review (spec then quality) = high quality, fast iteration
**Core principle:** Fresh subagent per coherent phase + two-stage review (spec then quality) = high quality without review overhead on every tiny task
**Continuous execution:** Do not pause to check in with your human partner between tasks. Execute all tasks from the plan without stopping. The only reasons to stop are: BLOCKED status you cannot resolve, ambiguity that genuinely prevents progress, or all tasks complete. "Should I continue?" prompts and progress summaries waste their time — they asked you to execute the plan, so execute it.
**Continuous execution:** Do not pause to check in with your human partner between phases unless blocked. Execute all tasks from the plan in the current branch without stopping. The only reasons to stop are: current branch is `main` or `master`, BLOCKED status you cannot resolve, ambiguity that genuinely prevents progress, or all tasks complete. "Should I continue?" prompts and progress summaries waste their time — they asked you to execute the plan, so execute it.
## When to Use
@@ -35,18 +35,29 @@ digraph 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
- Fresh subagent per phase (no context pollution)
- Two-stage review after each phase: spec compliance first, then code quality
- Faster iteration (no human-in-loop between tasks)
## Phase Grouping
Before grouping phases, confirm the current git branch is not `main` or `master` with `git branch --show-current`. If it is, stop and ask the user to switch or create a feature branch. Do not create or switch to a worktree unless the user explicitly asks.
Before dispatching implementers, group tasks into phases:
- Group adjacent tasks when they touch the same files, complete one coherent behavior, or would create review churn if split
- Keep a task as its own phase when it is risky, broad, independent, or likely to need a focused review
- Never group tasks just to hide uncertainty; if grouping makes requirements harder to verify, split the phase
- Record phase membership in TodoWrite so progress is visible at both phase and task level
## The Process
```dot
digraph process {
rankdir=TB;
subgraph cluster_per_task {
label="Per Task";
subgraph cluster_per_phase {
label="Per Phase";
"Dispatch implementer subagent (./implementer-prompt.md)" [shape=box];
"Implementer subagent asks questions?" [shape=diamond];
"Answer questions, provide context" [shape=box];
@@ -57,15 +68,15 @@ digraph process {
"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];
"Mark phase tasks complete in TodoWrite" [shape=box];
}
"Read plan, extract all tasks with full text, note context, create TodoWrite" [shape=box];
"More tasks remain?" [shape=diamond];
"Read plan, extract all tasks with full text, group into phases, note context, create TodoWrite" [shape=box];
"More phases 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];
"Use superpowers-lite: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)";
"Read plan, extract all tasks with full text, group into phases, 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)";
@@ -78,11 +89,11 @@ digraph process {
"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";
"Code quality reviewer subagent approves?" -> "Mark phase tasks complete in TodoWrite" [label="yes"];
"Mark phase tasks complete in TodoWrite" -> "More phases remain?";
"More phases remain?" -> "Dispatch implementer subagent (./implementer-prompt.md)" [label="yes"];
"More phases remain?" -> "Dispatch final code reviewer subagent for entire implementation" [label="no"];
"Dispatch final code reviewer subagent for entire implementation" -> "Use superpowers-lite:finishing-a-development-branch";
}
```
@@ -130,14 +141,15 @@ Implementer subagents report one of four statuses. Handle each appropriately:
```
You: I'm using Subagent-Driven Development to execute this plan.
[Read plan file once: docs/superpowers/plans/feature-plan.md]
[Read plan file once: .superpowers-lite/plans/feature-plan.md]
[Extract all 5 tasks with full text and context]
[Create TodoWrite with all tasks]
[Group into 3 phases: Phase 1 = Task 1, Phase 2 = Tasks 2-3, Phase 3 = Tasks 4-5]
[Create TodoWrite with all phases and tasks]
Task 1: Hook installation script
Phase 1: Hook installation script
[Get Task 1 text and context (already extracted)]
[Dispatch implementation subagent with full task text + context]
[Dispatch implementation subagent with full phase text + context]
Implementer: "Before I begin - should the hook be installed at user or system level?"
@@ -156,12 +168,12 @@ Spec reviewer: ✅ Spec compliant - all requirements met, nothing extra
[Get git SHAs, dispatch code quality reviewer]
Code reviewer: Strengths: Good test coverage, clean. Issues: None. Approved.
[Mark Task 1 complete]
[Mark Phase 1 tasks complete]
Task 2: Recovery modes
Phase 2: Recovery modes and CLI wiring
[Get Task 2 text and context (already extracted)]
[Dispatch implementation subagent with full task text + context]
[Get Task 2 and Task 3 text and context (already extracted)]
[Dispatch implementation subagent with full phase text + context]
Implementer: [No questions, proceeds]
Implementer:
@@ -190,7 +202,7 @@ Implementer: Extracted PROGRESS_INTERVAL constant
[Code reviewer reviews again]
Code reviewer: ✅ Approved
[Mark Task 2 complete]
[Mark Phase 2 tasks complete]
...
@@ -205,8 +217,8 @@ Done!
**vs. Manual execution:**
- Subagents follow TDD naturally
- Fresh context per task (no confusion)
- Parallel-safe (subagents don't interfere)
- Fresh context per phase (less confusion)
- Parallel-safe when phases do not share files (subagents do not interfere)
- Subagent can ask questions (before AND during work)
**vs. Executing Plans:**
@@ -228,7 +240,7 @@ Done!
- Code quality ensures implementation is well-built
**Cost:**
- More subagent invocations (implementer + 2 reviewers per task)
- More subagent invocations than inline work (implementer + 2 reviewers per phase)
- Controller does more prep work (extracting all tasks upfront)
- Review loops add iterations
- But catches issues early (cheaper than debugging later)
@@ -236,10 +248,10 @@ Done!
## Red Flags
**Never:**
- Start implementation on main/master branch without explicit user consent
- Skip reviews (spec compliance OR code quality)
- Start implementation on `main` or `master`
- Skip phase reviews (spec compliance OR code quality)
- Proceed with unfixed issues
- Dispatch multiple implementation subagents in parallel (conflicts)
- Dispatch multiple implementation subagents in parallel when phases share files or state
- Make subagent read plan file (provide full text instead)
- Skip scene-setting context (subagent needs to understand where task fits)
- Ignore subagent questions (answer before letting them proceed)
@@ -247,7 +259,7 @@ Done!
- Skip review loops (reviewer found issues = implementer fixes = review again)
- Let implementer self-review replace actual review (both are needed)
- **Start code quality review before spec compliance is ✅** (wrong order)
- Move to next task while either review has open issues
- Move to next phase while either review has open issues
**If subagent asks questions:**
- Answer clearly and completely
@@ -260,20 +272,22 @@ Done!
- Repeat until approved
- Don't skip the re-review
**If subagent fails task:**
**If subagent fails a phase:**
- Dispatch fix subagent with specific instructions
- Don't try to fix manually (context pollution)
## Integration
**Required workflow skills:**
- **superpowers:using-git-worktrees** - Ensures isolated workspace (creates one or verifies existing)
- **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
- **superpowers-lite:writing-plans** - Creates the plan this skill executes
- **superpowers-lite:requesting-code-review** - Code review template for reviewer subagents
- **superpowers-lite:finishing-a-development-branch** - Complete development after all tasks
**Optional workflow skills:**
- **superpowers-lite:using-git-worktrees** - Use only when the user explicitly asks for an isolated workspace
**Subagents should use:**
- **superpowers:test-driven-development** - Subagents follow TDD for each task
- **superpowers-lite:test-driven-development** - Subagents follow TDD for each task
**Alternative workflow:**
- **superpowers:executing-plans** - Use for parallel session instead of same-session execution
- **superpowers-lite:executing-plans** - Use for parallel session instead of same-session execution

View File

@@ -4,15 +4,15 @@ Use this template when dispatching a code quality reviewer subagent.
**Purpose:** Verify implementation is well-built (clean, tested, maintainable)
**Only dispatch after spec compliance review passes.**
**Only dispatch after phase spec compliance review passes.**
```
Task tool (general-purpose):
Use template at requesting-code-review/code-reviewer.md
DESCRIPTION: [task summary, from implementer's report]
PLAN_OR_REQUIREMENTS: Task N from [plan-file]
BASE_SHA: [commit before task]
DESCRIPTION: [phase summary, from implementer's report]
PLAN_OR_REQUIREMENTS: Phase N from [plan-file]
BASE_SHA: [commit before phase]
HEAD_SHA: [current commit]
```

View File

@@ -1,16 +1,16 @@
# Implementer Subagent Prompt Template
Use this template when dispatching an implementer subagent.
Use this template when dispatching an implementer subagent for one execution phase. A phase may contain one task or several related tasks from the plan.
```
Task tool (general-purpose):
description: "Implement Task N: [task name]"
description: "Implement Phase N: [phase name]"
prompt: |
You are implementing Task N: [task name]
You are implementing Phase N: [phase name]
## Task Description
## Phase Description
[FULL TEXT of task from plan - paste it here, don't make subagent read file]
[FULL TEXT of every task in this phase from plan - paste it here, don't make subagent read file]
## Context
@@ -29,7 +29,7 @@ Task tool (general-purpose):
## Your Job
Once you're clear on requirements:
1. Implement exactly what the task specifies
1. Implement exactly what the phase tasks specify
2. Write tests (following TDD if task says to)
3. Verify implementation works
4. Commit your work
@@ -38,6 +38,9 @@ Task tool (general-purpose):
Work from: [directory]
Use the current branch and current working tree. Do not create a git worktree
or switch branches unless the controller explicitly instructed you to.
**While you work:** If you encounter something unexpected or unclear, **ask questions**.
It's always OK to pause and clarify. Don't guess or make assumptions.
@@ -60,10 +63,10 @@ Task tool (general-purpose):
no work. You will not be penalized for escalating.
**STOP and escalate when:**
- The task requires architectural decisions with multiple valid approaches
- The phase requires architectural decisions with multiple valid approaches
- You need to understand code beyond what was provided and can't find clarity
- You feel uncertain about whether your approach is correct
- The task involves restructuring existing code in ways the plan didn't anticipate
- The phase involves restructuring existing code in ways the plan didn't anticipate
- You've been reading file after file trying to understand the system without progress
**How to escalate:** Report back with status BLOCKED or NEEDS_CONTEXT. Describe

View File

@@ -1,18 +1,18 @@
# Spec Compliance Reviewer Prompt Template
Use this template when dispatching a spec compliance reviewer subagent.
Use this template when dispatching a spec compliance reviewer subagent after a phase implementation.
**Purpose:** Verify implementer built what was requested (nothing more, nothing less)
```
Task tool (general-purpose):
description: "Review spec compliance for Task N"
description: "Review spec compliance for Phase N"
prompt: |
You are reviewing whether an implementation matches its specification.
## What Was Requested
[FULL TEXT of task requirements]
[FULL TEXT of every task requirement included in this phase]
## What Implementer Claims They Built