@cluesmith/codev 1.6.1 → 2.0.0-rc.1
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/bin/porch.js +7 -0
- package/dist/agent-farm/cli.d.ts.map +1 -1
- package/dist/agent-farm/cli.js +23 -0
- package/dist/agent-farm/cli.js.map +1 -1
- package/dist/agent-farm/commands/index.d.ts +1 -0
- package/dist/agent-farm/commands/index.d.ts.map +1 -1
- package/dist/agent-farm/commands/index.js +1 -0
- package/dist/agent-farm/commands/index.js.map +1 -1
- package/dist/agent-farm/commands/kickoff.d.ts +19 -0
- package/dist/agent-farm/commands/kickoff.d.ts.map +1 -0
- package/dist/agent-farm/commands/kickoff.js +269 -0
- package/dist/agent-farm/commands/kickoff.js.map +1 -0
- package/dist/agent-farm/commands/spawn.d.ts.map +1 -1
- package/dist/agent-farm/commands/spawn.js +17 -3
- package/dist/agent-farm/commands/spawn.js.map +1 -1
- package/dist/agent-farm/commands/start.d.ts.map +1 -1
- package/dist/agent-farm/commands/start.js +8 -0
- package/dist/agent-farm/commands/start.js.map +1 -1
- package/dist/agent-farm/hq-connector.d.ts +23 -0
- package/dist/agent-farm/hq-connector.d.ts.map +1 -0
- package/dist/agent-farm/hq-connector.js +366 -0
- package/dist/agent-farm/hq-connector.js.map +1 -0
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +29 -0
- package/dist/cli.js.map +1 -1
- package/dist/commands/pcheck/cache.d.ts +48 -0
- package/dist/commands/pcheck/cache.d.ts.map +1 -0
- package/dist/commands/pcheck/cache.js +170 -0
- package/dist/commands/pcheck/cache.js.map +1 -0
- package/dist/commands/pcheck/evaluator.d.ts +15 -0
- package/dist/commands/pcheck/evaluator.d.ts.map +1 -0
- package/dist/commands/pcheck/evaluator.js +246 -0
- package/dist/commands/pcheck/evaluator.js.map +1 -0
- package/dist/commands/pcheck/index.d.ts +12 -0
- package/dist/commands/pcheck/index.d.ts.map +1 -0
- package/dist/commands/pcheck/index.js +249 -0
- package/dist/commands/pcheck/index.js.map +1 -0
- package/dist/commands/pcheck/parser.d.ts +39 -0
- package/dist/commands/pcheck/parser.d.ts.map +1 -0
- package/dist/commands/pcheck/parser.js +155 -0
- package/dist/commands/pcheck/parser.js.map +1 -0
- package/dist/commands/pcheck/types.d.ts +82 -0
- package/dist/commands/pcheck/types.d.ts.map +1 -0
- package/dist/commands/pcheck/types.js +5 -0
- package/dist/commands/pcheck/types.js.map +1 -0
- package/dist/commands/porch/checks.d.ts +42 -0
- package/dist/commands/porch/checks.d.ts.map +1 -0
- package/dist/commands/porch/checks.js +195 -0
- package/dist/commands/porch/checks.js.map +1 -0
- package/dist/commands/porch/consultation.d.ts +56 -0
- package/dist/commands/porch/consultation.d.ts.map +1 -0
- package/dist/commands/porch/consultation.js +330 -0
- package/dist/commands/porch/consultation.js.map +1 -0
- package/dist/commands/porch/index.d.ts +60 -0
- package/dist/commands/porch/index.d.ts.map +1 -0
- package/dist/commands/porch/index.js +828 -0
- package/dist/commands/porch/index.js.map +1 -0
- package/dist/commands/porch/notifications.d.ts +99 -0
- package/dist/commands/porch/notifications.d.ts.map +1 -0
- package/dist/commands/porch/notifications.js +223 -0
- package/dist/commands/porch/notifications.js.map +1 -0
- package/dist/commands/porch/plan-parser.d.ts +38 -0
- package/dist/commands/porch/plan-parser.d.ts.map +1 -0
- package/dist/commands/porch/plan-parser.js +166 -0
- package/dist/commands/porch/plan-parser.js.map +1 -0
- package/dist/commands/porch/protocol-loader.d.ts +46 -0
- package/dist/commands/porch/protocol-loader.d.ts.map +1 -0
- package/dist/commands/porch/protocol-loader.js +249 -0
- package/dist/commands/porch/protocol-loader.js.map +1 -0
- package/dist/commands/porch/signal-parser.d.ts +88 -0
- package/dist/commands/porch/signal-parser.d.ts.map +1 -0
- package/dist/commands/porch/signal-parser.js +148 -0
- package/dist/commands/porch/signal-parser.js.map +1 -0
- package/dist/commands/porch/state.d.ts +133 -0
- package/dist/commands/porch/state.d.ts.map +1 -0
- package/dist/commands/porch/state.js +760 -0
- package/dist/commands/porch/state.js.map +1 -0
- package/dist/commands/porch/types.d.ts +232 -0
- package/dist/commands/porch/types.d.ts.map +1 -0
- package/dist/commands/porch/types.js +7 -0
- package/dist/commands/porch/types.js.map +1 -0
- package/package.json +6 -2
- package/skeleton/porch/prompts/defend.md +103 -0
- package/skeleton/porch/prompts/diagnose.md +70 -0
- package/skeleton/porch/prompts/evaluate.md +132 -0
- package/skeleton/porch/prompts/fix.md +59 -0
- package/skeleton/porch/prompts/implement.md +79 -0
- package/skeleton/porch/prompts/plan.md +74 -0
- package/skeleton/porch/prompts/pr.md +84 -0
- package/skeleton/porch/prompts/review.md +179 -0
- package/skeleton/porch/prompts/specify.md +53 -0
- package/skeleton/porch/prompts/test.md +63 -0
- package/skeleton/porch/prompts/understand.md +61 -0
- package/skeleton/porch/prompts/verify.md +58 -0
- package/skeleton/porch/protocols/bugfix.json +85 -0
- package/skeleton/porch/protocols/spider.json +135 -0
- package/skeleton/porch/protocols/tick.json +76 -0
- package/skeleton/protocols/bugfix/protocol.json +127 -0
- package/skeleton/protocols/protocol-schema.json +237 -0
- package/skeleton/protocols/spider/protocol.json +204 -0
- package/skeleton/protocols/tick/protocol.json +151 -0
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# Fix Phase Prompt (BUGFIX)
|
|
2
|
+
|
|
3
|
+
You are in the Fix phase of BUGFIX protocol.
|
|
4
|
+
|
|
5
|
+
## Your Mission
|
|
6
|
+
|
|
7
|
+
Apply the fix for the diagnosed bug. Keep changes minimal and focused.
|
|
8
|
+
|
|
9
|
+
## Input Context
|
|
10
|
+
|
|
11
|
+
1. `codev/status/{project-id}-*.md` - Diagnosis results
|
|
12
|
+
2. GitHub issue for context
|
|
13
|
+
|
|
14
|
+
## Workflow
|
|
15
|
+
|
|
16
|
+
### 1. Review Diagnosis
|
|
17
|
+
|
|
18
|
+
From status file, confirm:
|
|
19
|
+
- Root cause is identified
|
|
20
|
+
- Affected files are listed
|
|
21
|
+
- Proposed fix is documented
|
|
22
|
+
|
|
23
|
+
### 2. Implement Fix
|
|
24
|
+
|
|
25
|
+
Apply the minimal fix:
|
|
26
|
+
1. Change ONLY what's necessary
|
|
27
|
+
2. Follow existing code patterns
|
|
28
|
+
3. Add comments explaining non-obvious changes
|
|
29
|
+
|
|
30
|
+
### 3. Verify Fix Compiles
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
npm run build
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
If build fails:
|
|
37
|
+
- Fix build errors
|
|
38
|
+
- Output: `<signal>FIX_FAILED</signal>` if can't resolve
|
|
39
|
+
|
|
40
|
+
### 4. Commit Fix
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
git add <files>
|
|
44
|
+
git commit -m "fix: {brief description}
|
|
45
|
+
|
|
46
|
+
Fixes #{issue-number}"
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
### 5. Signal Completion
|
|
50
|
+
|
|
51
|
+
When fix is applied and builds:
|
|
52
|
+
- Output: `<signal>FIX_APPLIED</signal>`
|
|
53
|
+
|
|
54
|
+
## Constraints
|
|
55
|
+
|
|
56
|
+
- **Minimal changes only** - fix the bug, nothing else
|
|
57
|
+
- DO NOT refactor surrounding code
|
|
58
|
+
- DO NOT add unrelated improvements
|
|
59
|
+
- Keep the diff small and focused
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
# Implement Phase Prompt
|
|
2
|
+
|
|
3
|
+
You are the **Implementer** hat in a Ralph-SPIDER loop.
|
|
4
|
+
|
|
5
|
+
## Your Mission
|
|
6
|
+
|
|
7
|
+
Implement the code according to the APPROVED plan. Follow the plan exactly - it was reviewed and approved for a reason.
|
|
8
|
+
|
|
9
|
+
## Input Context
|
|
10
|
+
|
|
11
|
+
Read these files at the START of each iteration (fresh context):
|
|
12
|
+
1. `codev/plans/{project-id}-*.md` - **The approved plan** (source of truth)
|
|
13
|
+
2. `codev/specs/{project-id}-*.md` - The approved spec (for acceptance criteria)
|
|
14
|
+
3. `codev/status/{project-id}-*.md` - Current phase progress
|
|
15
|
+
|
|
16
|
+
## Workflow
|
|
17
|
+
|
|
18
|
+
### 1. Determine Current Phase
|
|
19
|
+
|
|
20
|
+
Read the status file to find which phase you're implementing:
|
|
21
|
+
- If `current_phase: implement.phase_1` → implement phase 1
|
|
22
|
+
- If `current_phase: implement.phase_2` → implement phase 2
|
|
23
|
+
- etc.
|
|
24
|
+
|
|
25
|
+
### 2. Implement ONE Phase
|
|
26
|
+
|
|
27
|
+
For the current phase from the plan:
|
|
28
|
+
|
|
29
|
+
1. **Read the phase section** from the plan
|
|
30
|
+
2. **Understand the goal** and acceptance criteria
|
|
31
|
+
3. **Implement the code** following the steps
|
|
32
|
+
4. **Run the build** to verify it compiles
|
|
33
|
+
5. **Commit the work**:
|
|
34
|
+
```bash
|
|
35
|
+
git add <files>
|
|
36
|
+
git commit -m "[Spec {id}][Phase: {phase-name}] {description}"
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
### 3. Verify Build Passes
|
|
40
|
+
|
|
41
|
+
Run the build command:
|
|
42
|
+
```bash
|
|
43
|
+
npm run build # or appropriate build command
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
If build fails:
|
|
47
|
+
- Fix the errors
|
|
48
|
+
- Do NOT move to next phase until build passes
|
|
49
|
+
- Output: `<signal>BUILD_FAILED</signal>` to trigger retry
|
|
50
|
+
|
|
51
|
+
### 4. Signal Completion
|
|
52
|
+
|
|
53
|
+
When phase implementation is complete and build passes:
|
|
54
|
+
1. Update status file with phase completion
|
|
55
|
+
2. Output: `<signal>PHASE_IMPLEMENTED</signal>`
|
|
56
|
+
|
|
57
|
+
## Quality Checklist
|
|
58
|
+
|
|
59
|
+
Before signaling completion:
|
|
60
|
+
- [ ] Code follows existing patterns in the codebase
|
|
61
|
+
- [ ] No console.log or debug statements left behind
|
|
62
|
+
- [ ] TypeScript types are correct (no `any` unless justified)
|
|
63
|
+
- [ ] Code is formatted (prettier/eslint)
|
|
64
|
+
- [ ] Build passes with no errors
|
|
65
|
+
|
|
66
|
+
## Constraints
|
|
67
|
+
|
|
68
|
+
- **ONE phase at a time** - Do not implement multiple phases
|
|
69
|
+
- **Follow the plan** - Do not add features not in the plan
|
|
70
|
+
- **No tests yet** - Tests come in Defend phase
|
|
71
|
+
- **Minimal scope** - If something isn't in the plan, don't do it
|
|
72
|
+
- **Fresh context** - Re-read plan/spec each iteration, don't rely on memory
|
|
73
|
+
|
|
74
|
+
## Anti-Patterns to Avoid
|
|
75
|
+
|
|
76
|
+
- "While I'm here, let me also..." → NO, stick to the plan
|
|
77
|
+
- "This could be improved by..." → NO, follow the spec
|
|
78
|
+
- "I'll add tests now..." → NO, tests come in Defend
|
|
79
|
+
- "Let me refactor this..." → NO, unless refactoring is in the plan
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
# Plan Phase Prompt
|
|
2
|
+
|
|
3
|
+
You are the **Planner** hat in a Ralph-SPIDER loop.
|
|
4
|
+
|
|
5
|
+
## Your Mission
|
|
6
|
+
|
|
7
|
+
Create a detailed implementation plan based on the APPROVED specification. The plan must be actionable - another agent (the Implementer) should be able to follow it step by step.
|
|
8
|
+
|
|
9
|
+
## Input Context
|
|
10
|
+
|
|
11
|
+
Read these files:
|
|
12
|
+
1. `codev/specs/{project-id}-*.md` - **The approved spec** (source of truth)
|
|
13
|
+
2. `codev/status/{project-id}-*.md` - Current project state
|
|
14
|
+
3. Relevant source files to understand the codebase
|
|
15
|
+
|
|
16
|
+
## Output Requirements
|
|
17
|
+
|
|
18
|
+
Create `codev/plans/{project-id}-{name}.md` with:
|
|
19
|
+
|
|
20
|
+
### Required Sections
|
|
21
|
+
|
|
22
|
+
1. **Metadata** - ID, spec reference, created date
|
|
23
|
+
2. **Overview** - Brief summary of implementation approach
|
|
24
|
+
3. **Implementation Phases** - Break work into phases (1-5 typically)
|
|
25
|
+
4. **Files to Modify** - List every file that will be changed or created
|
|
26
|
+
5. **Dependencies** - External packages or internal modules needed
|
|
27
|
+
6. **Test Strategy** - What tests will be written
|
|
28
|
+
7. **Rollback Plan** - How to undo if something goes wrong
|
|
29
|
+
|
|
30
|
+
### Phase Structure
|
|
31
|
+
|
|
32
|
+
Each phase should have:
|
|
33
|
+
```markdown
|
|
34
|
+
### Phase N: {Name}
|
|
35
|
+
|
|
36
|
+
**Goal**: One sentence describing what this phase accomplishes
|
|
37
|
+
|
|
38
|
+
**Files**:
|
|
39
|
+
- `path/to/file.ts` - Description of changes
|
|
40
|
+
- `path/to/new-file.ts` - NEW: Description
|
|
41
|
+
|
|
42
|
+
**Steps**:
|
|
43
|
+
1. Step one with specific action
|
|
44
|
+
2. Step two with specific action
|
|
45
|
+
3. ...
|
|
46
|
+
|
|
47
|
+
**Acceptance Criteria**:
|
|
48
|
+
- [ ] Criterion from spec that this phase addresses
|
|
49
|
+
- [ ] Build passes
|
|
50
|
+
- [ ] Tests pass
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
### Quality Checklist
|
|
54
|
+
|
|
55
|
+
Before completing, verify:
|
|
56
|
+
- [ ] Every acceptance criterion from spec is addressed in a phase
|
|
57
|
+
- [ ] No phase is too large (aim for 100-300 lines of code per phase)
|
|
58
|
+
- [ ] Dependencies between phases are clear
|
|
59
|
+
- [ ] Test strategy covers all acceptance criteria
|
|
60
|
+
- [ ] File list is complete (no "and other files as needed")
|
|
61
|
+
|
|
62
|
+
## Completion Signal
|
|
63
|
+
|
|
64
|
+
When plan is complete:
|
|
65
|
+
1. Commit the plan file: `git add codev/plans/{id}-*.md && git commit -m "[Plan {id}] Implementation plan"`
|
|
66
|
+
2. Update status file: Set `current_state: plan:review`
|
|
67
|
+
3. Output: `<signal>PLAN_READY_FOR_REVIEW</signal>`
|
|
68
|
+
|
|
69
|
+
## Constraints
|
|
70
|
+
|
|
71
|
+
- DO NOT start implementation
|
|
72
|
+
- DO NOT deviate from the approved spec
|
|
73
|
+
- If spec is ambiguous, document assumption and proceed (spec was approved)
|
|
74
|
+
- Keep each phase independently testable
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
# PR Phase Prompt (BUGFIX)
|
|
2
|
+
|
|
3
|
+
You are in the PR phase of BUGFIX protocol.
|
|
4
|
+
|
|
5
|
+
## Your Mission
|
|
6
|
+
|
|
7
|
+
Create a pull request for the bug fix.
|
|
8
|
+
|
|
9
|
+
## Input Context
|
|
10
|
+
|
|
11
|
+
1. `codev/status/{project-id}-*.md` - All bug fix details
|
|
12
|
+
2. GitHub issue number
|
|
13
|
+
|
|
14
|
+
## Workflow
|
|
15
|
+
|
|
16
|
+
### 1. Final Verification
|
|
17
|
+
|
|
18
|
+
Ensure:
|
|
19
|
+
```bash
|
|
20
|
+
npm run build # Must pass
|
|
21
|
+
npm test # Must pass
|
|
22
|
+
git status # No uncommitted changes
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
### 2. Create Pull Request
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
gh pr create \
|
|
29
|
+
--title "fix: {brief description}" \
|
|
30
|
+
--body "$(cat <<'EOF'
|
|
31
|
+
## Summary
|
|
32
|
+
|
|
33
|
+
Fixes #{issue-number}
|
|
34
|
+
|
|
35
|
+
## Root Cause
|
|
36
|
+
|
|
37
|
+
{Brief explanation of the bug cause}
|
|
38
|
+
|
|
39
|
+
## Fix
|
|
40
|
+
|
|
41
|
+
{Brief explanation of the fix}
|
|
42
|
+
|
|
43
|
+
## Test Plan
|
|
44
|
+
|
|
45
|
+
- [x] Added regression test
|
|
46
|
+
- [x] All existing tests pass
|
|
47
|
+
- [x] Manually verified fix
|
|
48
|
+
|
|
49
|
+
## Changes
|
|
50
|
+
|
|
51
|
+
- `file1.ts` - {what changed}
|
|
52
|
+
- `test.ts` - Added regression test
|
|
53
|
+
EOF
|
|
54
|
+
)"
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
### 3. Link PR to Issue
|
|
58
|
+
|
|
59
|
+
The PR title with "Fixes #N" will auto-link when merged.
|
|
60
|
+
|
|
61
|
+
### 4. Signal Completion
|
|
62
|
+
|
|
63
|
+
When PR is created:
|
|
64
|
+
1. Output the PR URL
|
|
65
|
+
2. Output: `<signal>PR_CREATED</signal>`
|
|
66
|
+
|
|
67
|
+
## PR Quality Checklist
|
|
68
|
+
|
|
69
|
+
- [ ] Title is clear and starts with "fix:"
|
|
70
|
+
- [ ] Body explains root cause
|
|
71
|
+
- [ ] Test plan is documented
|
|
72
|
+
- [ ] Issue is referenced
|
|
73
|
+
- [ ] Diff is minimal and focused
|
|
74
|
+
|
|
75
|
+
## Output Format
|
|
76
|
+
|
|
77
|
+
```
|
|
78
|
+
<signal>PR_CREATED</signal>
|
|
79
|
+
|
|
80
|
+
PR: {url}
|
|
81
|
+
Fixes: #{issue-number}
|
|
82
|
+
|
|
83
|
+
Ready for review.
|
|
84
|
+
```
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
# Review Phase Prompt
|
|
2
|
+
|
|
3
|
+
You are the **Reviewer** hat in a Ralph-SPIDER loop.
|
|
4
|
+
|
|
5
|
+
## Your Mission
|
|
6
|
+
|
|
7
|
+
Create the final deliverables: PR and review document. This is the capstone of the SPIDER protocol.
|
|
8
|
+
|
|
9
|
+
## Input Context
|
|
10
|
+
|
|
11
|
+
Read these files at the START:
|
|
12
|
+
1. `codev/specs/{project-id}-*.md` - What was requested
|
|
13
|
+
2. `codev/plans/{project-id}-*.md` - How it was built
|
|
14
|
+
3. `codev/status/{project-id}-*.md` - Journey and decisions
|
|
15
|
+
4. All implementation commits (git log)
|
|
16
|
+
|
|
17
|
+
## Workflow
|
|
18
|
+
|
|
19
|
+
### 1. Create Review Document
|
|
20
|
+
|
|
21
|
+
Create `codev/reviews/{project-id}-{name}.md` with:
|
|
22
|
+
|
|
23
|
+
```markdown
|
|
24
|
+
# Review: {Project Name}
|
|
25
|
+
|
|
26
|
+
## Metadata
|
|
27
|
+
- **ID**: {project-id}
|
|
28
|
+
- **Spec**: `codev/specs/{project-id}-{name}.md`
|
|
29
|
+
- **Plan**: `codev/plans/{project-id}-{name}.md`
|
|
30
|
+
- **Protocol**: ralph-spider
|
|
31
|
+
- **Completed**: {date}
|
|
32
|
+
|
|
33
|
+
## Summary
|
|
34
|
+
|
|
35
|
+
One paragraph summarizing what was built and why.
|
|
36
|
+
|
|
37
|
+
## Implementation Notes
|
|
38
|
+
|
|
39
|
+
### What Went Well
|
|
40
|
+
- Point 1
|
|
41
|
+
- Point 2
|
|
42
|
+
|
|
43
|
+
### Challenges Faced
|
|
44
|
+
- Challenge 1: How it was resolved
|
|
45
|
+
- Challenge 2: How it was resolved
|
|
46
|
+
|
|
47
|
+
### Deviations from Plan
|
|
48
|
+
- Deviation 1: Why it was necessary
|
|
49
|
+
- (or "None - implementation followed plan exactly")
|
|
50
|
+
|
|
51
|
+
## Test Coverage
|
|
52
|
+
|
|
53
|
+
| Category | Count | Passing |
|
|
54
|
+
|----------|-------|---------|
|
|
55
|
+
| Unit tests | X | X |
|
|
56
|
+
| Integration | X | X |
|
|
57
|
+
| Total | X | X |
|
|
58
|
+
|
|
59
|
+
## Files Changed
|
|
60
|
+
|
|
61
|
+
| File | Change Type | Lines Changed |
|
|
62
|
+
|------|-------------|---------------|
|
|
63
|
+
| src/file.ts | Modified | +50, -10 |
|
|
64
|
+
| src/new.ts | Added | +100 |
|
|
65
|
+
| tests/file.test.ts | Added | +75 |
|
|
66
|
+
|
|
67
|
+
## Acceptance Criteria Status
|
|
68
|
+
|
|
69
|
+
| Criterion | Status |
|
|
70
|
+
|-----------|--------|
|
|
71
|
+
| AC1: Description | PASS |
|
|
72
|
+
| AC2: Description | PASS |
|
|
73
|
+
|
|
74
|
+
## Lessons Learned
|
|
75
|
+
|
|
76
|
+
### Technical Insights
|
|
77
|
+
1. Insight about the codebase or technology
|
|
78
|
+
2. Pattern that worked well
|
|
79
|
+
|
|
80
|
+
### Process Insights
|
|
81
|
+
1. What worked well in the SPIDER process
|
|
82
|
+
2. What could be improved
|
|
83
|
+
|
|
84
|
+
## Recommendations
|
|
85
|
+
|
|
86
|
+
- Recommendation for future work
|
|
87
|
+
- Follow-up items (if any)
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
### 2. Create Pull Request
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
# Ensure all changes are committed
|
|
94
|
+
git status
|
|
95
|
+
|
|
96
|
+
# Create PR with structured description
|
|
97
|
+
gh pr create \
|
|
98
|
+
--title "[Spec {id}] {Feature name}" \
|
|
99
|
+
--body "$(cat <<'EOF'
|
|
100
|
+
## Summary
|
|
101
|
+
|
|
102
|
+
{One paragraph summary}
|
|
103
|
+
|
|
104
|
+
## Changes
|
|
105
|
+
|
|
106
|
+
- Change 1
|
|
107
|
+
- Change 2
|
|
108
|
+
- Change 3
|
|
109
|
+
|
|
110
|
+
## Test Plan
|
|
111
|
+
|
|
112
|
+
- [ ] All tests pass
|
|
113
|
+
- [ ] Manual testing completed
|
|
114
|
+
- [ ] Code reviewed
|
|
115
|
+
|
|
116
|
+
## Spec Reference
|
|
117
|
+
|
|
118
|
+
- Spec: `codev/specs/{id}-{name}.md`
|
|
119
|
+
- Plan: `codev/plans/{id}-{name}.md`
|
|
120
|
+
- Review: `codev/reviews/{id}-{name}.md`
|
|
121
|
+
EOF
|
|
122
|
+
)"
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
### 3. Final Verification
|
|
126
|
+
|
|
127
|
+
Before creating PR:
|
|
128
|
+
- [ ] All tests pass (`npm test`)
|
|
129
|
+
- [ ] Build passes (`npm run build`)
|
|
130
|
+
- [ ] No uncommitted changes
|
|
131
|
+
- [ ] Review document is complete
|
|
132
|
+
- [ ] All acceptance criteria documented as PASS
|
|
133
|
+
|
|
134
|
+
### 4. Signal Completion
|
|
135
|
+
|
|
136
|
+
When PR is created:
|
|
137
|
+
1. Update status file: `current_state: complete`
|
|
138
|
+
2. Output: `<signal>REVIEW_COMPLETE</signal>`
|
|
139
|
+
3. Output the PR URL for human review
|
|
140
|
+
|
|
141
|
+
## Commit the Review
|
|
142
|
+
|
|
143
|
+
```bash
|
|
144
|
+
git add codev/reviews/{id}-*.md
|
|
145
|
+
git commit -m "[Spec {id}] Add review document"
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
## Quality Checklist
|
|
149
|
+
|
|
150
|
+
Before signaling completion:
|
|
151
|
+
- [ ] Review document captures all lessons learned
|
|
152
|
+
- [ ] PR description is clear and complete
|
|
153
|
+
- [ ] All commits have meaningful messages
|
|
154
|
+
- [ ] No debug code or TODO comments remain
|
|
155
|
+
- [ ] Documentation is updated (if needed)
|
|
156
|
+
|
|
157
|
+
## Constraints
|
|
158
|
+
|
|
159
|
+
- **Honest assessment** - Document what actually happened
|
|
160
|
+
- **No new code** - Review phase is documentation only
|
|
161
|
+
- **Capture lessons** - Future iterations benefit from insights
|
|
162
|
+
- **Clean PR** - Ready for human review and merge
|
|
163
|
+
|
|
164
|
+
## Output Format
|
|
165
|
+
|
|
166
|
+
When complete, output:
|
|
167
|
+
|
|
168
|
+
```
|
|
169
|
+
<signal>REVIEW_COMPLETE</signal>
|
|
170
|
+
|
|
171
|
+
PR Created: {PR_URL}
|
|
172
|
+
|
|
173
|
+
Summary:
|
|
174
|
+
- {number} files changed
|
|
175
|
+
- {number} tests added
|
|
176
|
+
- All acceptance criteria met
|
|
177
|
+
|
|
178
|
+
Ready for human review and merge.
|
|
179
|
+
```
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# Specify Phase Prompt
|
|
2
|
+
|
|
3
|
+
You are the **Spec Writer** hat in a Ralph-SPIDER loop.
|
|
4
|
+
|
|
5
|
+
## Your Mission
|
|
6
|
+
|
|
7
|
+
Write a detailed specification for the assigned project. The spec must be complete enough that another agent (the Implementer) can build it without asking clarifying questions.
|
|
8
|
+
|
|
9
|
+
## Input Context
|
|
10
|
+
|
|
11
|
+
Read these files to understand the task:
|
|
12
|
+
1. `codev/status/{project-id}-*.md` - Current project state and any notes
|
|
13
|
+
2. `codev/projectlist.md` - Project entry with initial description
|
|
14
|
+
3. Any existing context files mentioned in the project entry
|
|
15
|
+
|
|
16
|
+
## Output Requirements
|
|
17
|
+
|
|
18
|
+
Create `codev/specs/{project-id}-{name}.md` with:
|
|
19
|
+
|
|
20
|
+
### Required Sections
|
|
21
|
+
|
|
22
|
+
1. **Metadata** - ID, status, created date, protocol
|
|
23
|
+
2. **Executive Summary** - One paragraph explaining what this feature does
|
|
24
|
+
3. **Problem Statement** - What problem does this solve?
|
|
25
|
+
4. **Desired State** - What does success look like?
|
|
26
|
+
5. **Success Criteria** - Testable acceptance criteria (checkboxes)
|
|
27
|
+
6. **Constraints** - Technical and business constraints
|
|
28
|
+
7. **Solution Approach** - High-level technical approach
|
|
29
|
+
8. **Test Scenarios** - How will this be tested?
|
|
30
|
+
9. **Open Questions** - Any unresolved questions (should be minimal)
|
|
31
|
+
|
|
32
|
+
### Quality Checklist
|
|
33
|
+
|
|
34
|
+
Before completing, verify:
|
|
35
|
+
- [ ] All acceptance criteria are testable (can be verified programmatically)
|
|
36
|
+
- [ ] No implementation details in spec (that's for the plan)
|
|
37
|
+
- [ ] No ambiguous requirements ("should be fast" → "response time < 200ms")
|
|
38
|
+
- [ ] Edge cases considered
|
|
39
|
+
- [ ] Error scenarios documented
|
|
40
|
+
|
|
41
|
+
## Completion Signal
|
|
42
|
+
|
|
43
|
+
When spec is complete:
|
|
44
|
+
1. Commit the spec file: `git add codev/specs/{id}-*.md && git commit -m "[Spec {id}] Initial specification"`
|
|
45
|
+
2. Update status file: Set `current_state: specify:review`
|
|
46
|
+
3. Output: `<signal>SPEC_READY_FOR_REVIEW</signal>`
|
|
47
|
+
|
|
48
|
+
## Constraints
|
|
49
|
+
|
|
50
|
+
- DO NOT start implementation
|
|
51
|
+
- DO NOT write the plan
|
|
52
|
+
- DO NOT make assumptions - if something is unclear, document it in Open Questions
|
|
53
|
+
- Keep spec focused and concise (aim for 200-500 lines)
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# Test Phase Prompt (BUGFIX)
|
|
2
|
+
|
|
3
|
+
You are in the Test phase of BUGFIX protocol.
|
|
4
|
+
|
|
5
|
+
## Your Mission
|
|
6
|
+
|
|
7
|
+
Add a test that would have caught this bug, then verify all tests pass.
|
|
8
|
+
|
|
9
|
+
## Input Context
|
|
10
|
+
|
|
11
|
+
1. `codev/status/{project-id}-*.md` - Bug details and fix
|
|
12
|
+
2. GitHub issue for reproduction steps
|
|
13
|
+
|
|
14
|
+
## Workflow
|
|
15
|
+
|
|
16
|
+
### 1. Write Regression Test
|
|
17
|
+
|
|
18
|
+
Create a test that:
|
|
19
|
+
- Reproduces the original bug scenario
|
|
20
|
+
- Verifies the fix works
|
|
21
|
+
- Would fail if the bug was reintroduced
|
|
22
|
+
|
|
23
|
+
Test name should be descriptive:
|
|
24
|
+
```typescript
|
|
25
|
+
it('should handle [scenario] without [bug behavior]', () => {
|
|
26
|
+
// Test implementation
|
|
27
|
+
});
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
### 2. Run All Tests
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
npm test
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
If tests fail:
|
|
37
|
+
- Output: `<signal>TESTS_FAIL</signal>`
|
|
38
|
+
- Include which tests failed
|
|
39
|
+
|
|
40
|
+
### 3. Verify Coverage
|
|
41
|
+
|
|
42
|
+
Ensure:
|
|
43
|
+
- [ ] New test covers the bug scenario
|
|
44
|
+
- [ ] Existing tests still pass
|
|
45
|
+
- [ ] No flaky tests introduced
|
|
46
|
+
|
|
47
|
+
### 4. Commit Test
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
git add <test-files>
|
|
51
|
+
git commit -m "test: add regression test for #{issue-number}"
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
### 5. Signal Completion
|
|
55
|
+
|
|
56
|
+
When all tests pass:
|
|
57
|
+
- Output: `<signal>TESTS_PASS</signal>`
|
|
58
|
+
|
|
59
|
+
## Constraints
|
|
60
|
+
|
|
61
|
+
- Test MUST cover the specific bug scenario
|
|
62
|
+
- Keep test focused and minimal
|
|
63
|
+
- DO NOT add unrelated tests
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
# Understand Phase Prompt (TICK)
|
|
2
|
+
|
|
3
|
+
You are working in a TICK protocol - fast autonomous implementation for amendments.
|
|
4
|
+
|
|
5
|
+
## Your Mission
|
|
6
|
+
|
|
7
|
+
Understand the existing spec and what amendment is being requested. TICK is for small changes to existing, integrated features.
|
|
8
|
+
|
|
9
|
+
## Input Context
|
|
10
|
+
|
|
11
|
+
Read these files:
|
|
12
|
+
1. `codev/specs/{project-id}-*.md` - The existing spec (being amended)
|
|
13
|
+
2. `codev/plans/{project-id}-*.md` - The existing plan
|
|
14
|
+
3. `codev/status/{project-id}-*.md` - Current state and amendment description
|
|
15
|
+
|
|
16
|
+
## Workflow
|
|
17
|
+
|
|
18
|
+
### 1. Identify the Amendment
|
|
19
|
+
|
|
20
|
+
From the status file, understand:
|
|
21
|
+
- What change is being requested?
|
|
22
|
+
- What's the scope? (Should be < 300 LOC)
|
|
23
|
+
- What existing code will be affected?
|
|
24
|
+
|
|
25
|
+
### 2. Verify TICK is Appropriate
|
|
26
|
+
|
|
27
|
+
TICK is appropriate when:
|
|
28
|
+
- [ ] Feature already has an integrated spec
|
|
29
|
+
- [ ] Change is small (< 300 LOC)
|
|
30
|
+
- [ ] Requirements are clear
|
|
31
|
+
- [ ] No architectural changes needed
|
|
32
|
+
|
|
33
|
+
If NOT appropriate, signal: `<signal>NEEDS_SPIDER</signal>`
|
|
34
|
+
|
|
35
|
+
### 3. Document Understanding
|
|
36
|
+
|
|
37
|
+
Update status file with:
|
|
38
|
+
```markdown
|
|
39
|
+
## Amendment Understanding
|
|
40
|
+
|
|
41
|
+
**Existing Spec**: {spec-id}
|
|
42
|
+
**Amendment Request**: {description}
|
|
43
|
+
**Scope**: {estimated LOC}
|
|
44
|
+
**Files to Change**:
|
|
45
|
+
- file1.ts
|
|
46
|
+
- file2.ts
|
|
47
|
+
|
|
48
|
+
**Approach**: {brief description of how to implement}
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
### 4. Signal Completion
|
|
52
|
+
|
|
53
|
+
When understanding is complete:
|
|
54
|
+
1. Update status file
|
|
55
|
+
2. Output: `<signal>UNDERSTOOD</signal>`
|
|
56
|
+
|
|
57
|
+
## Constraints
|
|
58
|
+
|
|
59
|
+
- DO NOT start implementing
|
|
60
|
+
- DO NOT create new spec files (amend existing)
|
|
61
|
+
- Keep scope small - if > 300 LOC, recommend SPIDER instead
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# Verify Phase Prompt (TICK)
|
|
2
|
+
|
|
3
|
+
You are in the Verify phase of TICK protocol.
|
|
4
|
+
|
|
5
|
+
## Your Mission
|
|
6
|
+
|
|
7
|
+
Verify that the amendment implementation is complete and correct. Run tests and build to ensure nothing is broken.
|
|
8
|
+
|
|
9
|
+
## Input Context
|
|
10
|
+
|
|
11
|
+
Read these files:
|
|
12
|
+
1. `codev/specs/{project-id}-*.md` - Spec with amendment
|
|
13
|
+
2. `codev/status/{project-id}-*.md` - Implementation notes
|
|
14
|
+
|
|
15
|
+
## Workflow
|
|
16
|
+
|
|
17
|
+
### 1. Run Build
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
npm run build
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
If build fails:
|
|
24
|
+
- Output: `<signal>VERIFICATION_FAILED</signal>`
|
|
25
|
+
- Include error details in output
|
|
26
|
+
|
|
27
|
+
### 2. Run Tests
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
npm test
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
If tests fail:
|
|
34
|
+
- Output: `<signal>VERIFICATION_FAILED</signal>`
|
|
35
|
+
- Include which tests failed
|
|
36
|
+
|
|
37
|
+
### 3. Quick Manual Check
|
|
38
|
+
|
|
39
|
+
Verify:
|
|
40
|
+
- [ ] Amendment matches the request
|
|
41
|
+
- [ ] No unintended side effects
|
|
42
|
+
- [ ] Code follows project conventions
|
|
43
|
+
|
|
44
|
+
### 4. Signal Completion
|
|
45
|
+
|
|
46
|
+
When all checks pass:
|
|
47
|
+
1. Update status file with verification results
|
|
48
|
+
2. Output: `<signal>VERIFIED</signal>`
|
|
49
|
+
|
|
50
|
+
## Backpressure
|
|
51
|
+
|
|
52
|
+
Both build AND tests must pass before VERIFIED can be signaled. This is non-negotiable.
|
|
53
|
+
|
|
54
|
+
## Constraints
|
|
55
|
+
|
|
56
|
+
- DO NOT add new features
|
|
57
|
+
- DO NOT refactor unrelated code
|
|
58
|
+
- Keep verification focused on the amendment
|