@laitszkin/apollo-toolkit 5.0.3 → 5.0.5
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/CHANGELOG.md +23 -0
- package/package.json +1 -1
- package/skills/design/SKILL.md +92 -54
- package/skills/design/assets/templates/CHECKLIST.md +1 -0
- package/skills/design/assets/templates/DESIGN.md +1 -0
- package/skills/docs-project/SKILL.md +23 -6
- package/skills/fix/SKILL.md +1 -1
- package/skills/implement/SKILL.md +1 -1
- package/skills/plan/SKILL.md +52 -47
- package/skills/plan/assets/templates/PROMPT.md +97 -159
- package/skills/plan/assets/templates/WORKER_PROMPT.md +92 -0
- package/skills/qa/SKILL.md +83 -57
- package/skills/qa/assets/templates/FIX.md +118 -231
- package/skills/qa/assets/templates/FIX_WORKER.md +96 -0
- package/skills/qa/assets/templates/REGTEST_WORKER.md +98 -0
- package/skills/spec/SKILL.md +40 -25
- package/skills/spec/assets/templates/SPEC.md +4 -2
|
@@ -8,14 +8,23 @@
|
|
|
8
8
|
|
|
9
9
|
---
|
|
10
10
|
|
|
11
|
-
## 1. Your Role
|
|
11
|
+
## 1. Your Role & Rules
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
[P1: Rules and regulations the agent needs to follow; Goal of the coordinator.]
|
|
14
|
+
|
|
15
|
+
### Mission
|
|
14
16
|
|
|
15
|
-
|
|
17
|
+
[One paragraph summarizing the scope, total issues, regression test count, and overall execution strategy.]
|
|
16
18
|
|
|
19
|
+
**Success looks like**: All issues in REPORT.md are fixed, all regression tests pass, full test suite passes, no regressions.
|
|
20
|
+
|
|
21
|
+
### Your Role
|
|
22
|
+
|
|
23
|
+
**You are the fix coordinator.** You do not write code. Your job is to understand the issues found in code review, delegate each fix and regression test to a worker, and verify that every issue is resolved without introducing regressions.
|
|
24
|
+
|
|
25
|
+
**What you do:**
|
|
17
26
|
- Read and understand the issue inventory, dependency analysis, and fix details below
|
|
18
|
-
- Spawn workers to execute individual fixes, giving each a self-contained prompt (provided in Section
|
|
27
|
+
- Spawn workers to execute individual fixes, giving each a self-contained prompt (provided in Section 3 Worker Prompt Index)
|
|
19
28
|
- After all fixes pass verification, spawn workers to implement regression tests
|
|
20
29
|
- Wait for all workers in a batch to complete, then digest their results
|
|
21
30
|
- Run verification commands at each checkpoint
|
|
@@ -23,8 +32,7 @@
|
|
|
23
32
|
- Handle lightweight coordination tasks: resolving merge conflicts, updating lockfiles
|
|
24
33
|
- Commit all changes in a single commit after the final verification gate passes
|
|
25
34
|
|
|
26
|
-
|
|
27
|
-
|
|
35
|
+
**What you NEVER do:**
|
|
28
36
|
- Write, edit, or modify any source-code or test file directly
|
|
29
37
|
- Skip a verification checkpoint
|
|
30
38
|
- Proceed to the next batch when the current batch has not passed verification
|
|
@@ -33,196 +41,134 @@
|
|
|
33
41
|
- Start regression tests before all fixes in scope are verified
|
|
34
42
|
- Defer any REPORT.md issue to a future round — every issue has a complete plan here
|
|
35
43
|
|
|
36
|
-
|
|
44
|
+
### Boundaries
|
|
45
|
+
|
|
46
|
+
**ALWAYS**
|
|
47
|
+
- Run gate verification immediately after every batch
|
|
48
|
+
- Extract worker prompts verbatim from `fix/*.md` files — do not rewrite them
|
|
49
|
+
- After a worker reports, digest the results before deciding next steps
|
|
50
|
+
- Fixes must not conflict with the original spec requirements
|
|
51
|
+
- Regression tests must not start before all fix batches pass
|
|
52
|
+
- Resolve merge conflicts yourself — the coordinator handles them
|
|
53
|
+
- For fixes marked as Complex: ensure the worker performs systematic debugging (reading related code, tracing execution paths) before applying the fix
|
|
54
|
+
- After each batch completes, clean up any temporary branches or worktrees created by workers
|
|
37
55
|
|
|
38
|
-
|
|
56
|
+
**ASK FIRST** — pause and confirm with the user:
|
|
57
|
+
- Fix approach conflicts with spec design intent
|
|
58
|
+
- Need to add a new external dependency
|
|
59
|
+
- Worker has failed twice
|
|
60
|
+
- Test regression cannot be quickly diagnosed
|
|
39
61
|
|
|
40
|
-
|
|
62
|
+
**NEVER**
|
|
63
|
+
- Write implementation logic or modify source code beyond resolving merge conflict markers
|
|
64
|
+
- Let workers spawn sub-workers
|
|
65
|
+
- Skip verification and proceed to the next batch
|
|
66
|
+
- Modify spec documents (unless the fix reveals a spec error — report it instead)
|
|
67
|
+
- Start regression tests before all fixes are verified
|
|
68
|
+
- Defer any REPORT.md issue to a future round
|
|
41
69
|
|
|
42
|
-
|
|
70
|
+
### Error Recovery
|
|
71
|
+
|
|
72
|
+
| Scenario | Response |
|
|
73
|
+
|---|---|
|
|
74
|
+
| Fix worker reports failure | Retry with the worker's existing context (do not create a new one), giving more specific guidance. At most one retry. |
|
|
75
|
+
| Same fix worker fails twice | Pause the entire flow. Preserve successful results from other workers in the same batch. Report to the user. |
|
|
76
|
+
| Regression test worker reports failure (test cannot pass) | Check whether the test code is wrong or the fix is incomplete. If test code is wrong, continue the worker to fix it. If the fix is incomplete, go back to the corresponding fix worker. |
|
|
77
|
+
| Regression test passes on the unfixed code | The test design is invalid — redesign the oracle and dispatch a new worker. |
|
|
78
|
+
| Merge conflicts | Coordinator resolves the conflict, then re-runs the batch gate verification. |
|
|
79
|
+
| Fix or regression test breaks existing tests | Pause. Report which test failed and which worker's change caused it. |
|
|
43
80
|
|
|
44
81
|
---
|
|
45
82
|
|
|
46
|
-
##
|
|
83
|
+
## 2. Context
|
|
47
84
|
|
|
48
|
-
|
|
49
|
-
- FIX-02 (P0, 複雜, 實作遺漏): [Brief description] — src/b.ts, src/c.ts
|
|
50
|
-
- FIX-03 (P1, 簡單, 架構瑕疵): [Brief description] — src/d.ts
|
|
85
|
+
[P2: What the agent needs to read before it starts working.]
|
|
51
86
|
|
|
52
|
-
|
|
87
|
+
### Issue Inventory
|
|
53
88
|
|
|
54
|
-
|
|
89
|
+
- FIX-01 (P0, Simple): [Brief description] — src/a.ts
|
|
90
|
+
- FIX-02 (P0, Complex): [Brief description] — src/b.ts, src/c.ts
|
|
91
|
+
- FIX-03 (P1, Simple): [Brief description] — src/d.ts
|
|
55
92
|
|
|
56
|
-
|
|
93
|
+
[All REPORT.md issues (P0–P3) listed here. The "no-defer" rule applies — every issue has a complete fix plan.]
|
|
57
94
|
|
|
95
|
+
### Fix Dependency Analysis
|
|
96
|
+
|
|
97
|
+
**Dependencies:**
|
|
58
98
|
- FIX-02 depends on FIX-01 (FIX-01 refactors the interface FIX-02 needs)
|
|
59
99
|
- FIX-03 is independent
|
|
60
100
|
- All REGTESTs depend on their corresponding FIX completing first
|
|
61
101
|
|
|
62
|
-
|
|
63
|
-
|
|
102
|
+
**File overlaps:**
|
|
64
103
|
- FIX-04, FIX-05 both modify `src/e.ts` → must be sequential
|
|
65
|
-
- FIX-01, FIX-03: no overlap → can run in parallel
|
|
104
|
+
- FIX-01, FIX-03: no overlap, no logical dependency → can run in parallel
|
|
66
105
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
## 5. Fix Details (with Regression Test Design)
|
|
106
|
+
### Fix Details (with Regression Test Design)
|
|
70
107
|
|
|
71
108
|
[Each issue's fix information + corresponding regression test design.]
|
|
72
109
|
|
|
73
|
-
|
|
110
|
+
#### FIX-01: [Issue title] (P0)
|
|
74
111
|
|
|
75
112
|
**Root cause**: [Root cause of the issue]
|
|
76
113
|
**Files involved**: `[path]` > `[functionName()]` (L[N]-[N])
|
|
77
114
|
**Fix approach**: [How to modify]
|
|
78
115
|
**Complexity**: Simple
|
|
79
116
|
|
|
80
|
-
**Regression test:** REGTEST-01 ([Unit test
|
|
117
|
+
**Regression test:** REGTEST-01 ([Unit test] → `[test/file/path.test.ts]`)
|
|
81
118
|
- GIVEN [precondition] WHEN [trigger] THEN [expected result]
|
|
82
|
-
- Oracle:
|
|
119
|
+
- Oracle: Must fail on unfixed code, pass after fix
|
|
83
120
|
|
|
84
|
-
|
|
121
|
+
#### FIX-02: [Issue title] (P0)
|
|
85
122
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
**Root cause**: [Root cause]
|
|
123
|
+
**Root cause**: [Root cause of the issue]
|
|
89
124
|
**Files involved**: `[path]` > `[functionName()]` (L[N]-[N])
|
|
90
125
|
**Fix approach**: [How to modify]
|
|
91
126
|
**Complexity**: Complex — needs systematic debug
|
|
92
127
|
|
|
93
128
|
**Regression test:** REGTEST-02 ([Integration test] → `[test/file/path.test.ts]`)
|
|
94
129
|
- GIVEN [precondition] WHEN [trigger] THEN [expected result]
|
|
95
|
-
- Oracle:
|
|
96
|
-
|
|
97
|
-
---
|
|
98
|
-
|
|
99
|
-
[Repeat the above block for each issue. If an issue cannot be automatically tested (e.g., visual-only), note manual verification steps in the regression test.]
|
|
100
|
-
|
|
101
|
-
---
|
|
102
|
-
|
|
103
|
-
## 6. Worker Prompt Library
|
|
104
|
-
|
|
105
|
-
### Fix Worker Prompts
|
|
106
|
-
|
|
107
|
-
[Each dispatchable fix task has a pre-written self-contained worker prompt.]
|
|
108
|
-
|
|
109
|
-
#### FIX-01: [Issue title]
|
|
110
|
-
|
|
111
|
-
```
|
|
112
|
-
## Mission
|
|
113
|
-
[Brief description: what to fix and why.]
|
|
114
|
-
|
|
115
|
-
## Context
|
|
116
|
-
- Review dimension: [Hallucinated code / Omission / Deviation / Architecture / Performance / Redundancy]
|
|
117
|
-
- Spec requirement: [Related SPEC requirement]
|
|
118
|
-
|
|
119
|
-
## Input
|
|
120
|
-
- Read the following files: [list]
|
|
121
|
-
|
|
122
|
-
## What to do
|
|
123
|
-
1. [Specify the exact file path, the function or line range, and what specific change to make (add/delete/modify). Example: "In src/auth/login.ts, function validateToken() (line 42-58): add a null check for the token parameter before calling decode()."]
|
|
124
|
-
2. [Repeat for each file — never leave the change description vague]
|
|
125
|
-
|
|
126
|
-
## Scope
|
|
127
|
-
- Allowed files:
|
|
128
|
-
- `[path]` — [explanation]
|
|
129
|
-
- Forbidden files:
|
|
130
|
-
- `[path]` — (belongs to another worker)
|
|
131
|
-
|
|
132
|
-
## Output
|
|
133
|
-
On completion, report:
|
|
134
|
-
- Which files were modified (absolute paths)
|
|
135
|
-
- Change summary for each file
|
|
136
|
-
- Test results (pass/fail)
|
|
137
|
-
- Any blockers or risks encountered
|
|
138
|
-
|
|
139
|
-
## Verify
|
|
140
|
-
- Run: `[command]`
|
|
141
|
-
- Expected: [what you should see]
|
|
130
|
+
- Oracle: Must fail on unfixed code, pass after fix
|
|
142
131
|
|
|
143
|
-
|
|
144
|
-
- Do not modify any file in the forbidden list
|
|
145
|
-
- Fix must not conflict with the original spec requirements
|
|
146
|
-
- Preserve existing test behavior semantics (unless the spec explicitly requires a change)
|
|
147
|
-
- Do not write regression tests — that is handled by another worker
|
|
148
|
-
- If you encounter an unexpected blocker, stop and report — do not invent alternative approaches
|
|
149
|
-
```
|
|
132
|
+
[Repeat the above block for each issue. If an issue cannot be automatically tested (e.g., visual-only), note manual verification steps in the regression test field.]
|
|
150
133
|
|
|
151
134
|
---
|
|
152
135
|
|
|
153
|
-
|
|
136
|
+
## 3. Execution Plan
|
|
154
137
|
|
|
155
|
-
|
|
138
|
+
[P3: Batch tasks — which workers to dispatch in each batch, per-batch verification gates.]
|
|
156
139
|
|
|
157
|
-
|
|
140
|
+
### Worker Prompt Index
|
|
158
141
|
|
|
159
|
-
|
|
142
|
+
[Each dispatchable fix and regression test has a pre-written self-contained worker prompt in a separate file under `fix/`. The coordinator reads the corresponding file and dispatches it without modification.]
|
|
160
143
|
|
|
161
|
-
|
|
162
|
-
## Mission
|
|
163
|
-
Create a regression test for FIX-01 ([brief description]). This test ensures the issue never reappears.
|
|
144
|
+
**Fix Worker Prompts:**
|
|
164
145
|
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
-
|
|
168
|
-
-
|
|
146
|
+
| Fix ID | Worker Prompt File | Description |
|
|
147
|
+
|---|---|---|
|
|
148
|
+
| FIX-01 | `fix/FIX-01-[name].md` | [Brief description] |
|
|
149
|
+
| FIX-02 | `fix/FIX-02-[name].md` | [Brief description] |
|
|
169
150
|
|
|
170
|
-
|
|
171
|
-
- Read fix-related files: [list]
|
|
172
|
-
- Read existing test files as format reference: `[existing test path]`
|
|
151
|
+
**Regression Test Worker Prompts:**
|
|
173
152
|
|
|
174
|
-
|
|
175
|
-
|
|
153
|
+
| Test ID | Worker Prompt File | Related Fix | Description |
|
|
154
|
+
|---|---|---|---|
|
|
155
|
+
| REGTEST-01 | `fix/REGTEST-01-[name].md` | FIX-01 | [Brief description] |
|
|
156
|
+
| REGTEST-02 | `fix/REGTEST-02-[name].md` | FIX-02 | [Brief description] |
|
|
176
157
|
|
|
177
|
-
|
|
178
|
-
- GIVEN [specific precondition and input]
|
|
179
|
-
- WHEN [specific trigger]
|
|
180
|
-
- THEN [expected output or behavior]
|
|
158
|
+
### Batch Schedule
|
|
181
159
|
|
|
182
|
-
|
|
160
|
+
*Tasks within the same batch have no file overlap and no logical dependency — they may be dispatched in parallel.*
|
|
183
161
|
|
|
184
|
-
|
|
185
|
-
- Allowed files:
|
|
186
|
-
- `[test file path]` — create/modify regression test
|
|
187
|
-
- Forbidden files:
|
|
188
|
-
- All non-test source files (fixes are handled by another worker)
|
|
189
|
-
|
|
190
|
-
## Output
|
|
191
|
-
On completion, report:
|
|
192
|
-
- The test file and test function name
|
|
193
|
-
- Test execution result (must pass)
|
|
194
|
-
- If the test cannot pass, explain why (may indicate an incomplete fix)
|
|
195
|
-
|
|
196
|
-
## Verify
|
|
197
|
-
- Run: `[test command]`
|
|
198
|
-
- Expected: REGTEST-01 passes
|
|
199
|
-
|
|
200
|
-
## Boundaries
|
|
201
|
-
- Do not modify any source code files
|
|
202
|
-
- The test must be independently executable, not dependent on external state
|
|
203
|
-
- Follow the existing test file's formatting and naming conventions
|
|
204
|
-
```
|
|
205
|
-
|
|
206
|
-
---
|
|
207
|
-
|
|
208
|
-
[Repeat the above block for each regression test worker. Multiple regressions in the same file can be merged into one worker prompt.]
|
|
209
|
-
|
|
210
|
-
---
|
|
211
|
-
|
|
212
|
-
## 7. Fix Batch Schedule
|
|
213
|
-
|
|
214
|
-
### Batch 1 — Independent P0 Fixes
|
|
162
|
+
#### Batch 1 — Independent P0 Fixes
|
|
215
163
|
|
|
216
164
|
- **Issues**: FIX-01, FIX-03
|
|
217
|
-
- **Strategy**:
|
|
165
|
+
- **Strategy**: Parallel
|
|
218
166
|
- **Gate**:
|
|
219
167
|
- [ ] FIX-01 worker reports success
|
|
220
168
|
- [ ] FIX-03 worker reports success
|
|
221
|
-
- [ ]
|
|
169
|
+
- [ ] Verification: `[command]` → [expected result]
|
|
222
170
|
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
### Batch 2 — Dependent Fixes
|
|
171
|
+
#### Batch 2 — Dependent Fixes
|
|
226
172
|
|
|
227
173
|
- **Issues**: FIX-02 → FIX-04 → FIX-05
|
|
228
174
|
- **Strategy**: Sequential (file overlap or logical dependency)
|
|
@@ -231,26 +177,25 @@ On completion, report:
|
|
|
231
177
|
- [ ] FIX-02 worker reports success
|
|
232
178
|
- [ ] FIX-04 worker reports success
|
|
233
179
|
- [ ] FIX-05 worker reports success
|
|
234
|
-
- [ ]
|
|
235
|
-
|
|
236
|
-
---
|
|
180
|
+
- [ ] Verification: `[command]` → [expected result]
|
|
237
181
|
|
|
238
|
-
|
|
182
|
+
#### Batch 3 — Regression Test Implementation
|
|
239
183
|
|
|
240
|
-
- **Tasks**: REGTEST-01, REGTEST-02, REGTEST-03
|
|
241
|
-
- **Strategy**: Parallel
|
|
184
|
+
- **Tasks**: REGTEST-01, REGTEST-02, REGTEST-03
|
|
185
|
+
- **Strategy**: Parallel (no file overlap = full parallel; overlap = sub-batches)
|
|
242
186
|
- **Depends on**: All fix batches completed
|
|
243
187
|
- **Gate**:
|
|
244
188
|
- [ ] All REGTEST workers report success
|
|
245
189
|
- [ ] All new regression tests pass
|
|
190
|
+
- [ ] Logical check: each REGTEST oracle must be "fails on unfixed code, passes after fix" — if a test also passes on unfixed code, it is not a valid regression test
|
|
246
191
|
- [ ] Existing test suite passes (confirm no regression)
|
|
247
192
|
|
|
248
|
-
|
|
193
|
+
> If property-based testing is required by the original CHECKLIST.md, implement it alongside the regression tests listed here. Property-based tests serve as additional hardening for business-logic changes.
|
|
249
194
|
|
|
250
|
-
|
|
195
|
+
#### Batch 4 — Final Integration
|
|
251
196
|
|
|
252
|
-
- **Tasks**:
|
|
253
|
-
- **Strategy**: Sequential
|
|
197
|
+
- **Tasks**: Full test suite, lint, cross-check REPORT.md
|
|
198
|
+
- **Strategy**: Sequential
|
|
254
199
|
- **Depends on**: All preceding batches
|
|
255
200
|
- **Gate**:
|
|
256
201
|
- [ ] Full test suite passes: `[command]`
|
|
@@ -259,90 +204,32 @@ On completion, report:
|
|
|
259
204
|
|
|
260
205
|
---
|
|
261
206
|
|
|
262
|
-
##
|
|
263
|
-
|
|
264
|
-
If property-based testing is required by the original CHECKLIST.md, implement it alongside the regression tests listed here. Property-based tests serve as additional hardening for business-logic changes.
|
|
265
|
-
|
|
266
|
-
- REGTEST-01 → FIX-01: [Unit] [test/unit/foo.test.ts] — GIVEN X WHEN Y THEN Z
|
|
267
|
-
- REGTEST-02 → FIX-02: [Integration] [test/integration/bar.test.ts] — GIVEN A WHEN B THEN C
|
|
268
|
-
- REGTEST-03 → FIX-03: [Unit] [test/unit/baz.test.ts] — GIVEN P WHEN Q THEN R
|
|
269
|
-
|
|
270
|
-
If there are no entries here, see Section 5 for each fix's regression test design.
|
|
271
|
-
|
|
272
|
-
---
|
|
273
|
-
|
|
274
|
-
## 9. Verification Checkpoints
|
|
275
|
-
|
|
276
|
-
### Checkpoint 1 — After fix batches complete (before regression tests)
|
|
277
|
-
- Run: `[command]`
|
|
278
|
-
- Expected: All existing tests pass, all fixes confirmed
|
|
279
|
-
|
|
280
|
-
### Checkpoint 2 — After regression tests are implemented
|
|
281
|
-
- Run: `[command]`
|
|
282
|
-
- Expected: All new regression tests pass, confirming each fix is effective
|
|
283
|
-
- Logical check: Each REGTEST oracle must be "fails on unfixed code, passes after fix" — if a test also passes on the unfixed code, it is not a valid regression test
|
|
284
|
-
|
|
285
|
-
### Checkpoint 3 — Final verification
|
|
286
|
-
- Run full test suite: `[command]`
|
|
287
|
-
- Confirm lint passes
|
|
288
|
-
- Cross-check REPORT.md: every issue resolved
|
|
289
|
-
|
|
290
|
-
---
|
|
207
|
+
## 4. Final Verification
|
|
291
208
|
|
|
292
|
-
|
|
209
|
+
[P4: Meta-checks after all batches complete. These verify completeness beyond what per-batch gates already cover.]
|
|
293
210
|
|
|
294
|
-
-
|
|
295
|
-
-
|
|
296
|
-
-
|
|
297
|
-
-
|
|
298
|
-
-
|
|
299
|
-
- **If a fix or regression test breaks existing tests**: Pause. Report which test failed and which worker's change caused it.
|
|
211
|
+
- [ ] Every issue in REPORT.md (P0–P3) has a completed fix
|
|
212
|
+
- [ ] Every fix has a regression test that passes
|
|
213
|
+
- [ ] All worker prompts in Section 3 have been dispatched and returned success
|
|
214
|
+
- [ ] Full test suite passes with no regressions
|
|
215
|
+
- [ ] All changes committed in a single commit
|
|
300
216
|
|
|
301
217
|
---
|
|
302
218
|
|
|
303
|
-
##
|
|
219
|
+
## 5. References
|
|
304
220
|
|
|
305
|
-
|
|
306
|
-
### Round N — [YYYY-MM-DD]
|
|
307
|
-
- **Issues fixed**: FIX-01, FIX-02, ... (P0:X, P1:X, P2:X, P3:X)
|
|
308
|
-
- **Outcome**: [All resolved / Partial — X issues remaining]
|
|
309
|
-
- **Key notes**: [1-2 sentence summary of important decisions or residual risks]
|
|
310
|
-
-->
|
|
221
|
+
[P5: Reference files for coordinator and workers.]
|
|
311
222
|
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
- **Project context files**: [List
|
|
317
|
-
- **Related documents**: [
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
- Run gate verification immediately after every batch
|
|
326
|
-
- Extract worker prompts verbatim from Section 6 — do not rewrite them
|
|
327
|
-
- After a worker reports, digest the results before deciding next steps
|
|
328
|
-
- Fixes must not conflict with the original spec requirements
|
|
329
|
-
- Regression tests must not start before all fix batches pass
|
|
330
|
-
- Resolve merge conflicts yourself — the coordinator handles them. This is coordination, not implementation.
|
|
331
|
-
- **For fixes marked as Complex**: ensure the worker performs systematic debugging (reading related code, tracing execution paths) before applying the fix. Do not let the worker guess the fix.
|
|
332
|
-
- **After each batch completes, clean up any temporary branches or worktrees created by workers** — no ephemeral worktree should be left orphaned.
|
|
333
|
-
|
|
334
|
-
### ASK FIRST — pause and confirm with the user
|
|
335
|
-
|
|
336
|
-
- Fix approach conflicts with spec design intent
|
|
337
|
-
- Need to add a new external dependency
|
|
338
|
-
- Worker has failed twice
|
|
339
|
-
- Test regression cannot be quickly diagnosed
|
|
340
|
-
|
|
341
|
-
### NEVER
|
|
342
|
-
|
|
343
|
-
- Write implementation logic or modify source code beyond resolving merge conflict markers
|
|
344
|
-
- Let workers spawn sub-workers
|
|
345
|
-
- Skip verification and proceed to the next batch
|
|
346
|
-
- Modify spec documents (unless the fix reveals a spec error — report it instead)
|
|
347
|
-
- Start regression tests before all fixes are verified
|
|
348
|
-
- **Defer any REPORT.md issue to a future round** — every issue has a complete fix plan in this FIX.md
|
|
223
|
+
- **Worker prompt files**: [List all `fix/*.md` files — e.g., `fix/FIX-01-*.md`, `fix/REGTEST-01-*.md`]
|
|
224
|
+
- **Code files to modify** (across all fixes and regression tests):
|
|
225
|
+
- [File path — e.g., `src/auth/login.ts`]
|
|
226
|
+
- [File path — e.g., `src/auth/logout.ts`]
|
|
227
|
+
- **Project context files**: [List project context files the fix coordinator may need — e.g., CLAUDE.md, AGENTS.md, project architecture files]
|
|
228
|
+
- **Related documents**: [Paths to source documents — e.g., the paths to REPORT.md, SPEC.md, and DESIGN.md for this spec]
|
|
229
|
+
- **Fix History**:
|
|
230
|
+
<!--
|
|
231
|
+
### Round N — [YYYY-MM-DD]
|
|
232
|
+
- **Issues fixed**: FIX-01, FIX-02, ... (P0:X, P1:X, P2:X, P3:X)
|
|
233
|
+
- **Outcome**: [All resolved / Partial — X issues remaining]
|
|
234
|
+
- **Key notes**: [1-2 sentence summary of important decisions or residual risks]
|
|
235
|
+
-->
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
# Fix Worker Prompt: FIX-{sequence}-{kebab-case-name}
|
|
2
|
+
|
|
3
|
+
- **Related issue**: [FIX ID from coordinator — e.g., FIX-01]
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## 1. Mission & Rules
|
|
8
|
+
|
|
9
|
+
[P1: Goal of this fix and behavioral rules.]
|
|
10
|
+
|
|
11
|
+
### Mission
|
|
12
|
+
|
|
13
|
+
[One sentence — which issue to fix and why.]
|
|
14
|
+
|
|
15
|
+
### Context
|
|
16
|
+
|
|
17
|
+
[Which review dimension flagged this issue, which spec requirement it relates to.]
|
|
18
|
+
|
|
19
|
+
### Rules
|
|
20
|
+
|
|
21
|
+
- Follow the Scope in Section 5 — only modify files listed as Allowed
|
|
22
|
+
- Preserve existing test semantics — do not weaken, skip, or remove existing tests
|
|
23
|
+
- If the fix approach conflicts with the original spec design intent, pause and report to the coordinator
|
|
24
|
+
- Do not add new dependencies without reporting to the coordinator first
|
|
25
|
+
- Workers are leaf nodes — do not spawn sub-workers
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
## 2. Context
|
|
30
|
+
|
|
31
|
+
[P2: Files to read before starting, root cause analysis.]
|
|
32
|
+
|
|
33
|
+
### Input Files
|
|
34
|
+
|
|
35
|
+
- [File path] — [what to read from it]
|
|
36
|
+
- [File path] — [what to read from it]
|
|
37
|
+
|
|
38
|
+
### Root Cause
|
|
39
|
+
|
|
40
|
+
[Brief description of the root cause, determined during QA analysis.]
|
|
41
|
+
|
|
42
|
+
---
|
|
43
|
+
|
|
44
|
+
## 3. Tasks
|
|
45
|
+
|
|
46
|
+
[P3: Concrete fix steps. Each entry specifies the exact file path, function or line range, and what to add/delete/modify.]
|
|
47
|
+
|
|
48
|
+
### [File path] — [what to fix]
|
|
49
|
+
|
|
50
|
+
1. Open `[file path]`
|
|
51
|
+
2. Locate `[function / class / line range]`
|
|
52
|
+
3. [Add / Modify / Delete] the following:
|
|
53
|
+
- **Before** (current code): [current code or description]
|
|
54
|
+
- **After** (fixed code): [new code or description]
|
|
55
|
+
4. [Additional step if needed]
|
|
56
|
+
|
|
57
|
+
[Repeat for each file or logical change group.]
|
|
58
|
+
|
|
59
|
+
### Output
|
|
60
|
+
|
|
61
|
+
When done, report back to the coordinator:
|
|
62
|
+
- **Files modified**: [list of files]
|
|
63
|
+
- **Change summary**: [brief description]
|
|
64
|
+
- **Test results**: [pass/fail]
|
|
65
|
+
- **Risks or concerns**: [or "None"]
|
|
66
|
+
|
|
67
|
+
---
|
|
68
|
+
|
|
69
|
+
## 4. Verification
|
|
70
|
+
|
|
71
|
+
[P4: How to confirm the fix works correctly.]
|
|
72
|
+
|
|
73
|
+
1. Run: `[command]`
|
|
74
|
+
- Expected: [result]
|
|
75
|
+
2. Run: `[command]`
|
|
76
|
+
- Expected: [result]
|
|
77
|
+
|
|
78
|
+
---
|
|
79
|
+
|
|
80
|
+
## 5. Scope & References
|
|
81
|
+
|
|
82
|
+
[P5: Allowed/forbidden files and related reference files.]
|
|
83
|
+
|
|
84
|
+
### Allowed Files
|
|
85
|
+
|
|
86
|
+
- [file path] — [reason]
|
|
87
|
+
- [file path] — [reason]
|
|
88
|
+
|
|
89
|
+
### Forbidden Files
|
|
90
|
+
|
|
91
|
+
- [file path] — [reason, e.g., "owned by another fix worker"]
|
|
92
|
+
- [file path] — [reason]
|
|
93
|
+
|
|
94
|
+
### Related Documents
|
|
95
|
+
|
|
96
|
+
- [path to SPEC.md, DESIGN.md, or relevant files]
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
# Regression Test Worker Prompt: REGTEST-{sequence}-{kebab-case-name}
|
|
2
|
+
|
|
3
|
+
- **Related fix**: FIX-{sequence} — [fix title]
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## 1. Mission & Rules
|
|
8
|
+
|
|
9
|
+
[P1: Goal of this regression test and behavioral rules.]
|
|
10
|
+
|
|
11
|
+
### Mission
|
|
12
|
+
|
|
13
|
+
[Which fix needs a regression test and why.]
|
|
14
|
+
|
|
15
|
+
### Context
|
|
16
|
+
|
|
17
|
+
[What the fix addressed — summary, root cause.]
|
|
18
|
+
|
|
19
|
+
### Rules
|
|
20
|
+
|
|
21
|
+
- Only create or modify test files — never modify source code
|
|
22
|
+
- The test must fail on the unfixed code and pass after the fix is applied — this is the core oracle
|
|
23
|
+
- Follow the existing test patterns and style of the reference test files
|
|
24
|
+
- If the test cannot be designed to fail before the fix, report to the coordinator — do not write a weak test
|
|
25
|
+
- Workers are leaf nodes — do not spawn sub-workers
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
## 2. Context
|
|
30
|
+
|
|
31
|
+
[P2: Files to read before starting, test design.]
|
|
32
|
+
|
|
33
|
+
### Input Files
|
|
34
|
+
|
|
35
|
+
- Fix-related files: [path to the fixed code — understand what was changed]
|
|
36
|
+
- Existing test files (as format reference): [path — follow the same style and patterns]
|
|
37
|
+
|
|
38
|
+
### Test Design
|
|
39
|
+
|
|
40
|
+
- **Test ID**: REGTEST-{sequence}
|
|
41
|
+
- **Type**: [Unit / Integration / E2E]
|
|
42
|
+
- **Location**: [file path where the test will be written]
|
|
43
|
+
- **Scenario**: GIVEN [precondition] WHEN [trigger] THEN [expected result]
|
|
44
|
+
- **Oracle**: Must fail on unfixed code, must pass after fix
|
|
45
|
+
|
|
46
|
+
---
|
|
47
|
+
|
|
48
|
+
## 3. Tasks
|
|
49
|
+
|
|
50
|
+
[P3: Concrete steps for writing the regression test.]
|
|
51
|
+
|
|
52
|
+
1. Create the test at `[test file path]`
|
|
53
|
+
- Write the test according to the Test Design above
|
|
54
|
+
- Follow the format and naming conventions of [reference test file]
|
|
55
|
+
2. Run the test on the unfixed code — confirm it fails
|
|
56
|
+
3. [If the fix is already applied: temporarily revert the fix, run the test to confirm failure, then restore the fix]
|
|
57
|
+
4. [Additional steps if needed]
|
|
58
|
+
|
|
59
|
+
### Output
|
|
60
|
+
|
|
61
|
+
When done, report back to the coordinator:
|
|
62
|
+
- **Test file**: [path]
|
|
63
|
+
- **Test name**: [test name or description]
|
|
64
|
+
- **Oracle confirmed**: [test fails before fix / test passes after fix]
|
|
65
|
+
- **Risks or concerns**: [or "None"]
|
|
66
|
+
|
|
67
|
+
---
|
|
68
|
+
|
|
69
|
+
## 4. Verification
|
|
70
|
+
|
|
71
|
+
[P4: How to verify the regression test is valid.]
|
|
72
|
+
|
|
73
|
+
1. Run: `[test command for the specific test]` before the fix is applied
|
|
74
|
+
- Expected: Test fails (confirming the oracle detects the bug)
|
|
75
|
+
2. Run: `[test command for the specific test]` after the fix is applied
|
|
76
|
+
- Expected: Test passes (proving the fix resolves the issue)
|
|
77
|
+
3. Run: `[relevant subset of the full test suite]`
|
|
78
|
+
- Expected: All tests pass (no regression to other tests)
|
|
79
|
+
|
|
80
|
+
---
|
|
81
|
+
|
|
82
|
+
## 5. Scope & References
|
|
83
|
+
|
|
84
|
+
[P5: Allowed/forbidden files and related references.]
|
|
85
|
+
|
|
86
|
+
### Allowed Files
|
|
87
|
+
|
|
88
|
+
- [test file path] — write the regression test here
|
|
89
|
+
- [reference test file] — use as format reference
|
|
90
|
+
|
|
91
|
+
### Forbidden Files
|
|
92
|
+
|
|
93
|
+
- All source code files (`.ts`, `.js`, `.py`, etc.) — the regression test worker must not modify source code
|
|
94
|
+
|
|
95
|
+
### Related Documents
|
|
96
|
+
|
|
97
|
+
- [path to FIX_WORKER prompt for the related fix — understand what was fixed]
|
|
98
|
+
- [path to SPEC.md or DESIGN.md — understand the expected behavior]
|