@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.
Files changed (49) hide show
  1. package/dashboard/dist/assets/{index-B4PL4V8p.js → index-8O8nCk_X.js} +11 -11
  2. package/dashboard/dist/assets/index-8O8nCk_X.js.map +1 -0
  3. package/dashboard/dist/assets/{index-Cx2BNcx0.css → index-DCQyWOPv.css} +1 -1
  4. package/dashboard/dist/index.html +3 -3
  5. package/dist/agent-farm/commands/open.d.ts.map +1 -1
  6. package/dist/agent-farm/commands/open.js +12 -3
  7. package/dist/agent-farm/commands/open.js.map +1 -1
  8. package/dist/agent-farm/servers/tower-routes.d.ts.map +1 -1
  9. package/dist/agent-farm/servers/tower-routes.js +11 -2
  10. package/dist/agent-farm/servers/tower-routes.js.map +1 -1
  11. package/dist/agent-farm/utils/config.d.ts +4 -0
  12. package/dist/agent-farm/utils/config.d.ts.map +1 -1
  13. package/dist/agent-farm/utils/config.js +1 -1
  14. package/dist/agent-farm/utils/config.js.map +1 -1
  15. package/dist/commands/consult/index.d.ts.map +1 -1
  16. package/dist/commands/consult/index.js +22 -2
  17. package/dist/commands/consult/index.js.map +1 -1
  18. package/dist/commands/porch/index.d.ts.map +1 -1
  19. package/dist/commands/porch/index.js +20 -10
  20. package/dist/commands/porch/index.js.map +1 -1
  21. package/package.json +1 -1
  22. package/skeleton/porch/prompts/defend.md +5 -0
  23. package/skeleton/porch/prompts/implement.md +9 -0
  24. package/skeleton/protocols/aspir/builder-prompt.md +75 -0
  25. package/skeleton/protocols/aspir/consult-types/impl-review.md +72 -0
  26. package/skeleton/protocols/aspir/consult-types/phase-review.md +72 -0
  27. package/skeleton/protocols/aspir/consult-types/plan-review.md +59 -0
  28. package/skeleton/protocols/aspir/consult-types/pr-review.md +72 -0
  29. package/skeleton/protocols/aspir/consult-types/spec-review.md +55 -0
  30. package/skeleton/protocols/aspir/prompts/implement.md +215 -0
  31. package/skeleton/protocols/aspir/prompts/plan.md +150 -0
  32. package/skeleton/protocols/aspir/prompts/review.md +259 -0
  33. package/skeleton/protocols/aspir/prompts/specify.md +139 -0
  34. package/skeleton/protocols/aspir/protocol.json +161 -0
  35. package/skeleton/protocols/aspir/protocol.md +94 -0
  36. package/skeleton/protocols/aspir/templates/plan.md +204 -0
  37. package/skeleton/protocols/aspir/templates/review.md +120 -0
  38. package/skeleton/protocols/aspir/templates/spec.md +182 -0
  39. package/skeleton/protocols/bugfix/builder-prompt.md +9 -0
  40. package/skeleton/protocols/experiment/builder-prompt.md +9 -0
  41. package/skeleton/protocols/maintain/builder-prompt.md +9 -0
  42. package/skeleton/protocols/spir/builder-prompt.md +9 -0
  43. package/skeleton/protocols/spir/prompts/implement.md +7 -0
  44. package/skeleton/protocols/spir/prompts/review.md +5 -0
  45. package/skeleton/protocols/tick/builder-prompt.md +9 -0
  46. package/skeleton/templates/AGENTS.md +1 -0
  47. package/skeleton/templates/CLAUDE.md +1 -0
  48. package/templates/tower.html +4 -27
  49. package/dashboard/dist/assets/index-B4PL4V8p.js.map +0 -1
@@ -0,0 +1,72 @@
1
+ # Implementation Review Prompt
2
+
3
+ ## Context
4
+ You are reviewing implementation work during the Implement phase. A builder has completed a plan phase and needs feedback before proceeding. Your job is to verify the implementation matches the spec and plan.
5
+
6
+ ## CRITICAL: Verify Before Flagging
7
+
8
+ Before requesting changes for missing configuration, incorrect patterns, or framework issues:
9
+ 1. **Check `package.json`** for actual dependency versions — framework conventions change between major versions
10
+ 2. **Read the actual config files** (or confirm their deliberate absence) before flagging missing configs
11
+ 3. **Do not assume** your training data reflects the version in use — verify against project files
12
+ 4. If "Previous Iteration Context" is provided, read it carefully before re-raising concerns that were already disputed
13
+
14
+ ## Focus Areas
15
+
16
+ 1. **Spec Adherence**
17
+ - Does the implementation fulfill the spec requirements for this phase?
18
+ - Are acceptance criteria met?
19
+
20
+ 2. **Code Quality**
21
+ - Is the code readable and maintainable?
22
+ - Are there obvious bugs or issues?
23
+ - Are error cases handled appropriately?
24
+
25
+ 3. **Test Coverage**
26
+ - Are the tests adequate for this phase?
27
+ - Do tests cover the main paths AND edge cases?
28
+
29
+ 4. **Plan Alignment**
30
+ - Does the implementation follow the plan?
31
+ - Are there plan items skipped or partially completed?
32
+
33
+ 5. **UX Verification** (if spec has UX requirements)
34
+ - Does the actual user experience match what the spec describes?
35
+ - If spec says "async" or "non-blocking", is it actually async?
36
+
37
+ ## Verdict Format
38
+
39
+ After your review, provide your verdict in exactly this format:
40
+
41
+ ```
42
+ ---
43
+ VERDICT: [APPROVE | REQUEST_CHANGES | COMMENT]
44
+ SUMMARY: [One-line summary of your assessment]
45
+ CONFIDENCE: [HIGH | MEDIUM | LOW]
46
+ ---
47
+ KEY_ISSUES:
48
+ - [Issue 1 or "None"]
49
+ - [Issue 2]
50
+ ...
51
+ ```
52
+
53
+ **Verdict meanings:**
54
+ - `APPROVE`: Phase is complete, builder can proceed
55
+ - `REQUEST_CHANGES`: Issues that must be fixed before proceeding
56
+ - `COMMENT`: Minor suggestions, can proceed but note feedback
57
+
58
+ ## Scoping (Multi-Phase Plans)
59
+
60
+ When the implementation plan has multiple phases (e.g., scaffolding, landing, media_rtl):
61
+ - **ONLY review work belonging to the current plan phase**
62
+ - The query will specify which phase you are reviewing
63
+ - Do NOT request changes for functionality scheduled in later phases
64
+ - Do NOT flag missing features that are out of scope for this phase
65
+ - If unsure whether something belongs to this phase, check the plan file
66
+
67
+ ## Notes
68
+
69
+ - This is a phase-level review, not the final PR review
70
+ - Focus on "does this phase work" not "is the whole feature done"
71
+ - If referencing line numbers, use `file:line` format
72
+ - The builder needs actionable feedback to continue
@@ -0,0 +1,59 @@
1
+ # Plan Review Prompt
2
+
3
+ ## Context
4
+ You are reviewing an implementation plan during the Plan phase. The spec has been approved - now you must evaluate whether the plan adequately describes HOW to implement it.
5
+
6
+ ## Focus Areas
7
+
8
+ 1. **Spec Coverage**
9
+ - Does the plan address all requirements in the spec?
10
+ - Are there spec requirements not covered by any phase?
11
+ - Are there phases that go beyond the spec scope?
12
+
13
+ 2. **Phase Breakdown**
14
+ - Are phases appropriately sized (not too large or too small)?
15
+ - Is the sequence logical (dependencies respected)?
16
+ - Can each phase be completed and committed independently?
17
+
18
+ 3. **Technical Approach**
19
+ - Is the implementation approach sound?
20
+ - Are the right files/modules being modified?
21
+ - Are there obvious better approaches being missed?
22
+
23
+ 4. **Testability**
24
+ - Does each phase have clear test criteria?
25
+ - Will the Defend step (writing tests) be feasible?
26
+ - Are edge cases from the spec addressable?
27
+
28
+ 5. **Risk Assessment**
29
+ - Are there potential blockers not addressed?
30
+ - Are dependencies on other systems identified?
31
+ - Is the plan realistic given constraints?
32
+
33
+ ## Verdict Format
34
+
35
+ After your review, provide your verdict in exactly this format:
36
+
37
+ ```
38
+ ---
39
+ VERDICT: [APPROVE | REQUEST_CHANGES | COMMENT]
40
+ SUMMARY: [One-line summary of your assessment]
41
+ CONFIDENCE: [HIGH | MEDIUM | LOW]
42
+ ---
43
+ KEY_ISSUES:
44
+ - [Issue 1 or "None"]
45
+ - [Issue 2]
46
+ ...
47
+ ```
48
+
49
+ **Verdict meanings:**
50
+ - `APPROVE`: Plan is ready for human review
51
+ - `REQUEST_CHANGES`: Significant issues with approach or coverage
52
+ - `COMMENT`: Minor suggestions, plan is workable but could improve
53
+
54
+ ## Notes
55
+
56
+ - The spec has already been approved - don't re-litigate spec decisions
57
+ - Focus on the quality of the plan as a guide for builders
58
+ - Consider: Would a builder be able to follow this plan successfully?
59
+ - If referencing existing code, verify file paths seem accurate
@@ -0,0 +1,72 @@
1
+ # PR Ready Review Prompt
2
+
3
+ ## Context
4
+ You are performing a final self-check during the Review phase. The builder has completed all implementation phases and is about to create a PR. This is the last check before the work goes to the architect for integration review.
5
+
6
+ ## Focus Areas
7
+
8
+ 1. **Completeness**
9
+ - Are all spec requirements implemented?
10
+ - Are all plan phases complete?
11
+ - Is the review document written (`codev/reviews/XXXX-name.md`)?
12
+ - Are all commits properly formatted (`[Spec XXXX][Phase]`)?
13
+
14
+ 2. **Test Status**
15
+ - Do all tests pass?
16
+ - Is test coverage adequate for the changes?
17
+ - Are there any skipped or flaky tests?
18
+
19
+ 3. **Code Cleanliness**
20
+ - Is there any debug code left in?
21
+ - Are there any TODO comments that should be resolved?
22
+ - Are there any `// REVIEW:` comments that weren't addressed?
23
+ - Is the code properly formatted?
24
+
25
+ 4. **Documentation**
26
+ - Are inline comments clear where needed?
27
+ - Is the review document comprehensive?
28
+ - Are any new APIs documented?
29
+
30
+ 5. **PR Readiness**
31
+ - Is the branch up to date with main?
32
+ - Are commits atomic and well-described?
33
+ - Is the change diff reasonable in size?
34
+
35
+ ## Verdict Format
36
+
37
+ After your review, provide your verdict in exactly this format:
38
+
39
+ ```
40
+ ---
41
+ VERDICT: [APPROVE | REQUEST_CHANGES | COMMENT]
42
+ SUMMARY: [One-line summary of your assessment]
43
+ CONFIDENCE: [HIGH | MEDIUM | LOW]
44
+ ---
45
+ KEY_ISSUES:
46
+ - [Issue 1 or "None"]
47
+ - [Issue 2]
48
+ ...
49
+
50
+ PR_SUMMARY: |
51
+ ## Summary
52
+ [2-3 sentences describing what this PR does]
53
+
54
+ ## Key Changes
55
+ - [Change 1]
56
+ - [Change 2]
57
+
58
+ ## Test Plan
59
+ - [How to test]
60
+ ```
61
+
62
+ **Verdict meanings:**
63
+ - `APPROVE`: Ready to create PR
64
+ - `REQUEST_CHANGES`: Issues to fix before PR creation
65
+ - `COMMENT`: Minor items, can create PR but note feedback
66
+
67
+ ## Notes
68
+
69
+ - This is the builder's final self-review before hand-off
70
+ - The PR_SUMMARY in your output can be used as the PR description
71
+ - Focus on "is this ready for someone else to review" not "is this perfect"
72
+ - Any issues found here are cheaper to fix than during integration review
@@ -0,0 +1,55 @@
1
+ # Specification Review Prompt
2
+
3
+ ## Context
4
+ You are reviewing a feature specification during the Specify phase. Your role is to ensure the spec is complete, correct, and feasible before it moves to human approval.
5
+
6
+ ## Focus Areas
7
+
8
+ 1. **Completeness**
9
+ - Are all requirements clearly stated?
10
+ - Are success criteria defined?
11
+ - Are edge cases considered?
12
+ - Is scope well-bounded (not too broad or vague)?
13
+
14
+ 2. **Correctness**
15
+ - Do requirements make sense technically?
16
+ - Are there contradictions?
17
+ - Is the problem statement accurate?
18
+
19
+ 3. **Feasibility**
20
+ - Can this be implemented with available tools/constraints?
21
+ - Are there obvious technical blockers?
22
+ - Is the scope realistic for a single spec?
23
+
24
+ 4. **Clarity**
25
+ - Would a builder understand what to build?
26
+ - Are acceptance criteria testable?
27
+ - Is terminology consistent?
28
+
29
+ ## Verdict Format
30
+
31
+ After your review, provide your verdict in exactly this format:
32
+
33
+ ```
34
+ ---
35
+ VERDICT: [APPROVE | REQUEST_CHANGES | COMMENT]
36
+ SUMMARY: [One-line summary of your assessment]
37
+ CONFIDENCE: [HIGH | MEDIUM | LOW]
38
+ ---
39
+ KEY_ISSUES:
40
+ - [Issue 1 or "None"]
41
+ - [Issue 2]
42
+ ...
43
+ ```
44
+
45
+ **Verdict meanings:**
46
+ - `APPROVE`: Spec is ready for human review
47
+ - `REQUEST_CHANGES`: Significant issues must be fixed before proceeding
48
+ - `COMMENT`: Minor suggestions, can proceed but consider feedback
49
+
50
+ ## Notes
51
+
52
+ - You are NOT reviewing code - you are reviewing the specification document
53
+ - Focus on WHAT is being built, not HOW it will be implemented (that's for plan review)
54
+ - Be constructive - identify issues AND suggest solutions
55
+ - If the spec references other specs, note if context seems missing
@@ -0,0 +1,215 @@
1
+ # IMPLEMENT Phase Prompt
2
+
3
+ You are executing the **IMPLEMENT** phase of the SPIR protocol.
4
+
5
+ ## Your Goal
6
+
7
+ Write clean, well-structured code AND tests that implement the current plan phase.
8
+
9
+ ## Context
10
+
11
+ - **Project ID**: {{project_id}}
12
+ - **Project Title**: {{title}}
13
+ - **Current State**: {{current_state}}
14
+ - **Plan Phase**: {{plan_phase_id}} - {{plan_phase_title}}
15
+
16
+ ## ⚠️ SCOPE RESTRICTION — READ THIS FIRST
17
+
18
+ **You are implementing ONLY the current plan phase: {{plan_phase_id}} ({{plan_phase_title}}).**
19
+
20
+ - **DO NOT** implement other phases. Other phases will be handled in subsequent porch iterations.
21
+ - **DO NOT** read the full plan file and implement everything you see.
22
+ - The plan phase details are included below under "Current Plan Phase Details". That is your ONLY scope.
23
+ - If you need to reference the spec for requirements, read `codev/specs/{{project_id}}-*.md` but ONLY implement what the current phase requires.
24
+
25
+ ## What Happens After You Finish
26
+
27
+ When you signal `PHASE_COMPLETE`, porch will:
28
+ 1. Run 3-way consultation (Gemini, Codex, Claude) on your implementation
29
+ 2. Check that tests exist and pass
30
+ 3. If reviewers request changes, you'll be respawned with their feedback
31
+ 4. Once approved, porch commits and moves to the next plan phase
32
+
33
+ ## Spec Compliance (CRITICAL)
34
+
35
+ **The spec is the source of truth. Code that doesn't match the spec is wrong, even if it "works".**
36
+
37
+ ### Trust Hierarchy
38
+
39
+ ```
40
+ SPEC (source of truth)
41
+
42
+ PLAN (implementation guide derived from spec)
43
+
44
+ EXISTING CODE (NOT TRUSTED - must be validated against spec)
45
+ ```
46
+
47
+ **Never trust existing code over the spec.** Previous implementations may have drifted.
48
+
49
+ ### Pre-Implementation Sanity Check (PISC)
50
+
51
+ **Before writing ANY code:**
52
+
53
+ 1. ✅ "Have I read the spec in the last 30 minutes?"
54
+ 2. ✅ "If the spec has a 'Traps to Avoid' section, have I read it?"
55
+ 3. ✅ "Does my approach match the spec's Technical Implementation section?"
56
+ 4. ✅ "If the spec has code examples, am I following them?"
57
+ 5. ✅ "Does the existing code I'm building on actually match the spec?"
58
+
59
+ **If ANY answer is "no" or "unsure" → STOP and re-read the spec.**
60
+
61
+ ### Avoiding "Fixing Mode"
62
+
63
+ A dangerous pattern: You start looking at symptoms in code, making incremental fixes, copying existing patterns - without going back to the spec. This leads to:
64
+ - Cargo-culting patterns that may be wrong
65
+ - Building on broken foundations
66
+ - Implementing something different from the spec
67
+
68
+ **When you catch yourself "fixing" code:**
69
+ 1. STOP
70
+ 2. Ask: "What does the spec say about this?"
71
+ 3. Re-read the spec's Traps to Avoid section
72
+ 4. Verify existing code matches the spec before building on it
73
+
74
+ ## Prerequisites
75
+
76
+ Before implementing, verify:
77
+ 1. Previous phase (if any) is committed to git
78
+ 2. You've read the plan phase you're implementing
79
+ 3. You understand the success criteria for this phase
80
+ 4. Dependencies from earlier phases are available
81
+
82
+ ## Process
83
+
84
+ ### 1. Review the Plan Phase
85
+
86
+ Read the current phase in the plan:
87
+ - What is the objective?
88
+ - What files need to be created/modified?
89
+ - What are the success criteria?
90
+ - What dependencies exist?
91
+
92
+ ### 2. Set Up
93
+
94
+ - Verify you're on the correct branch
95
+ - Check that previous phase is committed: `git log --oneline -5`
96
+ - Ensure build passes before starting: `npm run build` (or equivalent)
97
+
98
+ ### 3. Implement the Code
99
+
100
+ Write the code following these principles:
101
+
102
+ **Code Quality Standards**:
103
+ - Self-documenting code (clear names, obvious structure)
104
+ - No commented-out code
105
+ - No debug prints in final code
106
+ - Explicit error handling
107
+ - Follow project style guide
108
+
109
+ **Implementation Approach**:
110
+ - Work on one file at a time
111
+ - Make small, incremental changes
112
+ - Document complex logic with comments
113
+
114
+ ### 4. Write Tests
115
+
116
+ **Tests are required.** For each piece of functionality you implement:
117
+
118
+ - Write unit tests for core logic
119
+ - Write integration tests if the phase involves multiple components
120
+ - Test error cases and edge conditions
121
+ - Ensure tests are deterministic (no flaky tests)
122
+
123
+ **Test file locations** (follow project conventions):
124
+ - `tests/` or `__tests__/` directories
125
+ - `*.test.ts` or `*.spec.ts` naming
126
+
127
+ ### 5. Verify Everything Works
128
+
129
+ Run both build and tests:
130
+
131
+ ```bash
132
+ npm run build # Must pass
133
+ npm test # Must pass
134
+ ```
135
+
136
+ **Important**: Don't assume these commands exist. Check `package.json` first.
137
+
138
+ Fix any errors before signaling completion.
139
+
140
+ ### 6. Self-Review
141
+
142
+ Before signaling completion:
143
+ - Read through all code changes
144
+ - Read through all test changes
145
+ - Verify code matches the spec requirements
146
+ - Ensure no accidental debug code
147
+ - Check test coverage is adequate
148
+
149
+ ## Output
150
+
151
+ When complete, you should have:
152
+ - Modified/created source files as specified in the plan phase
153
+ - Tests covering the new functionality
154
+ - All build checks passing
155
+ - All tests passing
156
+
157
+ ## Signals
158
+
159
+ When implementation AND tests are complete and passing:
160
+
161
+ ```
162
+ <signal>PHASE_COMPLETE</signal>
163
+ ```
164
+
165
+ If you encounter a blocker:
166
+
167
+ ```
168
+ <signal>BLOCKED:reason goes here</signal>
169
+ ```
170
+
171
+ If you need spec/plan clarification:
172
+
173
+ ```
174
+ <signal type=AWAITING_INPUT>
175
+ Your specific questions here
176
+ </signal>
177
+ ```
178
+
179
+ ## Important Notes
180
+
181
+ 1. **Follow the plan** - Implement what's specified, not more
182
+ 2. **Don't over-engineer** - Simplest solution that works
183
+ 3. **Don't skip error handling** - But don't go overboard either
184
+ 4. **Keep changes focused** - Only touch files in this phase
185
+ 5. **Build AND tests must pass** - Don't signal complete until both pass
186
+ 6. **Write tests** - Every implementation phase needs tests
187
+
188
+ ## What NOT to Do
189
+
190
+ - Don't modify files outside this phase's scope
191
+ - Don't add features not in the spec
192
+ - Don't leave TODO comments for later (fix now or note as blocker)
193
+ - Don't skip writing tests
194
+ - Don't use `git add .` or `git add -A` when you commit (security risk)
195
+
196
+ ## Handling Problems
197
+
198
+ **If the plan is unclear**:
199
+ Signal `AWAITING_INPUT` with your specific question.
200
+
201
+ **If you discover the spec is wrong**:
202
+ Signal `BLOCKED` and explain the issue. The Architect may need to update the spec.
203
+
204
+ **If a dependency is missing**:
205
+ Signal `BLOCKED` with details about what's missing.
206
+
207
+ **If build or tests fail and you can't fix it**:
208
+ Signal `BLOCKED` with the error message.
209
+
210
+ **If you encounter pre-existing flaky tests** (tests that fail intermittently but are unrelated to your changes):
211
+ 1. **DO NOT** edit `status.yaml` to bypass checks
212
+ 2. **DO NOT** skip porch checks or use workarounds to avoid the failure
213
+ 3. **DO** mark the flaky test as skipped with a clear annotation (e.g., `it.skip('...') // FLAKY: intermittent timeout, skipped pending investigation`)
214
+ 4. **DO** document each skipped flaky test in your review under a `## Flaky Tests` section so the team can follow up
215
+ 5. Commit the skip and continue with your work
@@ -0,0 +1,150 @@
1
+ # PLAN Phase Prompt
2
+
3
+ You are executing the **PLAN** phase of the SPIR protocol.
4
+
5
+ ## Your Goal
6
+
7
+ Transform the approved specification into an executable implementation plan with clear phases.
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
+
17
+ ## Prerequisites
18
+
19
+ Before planning, verify:
20
+ 1. The specification exists and has been approved
21
+ 2. You've read and understood the entire spec
22
+ 3. Success criteria are clear and measurable
23
+
24
+ ## Process
25
+
26
+ ### 1. Analyze the Specification
27
+
28
+ Read the spec thoroughly. Identify:
29
+ - All functional requirements
30
+ - Non-functional requirements
31
+ - Dependencies and constraints
32
+ - Success criteria to validate against
33
+
34
+ ### 2. Identify Implementation Phases
35
+
36
+ Break the work into logical phases. Each phase should be:
37
+ - **Self-contained** - A complete unit of functionality
38
+ - **Independently testable** - Can be verified on its own
39
+ - **Valuable** - Delivers observable progress
40
+ - **Committable** - Can be a single atomic commit
41
+
42
+ Good phase examples:
43
+ - "Database Schema" - Creates all tables/migrations
44
+ - "Core API Endpoints" - Implements main REST routes
45
+ - "Authentication Flow" - Handles login/logout/session
46
+
47
+ Bad phase examples:
48
+ - "Setup" - Too vague
49
+ - "Part 1" - Not descriptive
50
+ - "Everything" - Not broken down
51
+
52
+ ### 3. Define Each Phase
53
+
54
+ For each phase, document:
55
+ - **Objective** - Single clear goal
56
+ - **Files to modify/create** - Specific paths
57
+ - **Dependencies** - Which phases must complete first
58
+ - **Success criteria** - How to know it's done
59
+ - **Test approach** - What tests will verify it
60
+
61
+ ### 4. Order Phases by Dependencies
62
+
63
+ Arrange phases so dependencies are satisfied:
64
+ ```
65
+ Phase 1: Database Schema (no dependencies)
66
+ Phase 2: Data Models (depends on Phase 1)
67
+ Phase 3: API Endpoints (depends on Phase 2)
68
+ Phase 4: Frontend Integration (depends on Phase 3)
69
+ ```
70
+
71
+ ### 5. Finalize
72
+
73
+ After completing the plan 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.
74
+
75
+ ## Output
76
+
77
+ Create the plan file at `codev/plans/{{artifact_name}}.md`.
78
+
79
+ Use the plan template from `codev/protocols/spir/templates/plan.md` if available.
80
+
81
+ ### Plan Structure
82
+
83
+ ```markdown
84
+ # Implementation Plan: {{title}}
85
+
86
+ ## Overview
87
+ Brief summary of what will be implemented.
88
+
89
+ ## Phases
90
+
91
+ ### Phase 1: [Name]
92
+ - **Objective**: [Single clear goal]
93
+ - **Files**: [List of files to create/modify]
94
+ - **Dependencies**: None
95
+ - **Success Criteria**: [How to verify completion]
96
+ - **Tests**: [What tests will be written]
97
+
98
+ ### Phase 2: [Name]
99
+ - **Objective**: [Single clear goal]
100
+ - **Files**: [List of files]
101
+ - **Dependencies**: Phase 1
102
+ - **Success Criteria**: [Verification method]
103
+ - **Tests**: [Test approach]
104
+
105
+ [Continue for all phases...]
106
+
107
+ ## Risk Assessment
108
+ - [Risk 1]: [Mitigation]
109
+ - [Risk 2]: [Mitigation]
110
+
111
+ ```
112
+
113
+ ## Signals
114
+
115
+ Emit appropriate signals based on your progress:
116
+
117
+ - After completing the plan draft:
118
+ ```
119
+ <signal>PLAN_DRAFTED</signal>
120
+ ```
121
+
122
+ ## Commit Cadence
123
+
124
+ Make commits at these milestones:
125
+ 1. `[Spec {{project_id}}] Initial implementation plan`
126
+ 2. `[Spec {{project_id}}] Plan with multi-agent review`
127
+ 3. `[Spec {{project_id}}] Plan with user feedback`
128
+ 4. `[Spec {{project_id}}] Final approved plan`
129
+
130
+ **CRITICAL**: Never use `git add .` or `git add -A`. Always stage specific files:
131
+ ```bash
132
+ git add codev/plans/{{artifact_name}}.md
133
+ ```
134
+
135
+ ## Important Notes
136
+
137
+ 1. **No time estimates** - Don't include hours/days/weeks
138
+ 3. **Be specific about files** - Exact paths, not "the config file"
139
+ 4. **Keep phases small** - 1-3 files per phase is ideal
140
+ 5. **Document dependencies clearly** - Prevents blocked work
141
+
142
+ ## What NOT to Do
143
+
144
+ - Don't run `consult` commands yourself (porch handles consultations)
145
+ - Don't write code (that's for Implement phase)
146
+ - Don't estimate time (meaningless in AI development)
147
+ - Don't create phases that can't be independently tested
148
+ - Don't skip dependency analysis
149
+ - Don't make phases too large (if >5 files, split it)
150
+ - Don't use `git add .` or `git add -A` (security risk)