@adityaaria/spark 6.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.
- package/.claude-plugin/marketplace.json +20 -0
- package/.claude-plugin/plugin.json +20 -0
- package/.codex-plugin/plugin.json +48 -0
- package/.cursor-plugin/plugin.json +23 -0
- package/.kimi-plugin/plugin.json +38 -0
- package/.opencode/INSTALL.md +115 -0
- package/.opencode/plugins/spark.js +139 -0
- package/.pi/extensions/spark.ts +121 -0
- package/.version-bump.json +21 -0
- package/CLAUDE.md +115 -0
- package/CODE_OF_CONDUCT.md +128 -0
- package/GEMINI.md +2 -0
- package/LICENSE +21 -0
- package/README.md +282 -0
- package/RELEASE-NOTES.md +1299 -0
- package/assets/app-icon.png +0 -0
- package/assets/spark-small.svg +1 -0
- package/bin/spark.js +7 -0
- package/docs/README.kimi.md +94 -0
- package/docs/README.opencode.md +170 -0
- package/docs/porting-to-a-new-harness.md +830 -0
- package/gemini-extension.json +6 -0
- package/hooks/hooks-codex.json +16 -0
- package/hooks/hooks-cursor.json +10 -0
- package/hooks/hooks.json +16 -0
- package/hooks/run-hook.cmd +46 -0
- package/hooks/session-start +49 -0
- package/hooks/session-start-codex +26 -0
- package/package.json +52 -0
- package/skills/brainstorming/SKILL.md +159 -0
- package/skills/brainstorming/scripts/frame-template.html +213 -0
- package/skills/brainstorming/scripts/helper.js +167 -0
- package/skills/brainstorming/scripts/server.cjs +722 -0
- package/skills/brainstorming/scripts/start-server.sh +209 -0
- package/skills/brainstorming/scripts/stop-server.sh +120 -0
- package/skills/brainstorming/spec-document-reviewer-prompt.md +49 -0
- package/skills/brainstorming/visual-companion.md +298 -0
- package/skills/dispatching-parallel-agents/SKILL.md +185 -0
- package/skills/executing-plans/SKILL.md +70 -0
- package/skills/finishing-a-development-branch/SKILL.md +241 -0
- package/skills/receiving-code-review/SKILL.md +213 -0
- package/skills/requesting-code-review/SKILL.md +103 -0
- package/skills/requesting-code-review/code-reviewer.md +172 -0
- package/skills/subagent-driven-development/SKILL.md +418 -0
- package/skills/subagent-driven-development/implementer-prompt.md +139 -0
- package/skills/subagent-driven-development/scripts/review-package +44 -0
- package/skills/subagent-driven-development/scripts/sdd-workspace +22 -0
- package/skills/subagent-driven-development/scripts/task-brief +40 -0
- package/skills/subagent-driven-development/task-reviewer-prompt.md +188 -0
- package/skills/systematic-debugging/CREATION-LOG.md +119 -0
- package/skills/systematic-debugging/SKILL.md +296 -0
- package/skills/systematic-debugging/condition-based-waiting-example.ts +158 -0
- package/skills/systematic-debugging/condition-based-waiting.md +115 -0
- package/skills/systematic-debugging/defense-in-depth.md +122 -0
- package/skills/systematic-debugging/find-polluter.sh +63 -0
- package/skills/systematic-debugging/root-cause-tracing.md +169 -0
- package/skills/systematic-debugging/test-academic.md +14 -0
- package/skills/systematic-debugging/test-pressure-1.md +58 -0
- package/skills/systematic-debugging/test-pressure-2.md +68 -0
- package/skills/systematic-debugging/test-pressure-3.md +69 -0
- package/skills/test-driven-development/SKILL.md +371 -0
- package/skills/test-driven-development/testing-anti-patterns.md +299 -0
- package/skills/using-git-worktrees/SKILL.md +202 -0
- package/skills/using-spark/SKILL.md +121 -0
- package/skills/using-spark/references/antigravity-tools.md +96 -0
- package/skills/using-spark/references/claude-code-tools.md +50 -0
- package/skills/using-spark/references/codex-tools.md +72 -0
- package/skills/using-spark/references/copilot-tools.md +49 -0
- package/skills/using-spark/references/gemini-tools.md +63 -0
- package/skills/using-spark/references/pi-tools.md +28 -0
- package/skills/verification-before-completion/SKILL.md +139 -0
- package/skills/writing-plans/SKILL.md +174 -0
- package/skills/writing-plans/plan-document-reviewer-prompt.md +49 -0
- package/skills/writing-skills/SKILL.md +689 -0
- package/skills/writing-skills/anthropic-best-practices.md +1150 -0
- package/skills/writing-skills/examples/CLAUDE_MD_TESTING.md +189 -0
- package/skills/writing-skills/graphviz-conventions.dot +172 -0
- package/skills/writing-skills/persuasion-principles.md +187 -0
- package/skills/writing-skills/render-graphs.js +168 -0
- package/skills/writing-skills/testing-skills-with-subagents.md +384 -0
- package/src/cli/index.js +26 -0
- package/src/cli/install.js +47 -0
- package/src/cli/output.js +11 -0
- package/src/cli/parse-args.js +46 -0
- package/src/cli/prompt.js +10 -0
- package/src/installer/adapters/common.js +59 -0
- package/src/installer/adapters/extension-style.js +67 -0
- package/src/installer/adapters/shell-hook.js +57 -0
- package/src/installer/detect.js +168 -0
- package/src/installer/errors.js +7 -0
- package/src/installer/registry.js +35 -0
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: requesting-code-review
|
|
3
|
+
description: Use when completing tasks, implementing major features, or before merging to verify work meets requirements
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Requesting Code Review
|
|
7
|
+
|
|
8
|
+
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.
|
|
9
|
+
|
|
10
|
+
**Core principle:** Review early, review often.
|
|
11
|
+
|
|
12
|
+
## When to Request Review
|
|
13
|
+
|
|
14
|
+
**Mandatory:**
|
|
15
|
+
- After each task in subagent-driven development
|
|
16
|
+
- After completing major feature
|
|
17
|
+
- Before merge to main
|
|
18
|
+
|
|
19
|
+
**Optional but valuable:**
|
|
20
|
+
- When stuck (fresh perspective)
|
|
21
|
+
- Before refactoring (baseline check)
|
|
22
|
+
- After fixing complex bug
|
|
23
|
+
|
|
24
|
+
## How to Request
|
|
25
|
+
|
|
26
|
+
**1. Get git SHAs:**
|
|
27
|
+
```bash
|
|
28
|
+
BASE_SHA=$(git rev-parse HEAD~1) # or origin/main
|
|
29
|
+
HEAD_SHA=$(git rev-parse HEAD)
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
**2. Dispatch code reviewer subagent:**
|
|
33
|
+
|
|
34
|
+
Dispatch a `general-purpose` subagent, filling the template at [code-reviewer.md](code-reviewer.md)
|
|
35
|
+
|
|
36
|
+
**Placeholders:**
|
|
37
|
+
- `{DESCRIPTION}` - Brief summary of what you built
|
|
38
|
+
- `{PLAN_OR_REQUIREMENTS}` - What it should do
|
|
39
|
+
- `{BASE_SHA}` - Starting commit
|
|
40
|
+
- `{HEAD_SHA}` - Ending commit
|
|
41
|
+
|
|
42
|
+
**3. Act on feedback:**
|
|
43
|
+
- Fix Critical issues immediately
|
|
44
|
+
- Fix Important issues before proceeding
|
|
45
|
+
- Note Minor issues for later
|
|
46
|
+
- Push back if reviewer is wrong (with reasoning)
|
|
47
|
+
|
|
48
|
+
## Example
|
|
49
|
+
|
|
50
|
+
```
|
|
51
|
+
[Just completed Task 2: Add verification function]
|
|
52
|
+
|
|
53
|
+
You: Let me request code review before proceeding.
|
|
54
|
+
|
|
55
|
+
BASE_SHA=$(git log --oneline | grep "Task 1" | head -1 | awk '{print $1}')
|
|
56
|
+
HEAD_SHA=$(git rev-parse HEAD)
|
|
57
|
+
|
|
58
|
+
[Dispatch code reviewer subagent]
|
|
59
|
+
DESCRIPTION: Added verifyIndex() and repairIndex() with 4 issue types
|
|
60
|
+
PLAN_OR_REQUIREMENTS: Task 2 from docs/spark/plans/deployment-plan.md
|
|
61
|
+
BASE_SHA: a7981ec
|
|
62
|
+
HEAD_SHA: 3df7661
|
|
63
|
+
|
|
64
|
+
[Subagent returns]:
|
|
65
|
+
Strengths: Clean architecture, real tests
|
|
66
|
+
Issues:
|
|
67
|
+
Important: Missing progress indicators
|
|
68
|
+
Minor: Magic number (100) for reporting interval
|
|
69
|
+
Assessment: Ready to proceed
|
|
70
|
+
|
|
71
|
+
You: [Fix progress indicators]
|
|
72
|
+
[Continue to Task 3]
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
## Integration with Workflows
|
|
76
|
+
|
|
77
|
+
**Subagent-Driven Development:**
|
|
78
|
+
- Review after EACH task
|
|
79
|
+
- Catch issues before they compound
|
|
80
|
+
- Fix before moving to next task
|
|
81
|
+
|
|
82
|
+
**Executing Plans:**
|
|
83
|
+
- Review after each task or at natural checkpoints
|
|
84
|
+
- Get feedback, apply, continue
|
|
85
|
+
|
|
86
|
+
**Ad-Hoc Development:**
|
|
87
|
+
- Review before merge
|
|
88
|
+
- Review when stuck
|
|
89
|
+
|
|
90
|
+
## Red Flags
|
|
91
|
+
|
|
92
|
+
**Never:**
|
|
93
|
+
- Skip review because "it's simple"
|
|
94
|
+
- Ignore Critical issues
|
|
95
|
+
- Proceed with unfixed Important issues
|
|
96
|
+
- Argue with valid technical feedback
|
|
97
|
+
|
|
98
|
+
**If reviewer wrong:**
|
|
99
|
+
- Push back with technical reasoning
|
|
100
|
+
- Show code/tests that prove it works
|
|
101
|
+
- Request clarification
|
|
102
|
+
|
|
103
|
+
See template at: [code-reviewer.md](code-reviewer.md)
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
# Code Reviewer Prompt Template
|
|
2
|
+
|
|
3
|
+
Use this template when dispatching a code reviewer subagent.
|
|
4
|
+
|
|
5
|
+
**Purpose:** Review completed work against requirements and code quality standards before it cascades into more work.
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
Subagent (general-purpose):
|
|
9
|
+
description: "Review code changes"
|
|
10
|
+
prompt: |
|
|
11
|
+
You are a Senior Code Reviewer with expertise in software architecture,
|
|
12
|
+
design patterns, and best practices. Your job is to review completed work
|
|
13
|
+
against its plan or requirements and identify issues before they cascade.
|
|
14
|
+
|
|
15
|
+
## What Was Implemented
|
|
16
|
+
|
|
17
|
+
[DESCRIPTION]
|
|
18
|
+
|
|
19
|
+
## Requirements / Plan
|
|
20
|
+
|
|
21
|
+
[PLAN_OR_REQUIREMENTS]
|
|
22
|
+
|
|
23
|
+
## Git Range to Review
|
|
24
|
+
|
|
25
|
+
**Base:** [BASE_SHA]
|
|
26
|
+
**Head:** [HEAD_SHA]
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
git diff --stat [BASE_SHA]..[HEAD_SHA]
|
|
30
|
+
git diff [BASE_SHA]..[HEAD_SHA]
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Read-Only Review
|
|
34
|
+
|
|
35
|
+
Your review is read-only on this checkout. Do not mutate the working tree, the index, HEAD, or branch state in any way. Use tools like `git show`, `git diff`, and `git log` to inspect history. If you need a working copy of a different revision, check it out into a separate temporary directory (e.g. `git worktree add /tmp/review-[SHA] [SHA]`) — never move HEAD on this checkout.
|
|
36
|
+
|
|
37
|
+
## What to Check
|
|
38
|
+
|
|
39
|
+
**Plan alignment:**
|
|
40
|
+
- Does the implementation match the plan / requirements?
|
|
41
|
+
- Are deviations justified improvements, or problematic departures?
|
|
42
|
+
- Is all planned functionality present?
|
|
43
|
+
|
|
44
|
+
**Code quality:**
|
|
45
|
+
- Clean separation of concerns?
|
|
46
|
+
- Proper error handling?
|
|
47
|
+
- Type safety where applicable?
|
|
48
|
+
- DRY without premature abstraction?
|
|
49
|
+
- Edge cases handled?
|
|
50
|
+
|
|
51
|
+
**Architecture:**
|
|
52
|
+
- Sound design decisions?
|
|
53
|
+
- Reasonable scalability and performance?
|
|
54
|
+
- Security concerns?
|
|
55
|
+
- Integrates cleanly with surrounding code?
|
|
56
|
+
|
|
57
|
+
**Testing:**
|
|
58
|
+
- Tests verify real behavior, not mocks?
|
|
59
|
+
- Edge cases covered?
|
|
60
|
+
- Integration tests where they matter?
|
|
61
|
+
- All tests passing?
|
|
62
|
+
|
|
63
|
+
**Production readiness:**
|
|
64
|
+
- Migration strategy if schema changed?
|
|
65
|
+
- Backward compatibility considered?
|
|
66
|
+
- Documentation complete?
|
|
67
|
+
- No obvious bugs?
|
|
68
|
+
|
|
69
|
+
## Calibration
|
|
70
|
+
|
|
71
|
+
Categorize issues by actual severity. Not everything is Critical.
|
|
72
|
+
Acknowledge what was done well before listing issues — accurate praise
|
|
73
|
+
helps the implementer trust the rest of the feedback.
|
|
74
|
+
|
|
75
|
+
If you find significant deviations from the plan, flag them specifically
|
|
76
|
+
so the implementer can confirm whether the deviation was intentional.
|
|
77
|
+
If you find issues with the plan itself rather than the implementation,
|
|
78
|
+
say so.
|
|
79
|
+
|
|
80
|
+
## Output Format
|
|
81
|
+
|
|
82
|
+
### Strengths
|
|
83
|
+
[What's well done? Be specific.]
|
|
84
|
+
|
|
85
|
+
### Issues
|
|
86
|
+
|
|
87
|
+
#### Critical (Must Fix)
|
|
88
|
+
[Bugs, security issues, data loss risks, broken functionality]
|
|
89
|
+
|
|
90
|
+
#### Important (Should Fix)
|
|
91
|
+
[Architecture problems, missing features, poor error handling, test gaps]
|
|
92
|
+
|
|
93
|
+
#### Minor (Nice to Have)
|
|
94
|
+
[Code style, optimization opportunities, documentation polish]
|
|
95
|
+
|
|
96
|
+
For each issue:
|
|
97
|
+
- File:line reference
|
|
98
|
+
- What's wrong
|
|
99
|
+
- Why it matters
|
|
100
|
+
- How to fix (if not obvious)
|
|
101
|
+
|
|
102
|
+
### Recommendations
|
|
103
|
+
[Improvements for code quality, architecture, or process]
|
|
104
|
+
|
|
105
|
+
### Assessment
|
|
106
|
+
|
|
107
|
+
**Ready to merge?** [Yes | No | With fixes]
|
|
108
|
+
|
|
109
|
+
**Reasoning:** [1-2 sentence technical assessment]
|
|
110
|
+
|
|
111
|
+
## Critical Rules
|
|
112
|
+
|
|
113
|
+
**DO:**
|
|
114
|
+
- Categorize by actual severity
|
|
115
|
+
- Be specific (file:line, not vague)
|
|
116
|
+
- Explain WHY each issue matters
|
|
117
|
+
- Acknowledge strengths
|
|
118
|
+
- Give a clear verdict
|
|
119
|
+
|
|
120
|
+
**DON'T:**
|
|
121
|
+
- Say "looks good" without checking
|
|
122
|
+
- Mark nitpicks as Critical
|
|
123
|
+
- Give feedback on code you didn't actually read
|
|
124
|
+
- Be vague ("improve error handling")
|
|
125
|
+
- Avoid giving a clear verdict
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
**Placeholders:**
|
|
129
|
+
- `[DESCRIPTION]` — brief summary of what was built
|
|
130
|
+
- `[PLAN_OR_REQUIREMENTS]` — what it should do (plan file path, task text, or requirements)
|
|
131
|
+
- `[BASE_SHA]` — starting commit
|
|
132
|
+
- `[HEAD_SHA]` — ending commit
|
|
133
|
+
|
|
134
|
+
**Reviewer returns:** Strengths, Issues (Critical / Important / Minor), Recommendations, Assessment
|
|
135
|
+
|
|
136
|
+
## Example Output
|
|
137
|
+
|
|
138
|
+
```
|
|
139
|
+
### Strengths
|
|
140
|
+
- Clean database schema with proper migrations (db.ts:15-42)
|
|
141
|
+
- Comprehensive test coverage (18 tests, all edge cases)
|
|
142
|
+
- Good error handling with fallbacks (summarizer.ts:85-92)
|
|
143
|
+
|
|
144
|
+
### Issues
|
|
145
|
+
|
|
146
|
+
#### Important
|
|
147
|
+
1. **Missing help text in CLI wrapper**
|
|
148
|
+
- File: index-conversations:1-31
|
|
149
|
+
- Issue: No --help flag, users won't discover --concurrency
|
|
150
|
+
- Fix: Add --help case with usage examples
|
|
151
|
+
|
|
152
|
+
2. **Date validation missing**
|
|
153
|
+
- File: search.ts:25-27
|
|
154
|
+
- Issue: Invalid dates silently return no results
|
|
155
|
+
- Fix: Validate ISO format, throw error with example
|
|
156
|
+
|
|
157
|
+
#### Minor
|
|
158
|
+
1. **Progress indicators**
|
|
159
|
+
- File: indexer.ts:130
|
|
160
|
+
- Issue: No "X of Y" counter for long operations
|
|
161
|
+
- Impact: Users don't know how long to wait
|
|
162
|
+
|
|
163
|
+
### Recommendations
|
|
164
|
+
- Add progress reporting for user experience
|
|
165
|
+
- Consider config file for excluded projects (portability)
|
|
166
|
+
|
|
167
|
+
### Assessment
|
|
168
|
+
|
|
169
|
+
**Ready to merge: With fixes**
|
|
170
|
+
|
|
171
|
+
**Reasoning:** Core implementation is solid with good architecture and tests. Important issues (help text, date validation) are easily fixed and don't affect core functionality.
|
|
172
|
+
```
|
|
@@ -0,0 +1,418 @@
|
|
|
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 a fresh implementer subagent per task, a task review (spec compliance + code quality) after each, and a broad whole-branch review at the end.
|
|
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 + task review (spec + quality) + broad final review = high quality, fast iteration
|
|
13
|
+
|
|
14
|
+
**Narration:** between tool calls, narrate at most one short line — the
|
|
15
|
+
ledger and the tool results carry the record.
|
|
16
|
+
|
|
17
|
+
**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.
|
|
18
|
+
|
|
19
|
+
## When to Use
|
|
20
|
+
|
|
21
|
+
```dot
|
|
22
|
+
digraph when_to_use {
|
|
23
|
+
"Have implementation plan?" [shape=diamond];
|
|
24
|
+
"Tasks mostly independent?" [shape=diamond];
|
|
25
|
+
"Stay in this session?" [shape=diamond];
|
|
26
|
+
"subagent-driven-development" [shape=box];
|
|
27
|
+
"executing-plans" [shape=box];
|
|
28
|
+
"Manual execution or brainstorm first" [shape=box];
|
|
29
|
+
|
|
30
|
+
"Have implementation plan?" -> "Tasks mostly independent?" [label="yes"];
|
|
31
|
+
"Have implementation plan?" -> "Manual execution or brainstorm first" [label="no"];
|
|
32
|
+
"Tasks mostly independent?" -> "Stay in this session?" [label="yes"];
|
|
33
|
+
"Tasks mostly independent?" -> "Manual execution or brainstorm first" [label="no - tightly coupled"];
|
|
34
|
+
"Stay in this session?" -> "subagent-driven-development" [label="yes"];
|
|
35
|
+
"Stay in this session?" -> "executing-plans" [label="no - parallel session"];
|
|
36
|
+
}
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
**vs. Executing Plans (parallel session):**
|
|
40
|
+
- Same session (no context switch)
|
|
41
|
+
- Fresh subagent per task (no context pollution)
|
|
42
|
+
- Review after each task (spec compliance + code quality), broad review at the end
|
|
43
|
+
- Faster iteration (no human-in-loop between tasks)
|
|
44
|
+
|
|
45
|
+
## The Process
|
|
46
|
+
|
|
47
|
+
```dot
|
|
48
|
+
digraph process {
|
|
49
|
+
rankdir=TB;
|
|
50
|
+
|
|
51
|
+
subgraph cluster_per_task {
|
|
52
|
+
label="Per Task";
|
|
53
|
+
"Dispatch implementer subagent (./implementer-prompt.md)" [shape=box];
|
|
54
|
+
"Implementer subagent asks questions?" [shape=diamond];
|
|
55
|
+
"Answer questions, provide context" [shape=box];
|
|
56
|
+
"Implementer subagent implements, tests, commits, self-reviews" [shape=box];
|
|
57
|
+
"Write diff file, dispatch task reviewer subagent (./task-reviewer-prompt.md)" [shape=box];
|
|
58
|
+
"Task reviewer reports spec ✅ and quality approved?" [shape=diamond];
|
|
59
|
+
"Dispatch fix subagent for Critical/Important findings" [shape=box];
|
|
60
|
+
"Mark task complete in todo list and progress ledger" [shape=box];
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
"Read plan, note context and global constraints, create todos" [shape=box];
|
|
64
|
+
"More tasks remain?" [shape=diamond];
|
|
65
|
+
"Dispatch final code reviewer subagent (../requesting-code-review/code-reviewer.md)" [shape=box];
|
|
66
|
+
"Use spark:finishing-a-development-branch" [shape=box style=filled fillcolor=lightgreen];
|
|
67
|
+
|
|
68
|
+
"Read plan, note context and global constraints, create todos" -> "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" -> "Write diff file, dispatch task reviewer subagent (./task-reviewer-prompt.md)";
|
|
74
|
+
"Write diff file, dispatch task reviewer subagent (./task-reviewer-prompt.md)" -> "Task reviewer reports spec ✅ and quality approved?";
|
|
75
|
+
"Task reviewer reports spec ✅ and quality approved?" -> "Dispatch fix subagent for Critical/Important findings" [label="no"];
|
|
76
|
+
"Dispatch fix subagent for Critical/Important findings" -> "Write diff file, dispatch task reviewer subagent (./task-reviewer-prompt.md)" [label="re-review"];
|
|
77
|
+
"Task reviewer reports spec ✅ and quality approved?" -> "Mark task complete in todo list and progress ledger" [label="yes"];
|
|
78
|
+
"Mark task complete in todo list and progress ledger" -> "More tasks remain?";
|
|
79
|
+
"More tasks remain?" -> "Dispatch implementer subagent (./implementer-prompt.md)" [label="yes"];
|
|
80
|
+
"More tasks remain?" -> "Dispatch final code reviewer subagent (../requesting-code-review/code-reviewer.md)" [label="no"];
|
|
81
|
+
"Dispatch final code reviewer subagent (../requesting-code-review/code-reviewer.md)" -> "Use spark:finishing-a-development-branch";
|
|
82
|
+
}
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
## Pre-Flight Plan Review
|
|
86
|
+
|
|
87
|
+
Before dispatching Task 1, scan the plan once for conflicts:
|
|
88
|
+
|
|
89
|
+
- tasks that contradict each other or the plan's Global Constraints
|
|
90
|
+
- anything the plan explicitly mandates that the review rubric treats as a
|
|
91
|
+
defect (a test that asserts nothing, verbatim duplication of a logic block)
|
|
92
|
+
|
|
93
|
+
Present everything you find to your human partner as one batched question —
|
|
94
|
+
each finding beside the plan text that mandates it, asking which governs —
|
|
95
|
+
before execution begins, not one interrupt per discovery mid-plan. If the
|
|
96
|
+
scan is clean, proceed without comment. The review loop remains the net for
|
|
97
|
+
conflicts that only emerge from implementation.
|
|
98
|
+
|
|
99
|
+
## Model Selection
|
|
100
|
+
|
|
101
|
+
Use the least powerful model that can handle each role to conserve cost and increase speed.
|
|
102
|
+
|
|
103
|
+
**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.
|
|
104
|
+
|
|
105
|
+
**Integration and judgment tasks** (multi-file coordination, pattern matching, debugging): use a standard model.
|
|
106
|
+
|
|
107
|
+
**Architecture and design tasks**: use the most capable available model.
|
|
108
|
+
The final whole-branch review is one of these — dispatch it on the most
|
|
109
|
+
capable available model, not the session default.
|
|
110
|
+
|
|
111
|
+
**Review tasks**: choose the model with the same judgment, scaled to the
|
|
112
|
+
diff's size, complexity, and risk. A small mechanical diff does not need the
|
|
113
|
+
most capable model; a subtle concurrency change does.
|
|
114
|
+
|
|
115
|
+
**Always specify the model explicitly when dispatching a subagent.** An
|
|
116
|
+
omitted model inherits your session's model — often the most capable and
|
|
117
|
+
most expensive — which silently defeats this section.
|
|
118
|
+
|
|
119
|
+
**Turn count beats token price.** Wall-clock and context cost scale with how
|
|
120
|
+
many turns a subagent takes, and the cheapest models routinely take 2-3× the
|
|
121
|
+
turns on multi-step work — costing more overall. Use a mid-tier model as the
|
|
122
|
+
floor for reviewers and for implementers working from prose descriptions.
|
|
123
|
+
When the task's plan text contains the complete code to write, the
|
|
124
|
+
implementation is transcription plus testing: use the cheapest tier for
|
|
125
|
+
that implementer. Single-file mechanical fixes also take the cheapest tier.
|
|
126
|
+
|
|
127
|
+
**Task complexity signals (implementation tasks):**
|
|
128
|
+
- Touches 1-2 files with a complete spec → cheap model
|
|
129
|
+
- Touches multiple files with integration concerns → standard model
|
|
130
|
+
- Requires design judgment or broad codebase understanding → most capable model
|
|
131
|
+
|
|
132
|
+
## Handling Implementer Status
|
|
133
|
+
|
|
134
|
+
Implementer subagents report one of four statuses. Handle each appropriately:
|
|
135
|
+
|
|
136
|
+
**DONE:** Generate the review package (`scripts/review-package BASE HEAD`, from this skill's directory — it prints the unique file path it wrote; BASE is the commit you recorded before dispatching the implementer — never `HEAD~1`, which silently drops all but the last commit of a multi-commit task), then dispatch the task reviewer with the printed path.
|
|
137
|
+
|
|
138
|
+
**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.
|
|
139
|
+
|
|
140
|
+
**NEEDS_CONTEXT:** The implementer needs information that wasn't provided. Provide the missing context and re-dispatch.
|
|
141
|
+
|
|
142
|
+
**BLOCKED:** The implementer cannot complete the task. Assess the blocker:
|
|
143
|
+
1. If it's a context problem, provide more context and re-dispatch with the same model
|
|
144
|
+
2. If the task requires more reasoning, re-dispatch with a more capable model
|
|
145
|
+
3. If the task is too large, break it into smaller pieces
|
|
146
|
+
4. If the plan itself is wrong, escalate to the human
|
|
147
|
+
|
|
148
|
+
**Never** ignore an escalation or force the same model to retry without changes. If the implementer said it's stuck, something needs to change.
|
|
149
|
+
|
|
150
|
+
## Handling Reviewer ⚠️ Items
|
|
151
|
+
|
|
152
|
+
The task reviewer may report "⚠️ Cannot verify from diff" items — requirements
|
|
153
|
+
that live in unchanged code or span tasks. These do not block the rest of the
|
|
154
|
+
review, but you must resolve each one yourself before marking the task
|
|
155
|
+
complete: you hold the plan and cross-task context the reviewer
|
|
156
|
+
lacks. If you confirm an item is a real gap, treat it as a failed spec
|
|
157
|
+
review — send it back to the implementer and re-review.
|
|
158
|
+
|
|
159
|
+
## Constructing Reviewer Prompts
|
|
160
|
+
|
|
161
|
+
Per-task reviews are task-scoped gates. The broad review happens once, at the
|
|
162
|
+
final whole-branch review. When you fill a reviewer template:
|
|
163
|
+
|
|
164
|
+
- Do not add open-ended directives like "check all uses" or "run race tests
|
|
165
|
+
if useful" without a concrete, task-specific reason
|
|
166
|
+
- Do not ask a reviewer to re-run tests the implementer already ran on the
|
|
167
|
+
same code — the implementer's report carries the test evidence
|
|
168
|
+
- Do not pre-judge findings for the reviewer — never instruct a reviewer to
|
|
169
|
+
ignore or not flag a specific issue. If you believe a finding would be a
|
|
170
|
+
false positive, let the reviewer raise it and adjudicate it in the review
|
|
171
|
+
loop. If the prompt you are writing contains "do not flag," "don't treat X
|
|
172
|
+
as a defect," "at most Minor," or "the plan chose" — stop: you are
|
|
173
|
+
pre-judging, usually to spare yourself a review loop.
|
|
174
|
+
- The global-constraints block you hand the reviewer is its attention
|
|
175
|
+
lens. Copy the binding requirements verbatim from the plan's Global
|
|
176
|
+
Constraints section or the spec: exact values, exact formats, and the
|
|
177
|
+
stated relationships between components ("same layout as X", "matches
|
|
178
|
+
Y"). The reviewer's template already carries the process rules (YAGNI,
|
|
179
|
+
test hygiene, review method) — the constraints block is for what THIS
|
|
180
|
+
project's spec demands.
|
|
181
|
+
- Hand the reviewer its diff as a file: run this skill's
|
|
182
|
+
`scripts/review-package BASE HEAD` and pass the reviewer the file path
|
|
183
|
+
it prints (or, without bash: `git log --oneline`, `git diff --stat`,
|
|
184
|
+
and `git diff -U10` for the range, redirected to one uniquely named
|
|
185
|
+
file). The output never enters your own context, and the reviewer sees
|
|
186
|
+
the commit list, stat summary, and full diff with context in one Read
|
|
187
|
+
call. Use the BASE you recorded before dispatching the implementer —
|
|
188
|
+
never `HEAD~1`, which silently truncates multi-commit tasks.
|
|
189
|
+
- A dispatch prompt describes one task, not the session's history. Do not
|
|
190
|
+
paste accumulated prior-task summaries ("state after Tasks 1-3") into
|
|
191
|
+
later dispatches — a real session's dispatch hit 42k chars of which 99%
|
|
192
|
+
was pasted history. A fresh subagent needs its task, the interfaces it
|
|
193
|
+
touches, and the global constraints. Nothing else.
|
|
194
|
+
- Dispatch fix subagents for Critical and Important findings. Record Minor
|
|
195
|
+
findings in the progress ledger as you go, and point the final
|
|
196
|
+
whole-branch review at that list so it can triage which must be fixed
|
|
197
|
+
before merge. A roll-up nobody reads is a silent discard.
|
|
198
|
+
- A finding labeled plan-mandated — or any finding that conflicts with
|
|
199
|
+
what the plan's text requires — is the human's decision, like any plan
|
|
200
|
+
contradiction: present the finding and the plan text, ask which governs.
|
|
201
|
+
Do not dismiss the finding because the plan mandates it, and do not
|
|
202
|
+
dispatch a fix that contradicts the plan without asking.
|
|
203
|
+
- The final whole-branch review gets a package too: run
|
|
204
|
+
`scripts/review-package MERGE_BASE HEAD` (MERGE_BASE = the commit the
|
|
205
|
+
branch started from, e.g. `git merge-base main HEAD`) and include the
|
|
206
|
+
printed path in the final review dispatch, so the final reviewer reads
|
|
207
|
+
one file instead of re-deriving the branch diff with git commands.
|
|
208
|
+
- Every fix dispatch carries the implementer contract: the fix subagent
|
|
209
|
+
re-runs the tests covering its change and reports the results. Name the
|
|
210
|
+
covering test files in the dispatch — a one-line fix does not need the
|
|
211
|
+
whole suite. Before re-dispatching the reviewer, confirm the fix report
|
|
212
|
+
contains the covering tests, the command run, and the output; dispatch
|
|
213
|
+
the re-review once all three are present.
|
|
214
|
+
- If the final whole-branch review returns findings, dispatch ONE fix
|
|
215
|
+
subagent with the complete findings list — not one fixer per finding.
|
|
216
|
+
Per-finding fixers each rebuild context and re-run suites; a real
|
|
217
|
+
session's final-review fix wave cost more than all its tasks combined.
|
|
218
|
+
|
|
219
|
+
## File Handoffs
|
|
220
|
+
|
|
221
|
+
Everything you paste into a dispatch prompt — and everything a subagent
|
|
222
|
+
prints back — stays resident in your context for the rest of the session
|
|
223
|
+
and is re-read on every later turn. Hand artifacts over as files:
|
|
224
|
+
|
|
225
|
+
- **Task brief:** before dispatching an implementer, run this skill's
|
|
226
|
+
`scripts/task-brief PLAN_FILE N` — it extracts the task's full text to a
|
|
227
|
+
uniquely named file and prints the path. Compose the dispatch so the
|
|
228
|
+
brief stays the single source of requirements. Your dispatch should
|
|
229
|
+
contain: (1) one line on where this task fits in the project; (2) the
|
|
230
|
+
brief path, introduced as "read this first — it is your requirements,
|
|
231
|
+
with the exact values to use verbatim"; (3) interfaces and decisions
|
|
232
|
+
from earlier tasks that the brief cannot know; (4) your resolution of
|
|
233
|
+
any ambiguity you noticed in the brief; (5) the report-file path and
|
|
234
|
+
report contract. Exact values (numbers, magic strings, signatures, test
|
|
235
|
+
cases) appear only in the brief.
|
|
236
|
+
- **Report file:** name the implementer's report file after the brief
|
|
237
|
+
(brief `…/task-N-brief.md` → report `…/task-N-report.md`) and put it in
|
|
238
|
+
the dispatch prompt. The implementer writes the full report there and
|
|
239
|
+
returns only status, commits, a one-line test summary, and concerns.
|
|
240
|
+
- **Reviewer inputs:** the task reviewer gets three paths — the same brief
|
|
241
|
+
file, the report file, and the review package — plus the global
|
|
242
|
+
constraints that bind the task.
|
|
243
|
+
- Fix dispatches append their fix report (with test results) to the same
|
|
244
|
+
report file and return a short summary; re-reviews read the updated file.
|
|
245
|
+
|
|
246
|
+
## Durable Progress
|
|
247
|
+
|
|
248
|
+
Conversation memory does not survive compaction. In real sessions,
|
|
249
|
+
controllers that lost their place have re-dispatched entire completed task
|
|
250
|
+
sequences — the single most expensive failure observed. Track progress in
|
|
251
|
+
a ledger file, not only in todos.
|
|
252
|
+
|
|
253
|
+
- At skill start, check for a ledger:
|
|
254
|
+
`cat "$(git rev-parse --show-toplevel)/.spark/sdd/progress.md"`. Tasks listed there
|
|
255
|
+
as complete are DONE — do not re-dispatch them; resume at the first task
|
|
256
|
+
not marked complete.
|
|
257
|
+
- When a task's review comes back clean, append one line to the ledger in
|
|
258
|
+
the same message as your other bookkeeping:
|
|
259
|
+
`Task N: complete (commits <base7>..<head7>, review clean)`.
|
|
260
|
+
- The ledger is your recovery map: the commits it names exist in git even
|
|
261
|
+
when your context no longer remembers creating them. After compaction,
|
|
262
|
+
trust the ledger and `git log` over your own recollection.
|
|
263
|
+
- `git clean -fdx` will destroy the ledger (it's git-ignored scratch); if
|
|
264
|
+
that happens, recover from `git log`.
|
|
265
|
+
|
|
266
|
+
## Prompt Templates
|
|
267
|
+
|
|
268
|
+
- [implementer-prompt.md](implementer-prompt.md) - Dispatch implementer subagent
|
|
269
|
+
- [task-reviewer-prompt.md](task-reviewer-prompt.md) - Dispatch task reviewer subagent (spec compliance + code quality)
|
|
270
|
+
- Final whole-branch review: use spark:requesting-code-review's [code-reviewer.md](../requesting-code-review/code-reviewer.md)
|
|
271
|
+
|
|
272
|
+
## Example Workflow
|
|
273
|
+
|
|
274
|
+
```
|
|
275
|
+
You: I'm using Subagent-Driven Development to execute this plan.
|
|
276
|
+
|
|
277
|
+
[Read plan file once: docs/spark/plans/feature-plan.md]
|
|
278
|
+
[Create todos for all tasks]
|
|
279
|
+
|
|
280
|
+
Task 1: Hook installation script
|
|
281
|
+
|
|
282
|
+
[Run task-brief for Task 1; dispatch implementer with brief + report paths + context]
|
|
283
|
+
|
|
284
|
+
Implementer: "Before I begin - should the hook be installed at user or system level?"
|
|
285
|
+
|
|
286
|
+
You: "User level (~/.config/spark/hooks/)"
|
|
287
|
+
|
|
288
|
+
Implementer: "Got it. Implementing now..."
|
|
289
|
+
[Later] Implementer:
|
|
290
|
+
- Implemented install-hook command
|
|
291
|
+
- Added tests, 5/5 passing
|
|
292
|
+
- Self-review: Found I missed --force flag, added it
|
|
293
|
+
- Committed
|
|
294
|
+
|
|
295
|
+
[Run review-package, dispatch task reviewer with the printed path]
|
|
296
|
+
Task reviewer: Spec ✅ - all requirements met, nothing extra.
|
|
297
|
+
Strengths: Good test coverage, clean. Issues: None. Task quality: Approved.
|
|
298
|
+
|
|
299
|
+
[Mark Task 1 complete]
|
|
300
|
+
|
|
301
|
+
Task 2: Recovery modes
|
|
302
|
+
|
|
303
|
+
[Run task-brief for Task 2; dispatch implementer with brief + report paths + context]
|
|
304
|
+
|
|
305
|
+
Implementer: [No questions, proceeds]
|
|
306
|
+
Implementer:
|
|
307
|
+
- Added verify/repair modes
|
|
308
|
+
- 8/8 tests passing
|
|
309
|
+
- Self-review: All good
|
|
310
|
+
- Committed
|
|
311
|
+
|
|
312
|
+
[Run review-package, dispatch task reviewer with the printed path]
|
|
313
|
+
Task reviewer: Spec ❌:
|
|
314
|
+
- Missing: Progress reporting (spec says "report every 100 items")
|
|
315
|
+
- Extra: Added --json flag (not requested)
|
|
316
|
+
Issues (Important): Magic number (100)
|
|
317
|
+
|
|
318
|
+
[Dispatch fix subagent with all findings]
|
|
319
|
+
Fixer: Removed --json flag, added progress reporting, extracted PROGRESS_INTERVAL constant
|
|
320
|
+
|
|
321
|
+
[Task reviewer reviews again]
|
|
322
|
+
Task reviewer: Spec ✅. Task quality: Approved.
|
|
323
|
+
|
|
324
|
+
[Mark Task 2 complete]
|
|
325
|
+
|
|
326
|
+
...
|
|
327
|
+
|
|
328
|
+
[After all tasks]
|
|
329
|
+
[Dispatch final code-reviewer]
|
|
330
|
+
Final reviewer: All requirements met, ready to merge
|
|
331
|
+
|
|
332
|
+
Done!
|
|
333
|
+
```
|
|
334
|
+
|
|
335
|
+
## Advantages
|
|
336
|
+
|
|
337
|
+
**vs. Manual execution:**
|
|
338
|
+
- Subagents follow TDD naturally
|
|
339
|
+
- Fresh context per task (no confusion)
|
|
340
|
+
- Parallel-safe (subagents don't interfere)
|
|
341
|
+
- Subagent can ask questions (before AND during work)
|
|
342
|
+
|
|
343
|
+
**vs. Executing Plans:**
|
|
344
|
+
- Same session (no handoff)
|
|
345
|
+
- Continuous progress (no waiting)
|
|
346
|
+
- Review checkpoints automatic
|
|
347
|
+
|
|
348
|
+
**Efficiency gains:**
|
|
349
|
+
- Controller curates exactly what context is needed; bulk artifacts move
|
|
350
|
+
as files, not pasted text
|
|
351
|
+
- Subagent gets complete information upfront
|
|
352
|
+
- Questions surfaced before work begins (not after)
|
|
353
|
+
|
|
354
|
+
**Quality gates:**
|
|
355
|
+
- Self-review catches issues before handoff
|
|
356
|
+
- Task review carries two verdicts: spec compliance and code quality
|
|
357
|
+
- Review loops ensure fixes actually work
|
|
358
|
+
- Spec compliance prevents over/under-building
|
|
359
|
+
- Code quality ensures implementation is well-built
|
|
360
|
+
|
|
361
|
+
**Cost:**
|
|
362
|
+
- More subagent invocations (implementer + reviewer per task)
|
|
363
|
+
- Controller does more prep work (extracting all tasks upfront)
|
|
364
|
+
- Review loops add iterations
|
|
365
|
+
- But catches issues early (cheaper than debugging later)
|
|
366
|
+
|
|
367
|
+
## Red Flags
|
|
368
|
+
|
|
369
|
+
**Never:**
|
|
370
|
+
- Start implementation on main/master branch without explicit user consent
|
|
371
|
+
- Skip task review, or accept a report missing either verdict (spec compliance AND task quality are both required)
|
|
372
|
+
- Proceed with unfixed issues
|
|
373
|
+
- Dispatch multiple implementation subagents in parallel (conflicts)
|
|
374
|
+
- Make a subagent read the whole plan file (hand it its task brief —
|
|
375
|
+
`scripts/task-brief` — instead)
|
|
376
|
+
- Skip scene-setting context (subagent needs to understand where task fits)
|
|
377
|
+
- Ignore subagent questions (answer before letting them proceed)
|
|
378
|
+
- Accept "close enough" on spec compliance (reviewer found spec issues = not done)
|
|
379
|
+
- Skip review loops (reviewer found issues = implementer fixes = review again)
|
|
380
|
+
- Let implementer self-review replace actual review (both are needed)
|
|
381
|
+
- Tell a reviewer what not to flag, or pre-rate a finding's severity in the
|
|
382
|
+
dispatch prompt ("treat it as Minor at most") — the plan's example code is
|
|
383
|
+
a starting point, not evidence that its weaknesses were chosen
|
|
384
|
+
- Dispatch a task reviewer without a diff file — generate it first
|
|
385
|
+
(`scripts/review-package BASE HEAD`) and name the printed path in the
|
|
386
|
+
prompt
|
|
387
|
+
- Move to next task while the review has open Critical/Important issues
|
|
388
|
+
- Re-dispatch a task the progress ledger already marks complete — check
|
|
389
|
+
the ledger (and `git log`) after any compaction or resume
|
|
390
|
+
|
|
391
|
+
**If subagent asks questions:**
|
|
392
|
+
- Answer clearly and completely
|
|
393
|
+
- Provide additional context if needed
|
|
394
|
+
- Don't rush them into implementation
|
|
395
|
+
|
|
396
|
+
**If reviewer finds issues:**
|
|
397
|
+
- Implementer (same subagent) fixes them
|
|
398
|
+
- Reviewer reviews again
|
|
399
|
+
- Repeat until approved
|
|
400
|
+
- Don't skip the re-review
|
|
401
|
+
|
|
402
|
+
**If subagent fails task:**
|
|
403
|
+
- Dispatch fix subagent with specific instructions
|
|
404
|
+
- Don't try to fix manually (context pollution)
|
|
405
|
+
|
|
406
|
+
## Integration
|
|
407
|
+
|
|
408
|
+
**Required workflow skills:**
|
|
409
|
+
- **spark:using-git-worktrees** - Ensures isolated workspace (creates one or verifies existing)
|
|
410
|
+
- **spark:writing-plans** - Creates the plan this skill executes
|
|
411
|
+
- **spark:requesting-code-review** - Code review template for the final whole-branch review
|
|
412
|
+
- **spark:finishing-a-development-branch** - Complete development after all tasks
|
|
413
|
+
|
|
414
|
+
**Subagents should use:**
|
|
415
|
+
- **spark:test-driven-development** - Subagents follow TDD for each task
|
|
416
|
+
|
|
417
|
+
**Alternative workflow:**
|
|
418
|
+
- **spark:executing-plans** - Use for parallel session instead of same-session execution
|