superspecs 0.1.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.
@@ -0,0 +1,102 @@
1
+ ---
2
+ name: execute-branch
3
+ description: Create a git branch or worktree for isolated spec execution. One branch per spec. Triggers on /branch, "create branch", "set up worktree". Run after /pick-spec.
4
+ slash_command: branch
5
+ phase: "2.2 — Execute › Branch"
6
+ ---
7
+
8
+ # Skill: execute-branch
9
+
10
+ You are creating an isolated execution environment for this spec.
11
+
12
+ **One branch per spec. No exceptions.** Isolation prevents parallel workstreams from interfering with each other.
13
+
14
+ ## Steps
15
+
16
+ ### 1. Check git status
17
+
18
+ ```bash
19
+ git status
20
+ git branch --show-current
21
+ ```
22
+
23
+ Verify:
24
+ - The working directory is clean (no uncommitted changes)
25
+ - We're on the correct base branch (usually `main` or `develop`)
26
+
27
+ If there are uncommitted changes, stop: *"Commit or stash changes before creating a branch."*
28
+
29
+ ### 2. Determine branch name
30
+
31
+ Convention: `superspec/<slug>`
32
+
33
+ Examples:
34
+ - `superspec/auth-jwt`
35
+ - `superspec/export-csv`
36
+ - `superspec/payment-stripe`
37
+
38
+ ### 3. Choose: branch or worktree
39
+
40
+ **Standard branch** (default, single workstream):
41
+ ```bash
42
+ git checkout -b superspec/<slug>
43
+ ```
44
+
45
+ **Git worktree** (parallel workstreams, recommended when executing multiple specs simultaneously):
46
+ ```bash
47
+ git worktree add ../project-<slug> -b superspec/<slug>
48
+ ```
49
+
50
+ Ask the user: *"Use a worktree for parallel execution, or a standard branch?"*
51
+
52
+ If worktree: note the path in `plan.md`.
53
+
54
+ ### 4. Verify branch was created
55
+
56
+ ```bash
57
+ git branch --show-current
58
+ # should output: superspec/<slug>
59
+ ```
60
+
61
+ ### 5. Update plan.md
62
+
63
+ Add to `superspec/phases/<slug>-execute/plan.md`:
64
+
65
+ ```markdown
66
+ ## Branch
67
+
68
+ Branch name: `superspec/<slug>`
69
+ Type: [branch | worktree]
70
+ Worktree path: <path if worktree, else N/A>
71
+ Created from: <base branch> @ <short SHA>
72
+ Created: <timestamp>
73
+ ```
74
+
75
+ ### 6. Update status.md
76
+
77
+ ```markdown
78
+ ## Phase
79
+ 2.2 — Execute › Branch ✅
80
+
81
+ ## Checklist
82
+ ...
83
+ - [x] Branch created (superspec/<slug>)
84
+ ...
85
+ ```
86
+
87
+ ### 7. Handoff
88
+
89
+ ```
90
+ Branch ready: superspec/<slug>
91
+
92
+ Type: <branch/worktree>
93
+ Base: <base-branch> @ <SHA>
94
+
95
+ Next: /subagent <slug> (to start Wave 1)
96
+ ```
97
+
98
+ ## Output
99
+
100
+ - Git branch `superspec/<slug>` created
101
+ - `superspec/phases/<slug>-execute/plan.md` updated with branch info
102
+ - Updated `superspec/specs/<slug>/status.md`
@@ -0,0 +1,162 @@
1
+ ---
2
+ name: execute-pick-spec
3
+ description: Choose and validate the next spec for execution. Verifies the spec is complete, dependencies are met, and it fits a clean 200k context window. Triggers on /pick-spec, "what should we build next", "start execution".
4
+ slash_command: pick-spec
5
+ phase: "2.1 — Execute › Pick Spec"
6
+ ---
7
+
8
+ # Skill: execute-pick-spec
9
+
10
+ You are selecting the next spec to execute. This is the gate between planning and execution.
11
+
12
+ **Nothing is dispatched to subagents until this step passes.**
13
+
14
+ ## Steps
15
+
16
+ ### 1. List available specs
17
+
18
+ Scan `superspec/specs/`. For each directory, read `status.md` and categorize:
19
+
20
+ ```
21
+ Ready to execute (spec written, not yet started):
22
+ - <slug> — <purpose> — context: ~Xk
23
+
24
+ In progress:
25
+ - <slug> — <phase>
26
+
27
+ Complete:
28
+ - <slug>
29
+ ```
30
+
31
+ If the user specified a slug, jump to step 3 with that slug.
32
+
33
+ If multiple specs are ready, present the list and ask which to pick.
34
+
35
+ ### 2. Check dependencies
36
+
37
+ Read the spec's `spec.md`. Look for the `Depends on:` field.
38
+
39
+ For each dependency:
40
+ - Is there a spec for it in `superspec/specs/`?
41
+ - Is that spec complete (shipped)?
42
+
43
+ If unmet dependencies exist:
44
+ ```
45
+ Cannot execute <slug> yet.
46
+ Depends on: <dep-slug> (status: <status>)
47
+
48
+ Options:
49
+ 1. Execute <dep-slug> first
50
+ 2. Remove the dependency if it's not actually needed (update spec)
51
+ ```
52
+
53
+ Do not proceed until dependencies are resolved.
54
+
55
+ ### 3. Validate the spec
56
+
57
+ Read `spec.md` and `tasks.md` completely. Check:
58
+
59
+ **Completeness**
60
+ - [ ] Every requirement has at least one scenario
61
+ - [ ] Every scenario is testable (concrete GIVEN/WHEN/THEN)
62
+ - [ ] tasks.md exists with at least one task
63
+ - [ ] Done criteria defined
64
+
65
+ **Clarity**
66
+ - [ ] No ambiguous SHALL statements
67
+ - [ ] No tasks that say "implement X" without specifying the test requirement
68
+ - [ ] No tasks that depend on unwritten decisions
69
+
70
+ **Context window**
71
+ - Estimate: `spec.md` (~Xk) + `tasks.md` (~Yk) + typical implementation context (~Zk)
72
+ - Total must be under 200k
73
+ - Report: `Context budget: ~<total>k / 200k`
74
+
75
+ If validation fails, list specific issues and say: *"Fix these before execution begins."*
76
+
77
+ ### 4. Create the phase directory
78
+
79
+ Create `superspec/phases/<slug>-execute/`:
80
+
81
+ ```
82
+ superspec/phases/<slug>-execute/
83
+ ├── plan.md ← execution plan (written here)
84
+ ├── review-log.md ← code review findings (populated during execution)
85
+ └── wave-1.md ← populated when Wave 1 starts
86
+ ```
87
+
88
+ ### 5. Write plan.md
89
+
90
+ ```markdown
91
+ # Execution Plan: <Feature Name>
92
+
93
+ **Spec:** superspec/specs/<slug>/spec.md
94
+ **Tasks:** superspec/specs/<slug>/tasks.md
95
+ **Context estimate:** ~<N>k / 200k ✅
96
+ **Started:** <date>
97
+
98
+ ## Execution Strategy
99
+
100
+ Wave execution order: Wave 1 → Wave 2 → Wave 3
101
+ Parallelism: [list tasks that can run in parallel within each wave]
102
+
103
+ ## Wave Summary
104
+
105
+ ### Wave 1 — <Name>
106
+ Sequential / Parallel: <which>
107
+ Tasks: 1.1, 1.2, ...
108
+ Unblocks: Wave 2
109
+
110
+ ### Wave 2 — <Name>
111
+ Sequential / Parallel: <which>
112
+ Tasks: 2.1, 2.2, ...
113
+ Unblocks: Wave 3
114
+
115
+ ### Wave 3 — <Name>
116
+ Tasks: 3.1, ...
117
+
118
+ ## Executor Instructions
119
+
120
+ Each subagent receives:
121
+ 1. spec.md (full)
122
+ 2. tasks.md (their task only)
123
+ 3. The codebase (branch: <branch-name>)
124
+ 4. No prior chat history
125
+
126
+ ## Human Checkpoints
127
+ - After Wave 1: review and approve before Wave 2
128
+ - After Wave 2: review and approve before Wave 3
129
+ - After Wave 3: full verification before ship
130
+ ```
131
+
132
+ ### 6. Update status.md
133
+
134
+ ```markdown
135
+ ## Phase
136
+ 2.1 — Execute › Pick Spec ✅
137
+
138
+ ## Checklist
139
+ ...
140
+ - [x] Spec fits context window (~Nk / 200k)
141
+ - [ ] Branch created
142
+ ...
143
+ ```
144
+
145
+ ### 7. Handoff
146
+
147
+ ```
148
+ Spec validated: <slug>
149
+
150
+ Dependencies: ✅ met
151
+ Context: ~<N>k / 200k ✅
152
+ Tasks: X across Y waves
153
+ Validation: ✅ complete
154
+
155
+ Next: /branch <slug>
156
+ ```
157
+
158
+ ## Output
159
+
160
+ - `superspec/phases/<slug>-execute/plan.md`
161
+ - `superspec/phases/<slug>-execute/review-log.md` (empty template)
162
+ - Updated `superspec/specs/<slug>/status.md`
@@ -0,0 +1,161 @@
1
+ ---
2
+ name: execute-review
3
+ description: Review implementation against the spec between tasks. Two passes: spec compliance, then code quality. Critical findings BLOCK progress. Triggers on /code-review, between tasks, or when requested. Runs after each task in /subagent.
4
+ slash_command: code-review
5
+ phase: "2.5 — Execute › Code Review"
6
+ ---
7
+
8
+ # Skill: execute-review
9
+
10
+ You are reviewing implementation against the spec and for code quality.
11
+
12
+ **This runs between tasks.** Not at the end — between each task, while changes are still small and fixable.
13
+
14
+ **Critical findings block progress.** No task starts after a Critical finding until it's resolved.
15
+
16
+ ## Severity Levels
17
+
18
+ | Level | Meaning | Action |
19
+ |---|---|---|
20
+ | **Critical** | Spec violation, security issue, data loss risk, test circumvented | **BLOCK. Stop all execution. Must be fixed before next task.** |
21
+ | **High** | Logic error, wrong behavior, missing error handling | Must be resolved before wave ends |
22
+ | **Medium** | Code quality issue, missed edge case, unclear abstraction | Should be resolved; note in review-log |
23
+ | **Low** | Style, naming, minor improvement | Note in review-log; optional to fix |
24
+
25
+ ## Two-Pass Review
26
+
27
+ ### Pass 1: Spec Compliance
28
+
29
+ Read `superspec/specs/<slug>/spec.md`. For every requirement in scope of the completed task:
30
+
31
+ ```markdown
32
+ ## Pass 1: Spec Compliance
33
+
34
+ ### ✅ Requirement: <Name>
35
+ Scenario: <Name>
36
+ Coverage: `<test-file>:<line>` — `<test name>`
37
+ Verified: behavior matches spec ✅
38
+
39
+ ### ⚠️ Requirement: <Name>
40
+ Scenario: <Name>
41
+ Coverage: MISSING
42
+ Severity: Critical
43
+ Issue: This scenario has no test. The behavior is not verified.
44
+
45
+ ### ❌ Requirement: <Name>
46
+ Scenario: <Name>
47
+ Coverage: `<test-file>:<line>`
48
+ Verified: FAILS — the implementation does X but spec says Y
49
+ Severity: Critical
50
+ ```
51
+
52
+ **If any Critical findings in Pass 1:** stop immediately. Report. Do not run Pass 2.
53
+
54
+ ### Pass 2: Code Quality
55
+
56
+ Only run if Pass 1 is fully ✅ (or only Medium/Low findings).
57
+
58
+ Review dimensions:
59
+
60
+ **Logic correctness**
61
+ - Are there cases where the code does the wrong thing?
62
+ - Are error paths handled?
63
+ - Are assumptions safe?
64
+
65
+ **Test quality**
66
+ - Do tests test behavior (not implementation)?
67
+ - Are edge cases covered?
68
+ - Are tests readable as documentation?
69
+
70
+ **Structure**
71
+ - DRY: is there duplication that should be extracted?
72
+ - YAGNI: is there code that serves no current requirement?
73
+ - Clarity: can this be read and understood without mental overhead?
74
+
75
+ **Consistency**
76
+ - Does this match patterns in the rest of the codebase?
77
+ - Does naming follow existing conventions?
78
+
79
+ ```markdown
80
+ ## Pass 2: Code Quality
81
+
82
+ ### Strengths
83
+ - <What's done well>
84
+
85
+ ### Findings
86
+
87
+ #### [Critical] <Title>
88
+ File: `<path>:<line>`
89
+ Issue: <precise description>
90
+ Why it matters: <impact>
91
+ Fix: <concrete suggestion>
92
+
93
+ #### [High] <Title>
94
+ File: `<path>:<line>`
95
+ Issue: <description>
96
+ Fix: <suggestion>
97
+
98
+ #### [Medium] <Title>
99
+ ...
100
+
101
+ #### [Low] <Title>
102
+ ...
103
+ ```
104
+
105
+ ## After Review
106
+
107
+ ### Append to review-log.md
108
+
109
+ Append to `superspec/phases/<slug>-execute/review-log.md`:
110
+
111
+ ```markdown
112
+ ## Review: Task <id> — <timestamp>
113
+
114
+ ### Pass 1: Spec Compliance
115
+ Result: ✅ PASS / ❌ FAIL (N critical)
116
+
117
+ ### Pass 2: Code Quality
118
+ Result: ✅ PASS / ⚠️ FINDINGS
119
+
120
+ ### Findings Summary
121
+ | Severity | Count | Status |
122
+ |----------|-------|--------|
123
+ | Critical | 0 | — |
124
+ | High | 1 | resolved |
125
+ | Medium | 2 | noted |
126
+ | Low | 1 | noted |
127
+
128
+ ### Resolution
129
+ <Critical findings resolved by: <description of fix>>
130
+ ```
131
+
132
+ ### Decision
133
+
134
+ ```
135
+ Code Review: Task <id>
136
+
137
+ Pass 1 (Spec): ✅ / ❌
138
+ Pass 2 (Quality): ✅ / ⚠️ / ❌
139
+
140
+ Critical findings: <N>
141
+
142
+ → APPROVED — proceed to next task
143
+ → BLOCKED — fix Critical findings before continuing
144
+ ```
145
+
146
+ ## Blocked State
147
+
148
+ When blocked:
149
+
150
+ ```
151
+ ⛔ BLOCKED: Critical finding in Task <id>
152
+
153
+ Finding: <description>
154
+ File: <path>
155
+ Fix required: <what needs to change>
156
+
157
+ Execution paused. Resolve this before running the next task.
158
+ When fixed, run /code-review again to clear the block.
159
+ ```
160
+
161
+ Nothing proceeds until the block is cleared by a clean re-review.
@@ -0,0 +1,149 @@
1
+ ---
2
+ name: execute-subagent
3
+ description: Dispatch fresh subagents per task for parallel execution. Two-stage review per task. Human checkpoints between waves. Triggers on /subagent, "start executing", "run the tasks", "dispatch agents". Run after /branch.
4
+ slash_command: subagent
5
+ phase: "2.3 — Execute › Subagent Development"
6
+ ---
7
+
8
+ # Skill: execute-subagent
9
+
10
+ You are orchestrating subagent-driven execution.
11
+
12
+ Each subagent gets a **clean 200k-token context**: the spec, one task, and the codebase. Nothing else. No prior chat history. No shared state.
13
+
14
+ ## Core Principles
15
+
16
+ - **Fresh context per task.** Each subagent starts clean.
17
+ - **Two-stage review per task.** Every task gets reviewed for spec compliance first, then code quality.
18
+ - **Human checkpoints between waves.** No wave starts without human approval.
19
+ - **Critical findings block progress.** A Critical issue in code review stops the wave.
20
+
21
+ ## Steps
22
+
23
+ ### 1. Read the execution plan
24
+
25
+ Read `superspec/phases/<slug>-execute/plan.md` and `superspec/specs/<slug>/tasks.md`.
26
+
27
+ Identify:
28
+ - The current wave (which one hasn't started yet)
29
+ - Tasks in this wave
30
+ - Whether they're sequential or parallel
31
+
32
+ ### 2. Prepare subagent context package
33
+
34
+ For each task in this wave, assemble the context package. This is what each subagent receives — and ONLY this:
35
+
36
+ ```markdown
37
+ # Subagent Context: <Task ID>
38
+
39
+ ## Spec
40
+ <full contents of spec.md>
41
+
42
+ ## Your Task
43
+ <single task block from tasks.md>
44
+
45
+ ## Codebase State
46
+ Branch: superspec/<slug>
47
+ Relevant files: <list files the task touches>
48
+
49
+ ## Rules
50
+ 1. Write the failing test first (see /tdd skill)
51
+ 2. Make it pass with minimum code
52
+ 3. Run all tests after your change
53
+ 4. Commit with message: "task <task-id>: <short description>"
54
+
55
+ ## Done When
56
+ <done criteria from tasks.md for this task>
57
+ ```
58
+
59
+ ### 3. Execute the wave
60
+
61
+ #### Sequential tasks
62
+ Execute task by task. After each:
63
+ 1. Run `/tdd` enforcement (see tdd skill)
64
+ 2. Run `/code-review` (see code-review skill)
65
+ 3. If Critical finding: STOP. Report. Wait for resolution.
66
+ 4. If no Critical finding: proceed to next task.
67
+
68
+ #### Parallel tasks
69
+ For tasks that can run in parallel (stated in plan.md):
70
+
71
+ Note: true parallel execution requires multiple worktrees or the user to manually run tasks in separate terminals. In single-agent mode, execute tasks sequentially but treat them as logically independent.
72
+
73
+ Document in `wave-<N>.md` which tasks were parallelizable.
74
+
75
+ ### 4. Track progress in wave-N.md
76
+
77
+ Create `superspec/phases/<slug>-execute/wave-<N>.md`:
78
+
79
+ ```markdown
80
+ # Wave <N>: <Name>
81
+
82
+ Started: <timestamp>
83
+
84
+ ## Task Status
85
+
86
+ | Task | Status | Review | Notes |
87
+ |------|--------|--------|-------|
88
+ | 1.1 | ⏳ in progress | — | |
89
+ | 1.2 | ✅ done | ✅ passed | |
90
+ | 1.3 | ❌ blocked | ⚠️ critical finding | <issue> |
91
+
92
+ ## Review Log Summary
93
+ (populated by /code-review)
94
+
95
+ ## Completed: <timestamp>
96
+ ```
97
+
98
+ ### 5. Human checkpoint
99
+
100
+ After the wave completes (all tasks done, no Critical findings):
101
+
102
+ ```
103
+ Wave <N> complete: <slug>
104
+
105
+ Tasks: X/X ✅
106
+ Review findings:
107
+ - Critical: 0
108
+ - High: <N> (resolved)
109
+ - Medium: <N> (noted)
110
+ - Low: <N> (noted)
111
+
112
+ Tests: X passing
113
+
114
+ Ready for Wave <N+1>?
115
+ Show me the diff first, or type '/subagent <slug>' to continue.
116
+ ```
117
+
118
+ **Wait for human approval before starting the next wave.**
119
+
120
+ ### 6. Final wave complete
121
+
122
+ After all waves are done:
123
+
124
+ ```
125
+ All waves complete: <slug>
126
+
127
+ Total tasks: X
128
+ Review findings resolved: Y
129
+ Tests: X passing
130
+
131
+ Next: /check-tests <slug>
132
+ ```
133
+
134
+ Update `superspec/specs/<slug>/status.md`:
135
+ ```markdown
136
+ ## Phase
137
+ 2.3–2.5 — Execute ✅
138
+ ```
139
+
140
+ ## Batch Mode (alternative to wave mode)
141
+
142
+ If the user says "batch mode", run all waves without human checkpoints between waves, but still run code review between tasks. Stop only on Critical findings.
143
+
144
+ ## Output
145
+
146
+ - All task implementations committed to `superspec/<slug>` branch
147
+ - `superspec/phases/<slug>-execute/wave-<N>.md` for each wave
148
+ - `superspec/phases/<slug>-execute/review-log.md` populated
149
+ - Updated status