@gordon.gan/specflow 1.0.0

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 (178) hide show
  1. package/LICENSE +31 -0
  2. package/README.md +442 -0
  3. package/bin/specflow.js +2 -0
  4. package/dist/cli/commands/change-archive.d.ts +26 -0
  5. package/dist/cli/commands/change-archive.js +50 -0
  6. package/dist/cli/commands/change-new.d.ts +18 -0
  7. package/dist/cli/commands/change-new.js +53 -0
  8. package/dist/cli/commands/change-phase.d.ts +33 -0
  9. package/dist/cli/commands/change-phase.js +66 -0
  10. package/dist/cli/commands/change-status.d.ts +35 -0
  11. package/dist/cli/commands/change-status.js +95 -0
  12. package/dist/cli/commands/doctor.d.ts +9 -0
  13. package/dist/cli/commands/doctor.js +48 -0
  14. package/dist/cli/commands/init.d.ts +16 -0
  15. package/dist/cli/commands/init.js +122 -0
  16. package/dist/cli/commands/instructions.d.ts +21 -0
  17. package/dist/cli/commands/instructions.js +75 -0
  18. package/dist/cli/commands/parity-report.d.ts +10 -0
  19. package/dist/cli/commands/parity-report.js +67 -0
  20. package/dist/cli/commands/sync.d.ts +4 -0
  21. package/dist/cli/commands/sync.js +40 -0
  22. package/dist/cli/commands/validate.d.ts +21 -0
  23. package/dist/cli/commands/validate.js +46 -0
  24. package/dist/cli/index.d.ts +1 -0
  25. package/dist/cli/index.js +52 -0
  26. package/dist/core/archive.d.ts +39 -0
  27. package/dist/core/archive.js +154 -0
  28. package/dist/core/artifact-graph/graph.d.ts +60 -0
  29. package/dist/core/artifact-graph/graph.js +141 -0
  30. package/dist/core/artifact-graph/index.d.ts +10 -0
  31. package/dist/core/artifact-graph/index.js +7 -0
  32. package/dist/core/artifact-graph/instruction-loader.d.ts +45 -0
  33. package/dist/core/artifact-graph/instruction-loader.js +37 -0
  34. package/dist/core/artifact-graph/outputs.d.ts +35 -0
  35. package/dist/core/artifact-graph/outputs.js +48 -0
  36. package/dist/core/artifact-graph/resolver.d.ts +54 -0
  37. package/dist/core/artifact-graph/resolver.js +139 -0
  38. package/dist/core/artifact-graph/schema.d.ts +23 -0
  39. package/dist/core/artifact-graph/schema.js +115 -0
  40. package/dist/core/artifact-graph/state.d.ts +9 -0
  41. package/dist/core/artifact-graph/state.js +93 -0
  42. package/dist/core/artifact-graph/types.d.ts +123 -0
  43. package/dist/core/artifact-graph/types.js +29 -0
  44. package/dist/core/parsers/change-parser.d.ts +20 -0
  45. package/dist/core/parsers/change-parser.js +22 -0
  46. package/dist/core/parsers/index.d.ts +7 -0
  47. package/dist/core/parsers/index.js +4 -0
  48. package/dist/core/parsers/markdown-parser.d.ts +35 -0
  49. package/dist/core/parsers/markdown-parser.js +193 -0
  50. package/dist/core/parsers/requirement-blocks.d.ts +21 -0
  51. package/dist/core/parsers/requirement-blocks.js +57 -0
  52. package/dist/core/parsers/spec-structure.d.ts +22 -0
  53. package/dist/core/parsers/spec-structure.js +105 -0
  54. package/dist/core/specs-apply.d.ts +22 -0
  55. package/dist/core/specs-apply.js +165 -0
  56. package/dist/core/templates/index.d.ts +31 -0
  57. package/dist/core/templates/index.js +80 -0
  58. package/dist/core/templates/types.d.ts +4 -0
  59. package/dist/core/templates/types.js +1 -0
  60. package/dist/core/validation/constants.d.ts +14 -0
  61. package/dist/core/validation/constants.js +14 -0
  62. package/dist/core/validation/types.d.ts +13 -0
  63. package/dist/core/validation/types.js +6 -0
  64. package/dist/core/validation/validator.d.ts +24 -0
  65. package/dist/core/validation/validator.js +250 -0
  66. package/dist/integrations/claude/adapter.d.ts +2 -0
  67. package/dist/integrations/claude/adapter.js +106 -0
  68. package/dist/integrations/codex/adapter.d.ts +2 -0
  69. package/dist/integrations/codex/adapter.js +141 -0
  70. package/dist/integrations/cursor/adapter.d.ts +2 -0
  71. package/dist/integrations/cursor/adapter.js +126 -0
  72. package/dist/integrations/shared/adapter-registry.d.ts +4 -0
  73. package/dist/integrations/shared/adapter-registry.js +27 -0
  74. package/dist/integrations/shared/asset-copy.d.ts +2 -0
  75. package/dist/integrations/shared/asset-copy.js +44 -0
  76. package/dist/integrations/shared/asset-hash.d.ts +4 -0
  77. package/dist/integrations/shared/asset-hash.js +54 -0
  78. package/dist/integrations/shared/capability-evidence.d.ts +1 -0
  79. package/dist/integrations/shared/capability-evidence.js +42 -0
  80. package/dist/integrations/shared/command-catalog.d.ts +6 -0
  81. package/dist/integrations/shared/command-catalog.js +13 -0
  82. package/dist/integrations/shared/managed-assets.d.ts +2 -0
  83. package/dist/integrations/shared/managed-assets.js +21 -0
  84. package/dist/integrations/shared/marker-write.d.ts +3 -0
  85. package/dist/integrations/shared/marker-write.js +48 -0
  86. package/dist/integrations/shared/migration-state.d.ts +2 -0
  87. package/dist/integrations/shared/migration-state.js +67 -0
  88. package/dist/integrations/shared/parity-comparator.d.ts +6 -0
  89. package/dist/integrations/shared/parity-comparator.js +97 -0
  90. package/dist/integrations/shared/parity-manifest.d.ts +13 -0
  91. package/dist/integrations/shared/parity-manifest.js +58 -0
  92. package/dist/integrations/shared/runtime-assets.d.ts +2 -0
  93. package/dist/integrations/shared/runtime-assets.js +21 -0
  94. package/dist/integrations/shared/skill-renderer.d.ts +5 -0
  95. package/dist/integrations/shared/skill-renderer.js +77 -0
  96. package/dist/integrations/shared/types.d.ts +35 -0
  97. package/dist/integrations/shared/types.js +1 -0
  98. package/dist/utils/change-metadata.d.ts +38 -0
  99. package/dist/utils/change-metadata.js +82 -0
  100. package/dist/utils/change-utils.d.ts +53 -0
  101. package/dist/utils/change-utils.js +97 -0
  102. package/dist/utils/file-system.d.ts +35 -0
  103. package/dist/utils/file-system.js +67 -0
  104. package/dist/utils/index.d.ts +7 -0
  105. package/dist/utils/index.js +5 -0
  106. package/dist/utils/project-root.d.ts +22 -0
  107. package/dist/utils/project-root.js +44 -0
  108. package/dist/utils/task-progress.d.ts +39 -0
  109. package/dist/utils/task-progress.js +62 -0
  110. package/package.json +72 -0
  111. package/prompts/build/ecc-go-reviewer.md +80 -0
  112. package/prompts/build/ecc-java-reviewer.md +185 -0
  113. package/prompts/build/ecc-kotlin-reviewer.md +163 -0
  114. package/prompts/build/ecc-python-reviewer.md +102 -0
  115. package/prompts/build/ecc-rust-reviewer.md +98 -0
  116. package/prompts/build/ecc-typescript-reviewer.md +116 -0
  117. package/prompts/build/language-router.md +22 -0
  118. package/prompts/build/phase-a-plan.md +288 -0
  119. package/prompts/build/phase-b-execute.md +276 -0
  120. package/prompts/build/phase-b-review.md +119 -0
  121. package/prompts/build/phase-b-worktree.md +215 -0
  122. package/prompts/build/plan-document-reviewer.md +51 -0
  123. package/prompts/build/tdd.md +184 -0
  124. package/prompts/done/branch-finish.md +204 -0
  125. package/prompts/fix/debug.md +249 -0
  126. package/prompts/plan/design-draft.md +123 -0
  127. package/prompts/plan/proposal.md +85 -0
  128. package/prompts/plan/specs.md +114 -0
  129. package/prompts/plan/tasks-draft.md +123 -0
  130. package/prompts/reference/openspec/apply-instruction.md +2 -0
  131. package/prompts/reference/openspec/design-instruction.md +20 -0
  132. package/prompts/reference/openspec/proposal-instruction.md +18 -0
  133. package/prompts/reference/openspec/specs-instruction.md +47 -0
  134. package/prompts/reference/openspec/tasks-instruction.md +26 -0
  135. package/prompts/reference/specflow/example-design.md +284 -0
  136. package/prompts/reference/superpowers/anthropic-best-practices.md +1150 -0
  137. package/prompts/reference/superpowers/codex-tools.md +29 -0
  138. package/prompts/reference/superpowers/condition-based-waiting-example.ts +158 -0
  139. package/prompts/reference/superpowers/condition-based-waiting.md +115 -0
  140. package/prompts/reference/superpowers/defense-in-depth.md +122 -0
  141. package/prompts/reference/superpowers/find-polluter.sh +63 -0
  142. package/prompts/reference/superpowers/graphviz-conventions.dot +172 -0
  143. package/prompts/reference/superpowers/persuasion-principles.md +187 -0
  144. package/prompts/reference/superpowers/root-cause-tracing.md +169 -0
  145. package/prompts/reference/superpowers/testing-anti-patterns.md +299 -0
  146. package/prompts/reference/superpowers/testing-skills-with-subagents.md +384 -0
  147. package/prompts/reference/superpowers/using-superpowers.md +117 -0
  148. package/prompts/reference/superpowers/writing-skills.md +655 -0
  149. package/prompts/refine/brainstorm.md +241 -0
  150. package/prompts/refine/design-output.md +126 -0
  151. package/prompts/refine/spec-document-reviewer.md +51 -0
  152. package/prompts/refine/update-artifacts.md +185 -0
  153. package/prompts/review/code-review.md +223 -0
  154. package/prompts/shared/code-reviewer-prompt.md +98 -0
  155. package/prompts/shared/dispatching-parallel-agents.md +143 -0
  156. package/prompts/shared/executing-plans.md +67 -0
  157. package/prompts/shared/implementer-prompt.md +115 -0
  158. package/prompts/shared/receiving-code-review.md +174 -0
  159. package/prompts/shared/spec-reviewer-prompt.md +63 -0
  160. package/prompts/test/tdd.md +236 -0
  161. package/prompts/test/verification.md +129 -0
  162. package/prompts/verify/ecc-security-reviewer.md +112 -0
  163. package/prompts/verify/verification.md +196 -0
  164. package/schemas/specflow/schema.yaml +48 -0
  165. package/skills/specflow-build/SKILL.md +129 -0
  166. package/skills/specflow-done/SKILL.md +68 -0
  167. package/skills/specflow-fix/SKILL.md +74 -0
  168. package/skills/specflow-plan/SKILL.md +82 -0
  169. package/skills/specflow-refine/SKILL.md +128 -0
  170. package/skills/specflow-review/SKILL.md +40 -0
  171. package/skills/specflow-scan/SKILL.md +48 -0
  172. package/skills/specflow-snap/SKILL.md +46 -0
  173. package/skills/specflow-test/SKILL.md +48 -0
  174. package/skills/specflow-verify/SKILL.md +77 -0
  175. package/templates/design.md +19 -0
  176. package/templates/proposal.md +23 -0
  177. package/templates/spec.md +42 -0
  178. package/templates/tasks.md +9 -0
@@ -0,0 +1,223 @@
1
+ <!-- SOURCE: skills/requesting-code-review/SKILL.md + skills/requesting-code-review/code-reviewer.md -->
2
+
3
+ # Code Review
4
+
5
+ Dispatch a code-reviewer subagent to catch issues before they cascade. The reviewer gets precisely crafted context for evaluation -- never your session's history. This keeps the reviewer focused on the work product, not your thought process, and preserves your own context for continued work.
6
+
7
+ **Core principle:** Review early, review often.
8
+
9
+ ## When to Request Review
10
+
11
+ **Mandatory:**
12
+ - After each task in specflow:build Phase B
13
+ - After completing major feature
14
+ - Before merge to main
15
+
16
+ **Optional but valuable:**
17
+ - When stuck (fresh perspective)
18
+ - Before refactoring (baseline check)
19
+ - After fixing complex bug
20
+
21
+ ## How to Request
22
+
23
+ **1. Get git SHAs:**
24
+ ```bash
25
+ BASE_SHA=$(git rev-parse HEAD~1) # or origin/main
26
+ HEAD_SHA=$(git rev-parse HEAD)
27
+ ```
28
+
29
+ **2. Dispatch code-reviewer subagent:**
30
+
31
+ Use Task tool with the review template below, filling in the placeholders.
32
+
33
+ **3. Act on feedback:**
34
+ - Fix Critical issues immediately
35
+ - Fix Important issues before proceeding
36
+ - Note Minor issues for later
37
+ - Push back if reviewer is wrong (with reasoning)
38
+
39
+ ## SpecFlow Regression Check
40
+
41
+ **Before concluding the review, the reviewer MUST also check:**
42
+
43
+ If `specflow/specs/` exists in the repository:
44
+ 1. Read all relevant spec files from `specflow/specs/`
45
+ 2. Verify the changes do not regress any existing spec requirements
46
+ 3. Confirm the changes align with the declared behavior in specs
47
+ 4. Flag any spec violations as Critical issues
48
+
49
+ ## Code Reviewer Template
50
+
51
+ ```
52
+ Task tool (general-purpose):
53
+ description: "Review code changes"
54
+ prompt: |
55
+ You are reviewing code changes for production readiness.
56
+
57
+ **Your task:**
58
+ 1. Review {WHAT_WAS_IMPLEMENTED}
59
+ 2. Compare against {PLAN_OR_REQUIREMENTS}
60
+ 3. Check code quality, architecture, testing
61
+ 4. Categorize issues by severity
62
+ 5. Assess production readiness
63
+
64
+ ## What Was Implemented
65
+
66
+ {DESCRIPTION}
67
+
68
+ ## Requirements/Plan
69
+
70
+ {PLAN_REFERENCE}
71
+
72
+ ## Git Range to Review
73
+
74
+ **Base:** {BASE_SHA}
75
+ **Head:** {HEAD_SHA}
76
+
77
+ ```bash
78
+ git diff --stat {BASE_SHA}..{HEAD_SHA}
79
+ git diff {BASE_SHA}..{HEAD_SHA}
80
+ ```
81
+
82
+ ## Review Checklist
83
+
84
+ **Code Quality:**
85
+ - Clean separation of concerns?
86
+ - Proper error handling?
87
+ - Type safety (if applicable)?
88
+ - DRY principle followed?
89
+ - Edge cases handled?
90
+
91
+ **Architecture:**
92
+ - Sound design decisions?
93
+ - Scalability considerations?
94
+ - Performance implications?
95
+ - Security concerns?
96
+
97
+ **Testing:**
98
+ - Tests actually test logic (not mocks)?
99
+ - Edge cases covered?
100
+ - Integration tests where needed?
101
+ - All tests passing?
102
+
103
+ **Requirements:**
104
+ - All plan requirements met?
105
+ - Implementation matches spec?
106
+ - No scope creep?
107
+ - Breaking changes documented?
108
+
109
+ **Spec Regression (if specflow/specs/ exists):**
110
+ - Read relevant specs from specflow/specs/
111
+ - Verify no existing spec requirements are broken
112
+ - Confirm changes align with declared behavior
113
+ - Flag any spec violations as Critical
114
+
115
+ **Production Readiness:**
116
+ - Migration strategy (if schema changes)?
117
+ - Backward compatibility considered?
118
+ - Documentation complete?
119
+ - No obvious bugs?
120
+
121
+ ## Output Format
122
+
123
+ ### Strengths
124
+ [What's well done? Be specific.]
125
+
126
+ ### Issues
127
+
128
+ #### Critical (Must Fix)
129
+ [Bugs, security issues, data loss risks, broken functionality, spec violations]
130
+
131
+ #### Important (Should Fix)
132
+ [Architecture problems, missing features, poor error handling, test gaps]
133
+
134
+ #### Minor (Nice to Have)
135
+ [Code style, optimization opportunities, documentation improvements]
136
+
137
+ **For each issue:**
138
+ - File:line reference
139
+ - What's wrong
140
+ - Why it matters
141
+ - How to fix (if not obvious)
142
+
143
+ ### Recommendations
144
+ [Improvements for code quality, architecture, or process]
145
+
146
+ ### Assessment
147
+
148
+ **Ready to merge?** [Yes/No/With fixes]
149
+
150
+ **Reasoning:** [Technical assessment in 1-2 sentences]
151
+
152
+ ## Critical Rules
153
+
154
+ **DO:**
155
+ - Categorize by actual severity (not everything is Critical)
156
+ - Be specific (file:line, not vague)
157
+ - Explain WHY issues matter
158
+ - Acknowledge strengths
159
+ - Give clear verdict
160
+
161
+ **DON'T:**
162
+ - Say "looks good" without checking
163
+ - Mark nitpicks as Critical
164
+ - Give feedback on code you didn't review
165
+ - Be vague ("improve error handling")
166
+ - Avoid giving a clear verdict
167
+ ```
168
+
169
+ ## Example
170
+
171
+ ```
172
+ [Just completed Task 2: Add verification function]
173
+
174
+ You: Let me request code review before proceeding.
175
+
176
+ BASE_SHA=$(git log --oneline | grep "Task 1" | head -1 | awk '{print $1}')
177
+ HEAD_SHA=$(git rev-parse HEAD)
178
+
179
+ [Dispatch code-reviewer subagent]
180
+ WHAT_WAS_IMPLEMENTED: Verification and repair functions for conversation index
181
+ PLAN_OR_REQUIREMENTS: Task 2 from specflow/changes/<change-name>/tasks.md
182
+ BASE_SHA: a7981ec
183
+ HEAD_SHA: 3df7661
184
+ DESCRIPTION: Added verifyIndex() and repairIndex() with 4 issue types
185
+
186
+ [Subagent returns]:
187
+ Strengths: Clean architecture, real tests
188
+ Issues:
189
+ Important: Missing progress indicators
190
+ Minor: Magic number (100) for reporting interval
191
+ Assessment: Ready to proceed
192
+
193
+ You: [Fix progress indicators]
194
+ [Continue to Task 3]
195
+ ```
196
+
197
+ ## Integration with Workflows
198
+
199
+ **specflow:build Phase B:**
200
+ - Review after EACH task
201
+ - Catch issues before they compound
202
+ - Fix before moving to next task
203
+
204
+ **specflow:build Phase B (inline mode):**
205
+ - Review after each batch (3 tasks)
206
+ - Get feedback, apply, continue
207
+
208
+ **Ad-Hoc Development:**
209
+ - Review before merge
210
+ - Review when stuck
211
+
212
+ ## Red Flags
213
+
214
+ **Never:**
215
+ - Skip review because "it's simple"
216
+ - Ignore Critical issues
217
+ - Proceed with unfixed Important issues
218
+ - Argue with valid technical feedback
219
+
220
+ **If reviewer wrong:**
221
+ - Push back with technical reasoning
222
+ - Show code/tests that prove it works
223
+ - Request clarification
@@ -0,0 +1,98 @@
1
+ <!-- SOURCE: skills/subagent-driven-development/code-quality-reviewer-prompt.md -->
2
+
3
+ # Code Quality Reviewer Prompt Template
4
+
5
+ Use this template when dispatching a code quality reviewer subagent.
6
+
7
+ **Purpose:** Verify implementation is well-built (clean, tested, maintainable)
8
+
9
+ **Only dispatch after spec compliance review passes.**
10
+
11
+ ```
12
+ Task tool (general-purpose):
13
+ description: "Review code quality for Task N"
14
+ prompt: |
15
+ You are reviewing code changes for production readiness.
16
+
17
+ ## What Was Implemented
18
+
19
+ {DESCRIPTION}
20
+
21
+ ## Requirements/Plan
22
+
23
+ {PLAN_REFERENCE}
24
+
25
+ ## Git Range to Review
26
+
27
+ **Base:** {BASE_SHA}
28
+ **Head:** {HEAD_SHA}
29
+
30
+ ```bash
31
+ git diff --stat {BASE_SHA}..{HEAD_SHA}
32
+ git diff {BASE_SHA}..{HEAD_SHA}
33
+ ```
34
+
35
+ ## Review Checklist
36
+
37
+ **Code Quality:**
38
+ - Clean separation of concerns?
39
+ - Proper error handling?
40
+ - Type safety (if applicable)?
41
+ - DRY principle followed?
42
+ - Edge cases handled?
43
+
44
+ **Architecture:**
45
+ - Does each file have one clear responsibility with a well-defined interface?
46
+ - Are units decomposed so they can be understood and tested independently?
47
+ - Is the implementation following the file structure from the plan?
48
+ - Did this implementation create new files that are already large, or significantly
49
+ grow existing files? (Don't flag pre-existing file sizes -- focus on what this
50
+ change contributed.)
51
+ - Sound design decisions?
52
+ - Performance implications?
53
+ - Security concerns?
54
+
55
+ **Testing:**
56
+ - Tests actually test logic (not mocks)?
57
+ - Edge cases covered?
58
+ - Integration tests where needed?
59
+ - All tests passing?
60
+
61
+ **Requirements:**
62
+ - All plan requirements met?
63
+ - Implementation matches spec?
64
+ - No scope creep?
65
+
66
+ ## Output Format
67
+
68
+ ### Strengths
69
+ [What's well done? Be specific.]
70
+
71
+ ### Issues
72
+
73
+ #### Critical (Must Fix)
74
+ [Bugs, security issues, data loss risks, broken functionality]
75
+
76
+ #### Important (Should Fix)
77
+ [Architecture problems, missing features, poor error handling, test gaps]
78
+
79
+ #### Minor (Nice to Have)
80
+ [Code style, optimization opportunities, documentation improvements]
81
+
82
+ **For each issue:**
83
+ - File:line reference
84
+ - What's wrong
85
+ - Why it matters
86
+ - How to fix (if not obvious)
87
+
88
+ ### Recommendations
89
+ [Improvements for code quality, architecture, or process]
90
+
91
+ ### Assessment
92
+
93
+ **Ready to merge?** [Yes/No/With fixes]
94
+
95
+ **Reasoning:** [Technical assessment in 1-2 sentences]
96
+ ```
97
+
98
+ **Code reviewer returns:** Strengths, Issues (Critical/Important/Minor), Assessment
@@ -0,0 +1,143 @@
1
+ <!-- SOURCE: skills/dispatching-parallel-agents/SKILL.md -->
2
+
3
+ # Dispatching Parallel Agents
4
+
5
+ ## Overview
6
+
7
+ 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.
8
+
9
+ When you have multiple unrelated failures (different test files, different subsystems, different bugs), investigating them sequentially wastes time. Each investigation is independent and can happen in parallel.
10
+
11
+ **Core principle:** Dispatch one agent per independent problem domain. Let them work concurrently.
12
+
13
+ ## When to Use
14
+
15
+ ```dot
16
+ digraph when_to_use {
17
+ "Multiple failures?" [shape=diamond];
18
+ "Are they independent?" [shape=diamond];
19
+ "Single agent investigates all" [shape=box];
20
+ "One agent per problem domain" [shape=box];
21
+ "Can they work in parallel?" [shape=diamond];
22
+ "Sequential agents" [shape=box];
23
+ "Parallel dispatch" [shape=box];
24
+
25
+ "Multiple failures?" -> "Are they independent?" [label="yes"];
26
+ "Are they independent?" -> "Single agent investigates all" [label="no - related"];
27
+ "Are they independent?" -> "Can they work in parallel?" [label="yes"];
28
+ "Can they work in parallel?" -> "Parallel dispatch" [label="yes"];
29
+ "Can they work in parallel?" -> "Sequential agents" [label="no - shared state"];
30
+ }
31
+ ```
32
+
33
+ **Use when:**
34
+ - 3+ test files failing with different root causes
35
+ - Multiple subsystems broken independently
36
+ - Each problem can be understood without context from others
37
+ - No shared state between investigations
38
+
39
+ **Don't use when:**
40
+ - Failures are related (fix one might fix others)
41
+ - Need to understand full system state
42
+ - Agents would interfere with each other
43
+
44
+ ## The Pattern
45
+
46
+ ### 1. Identify Independent Domains
47
+
48
+ Group failures by what's broken:
49
+ - File A tests: Tool approval flow
50
+ - File B tests: Batch completion behavior
51
+ - File C tests: Abort functionality
52
+
53
+ Each domain is independent - fixing tool approval doesn't affect abort tests.
54
+
55
+ ### 2. Create Focused Agent Tasks
56
+
57
+ Each agent gets:
58
+ - **Specific scope:** One test file or subsystem
59
+ - **Clear goal:** Make these tests pass
60
+ - **Constraints:** Don't change other code
61
+ - **Expected output:** Summary of what you found and fixed
62
+
63
+ ### 3. Dispatch in Parallel
64
+
65
+ ```typescript
66
+ // In Claude Code / AI environment
67
+ Task("Fix agent-tool-abort.test.ts failures")
68
+ Task("Fix batch-completion-behavior.test.ts failures")
69
+ Task("Fix tool-approval-race-conditions.test.ts failures")
70
+ // All three run concurrently
71
+ ```
72
+
73
+ ### 4. Review and Integrate
74
+
75
+ When agents return:
76
+ - Read each summary
77
+ - Verify fixes don't conflict
78
+ - Run full test suite
79
+ - Integrate all changes
80
+
81
+ ## Agent Prompt Structure
82
+
83
+ Good agent prompts are:
84
+ 1. **Focused** - One clear problem domain
85
+ 2. **Self-contained** - All context needed to understand the problem
86
+ 3. **Specific about output** - What should the agent return?
87
+
88
+ ```markdown
89
+ Fix the 3 failing tests in src/agents/agent-tool-abort.test.ts:
90
+
91
+ 1. "should abort tool with partial output capture" - expects 'interrupted at' in message
92
+ 2. "should handle mixed completed and aborted tools" - fast tool aborted instead of completed
93
+ 3. "should properly track pendingToolCount" - expects 3 results but gets 0
94
+
95
+ These are timing/race condition issues. Your task:
96
+
97
+ 1. Read the test file and understand what each test verifies
98
+ 2. Identify root cause - timing issues or actual bugs?
99
+ 3. Fix by:
100
+ - Replacing arbitrary timeouts with event-based waiting
101
+ - Fixing bugs in abort implementation if found
102
+ - Adjusting test expectations if testing changed behavior
103
+
104
+ Do NOT just increase timeouts - find the real issue.
105
+
106
+ Return: Summary of what you found and what you fixed.
107
+ ```
108
+
109
+ ## Common Mistakes
110
+
111
+ **Too broad:** "Fix all the tests" - agent gets lost
112
+ **Specific:** "Fix agent-tool-abort.test.ts" - focused scope
113
+
114
+ **No context:** "Fix the race condition" - agent doesn't know where
115
+ **Context:** Paste the error messages and test names
116
+
117
+ **No constraints:** Agent might refactor everything
118
+ **Constraints:** "Do NOT change production code" or "Fix tests only"
119
+
120
+ **Vague output:** "Fix it" - you don't know what changed
121
+ **Specific:** "Return summary of root cause and changes"
122
+
123
+ ## When NOT to Use
124
+
125
+ **Related failures:** Fixing one might fix others - investigate together first
126
+ **Need full context:** Understanding requires seeing entire system
127
+ **Exploratory debugging:** You don't know what's broken yet
128
+ **Shared state:** Agents would interfere (editing same files, using same resources)
129
+
130
+ ## Key Benefits
131
+
132
+ 1. **Parallelization** - Multiple investigations happen simultaneously
133
+ 2. **Focus** - Each agent has narrow scope, less context to track
134
+ 3. **Independence** - Agents don't interfere with each other
135
+ 4. **Speed** - 3 problems solved in time of 1
136
+
137
+ ## Verification
138
+
139
+ After agents return:
140
+ 1. **Review each summary** - Understand what changed
141
+ 2. **Check for conflicts** - Did agents edit same code?
142
+ 3. **Run full suite** - Verify all fixes work together
143
+ 4. **Spot check** - Agents can make systematic errors
@@ -0,0 +1,67 @@
1
+ <!-- SOURCE: skills/executing-plans/SKILL.md -->
2
+
3
+ # Executing Plans (Inline Mode)
4
+
5
+ ## Overview
6
+
7
+ Load plan, review critically, execute all tasks, report when complete.
8
+
9
+ **Announce at start:** "I'm using specflow:build Phase B (inline mode) to implement this plan."
10
+
11
+ **Note:** SpecFlow works much better with access to subagents. The quality of its work will be significantly higher if run on a platform with subagent support (such as Claude Code or Codex). If subagents are available, use specflow:build Phase B instead of this skill.
12
+
13
+ ## The Process
14
+
15
+ ### Step 1: Load and Review Plan
16
+ 1. Read plan file
17
+ 2. Review critically - identify any questions or concerns about the plan
18
+ 3. If concerns: Raise them with your human partner before starting
19
+ 4. If no concerns: Create TodoWrite and proceed
20
+
21
+ ### Step 2: Execute Tasks
22
+
23
+ For each task:
24
+ 1. Mark as in_progress
25
+ 2. Follow each step exactly (plan has bite-sized steps)
26
+ 3. Run verifications as specified
27
+ 4. Mark as completed
28
+
29
+ ### Step 3: Complete Development
30
+
31
+ After all tasks complete and verified:
32
+ - Announce: "I'm using specflow:done to complete this work."
33
+ - **REQUIRED SUB-SKILL:** Use specflow:done
34
+ - Follow that skill to verify tests, present options, execute choice
35
+
36
+ ## When to Stop and Ask for Help
37
+
38
+ **STOP executing immediately when:**
39
+ - Hit a blocker (missing dependency, test fails, instruction unclear)
40
+ - Plan has critical gaps preventing starting
41
+ - You don't understand an instruction
42
+ - Verification fails repeatedly
43
+
44
+ **Ask for clarification rather than guessing.**
45
+
46
+ ## When to Revisit Earlier Steps
47
+
48
+ **Return to Review (Step 1) when:**
49
+ - Partner updates the plan based on your feedback
50
+ - Fundamental approach needs rethinking
51
+
52
+ **Don't force through blockers** - stop and ask.
53
+
54
+ ## Remember
55
+ - Review plan critically first
56
+ - Follow plan steps exactly
57
+ - Don't skip verifications
58
+ - Reference skills when plan says to
59
+ - Stop when blocked, don't guess
60
+ - Never start implementation on main/master branch without explicit user consent
61
+
62
+ ## Integration
63
+
64
+ **Required workflow skills:**
65
+ - **specflow:build Phase B (worktree)** - REQUIRED: Set up isolated workspace before starting
66
+ - **specflow:build Phase A** - Creates the plan this skill executes
67
+ - **specflow:done** - Complete development after all tasks
@@ -0,0 +1,115 @@
1
+ <!-- SOURCE: skills/subagent-driven-development/implementer-prompt.md -->
2
+
3
+ # Implementer Subagent Prompt Template
4
+
5
+ Use this template when dispatching an implementer subagent.
6
+
7
+ ```
8
+ Task tool (general-purpose):
9
+ description: "Implement Task N: [task name]"
10
+ prompt: |
11
+ You are implementing Task N: [task name]
12
+
13
+ ## Task Description
14
+
15
+ [FULL TEXT of task from plan - paste it here, don't make subagent read file]
16
+
17
+ ## Context
18
+
19
+ [Scene-setting: where this fits, dependencies, architectural context]
20
+
21
+ ## Before You Begin
22
+
23
+ If you have questions about:
24
+ - The requirements or acceptance criteria
25
+ - The approach or implementation strategy
26
+ - Dependencies or assumptions
27
+ - Anything unclear in the task description
28
+
29
+ **Ask them now.** Raise any concerns before starting work.
30
+
31
+ ## Your Job
32
+
33
+ Once you're clear on requirements:
34
+ 1. Implement exactly what the task specifies
35
+ 2. Write tests (following TDD if task says to)
36
+ 3. Verify implementation works
37
+ 4. Commit your work
38
+ 5. Self-review (see below)
39
+ 6. Report back
40
+
41
+ Work from: [directory]
42
+
43
+ **While you work:** If you encounter something unexpected or unclear, **ask questions**.
44
+ It's always OK to pause and clarify. Don't guess or make assumptions.
45
+
46
+ ## Code Organization
47
+
48
+ You reason best about code you can hold in context at once, and your edits are more
49
+ reliable when files are focused. Keep this in mind:
50
+ - Follow the file structure defined in the plan
51
+ - Each file should have one clear responsibility with a well-defined interface
52
+ - If a file you're creating is growing beyond the plan's intent, stop and report
53
+ it as DONE_WITH_CONCERNS -- don't split files on your own without plan guidance
54
+ - If an existing file you're modifying is already large or tangled, work carefully
55
+ and note it as a concern in your report
56
+ - In existing codebases, follow established patterns. Improve code you're touching
57
+ the way a good developer would, but don't restructure things outside your task.
58
+
59
+ ## When You're in Over Your Head
60
+
61
+ It is always OK to stop and say "this is too hard for me." Bad work is worse than
62
+ no work. You will not be penalized for escalating.
63
+
64
+ **STOP and escalate when:**
65
+ - The task requires architectural decisions with multiple valid approaches
66
+ - You need to understand code beyond what was provided and can't find clarity
67
+ - You feel uncertain about whether your approach is correct
68
+ - The task involves restructuring existing code in ways the plan didn't anticipate
69
+ - You've been reading file after file trying to understand the system without progress
70
+
71
+ **How to escalate:** Report back with status BLOCKED or NEEDS_CONTEXT. Describe
72
+ specifically what you're stuck on, what you've tried, and what kind of help you need.
73
+ The controller can provide more context, re-dispatch with a more capable model,
74
+ or break the task into smaller pieces.
75
+
76
+ ## Before Reporting Back: Self-Review
77
+
78
+ Review your work with fresh eyes. Ask yourself:
79
+
80
+ **Completeness:**
81
+ - Did I fully implement everything in the spec?
82
+ - Did I miss any requirements?
83
+ - Are there edge cases I didn't handle?
84
+
85
+ **Quality:**
86
+ - Is this my best work?
87
+ - Are names clear and accurate (match what things do, not how they work)?
88
+ - Is the code clean and maintainable?
89
+
90
+ **Discipline:**
91
+ - Did I avoid overbuilding (YAGNI)?
92
+ - Did I only build what was requested?
93
+ - Did I follow existing patterns in the codebase?
94
+
95
+ **Testing:**
96
+ - Do tests actually verify behavior (not just mock behavior)?
97
+ - Did I follow TDD if required?
98
+ - Are tests comprehensive?
99
+
100
+ If you find issues during self-review, fix them now before reporting.
101
+
102
+ ## Report Format
103
+
104
+ When done, report:
105
+ - **Status:** DONE | DONE_WITH_CONCERNS | BLOCKED | NEEDS_CONTEXT
106
+ - What you implemented (or what you attempted, if blocked)
107
+ - What you tested and test results
108
+ - Files changed
109
+ - Self-review findings (if any)
110
+ - Any issues or concerns
111
+
112
+ Use DONE_WITH_CONCERNS if you completed the work but have doubts about correctness.
113
+ Use BLOCKED if you cannot complete the task. Use NEEDS_CONTEXT if you need
114
+ information that wasn't provided. Never silently produce work you're unsure about.
115
+ ```