@cluesmith/codev 2.0.11 → 2.0.13
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/dashboard/dist/assets/{index-B4PL4V8p.js → index-8O8nCk_X.js} +11 -11
- package/dashboard/dist/assets/index-8O8nCk_X.js.map +1 -0
- package/dashboard/dist/assets/{index-Cx2BNcx0.css → index-DCQyWOPv.css} +1 -1
- package/dashboard/dist/index.html +3 -3
- package/dist/agent-farm/commands/open.d.ts.map +1 -1
- package/dist/agent-farm/commands/open.js +12 -3
- package/dist/agent-farm/commands/open.js.map +1 -1
- package/dist/agent-farm/servers/tower-routes.d.ts.map +1 -1
- package/dist/agent-farm/servers/tower-routes.js +11 -2
- package/dist/agent-farm/servers/tower-routes.js.map +1 -1
- package/dist/agent-farm/utils/config.d.ts +4 -0
- package/dist/agent-farm/utils/config.d.ts.map +1 -1
- package/dist/agent-farm/utils/config.js +1 -1
- package/dist/agent-farm/utils/config.js.map +1 -1
- package/dist/commands/consult/index.d.ts.map +1 -1
- package/dist/commands/consult/index.js +22 -2
- package/dist/commands/consult/index.js.map +1 -1
- package/dist/commands/porch/index.d.ts.map +1 -1
- package/dist/commands/porch/index.js +20 -10
- package/dist/commands/porch/index.js.map +1 -1
- package/package.json +1 -1
- package/skeleton/porch/prompts/defend.md +5 -0
- package/skeleton/porch/prompts/implement.md +9 -0
- package/skeleton/protocols/aspir/builder-prompt.md +75 -0
- package/skeleton/protocols/aspir/consult-types/impl-review.md +72 -0
- package/skeleton/protocols/aspir/consult-types/phase-review.md +72 -0
- package/skeleton/protocols/aspir/consult-types/plan-review.md +59 -0
- package/skeleton/protocols/aspir/consult-types/pr-review.md +72 -0
- package/skeleton/protocols/aspir/consult-types/spec-review.md +55 -0
- package/skeleton/protocols/aspir/prompts/implement.md +215 -0
- package/skeleton/protocols/aspir/prompts/plan.md +150 -0
- package/skeleton/protocols/aspir/prompts/review.md +259 -0
- package/skeleton/protocols/aspir/prompts/specify.md +139 -0
- package/skeleton/protocols/aspir/protocol.json +161 -0
- package/skeleton/protocols/aspir/protocol.md +94 -0
- package/skeleton/protocols/aspir/templates/plan.md +204 -0
- package/skeleton/protocols/aspir/templates/review.md +120 -0
- package/skeleton/protocols/aspir/templates/spec.md +182 -0
- package/skeleton/protocols/bugfix/builder-prompt.md +9 -0
- package/skeleton/protocols/experiment/builder-prompt.md +9 -0
- package/skeleton/protocols/maintain/builder-prompt.md +9 -0
- package/skeleton/protocols/spir/builder-prompt.md +9 -0
- package/skeleton/protocols/spir/prompts/implement.md +7 -0
- package/skeleton/protocols/spir/prompts/review.md +5 -0
- package/skeleton/protocols/tick/builder-prompt.md +9 -0
- package/skeleton/templates/AGENTS.md +1 -0
- package/skeleton/templates/CLAUDE.md +1 -0
- package/templates/tower.html +4 -27
- package/dashboard/dist/assets/index-B4PL4V8p.js.map +0 -1
|
@@ -0,0 +1,259 @@
|
|
|
1
|
+
# REVIEW Phase Prompt
|
|
2
|
+
|
|
3
|
+
You are executing the **REVIEW** phase of the SPIR protocol.
|
|
4
|
+
|
|
5
|
+
## Your Goal
|
|
6
|
+
|
|
7
|
+
Perform a comprehensive review, document lessons learned, and prepare for PR submission.
|
|
8
|
+
|
|
9
|
+
## Context
|
|
10
|
+
|
|
11
|
+
- **Project ID**: {{project_id}}
|
|
12
|
+
- **Project Title**: {{title}}
|
|
13
|
+
- **Current State**: {{current_state}}
|
|
14
|
+
- **Spec File**: `codev/specs/{{artifact_name}}.md`
|
|
15
|
+
- **Plan File**: `codev/plans/{{artifact_name}}.md`
|
|
16
|
+
- **Review File**: `codev/reviews/{{artifact_name}}.md`
|
|
17
|
+
|
|
18
|
+
## Prerequisites
|
|
19
|
+
|
|
20
|
+
Before review, verify:
|
|
21
|
+
1. All implementation phases are committed
|
|
22
|
+
2. All tests are passing
|
|
23
|
+
3. Build is passing
|
|
24
|
+
4. Spec compliance verified for all phases
|
|
25
|
+
|
|
26
|
+
Verify commits: `git log --oneline | grep "[Spec {{project_id}}]"`
|
|
27
|
+
|
|
28
|
+
## Process
|
|
29
|
+
|
|
30
|
+
### 1. Comprehensive Review
|
|
31
|
+
|
|
32
|
+
Review the entire implementation:
|
|
33
|
+
|
|
34
|
+
**Code Quality**:
|
|
35
|
+
- Is the code readable and maintainable?
|
|
36
|
+
- Are there any code smells?
|
|
37
|
+
- Is error handling consistent?
|
|
38
|
+
- Are there any security concerns?
|
|
39
|
+
|
|
40
|
+
**Architecture**:
|
|
41
|
+
- Does the implementation fit well with existing code?
|
|
42
|
+
- Are there any architectural concerns?
|
|
43
|
+
- Is the design scalable if needed?
|
|
44
|
+
|
|
45
|
+
**Documentation**:
|
|
46
|
+
- Is code adequately commented where needed?
|
|
47
|
+
- Are public APIs documented?
|
|
48
|
+
- Is README updated if needed?
|
|
49
|
+
|
|
50
|
+
### 2. Spec Comparison
|
|
51
|
+
|
|
52
|
+
Compare final implementation to original specification:
|
|
53
|
+
|
|
54
|
+
- What was delivered vs what was specified?
|
|
55
|
+
- Any deviations? Document why.
|
|
56
|
+
- All success criteria met?
|
|
57
|
+
|
|
58
|
+
### 3. Create Review Document
|
|
59
|
+
|
|
60
|
+
Create `codev/reviews/{{artifact_name}}.md`:
|
|
61
|
+
|
|
62
|
+
```markdown
|
|
63
|
+
# Review: {{title}}
|
|
64
|
+
|
|
65
|
+
## Summary
|
|
66
|
+
Brief description of what was implemented.
|
|
67
|
+
|
|
68
|
+
## Spec Compliance
|
|
69
|
+
- [x] Requirement 1: Implemented as specified
|
|
70
|
+
- [x] Requirement 2: Implemented with deviation (see below)
|
|
71
|
+
- [x] Requirement 3: Implemented as specified
|
|
72
|
+
|
|
73
|
+
## Deviations from Plan
|
|
74
|
+
- **Phase X**: [What changed and why]
|
|
75
|
+
|
|
76
|
+
## Lessons Learned
|
|
77
|
+
|
|
78
|
+
### What Went Well
|
|
79
|
+
- [Positive observation 1]
|
|
80
|
+
- [Positive observation 2]
|
|
81
|
+
|
|
82
|
+
### Challenges Encountered
|
|
83
|
+
- [Challenge 1]: [How it was resolved]
|
|
84
|
+
- [Challenge 2]: [How it was resolved]
|
|
85
|
+
|
|
86
|
+
### What Would Be Done Differently
|
|
87
|
+
- [Insight 1]
|
|
88
|
+
- [Insight 2]
|
|
89
|
+
|
|
90
|
+
### Methodology Improvements
|
|
91
|
+
- [Suggested improvement to SPIR protocol]
|
|
92
|
+
- [Suggested improvement to tooling]
|
|
93
|
+
|
|
94
|
+
## Technical Debt
|
|
95
|
+
- [Any shortcuts taken that should be addressed later]
|
|
96
|
+
|
|
97
|
+
## Consultation Feedback
|
|
98
|
+
|
|
99
|
+
[See instructions below]
|
|
100
|
+
|
|
101
|
+
## Flaky Tests
|
|
102
|
+
- [Any pre-existing tests that were skipped as flaky during this project]
|
|
103
|
+
- [Include test name, file path, and observed failure mode]
|
|
104
|
+
- [If none: "No flaky tests encountered"]
|
|
105
|
+
|
|
106
|
+
## Follow-up Items
|
|
107
|
+
- [Any items identified for future work]
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
### 3b. Include Consultation Feedback
|
|
111
|
+
|
|
112
|
+
**IMPORTANT**: The review document MUST include a `## Consultation Feedback` section that summarizes all consultation concerns raised during every phase of the project and how the builder responded.
|
|
113
|
+
|
|
114
|
+
Read the consultation output files from the project directory (`codev/projects/{project-id}-*/`). For each phase that had consultation, create a subsection organized by phase, round, and model:
|
|
115
|
+
|
|
116
|
+
```markdown
|
|
117
|
+
## Consultation Feedback
|
|
118
|
+
|
|
119
|
+
### Specify Phase (Round 1)
|
|
120
|
+
|
|
121
|
+
#### Gemini
|
|
122
|
+
- **Concern**: [Summary of the concern]
|
|
123
|
+
- **Addressed**: [What was changed to resolve it]
|
|
124
|
+
|
|
125
|
+
#### Codex
|
|
126
|
+
- **Concern**: [Summary]
|
|
127
|
+
- **Rebutted**: [Why the current approach is correct]
|
|
128
|
+
|
|
129
|
+
#### Claude
|
|
130
|
+
- No concerns raised (APPROVE)
|
|
131
|
+
|
|
132
|
+
### Plan Phase (Round 1)
|
|
133
|
+
...
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
**Response types** — each concern gets exactly one:
|
|
137
|
+
- **Addressed**: Builder made a change to resolve the concern
|
|
138
|
+
- **Rebutted**: Builder explains why the concern doesn't apply
|
|
139
|
+
- **N/A**: Concern is out of scope, already handled elsewhere, or moot
|
|
140
|
+
|
|
141
|
+
**Edge cases**:
|
|
142
|
+
- If all reviewers approved with no concerns: "No concerns raised — all consultations approved"
|
|
143
|
+
- For COMMENT verdicts: include their feedback (non-blocking but useful context)
|
|
144
|
+
- For CONSULT_ERROR (model failure): note "Consultation failed for [model]"
|
|
145
|
+
- If a phase had multiple rounds, give each round its own subsection
|
|
146
|
+
|
|
147
|
+
### 4. Update Architecture and Lessons Learned Documentation
|
|
148
|
+
|
|
149
|
+
**MANDATORY**: The review document MUST include `## Architecture Updates` and `## Lessons Learned Updates` sections. Porch will block advancement if these are missing.
|
|
150
|
+
|
|
151
|
+
**Architecture Updates** (`codev/resources/arch.md`):
|
|
152
|
+
1. Read the current `codev/resources/arch.md`
|
|
153
|
+
2. Determine if this project introduced architectural changes worth documenting (new subsystems, data flows, design decisions, invariants, file locations)
|
|
154
|
+
3. If yes: make the updates to arch.md and describe what you changed in the `## Architecture Updates` section of the review
|
|
155
|
+
4. If no: write "No architecture updates needed" in the section with a brief explanation (e.g., "This was a template-only change with no new subsystems or data flows")
|
|
156
|
+
|
|
157
|
+
**Lessons Learned Updates** (`codev/resources/lessons-learned.md`):
|
|
158
|
+
1. Read the current `codev/resources/lessons-learned.md`
|
|
159
|
+
2. Determine if this project produced generalizable lessons (patterns, anti-patterns, debugging insights, process improvements)
|
|
160
|
+
3. If yes: add entries to lessons-learned.md and describe what you added in the `## Lessons Learned Updates` section of the review
|
|
161
|
+
4. If no: write "No lessons learned updates needed" in the section with a brief explanation (e.g., "Straightforward implementation with no novel insights beyond existing entries")
|
|
162
|
+
|
|
163
|
+
### 4b. Update Other Documentation
|
|
164
|
+
|
|
165
|
+
If needed, also update:
|
|
166
|
+
- README.md (new features, changed behavior)
|
|
167
|
+
- API documentation
|
|
168
|
+
|
|
169
|
+
### 5. Final Verification
|
|
170
|
+
|
|
171
|
+
Before PR:
|
|
172
|
+
- [ ] All tests pass (use project-specific test command)
|
|
173
|
+
- [ ] Build passes (use project-specific build command)
|
|
174
|
+
- [ ] Lint passes (if configured)
|
|
175
|
+
- [ ] No uncommitted changes: `git status`
|
|
176
|
+
- [ ] Review document complete
|
|
177
|
+
|
|
178
|
+
### 6. Create Pull Request
|
|
179
|
+
|
|
180
|
+
**IMPORTANT: Create the PR BEFORE signaling completion.** The PR must exist so that
|
|
181
|
+
porch consultation reviews the actual PR, and the architect can review a real PR
|
|
182
|
+
when the pr gate fires.
|
|
183
|
+
|
|
184
|
+
```bash
|
|
185
|
+
gh pr create --title "[Spec {{project_id}}] {{title}}" --body "$(cat <<'EOF'
|
|
186
|
+
## Summary
|
|
187
|
+
[Brief description of the implementation]
|
|
188
|
+
|
|
189
|
+
## Changes
|
|
190
|
+
- [Change 1]
|
|
191
|
+
- [Change 2]
|
|
192
|
+
|
|
193
|
+
## Testing
|
|
194
|
+
- All unit tests passing
|
|
195
|
+
- Integration tests added for [X]
|
|
196
|
+
- Manual testing completed for [Y]
|
|
197
|
+
|
|
198
|
+
## Spec
|
|
199
|
+
Link: codev/specs/{{artifact_name}}.md
|
|
200
|
+
|
|
201
|
+
## Review
|
|
202
|
+
Link: codev/reviews/{{artifact_name}}.md
|
|
203
|
+
EOF
|
|
204
|
+
)"
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
### 7. Signal Completion
|
|
208
|
+
|
|
209
|
+
After the PR is created, signal completion. Porch will run 3-way consultation
|
|
210
|
+
(Gemini, Codex, Claude) automatically via the verify step. If reviewers request
|
|
211
|
+
changes, you'll be respawned with their feedback.
|
|
212
|
+
|
|
213
|
+
## Output
|
|
214
|
+
|
|
215
|
+
- Review document at `codev/reviews/{{artifact_name}}.md`
|
|
216
|
+
- Updated documentation (if needed)
|
|
217
|
+
- Pull request created and ready for review
|
|
218
|
+
|
|
219
|
+
## Signals
|
|
220
|
+
|
|
221
|
+
- After review document is complete:
|
|
222
|
+
```
|
|
223
|
+
<signal>REVIEW_COMPLETE</signal>
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
- After PR is created — signal completion so porch runs consultation:
|
|
227
|
+
```
|
|
228
|
+
<signal>PR_READY</signal>
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
## Important Notes
|
|
232
|
+
|
|
233
|
+
1. **Be honest in lessons learned** - Future you will thank present you
|
|
234
|
+
3. **Document deviations** - They're not failures, they're learnings
|
|
235
|
+
4. **Update methodology** - If you found a better way, document it
|
|
236
|
+
5. **Don't skip the checklist** - It catches last-minute issues
|
|
237
|
+
6. **Clean PR description** - Makes review easier
|
|
238
|
+
|
|
239
|
+
## What NOT to Do
|
|
240
|
+
|
|
241
|
+
- Don't run `consult` commands yourself (porch handles consultations)
|
|
242
|
+
- Don't skip lessons learned ("nothing to report")
|
|
243
|
+
- Don't merge your own PR (Architect handles integration)
|
|
244
|
+
- Don't leave uncommitted changes
|
|
245
|
+
- Don't forget to update documentation
|
|
246
|
+
- Don't rush this phase - it's valuable for learning
|
|
247
|
+
- Don't use `git add .` or `git add -A` (security risk)
|
|
248
|
+
|
|
249
|
+
## Review Prompts for Reflection
|
|
250
|
+
|
|
251
|
+
Ask yourself:
|
|
252
|
+
- What surprised me during implementation?
|
|
253
|
+
- Where did I spend the most time? Was it avoidable?
|
|
254
|
+
- What would have helped me go faster?
|
|
255
|
+
- Did the spec adequately describe what was needed?
|
|
256
|
+
- Did the plan phases make sense in hindsight?
|
|
257
|
+
- What tests caught issues? What tests were unnecessary?
|
|
258
|
+
|
|
259
|
+
Capture these reflections in the lessons learned section.
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
# SPECIFY Phase Prompt
|
|
2
|
+
|
|
3
|
+
You are executing the **SPECIFY** phase of the SPIR protocol.
|
|
4
|
+
|
|
5
|
+
## Your Goal
|
|
6
|
+
|
|
7
|
+
Create a comprehensive specification document that thoroughly explores the problem space and proposed solution.
|
|
8
|
+
|
|
9
|
+
## Context
|
|
10
|
+
|
|
11
|
+
- **Project ID**: {{project_id}}
|
|
12
|
+
- **Project Title**: {{title}}
|
|
13
|
+
- **Current State**: {{current_state}}
|
|
14
|
+
- **Spec File**: `codev/specs/{{artifact_name}}.md`
|
|
15
|
+
|
|
16
|
+
## Process
|
|
17
|
+
|
|
18
|
+
### 0. Check for Existing Spec (ALWAYS DO THIS FIRST)
|
|
19
|
+
|
|
20
|
+
**Before asking ANY questions**, check if a spec already exists:
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
ls codev/specs/{{project_id}}-*.md
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
**If a spec file exists:**
|
|
27
|
+
1. READ IT COMPLETELY - the answers to your questions are already there
|
|
28
|
+
2. The spec author has already made the key decisions
|
|
29
|
+
3. DO NOT ask clarifying questions - proceed directly to consultation
|
|
30
|
+
4. Your job is to REVIEW and IMPROVE the existing spec, not rewrite it from scratch
|
|
31
|
+
|
|
32
|
+
**If no spec exists:** Proceed to Step 1 below.
|
|
33
|
+
|
|
34
|
+
### 1. Clarifying Questions (ONLY IF NO SPEC EXISTS)
|
|
35
|
+
|
|
36
|
+
Before writing anything, ask clarifying questions to understand:
|
|
37
|
+
- What problem is being solved?
|
|
38
|
+
- Who are the stakeholders?
|
|
39
|
+
- What are the constraints?
|
|
40
|
+
- What's in scope vs out of scope?
|
|
41
|
+
- What does success look like?
|
|
42
|
+
|
|
43
|
+
If this is your first iteration AND no spec exists, ask these questions now and wait for answers.
|
|
44
|
+
|
|
45
|
+
**CRITICAL**: Do NOT ask questions if a spec already exists. The spec IS the answer.
|
|
46
|
+
|
|
47
|
+
**On subsequent iterations**: If questions were already answered, acknowledge the answers and proceed to the next step.
|
|
48
|
+
|
|
49
|
+
### 2. Problem Analysis
|
|
50
|
+
|
|
51
|
+
Once you have answers, document:
|
|
52
|
+
- The problem being solved (clearly articulated)
|
|
53
|
+
- Current state vs desired state
|
|
54
|
+
- Stakeholders and their needs
|
|
55
|
+
- Assumptions and constraints
|
|
56
|
+
|
|
57
|
+
### 3. Solution Exploration
|
|
58
|
+
|
|
59
|
+
Generate multiple solution approaches. For each:
|
|
60
|
+
- Technical design overview
|
|
61
|
+
- Trade-offs (pros/cons)
|
|
62
|
+
- Complexity assessment
|
|
63
|
+
- Risk assessment
|
|
64
|
+
|
|
65
|
+
### 4. Open Questions
|
|
66
|
+
|
|
67
|
+
List uncertainties categorized as:
|
|
68
|
+
- **Critical** - blocks progress
|
|
69
|
+
- **Important** - affects design
|
|
70
|
+
- **Nice-to-know** - optimization
|
|
71
|
+
|
|
72
|
+
### 5. Success Criteria
|
|
73
|
+
|
|
74
|
+
Define measurable acceptance criteria:
|
|
75
|
+
- Functional requirements (MUST, SHOULD, COULD)
|
|
76
|
+
- Non-functional requirements (performance, security)
|
|
77
|
+
- Test scenarios
|
|
78
|
+
|
|
79
|
+
### 6. Finalize
|
|
80
|
+
|
|
81
|
+
After completing the spec draft, signal completion. Porch will run 3-way consultation (Gemini, Codex, Claude) automatically via the verify step. If reviewers request changes, you'll be respawned with their feedback.
|
|
82
|
+
|
|
83
|
+
## Output
|
|
84
|
+
|
|
85
|
+
Create or update the specification file at `codev/specs/{{artifact_name}}.md`.
|
|
86
|
+
|
|
87
|
+
**IMPORTANT**: Keep spec/plan/review filenames in sync:
|
|
88
|
+
- Spec: `codev/specs/{{artifact_name}}.md`
|
|
89
|
+
- Plan: `codev/plans/{{artifact_name}}.md`
|
|
90
|
+
- Review: `codev/reviews/{{artifact_name}}.md`
|
|
91
|
+
|
|
92
|
+
## Signals
|
|
93
|
+
|
|
94
|
+
Emit appropriate signals based on your progress:
|
|
95
|
+
|
|
96
|
+
- When waiting for clarifying question answers, **include your questions in the signal**:
|
|
97
|
+
```
|
|
98
|
+
<signal type=AWAITING_INPUT>
|
|
99
|
+
Please answer these questions:
|
|
100
|
+
1. What should the primary use case be - internal tooling or customer-facing?
|
|
101
|
+
2. What are the key constraints we should consider?
|
|
102
|
+
3. Who are the main stakeholders?
|
|
103
|
+
</signal>
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
The content inside the signal tag is displayed prominently to the user.
|
|
107
|
+
|
|
108
|
+
- After completing the initial spec draft:
|
|
109
|
+
```
|
|
110
|
+
<signal>SPEC_DRAFTED</signal>
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
## Commit Cadence
|
|
115
|
+
|
|
116
|
+
Make commits at these milestones:
|
|
117
|
+
1. `[Spec {{project_id}}] Initial specification draft`
|
|
118
|
+
2. `[Spec {{project_id}}] Specification with multi-agent review`
|
|
119
|
+
3. `[Spec {{project_id}}] Specification with user feedback`
|
|
120
|
+
4. `[Spec {{project_id}}] Final approved specification`
|
|
121
|
+
|
|
122
|
+
**CRITICAL**: Never use `git add .` or `git add -A`. Always stage specific files:
|
|
123
|
+
```bash
|
|
124
|
+
git add codev/specs/{{artifact_name}}.md
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
## Important Notes
|
|
128
|
+
|
|
129
|
+
1. **Be thorough** - A good spec prevents implementation problems
|
|
130
|
+
3. **Be specific** - Vague specs lead to wrong implementations
|
|
131
|
+
4. **Include examples** - Concrete examples clarify intent
|
|
132
|
+
|
|
133
|
+
## What NOT to Do
|
|
134
|
+
|
|
135
|
+
- Don't run `consult` commands yourself (porch handles consultations)
|
|
136
|
+
- Don't include implementation details (that's for the Plan phase)
|
|
137
|
+
- Don't estimate time (AI makes time estimates meaningless)
|
|
138
|
+
- Don't start coding (you're in Specify, not Implement)
|
|
139
|
+
- Don't use `git add .` or `git add -A` (security risk)
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "../../protocol-schema.json",
|
|
3
|
+
"name": "aspir",
|
|
4
|
+
"version": "1.0.0",
|
|
5
|
+
"description": "ASPIR: Autonomous SPIR — Specify → Plan → Implement → Review without human approval gates",
|
|
6
|
+
"input": {
|
|
7
|
+
"type": "spec",
|
|
8
|
+
"required": false,
|
|
9
|
+
"default_for": ["--project", "-p"]
|
|
10
|
+
},
|
|
11
|
+
"phases": [
|
|
12
|
+
{
|
|
13
|
+
"id": "specify",
|
|
14
|
+
"name": "Specify",
|
|
15
|
+
"description": "Write specification with 3-way review",
|
|
16
|
+
"type": "build_verify",
|
|
17
|
+
"build": {
|
|
18
|
+
"prompt": "specify.md",
|
|
19
|
+
"artifact": "codev/specs/${PROJECT_TITLE}.md"
|
|
20
|
+
},
|
|
21
|
+
"verify": {
|
|
22
|
+
"type": "spec",
|
|
23
|
+
"models": ["gemini", "codex", "claude"],
|
|
24
|
+
"parallel": true
|
|
25
|
+
},
|
|
26
|
+
"max_iterations": 1,
|
|
27
|
+
"on_complete": {
|
|
28
|
+
"commit": true,
|
|
29
|
+
"push": true
|
|
30
|
+
},
|
|
31
|
+
"next": "plan"
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"id": "plan",
|
|
35
|
+
"name": "Plan",
|
|
36
|
+
"description": "Write implementation plan with 3-way review",
|
|
37
|
+
"type": "build_verify",
|
|
38
|
+
"build": {
|
|
39
|
+
"prompt": "plan.md",
|
|
40
|
+
"artifact": "codev/plans/${PROJECT_TITLE}.md"
|
|
41
|
+
},
|
|
42
|
+
"verify": {
|
|
43
|
+
"type": "plan",
|
|
44
|
+
"models": ["gemini", "codex", "claude"],
|
|
45
|
+
"parallel": true
|
|
46
|
+
},
|
|
47
|
+
"max_iterations": 1,
|
|
48
|
+
"on_complete": {
|
|
49
|
+
"commit": true,
|
|
50
|
+
"push": true
|
|
51
|
+
},
|
|
52
|
+
"checks": {
|
|
53
|
+
"plan_exists": "test -f codev/plans/${PROJECT_TITLE}.md",
|
|
54
|
+
"has_phases_json": "grep -q '\"phases\":' codev/plans/${PROJECT_TITLE}.md",
|
|
55
|
+
"min_two_phases": "grep -o '\"id\": *\"[^\"]*\"' codev/plans/${PROJECT_TITLE}.md | wc -l | awk '$1 >= 2 {exit 0} {exit 1}'"
|
|
56
|
+
},
|
|
57
|
+
"next": "implement"
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
"id": "implement",
|
|
61
|
+
"name": "Implement",
|
|
62
|
+
"description": "Implement code with 3-way review per plan phase",
|
|
63
|
+
"type": "per_plan_phase",
|
|
64
|
+
"build": {
|
|
65
|
+
"prompt": "implement.md",
|
|
66
|
+
"artifact": "src/**/*.{ts,tsx,js,jsx}"
|
|
67
|
+
},
|
|
68
|
+
"verify": {
|
|
69
|
+
"type": "impl",
|
|
70
|
+
"models": ["gemini", "codex", "claude"],
|
|
71
|
+
"parallel": true
|
|
72
|
+
},
|
|
73
|
+
"max_iterations": 1,
|
|
74
|
+
"on_complete": {
|
|
75
|
+
"commit": true,
|
|
76
|
+
"push": true
|
|
77
|
+
},
|
|
78
|
+
"checks": {
|
|
79
|
+
"build": {
|
|
80
|
+
"command": "npm run build",
|
|
81
|
+
"on_fail": "retry",
|
|
82
|
+
"max_retries": 2
|
|
83
|
+
},
|
|
84
|
+
"tests": {
|
|
85
|
+
"command": "npm test -- --exclude='**/e2e/**'",
|
|
86
|
+
"description": "Unit tests only - e2e tests run in review phase",
|
|
87
|
+
"on_fail": "retry",
|
|
88
|
+
"max_retries": 2
|
|
89
|
+
}
|
|
90
|
+
},
|
|
91
|
+
"transition": {
|
|
92
|
+
"on_complete": "implement",
|
|
93
|
+
"on_all_phases_complete": "review"
|
|
94
|
+
}
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
"id": "review",
|
|
98
|
+
"name": "Review",
|
|
99
|
+
"description": "Final review and PR with 3-way review",
|
|
100
|
+
"type": "build_verify",
|
|
101
|
+
"build": {
|
|
102
|
+
"prompt": "review.md",
|
|
103
|
+
"artifact": "codev/reviews/${PROJECT_TITLE}.md"
|
|
104
|
+
},
|
|
105
|
+
"verify": {
|
|
106
|
+
"type": "pr",
|
|
107
|
+
"models": ["gemini", "codex", "claude"],
|
|
108
|
+
"parallel": true
|
|
109
|
+
},
|
|
110
|
+
"max_iterations": 1,
|
|
111
|
+
"on_complete": {
|
|
112
|
+
"commit": true,
|
|
113
|
+
"push": true
|
|
114
|
+
},
|
|
115
|
+
"checks": {
|
|
116
|
+
"pr_exists": {
|
|
117
|
+
"command": "gh pr list --head \"$(git branch --show-current)\" --json number --jq 'length' | grep -q '^[1-9]'",
|
|
118
|
+
"description": "PR must be created before signaling completion"
|
|
119
|
+
},
|
|
120
|
+
"review_has_arch_updates": {
|
|
121
|
+
"command": "grep -q '## Architecture Updates' codev/reviews/${PROJECT_TITLE}.md",
|
|
122
|
+
"description": "Review must include '## Architecture Updates' section (what changed in arch.md, or why no changes needed)"
|
|
123
|
+
},
|
|
124
|
+
"review_has_lessons_updates": {
|
|
125
|
+
"command": "grep -q '## Lessons Learned Updates' codev/reviews/${PROJECT_TITLE}.md",
|
|
126
|
+
"description": "Review must include '## Lessons Learned Updates' section (what changed in lessons-learned.md, or why no changes needed)"
|
|
127
|
+
},
|
|
128
|
+
"e2e_tests": {
|
|
129
|
+
"command": "npm run test:e2e 2>&1 || echo 'e2e tests skipped (not configured)'",
|
|
130
|
+
"description": "Full e2e test suite - only runs in review phase",
|
|
131
|
+
"optional": true
|
|
132
|
+
}
|
|
133
|
+
},
|
|
134
|
+
"gate": "pr",
|
|
135
|
+
"next": null
|
|
136
|
+
}
|
|
137
|
+
],
|
|
138
|
+
"signals": {
|
|
139
|
+
"PHASE_COMPLETE": {
|
|
140
|
+
"description": "Signal current build phase is complete",
|
|
141
|
+
"transitions_to": "verify"
|
|
142
|
+
},
|
|
143
|
+
"BLOCKED": {
|
|
144
|
+
"description": "Signal implementation is blocked",
|
|
145
|
+
"requires": "reason"
|
|
146
|
+
}
|
|
147
|
+
},
|
|
148
|
+
"phase_completion": {
|
|
149
|
+
"build_succeeds": "npm run build 2>&1",
|
|
150
|
+
"tests_pass": "npm test 2>&1",
|
|
151
|
+
"commit_has_code": "git log -1 --name-only --pretty=format: | grep -qE '\\.(ts|tsx|js|jsx|py|go|rs)$'"
|
|
152
|
+
},
|
|
153
|
+
"defaults": {
|
|
154
|
+
"mode": "strict",
|
|
155
|
+
"max_iterations": 1,
|
|
156
|
+
"verify": {
|
|
157
|
+
"models": ["gemini", "codex", "claude"],
|
|
158
|
+
"parallel": true
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
# ASPIR Protocol
|
|
2
|
+
|
|
3
|
+
> **ASPIR** = **A**utonomous **S**pecify → **P**lan → **I**mplement → **R**eview
|
|
4
|
+
>
|
|
5
|
+
> Identical to SPIR but without human approval gates on spec and plan phases.
|
|
6
|
+
> Each phase has one build-verify cycle with 3-way consultation.
|
|
7
|
+
|
|
8
|
+
## What is ASPIR?
|
|
9
|
+
|
|
10
|
+
ASPIR is an autonomous variant of the SPIR protocol. It follows the exact same phases (Specify → Plan → Implement → Review) with the same 3-way consultations, checks, and PR flow — but removes the `spec-approval` and `plan-approval` human gates.
|
|
11
|
+
|
|
12
|
+
This means the builder proceeds automatically from Specify → Plan → Implement without waiting for human approval at each gate. The `pr` gate in the Review phase is preserved — a human still reviews all code before merge.
|
|
13
|
+
|
|
14
|
+
### Differences from SPIR
|
|
15
|
+
|
|
16
|
+
| Aspect | SPIR | ASPIR |
|
|
17
|
+
|--------|------|-------|
|
|
18
|
+
| Spec gate (`spec-approval`) | Human must approve | Auto-approved |
|
|
19
|
+
| Plan gate (`plan-approval`) | Human must approve | Auto-approved |
|
|
20
|
+
| PR gate (`pr`) | Human must approve | Human must approve |
|
|
21
|
+
| Phases | Specify → Plan → Implement → Review | Same |
|
|
22
|
+
| 3-way consultations | Yes, every phase | Same |
|
|
23
|
+
| Checks (build, tests, PR) | Yes | Same |
|
|
24
|
+
| Prompts / templates | Full set | Same (copied from SPIR) |
|
|
25
|
+
|
|
26
|
+
### When to Use ASPIR
|
|
27
|
+
|
|
28
|
+
Use ASPIR instead of SPIR when:
|
|
29
|
+
|
|
30
|
+
- The work is **trusted and low-risk** — internal tooling, protocol additions, well-understood features
|
|
31
|
+
- The architect has **pre-written and approved** the spec before spawning
|
|
32
|
+
- The scope is **self-contained** with low blast radius
|
|
33
|
+
- You want **full SPIR discipline** (consultations, phased implementation, review) without waiting at gates
|
|
34
|
+
|
|
35
|
+
### When NOT to Use ASPIR
|
|
36
|
+
|
|
37
|
+
Use SPIR instead when:
|
|
38
|
+
|
|
39
|
+
- The feature involves **novel architecture** or unclear requirements
|
|
40
|
+
- The spec needs **iterative human feedback** during drafting
|
|
41
|
+
- The work is **high-risk** — security-sensitive, user-facing, or broadly impactful
|
|
42
|
+
- You want to **review and adjust** the plan before implementation starts
|
|
43
|
+
|
|
44
|
+
## Protocol Phases
|
|
45
|
+
|
|
46
|
+
ASPIR follows the same four phases as SPIR. For full phase documentation, see the [SPIR protocol](../spir/protocol.md).
|
|
47
|
+
|
|
48
|
+
### S - Specify
|
|
49
|
+
Write specification with 3-way review (Gemini, Codex, Claude). **No human gate** — proceeds directly to Plan after verification.
|
|
50
|
+
|
|
51
|
+
### P - Plan
|
|
52
|
+
Write implementation plan with 3-way review. **No human gate** — proceeds directly to Implement after verification and checks pass.
|
|
53
|
+
|
|
54
|
+
### I - Implement
|
|
55
|
+
Execute each plan phase with build-verify cycle. Same as SPIR — no gate between phases (SPIR also has no gate here).
|
|
56
|
+
|
|
57
|
+
### R - Review
|
|
58
|
+
Final review, PR preparation, and 3-way review. **PR gate preserved** — builder stops and waits for human approval before merge.
|
|
59
|
+
|
|
60
|
+
## Usage
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
# Spawn a builder using ASPIR
|
|
64
|
+
af spawn 42 --protocol aspir
|
|
65
|
+
|
|
66
|
+
# The builder runs autonomously through Specify → Plan → Implement
|
|
67
|
+
# and stops only at the PR gate in the Review phase
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
## File Structure
|
|
71
|
+
|
|
72
|
+
```
|
|
73
|
+
codev/protocols/aspir/
|
|
74
|
+
├── protocol.json # Protocol definition (SPIR minus gates)
|
|
75
|
+
├── protocol.md # This file
|
|
76
|
+
├── builder-prompt.md # Builder instructions (same as SPIR)
|
|
77
|
+
├── prompts/
|
|
78
|
+
│ ├── specify.md # Specify phase prompt (same as SPIR)
|
|
79
|
+
│ ├── plan.md # Plan phase prompt (same as SPIR)
|
|
80
|
+
│ ├── implement.md # Implement phase prompt (same as SPIR)
|
|
81
|
+
│ └── review.md # Review phase prompt (same as SPIR)
|
|
82
|
+
├── consult-types/
|
|
83
|
+
│ ├── spec-review.md # Spec consultation guide (same as SPIR)
|
|
84
|
+
│ ├── plan-review.md # Plan consultation guide (same as SPIR)
|
|
85
|
+
│ ├── impl-review.md # Impl consultation guide (same as SPIR)
|
|
86
|
+
│ ├── phase-review.md # Phase consultation guide (same as SPIR)
|
|
87
|
+
│ └── pr-review.md # PR consultation guide (same as SPIR)
|
|
88
|
+
└── templates/
|
|
89
|
+
├── spec.md # Spec template (same as SPIR)
|
|
90
|
+
├── plan.md # Plan template (same as SPIR)
|
|
91
|
+
└── review.md # Review template (same as SPIR)
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
All files except `protocol.json` and `protocol.md` are identical to their SPIR counterparts.
|