ostacky 0.0.1 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (28) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +38 -26
  3. package/assets/agents/ostacky.md +65 -594
  4. package/assets/commands/install-stack.md +53 -19
  5. package/assets/commands/opsx-sync.md +25 -0
  6. package/assets/skills/brainstorming/SKILL.md +164 -0
  7. package/assets/skills/brainstorming/SKILL.md.placeholder +36 -0
  8. package/assets/skills/dispatching-parallel-agents/SKILL.md +182 -0
  9. package/assets/skills/dispatching-parallel-agents/SKILL.md.placeholder +36 -0
  10. package/assets/skills/openspec-apply-change/SKILL.md +156 -0
  11. package/assets/skills/openspec-apply-change/SKILL.md.placeholder +36 -0
  12. package/assets/skills/openspec-archive-change/SKILL.md +114 -0
  13. package/assets/skills/openspec-archive-change/SKILL.md.placeholder +36 -0
  14. package/assets/skills/openspec-explore/SKILL.md +288 -0
  15. package/assets/skills/openspec-explore/SKILL.md.placeholder +36 -0
  16. package/assets/skills/openspec-propose/SKILL.md +110 -0
  17. package/assets/skills/openspec-propose/SKILL.md.placeholder +36 -0
  18. package/assets/skills/review/SKILL.md +214 -0
  19. package/assets/skills/review/SKILL.md.placeholder +36 -0
  20. package/assets/skills/subagent-driven-development/SKILL.md +279 -0
  21. package/assets/skills/subagent-driven-development/SKILL.md.placeholder +36 -0
  22. package/assets/skills/tdd/SKILL.md +371 -0
  23. package/assets/skills/tdd/SKILL.md.placeholder +36 -0
  24. package/assets/skills/writing-plans/SKILL.md +152 -0
  25. package/assets/skills/writing-plans/SKILL.md.placeholder +36 -0
  26. package/dist/cli.js +389 -47
  27. package/manifest.json +101 -22
  28. package/package.json +39 -38
@@ -0,0 +1,110 @@
1
+ ---
2
+ name: openspec-propose
3
+ description: Propose a new change with all artifacts generated in one step. Use when the user wants to quickly describe what they want to build and get a complete proposal with design, specs, and tasks ready for implementation.
4
+ license: MIT
5
+ compatibility: Requires openspec CLI.
6
+ metadata:
7
+ author: openspec
8
+ version: "1.0"
9
+ generatedBy: "1.3.1"
10
+ ---
11
+
12
+ Propose a new change - create the change and generate all artifacts in one step.
13
+
14
+ I'll create a change with artifacts:
15
+ - proposal.md (what & why)
16
+ - design.md (how)
17
+ - tasks.md (implementation steps)
18
+
19
+ When ready to implement, run /opsx-apply
20
+
21
+ ---
22
+
23
+ **Input**: The user's request should include a change name (kebab-case) OR a description of what they want to build.
24
+
25
+ **Steps**
26
+
27
+ 1. **If no clear input provided, ask what they want to build**
28
+
29
+ Use the **AskUserQuestion tool** (open-ended, no preset options) to ask:
30
+ > "What change do you want to work on? Describe what you want to build or fix."
31
+
32
+ From their description, derive a kebab-case name (e.g., "add user authentication" → `add-user-auth`).
33
+
34
+ **IMPORTANT**: Do NOT proceed without understanding what the user wants to build.
35
+
36
+ 2. **Create the change directory**
37
+ ```bash
38
+ openspec new change "<name>"
39
+ ```
40
+ This creates a scaffolded change at `openspec/changes/<name>/` with `.openspec.yaml`.
41
+
42
+ 3. **Get the artifact build order**
43
+ ```bash
44
+ openspec status --change "<name>" --json
45
+ ```
46
+ Parse the JSON to get:
47
+ - `applyRequires`: array of artifact IDs needed before implementation (e.g., `["tasks"]`)
48
+ - `artifacts`: list of all artifacts with their status and dependencies
49
+
50
+ 4. **Create artifacts in sequence until apply-ready**
51
+
52
+ Use the **TodoWrite tool** to track progress through the artifacts.
53
+
54
+ Loop through artifacts in dependency order (artifacts with no pending dependencies first):
55
+
56
+ a. **For each artifact that is `ready` (dependencies satisfied)**:
57
+ - Get instructions:
58
+ ```bash
59
+ openspec instructions <artifact-id> --change "<name>" --json
60
+ ```
61
+ - The instructions JSON includes:
62
+ - `context`: Project background (constraints for you - do NOT include in output)
63
+ - `rules`: Artifact-specific rules (constraints for you - do NOT include in output)
64
+ - `template`: The structure to use for your output file
65
+ - `instruction`: Schema-specific guidance for this artifact type
66
+ - `outputPath`: Where to write the artifact
67
+ - `dependencies`: Completed artifacts to read for context
68
+ - Read any completed dependency files for context
69
+ - Create the artifact file using `template` as the structure
70
+ - Apply `context` and `rules` as constraints - but do NOT copy them into the file
71
+ - Show brief progress: "Created <artifact-id>"
72
+
73
+ b. **Continue until all `applyRequires` artifacts are complete**
74
+ - After creating each artifact, re-run `openspec status --change "<name>" --json`
75
+ - Check if every artifact ID in `applyRequires` has `status: "done"` in the artifacts array
76
+ - Stop when all `applyRequires` artifacts are done
77
+
78
+ c. **If an artifact requires user input** (unclear context):
79
+ - Use **AskUserQuestion tool** to clarify
80
+ - Then continue with creation
81
+
82
+ 5. **Show final status**
83
+ ```bash
84
+ openspec status --change "<name>"
85
+ ```
86
+
87
+ **Output**
88
+
89
+ After completing all artifacts, summarize:
90
+ - Change name and location
91
+ - List of artifacts created with brief descriptions
92
+ - What's ready: "All artifacts created! Ready for implementation."
93
+ - Prompt: "Run `/opsx-apply` or ask me to implement to start working on the tasks."
94
+
95
+ **Artifact Creation Guidelines**
96
+
97
+ - Follow the `instruction` field from `openspec instructions` for each artifact type
98
+ - The schema defines what each artifact should contain - follow it
99
+ - Read dependency artifacts for context before creating new ones
100
+ - Use `template` as the structure for your output file - fill in its sections
101
+ - **IMPORTANT**: `context` and `rules` are constraints for YOU, not content for the file
102
+ - Do NOT copy `<context>`, `<rules>`, `<project_context>` blocks into the artifact
103
+ - These guide what you write, but should never appear in the output
104
+
105
+ **Guardrails**
106
+ - Create ALL artifacts needed for implementation (as defined by schema's `apply.requires`)
107
+ - Always read dependency artifacts before creating a new one
108
+ - If context is critically unclear, ask the user - but prefer making reasonable decisions to keep momentum
109
+ - If a change with that name already exists, ask if user wants to continue it or create a new one
110
+ - Verify each artifact file exists after writing before proceeding to next
@@ -0,0 +1,36 @@
1
+ ---
2
+ name: openspec-propose
3
+ description: Create a change proposal with all artifacts (proposal, design, tasks)
4
+ source: github.com/Fission-AI/OpenSpec
5
+ ref: main
6
+ status: placeholder
7
+ ---
8
+
9
+ # openspec-propose (placeholder)
10
+
11
+ **Status:** placeholder. Real content must be fetched from upstream via `ostacky sync` (maintainer command).
12
+
13
+ **Source:** github.com/Fission-AI/OpenSpec @ `ref: main`
14
+ **Original path in upstream:** `skills/openspec-propose/SKILL.md` (or equivalent — adjust per repo)
15
+
16
+ ## What this skill does
17
+
18
+ This file is a placeholder so the bundled installer can copy a complete directory
19
+ structure into `.opencode/skills/openspec-propose/`. The CLI hashes the directory tree and
20
+ records the hash in the lockfile. Replacing this placeholder with the real
21
+ upstream content is a maintainer task, not an end-user task.
22
+
23
+ ## For end users
24
+
25
+ If you ran `ostacky install` and see this file in your `.opencode/skills/openspec-propose/`,
26
+ your installation is working as designed. The curated set is intentionally small.
27
+ To get the real skill content, ask the Ostacky maintainer to refresh the bundle.
28
+
29
+ ## For maintainers
30
+
31
+ To populate this placeholder with the real upstream content:
32
+
33
+ 1. `git clone --depth=1 https://github.com/github.com/Fission-AI/OpenSpec.git`
34
+ 2. Copy `skills/openspec-propose/SKILL.md` (and `scripts/`, `references/` if present) to this directory
35
+ 3. Update `manifest.json` with the computed tree hash for this skill
36
+ 4. Bump version, `npm publish`
@@ -0,0 +1,214 @@
1
+ ---
2
+ name: review
3
+ description: Review code changes for security, performance, bugs, and quality. Reviews staged changes, unstaged changes, specific commits, or PR-ready diffs.
4
+ ---
5
+
6
+ <objective>
7
+ Review code changes and provide structured feedback covering security, performance, bug risks, code quality, and test coverage gaps. This skill analyzes diffs and surrounding context to catch issues before they reach production.
8
+ </objective>
9
+
10
+ <context>
11
+ This skill reviews code changes at various stages of the development workflow. It can review staged changes before a commit, unstaged work-in-progress, a specific commit, or the full set of changes on a branch that are ready for a pull request.
12
+
13
+ The reviewer reads both the diff and the surrounding source files to understand intent and catch issues that only appear in context.
14
+ </context>
15
+
16
+ <core_principle>
17
+ **FIND REAL ISSUES, NOT STYLE NITS.** Focus on problems that cause bugs, security vulnerabilities, performance degradation, or maintainability pain. Avoid nitpicking formatting or subjective style preferences unless they harm readability.
18
+ </core_principle>
19
+
20
+ <analysis_only_rule>
21
+ **THIS SKILL IS READ-ONLY. DO NOT MODIFY CODE.**
22
+
23
+ The purpose is to review and report findings. Making changes during review conflates the reviewer and author roles. Present findings and let the user decide what to act on.
24
+ </analysis_only_rule>
25
+
26
+ <quick_start>
27
+
28
+ <determine_review_scope>
29
+
30
+ Parse the user's input to determine what to review:
31
+
32
+ 1. **No arguments** - Review staged changes first. If nothing is staged, review unstaged changes.
33
+ - Staged: `git diff --cached`
34
+ - Unstaged: `git diff`
35
+ - If both are empty, review the most recent commit: `git show HEAD`
36
+
37
+ 2. **Commit hash argument** (e.g., `/review abc1234`) - Review that specific commit.
38
+ - `git show <hash>`
39
+
40
+ 3. **File path argument** (e.g., `/review src/foo.ts`) - Review unstaged changes in that file.
41
+ - `git diff -- <path>` then fall back to `git diff --cached -- <path>`
42
+
43
+ 4. **"pr" argument** (e.g., `/review pr`) - Review all changes since branching from main.
44
+ - `git diff main...HEAD`
45
+ - If on main, review `git diff HEAD~1`
46
+
47
+ After obtaining the diff, if it is empty, inform the user that there are no changes to review and stop.
48
+
49
+ </determine_review_scope>
50
+
51
+ <gather_context>
52
+
53
+ Before analyzing the diff:
54
+
55
+ 1. **Read changed files in full** - Do not review a diff in isolation. Read each modified file to understand the surrounding code, imports, types, and control flow.
56
+ 2. **Identify the tech stack** - Note languages, frameworks, and libraries in use. This affects what patterns are risky.
57
+ 3. **Check for related test files** - For each changed source file, look for corresponding test files. Note whether tests were updated alongside the changes.
58
+ 4. **Check for configuration changes** - If config files changed (env, CI, package.json, tsconfig, etc.), pay extra attention to side effects.
59
+
60
+ </gather_context>
61
+
62
+ <review_categories>
63
+
64
+ Analyze the changes against each category below. Only report findings that are actually present. Skip categories with no issues.
65
+
66
+ **A. Security Issues** (Severity: CRITICAL or HIGH)
67
+ - Injection vulnerabilities (SQL injection, command injection, template injection)
68
+ - Cross-site scripting (XSS) - unsanitized user input rendered in HTML
69
+ - Authentication and authorization flaws (missing auth checks, privilege escalation)
70
+ - Secrets or credentials hardcoded or logged
71
+ - Insecure deserialization or unsafe eval usage
72
+ - Path traversal or file access vulnerabilities
73
+ - Missing input validation on external data
74
+
75
+ **B. Performance Concerns** (Severity: HIGH or MEDIUM)
76
+ - N+1 query patterns in database access
77
+ - Unnecessary memory allocations in hot paths or loops
78
+ - Blocking operations on the main thread or in async contexts
79
+ - Missing pagination on unbounded queries
80
+ - Redundant computation that could be cached or memoized
81
+ - Large payloads without streaming or chunking
82
+
83
+ **C. Bug Risks** (Severity: HIGH or MEDIUM)
84
+ - Off-by-one errors in loops or array access
85
+ - Null/undefined dereferences without guards
86
+ - Race conditions in concurrent or async code
87
+ - Incorrect error handling (swallowed errors, wrong error types)
88
+ - Type mismatches or unsafe type assertions
89
+ - Logic errors in conditionals (inverted checks, missing cases)
90
+ - Resource leaks (unclosed connections, file handles, listeners)
91
+
92
+ **D. Code Quality** (Severity: MEDIUM or LOW)
93
+ - Unclear or misleading naming
94
+ - Significant code duplication that should be extracted
95
+ - Excessive complexity (deeply nested logic, functions doing too many things)
96
+ - Dead code or unreachable branches
97
+ - Missing or misleading comments on non-obvious logic
98
+ - Inconsistency with patterns used elsewhere in the codebase
99
+
100
+ **E. Test Coverage Gaps** (Severity: MEDIUM or LOW)
101
+ - New logic paths without corresponding test cases
102
+ - Changed behavior without updated tests
103
+ - Edge cases not covered (empty inputs, boundary values, error paths)
104
+ - Missing integration tests for new API endpoints or database changes
105
+
106
+ </review_categories>
107
+
108
+ <format_findings>
109
+
110
+ For each finding, use this structure:
111
+
112
+ ```
113
+ ### [SEVERITY] Category: Brief Title
114
+
115
+ **File**: `path/to/file.ext` (lines X-Y)
116
+
117
+ **Issue**: Clear description of the problem.
118
+
119
+ **Why it matters**: What could go wrong if this is not addressed.
120
+
121
+ **Suggestion**: How to fix it, with a code snippet if helpful.
122
+ ```
123
+
124
+ Severity levels:
125
+ - **CRITICAL** - Must fix before merge. Security vulnerability or data loss risk.
126
+ - **HIGH** - Should fix before merge. Likely bug or significant performance issue.
127
+ - **MEDIUM** - Should fix soon. Code quality or moderate risk issue.
128
+ - **LOW** - Consider fixing. Minor improvement opportunity.
129
+
130
+ </format_findings>
131
+
132
+ </quick_start>
133
+
134
+ <critical_rules>
135
+
136
+ 1. **READ THE FULL FILE**: Never review a diff without reading the complete source file for context
137
+ 2. **NO FALSE ALARMS**: Only report issues you can explain concretely. Do not report vague concerns
138
+ 3. **PRIORITIZE**: Lead with the most severe findings. Do not bury critical issues under style nits
139
+ 4. **BE SPECIFIC**: Include file paths, line numbers, and code references for every finding
140
+ 5. **EXPLAIN THE RISK**: For each finding, explain what could actually go wrong
141
+ 6. **CHECK TESTS**: Always check whether changes have corresponding test updates
142
+ 7. **CONSIDER THE STACK**: Apply language-specific and framework-specific knowledge to your review
143
+ 8. **DO NOT MODIFY CODE**: Present findings only. The user decides what to act on
144
+
145
+ </critical_rules>
146
+
147
+ <output_format>
148
+
149
+ ```markdown
150
+ ## Code Review: [brief description of what was reviewed]
151
+
152
+ **Scope**: [staged changes | unstaged changes | commit abc1234 | PR changes from main]
153
+ **Files reviewed**: [count] files changed, [additions] additions, [deletions] deletions
154
+
155
+ ---
156
+
157
+ ### Findings
158
+
159
+ [Findings grouped by severity, highest first. Use the format from <format_findings>.]
160
+
161
+ ---
162
+
163
+ ### Summary
164
+
165
+ | Severity | Count |
166
+ |----------|-------|
167
+ | CRITICAL | X |
168
+ | HIGH | X |
169
+ | MEDIUM | X |
170
+ | LOW | X |
171
+
172
+ ### Recommended Actions
173
+
174
+ 1. [Most important action to take]
175
+ 2. [Next most important action]
176
+ 3. [...]
177
+ ```
178
+
179
+ If no issues are found:
180
+
181
+ ```markdown
182
+ ## Code Review: [brief description]
183
+
184
+ **Scope**: [what was reviewed]
185
+ **Files reviewed**: [count]
186
+
187
+ No significant issues found. The changes look good to merge.
188
+ ```
189
+
190
+ </output_format>
191
+
192
+ <decision_gate>
193
+
194
+ **After presenting findings, ALWAYS offer these options:**
195
+
196
+ ```
197
+ ─────────────────────────────────────────
198
+ REVIEW COMPLETE
199
+
200
+ What would you like to do?
201
+
202
+ 1. **Fix issues** - I'll address the findings starting with the most critical
203
+ 2. **Save review** - Export findings to a markdown file
204
+ 3. **Review again** - Re-review with different scope or focus
205
+ 4. **Discuss a finding** - Ask questions about a specific issue
206
+ 5. **Other** - Tell me what you need
207
+ ─────────────────────────────────────────
208
+ ```
209
+
210
+ **Wait for user response before taking any action.**
211
+
212
+ This gate is MANDATORY. Never skip it. Never auto-implement fixes.
213
+
214
+ </decision_gate>
@@ -0,0 +1,36 @@
1
+ ---
2
+ name: review
3
+ description: Review code changes for security, performance, bugs, and quality
4
+ source: github.com/obra/superpowers
5
+ ref: main
6
+ status: placeholder
7
+ ---
8
+
9
+ # review (placeholder)
10
+
11
+ **Status:** placeholder. Real content must be fetched from upstream via `ostacky sync` (maintainer command).
12
+
13
+ **Source:** github.com/obra/superpowers @ `ref: main`
14
+ **Original path in upstream:** `skills/review/SKILL.md` (or equivalent — adjust per repo)
15
+
16
+ ## What this skill does
17
+
18
+ This file is a placeholder so the bundled installer can copy a complete directory
19
+ structure into `.opencode/skills/review/`. The CLI hashes the directory tree and
20
+ records the hash in the lockfile. Replacing this placeholder with the real
21
+ upstream content is a maintainer task, not an end-user task.
22
+
23
+ ## For end users
24
+
25
+ If you ran `ostacky install` and see this file in your `.opencode/skills/review/`,
26
+ your installation is working as designed. The curated set is intentionally small.
27
+ To get the real skill content, ask the Ostacky maintainer to refresh the bundle.
28
+
29
+ ## For maintainers
30
+
31
+ To populate this placeholder with the real upstream content:
32
+
33
+ 1. `git clone --depth=1 https://github.com/github.com/obra/superpowers.git`
34
+ 2. Copy `skills/review/SKILL.md` (and `scripts/`, `references/` if present) to this directory
35
+ 3. Update `manifest.json` with the computed tree hash for this skill
36
+ 4. Bump version, `npm publish`
@@ -0,0 +1,279 @@
1
+ ---
2
+ name: subagent-driven-development
3
+ description: Use when executing implementation plans with independent tasks in the current session
4
+ ---
5
+
6
+ # Subagent-Driven Development
7
+
8
+ Execute plan by dispatching fresh subagent per task, with two-stage review after each: spec compliance review first, then code quality review.
9
+
10
+ **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.
11
+
12
+ **Core principle:** Fresh subagent per task + two-stage review (spec then quality) = high quality, fast iteration
13
+
14
+ **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.
15
+
16
+ ## When to Use
17
+
18
+ ```dot
19
+ digraph when_to_use {
20
+ "Have implementation plan?" [shape=diamond];
21
+ "Tasks mostly independent?" [shape=diamond];
22
+ "Stay in this session?" [shape=diamond];
23
+ "subagent-driven-development" [shape=box];
24
+ "executing-plans" [shape=box];
25
+ "Manual execution or brainstorm first" [shape=box];
26
+
27
+ "Have implementation plan?" -> "Tasks mostly independent?" [label="yes"];
28
+ "Have implementation plan?" -> "Manual execution or brainstorm first" [label="no"];
29
+ "Tasks mostly independent?" -> "Stay in this session?" [label="yes"];
30
+ "Tasks mostly independent?" -> "Manual execution or brainstorm first" [label="no - tightly coupled"];
31
+ "Stay in this session?" -> "subagent-driven-development" [label="yes"];
32
+ "Stay in this session?" -> "executing-plans" [label="no - parallel session"];
33
+ }
34
+ ```
35
+
36
+ **vs. Executing Plans (parallel session):**
37
+ - Same session (no context switch)
38
+ - Fresh subagent per task (no context pollution)
39
+ - Two-stage review after each task: spec compliance first, then code quality
40
+ - Faster iteration (no human-in-loop between tasks)
41
+
42
+ ## The Process
43
+
44
+ ```dot
45
+ digraph process {
46
+ rankdir=TB;
47
+
48
+ subgraph cluster_per_task {
49
+ label="Per Task";
50
+ "Dispatch implementer subagent (./implementer-prompt.md)" [shape=box];
51
+ "Implementer subagent asks questions?" [shape=diamond];
52
+ "Answer questions, provide context" [shape=box];
53
+ "Implementer subagent implements, tests, commits, self-reviews" [shape=box];
54
+ "Dispatch spec reviewer subagent (./spec-reviewer-prompt.md)" [shape=box];
55
+ "Spec reviewer subagent confirms code matches spec?" [shape=diamond];
56
+ "Implementer subagent fixes spec gaps" [shape=box];
57
+ "Dispatch code quality reviewer subagent (./code-quality-reviewer-prompt.md)" [shape=box];
58
+ "Code quality reviewer subagent approves?" [shape=diamond];
59
+ "Implementer subagent fixes quality issues" [shape=box];
60
+ "Mark task complete in TodoWrite" [shape=box];
61
+ }
62
+
63
+ "Read plan, extract all tasks with full text, note context, create TodoWrite" [shape=box];
64
+ "More tasks remain?" [shape=diamond];
65
+ "Dispatch final code reviewer subagent for entire implementation" [shape=box];
66
+ "Use superpowers:finishing-a-development-branch" [shape=box style=filled fillcolor=lightgreen];
67
+
68
+ "Read plan, extract all tasks with full text, note context, create TodoWrite" -> "Dispatch implementer subagent (./implementer-prompt.md)";
69
+ "Dispatch implementer subagent (./implementer-prompt.md)" -> "Implementer subagent asks questions?";
70
+ "Implementer subagent asks questions?" -> "Answer questions, provide context" [label="yes"];
71
+ "Answer questions, provide context" -> "Dispatch implementer subagent (./implementer-prompt.md)";
72
+ "Implementer subagent asks questions?" -> "Implementer subagent implements, tests, commits, self-reviews" [label="no"];
73
+ "Implementer subagent implements, tests, commits, self-reviews" -> "Dispatch spec reviewer subagent (./spec-reviewer-prompt.md)";
74
+ "Dispatch spec reviewer subagent (./spec-reviewer-prompt.md)" -> "Spec reviewer subagent confirms code matches spec?";
75
+ "Spec reviewer subagent confirms code matches spec?" -> "Implementer subagent fixes spec gaps" [label="no"];
76
+ "Implementer subagent fixes spec gaps" -> "Dispatch spec reviewer subagent (./spec-reviewer-prompt.md)" [label="re-review"];
77
+ "Spec reviewer subagent confirms code matches spec?" -> "Dispatch code quality reviewer subagent (./code-quality-reviewer-prompt.md)" [label="yes"];
78
+ "Dispatch code quality reviewer subagent (./code-quality-reviewer-prompt.md)" -> "Code quality reviewer subagent approves?";
79
+ "Code quality reviewer subagent approves?" -> "Implementer subagent fixes quality issues" [label="no"];
80
+ "Implementer subagent fixes quality issues" -> "Dispatch code quality reviewer subagent (./code-quality-reviewer-prompt.md)" [label="re-review"];
81
+ "Code quality reviewer subagent approves?" -> "Mark task complete in TodoWrite" [label="yes"];
82
+ "Mark task complete in TodoWrite" -> "More tasks remain?";
83
+ "More tasks remain?" -> "Dispatch implementer subagent (./implementer-prompt.md)" [label="yes"];
84
+ "More tasks remain?" -> "Dispatch final code reviewer subagent for entire implementation" [label="no"];
85
+ "Dispatch final code reviewer subagent for entire implementation" -> "Use superpowers:finishing-a-development-branch";
86
+ }
87
+ ```
88
+
89
+ ## Model Selection
90
+
91
+ Use the least powerful model that can handle each role to conserve cost and increase speed.
92
+
93
+ **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.
94
+
95
+ **Integration and judgment tasks** (multi-file coordination, pattern matching, debugging): use a standard model.
96
+
97
+ **Architecture, design, and review tasks**: use the most capable available model.
98
+
99
+ **Task complexity signals:**
100
+ - Touches 1-2 files with a complete spec → cheap model
101
+ - Touches multiple files with integration concerns → standard model
102
+ - Requires design judgment or broad codebase understanding → most capable model
103
+
104
+ ## Handling Implementer Status
105
+
106
+ Implementer subagents report one of four statuses. Handle each appropriately:
107
+
108
+ **DONE:** Proceed to spec compliance review.
109
+
110
+ **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.
111
+
112
+ **NEEDS_CONTEXT:** The implementer needs information that wasn't provided. Provide the missing context and re-dispatch.
113
+
114
+ **BLOCKED:** The implementer cannot complete the task. Assess the blocker:
115
+ 1. If it's a context problem, provide more context and re-dispatch with the same model
116
+ 2. If the task requires more reasoning, re-dispatch with a more capable model
117
+ 3. If the task is too large, break it into smaller pieces
118
+ 4. If the plan itself is wrong, escalate to the human
119
+
120
+ **Never** ignore an escalation or force the same model to retry without changes. If the implementer said it's stuck, something needs to change.
121
+
122
+ ## Prompt Templates
123
+
124
+ - `./implementer-prompt.md` - Dispatch implementer subagent
125
+ - `./spec-reviewer-prompt.md` - Dispatch spec compliance reviewer subagent
126
+ - `./code-quality-reviewer-prompt.md` - Dispatch code quality reviewer subagent
127
+
128
+ ## Example Workflow
129
+
130
+ ```
131
+ You: I'm using Subagent-Driven Development to execute this plan.
132
+
133
+ [Read plan file once: docs/superpowers/plans/feature-plan.md]
134
+ [Extract all 5 tasks with full text and context]
135
+ [Create TodoWrite with all tasks]
136
+
137
+ Task 1: Hook installation script
138
+
139
+ [Get Task 1 text and context (already extracted)]
140
+ [Dispatch implementation subagent with full task text + context]
141
+
142
+ Implementer: "Before I begin - should the hook be installed at user or system level?"
143
+
144
+ You: "User level (~/.config/superpowers/hooks/)"
145
+
146
+ Implementer: "Got it. Implementing now..."
147
+ [Later] Implementer:
148
+ - Implemented install-hook command
149
+ - Added tests, 5/5 passing
150
+ - Self-review: Found I missed --force flag, added it
151
+ - Committed
152
+
153
+ [Dispatch spec compliance reviewer]
154
+ Spec reviewer: ✅ Spec compliant - all requirements met, nothing extra
155
+
156
+ [Get git SHAs, dispatch code quality reviewer]
157
+ Code reviewer: Strengths: Good test coverage, clean. Issues: None. Approved.
158
+
159
+ [Mark Task 1 complete]
160
+
161
+ Task 2: Recovery modes
162
+
163
+ [Get Task 2 text and context (already extracted)]
164
+ [Dispatch implementation subagent with full task text + context]
165
+
166
+ Implementer: [No questions, proceeds]
167
+ Implementer:
168
+ - Added verify/repair modes
169
+ - 8/8 tests passing
170
+ - Self-review: All good
171
+ - Committed
172
+
173
+ [Dispatch spec compliance reviewer]
174
+ Spec reviewer: ❌ Issues:
175
+ - Missing: Progress reporting (spec says "report every 100 items")
176
+ - Extra: Added --json flag (not requested)
177
+
178
+ [Implementer fixes issues]
179
+ Implementer: Removed --json flag, added progress reporting
180
+
181
+ [Spec reviewer reviews again]
182
+ Spec reviewer: ✅ Spec compliant now
183
+
184
+ [Dispatch code quality reviewer]
185
+ Code reviewer: Strengths: Solid. Issues (Important): Magic number (100)
186
+
187
+ [Implementer fixes]
188
+ Implementer: Extracted PROGRESS_INTERVAL constant
189
+
190
+ [Code reviewer reviews again]
191
+ Code reviewer: ✅ Approved
192
+
193
+ [Mark Task 2 complete]
194
+
195
+ ...
196
+
197
+ [After all tasks]
198
+ [Dispatch final code-reviewer]
199
+ Final reviewer: All requirements met, ready to merge
200
+
201
+ Done!
202
+ ```
203
+
204
+ ## Advantages
205
+
206
+ **vs. Manual execution:**
207
+ - Subagents follow TDD naturally
208
+ - Fresh context per task (no confusion)
209
+ - Parallel-safe (subagents don't interfere)
210
+ - Subagent can ask questions (before AND during work)
211
+
212
+ **vs. Executing Plans:**
213
+ - Same session (no handoff)
214
+ - Continuous progress (no waiting)
215
+ - Review checkpoints automatic
216
+
217
+ **Efficiency gains:**
218
+ - No file reading overhead (controller provides full text)
219
+ - Controller curates exactly what context is needed
220
+ - Subagent gets complete information upfront
221
+ - Questions surfaced before work begins (not after)
222
+
223
+ **Quality gates:**
224
+ - Self-review catches issues before handoff
225
+ - Two-stage review: spec compliance, then code quality
226
+ - Review loops ensure fixes actually work
227
+ - Spec compliance prevents over/under-building
228
+ - Code quality ensures implementation is well-built
229
+
230
+ **Cost:**
231
+ - More subagent invocations (implementer + 2 reviewers per task)
232
+ - Controller does more prep work (extracting all tasks upfront)
233
+ - Review loops add iterations
234
+ - But catches issues early (cheaper than debugging later)
235
+
236
+ ## Red Flags
237
+
238
+ **Never:**
239
+ - Start implementation on main/master branch without explicit user consent
240
+ - Skip reviews (spec compliance OR code quality)
241
+ - Proceed with unfixed issues
242
+ - Dispatch multiple implementation subagents in parallel (conflicts)
243
+ - Make subagent read plan file (provide full text instead)
244
+ - Skip scene-setting context (subagent needs to understand where task fits)
245
+ - Ignore subagent questions (answer before letting them proceed)
246
+ - Accept "close enough" on spec compliance (spec reviewer found issues = not done)
247
+ - Skip review loops (reviewer found issues = implementer fixes = review again)
248
+ - Let implementer self-review replace actual review (both are needed)
249
+ - **Start code quality review before spec compliance is ✅** (wrong order)
250
+ - Move to next task while either review has open issues
251
+
252
+ **If subagent asks questions:**
253
+ - Answer clearly and completely
254
+ - Provide additional context if needed
255
+ - Don't rush them into implementation
256
+
257
+ **If reviewer finds issues:**
258
+ - Implementer (same subagent) fixes them
259
+ - Reviewer reviews again
260
+ - Repeat until approved
261
+ - Don't skip the re-review
262
+
263
+ **If subagent fails task:**
264
+ - Dispatch fix subagent with specific instructions
265
+ - Don't try to fix manually (context pollution)
266
+
267
+ ## Integration
268
+
269
+ **Required workflow skills:**
270
+ - **superpowers:using-git-worktrees** - Ensures isolated workspace (creates one or verifies existing)
271
+ - **superpowers:writing-plans** - Creates the plan this skill executes
272
+ - **superpowers:requesting-code-review** - Code review template for reviewer subagents
273
+ - **superpowers:finishing-a-development-branch** - Complete development after all tasks
274
+
275
+ **Subagents should use:**
276
+ - **superpowers:test-driven-development** - Subagents follow TDD for each task
277
+
278
+ **Alternative workflow:**
279
+ - **superpowers:executing-plans** - Use for parallel session instead of same-session execution