@tianhai/pi-workflow-kit 0.18.1 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +79 -62
- package/agents/pwk-hazard-reviewer.md +24 -0
- package/agents/pwk-smell-reviewer.md +17 -0
- package/agents/pwk-spec-reviewer.md +14 -0
- package/agents/pwk-tracing-reviewer.md +14 -0
- package/docs/developer-usage-guide.md +38 -44
- package/docs/lessons.md +2 -7
- package/docs/oversight-model.md +18 -14
- package/docs/workflow-phases.md +52 -29
- package/extensions/workflow-guard.ts +190 -92
- package/package.json +18 -3
- package/skills/pwk-brainstorming/SKILL.md +19 -18
- package/skills/pwk-code-review/SKILL.md +46 -0
- package/skills/pwk-diagnose/SKILL.md +2 -1
- package/skills/pwk-executing-tasks/SKILL.md +102 -328
- package/skills/pwk-finalizing/SKILL.md +36 -84
- package/skills/pwk-status/SKILL.md +28 -0
- package/skills/pwk-writing-plans/SKILL.md +50 -325
- package/docs/plans/2026-06-03-karpathy-guidelines-ab-comparison.md +0 -166
- package/docs/plans/completed/2026-04-11-checkpoint-review-gates-design.md +0 -50
- package/docs/plans/completed/2026-04-11-checkpoint-review-gates-implementation.md +0 -98
- package/docs/plans/completed/2026-04-11-finalizing-merge-options-design.md +0 -33
- package/docs/plans/completed/2026-04-11-finalizing-merge-options-implementation.md +0 -75
- package/docs/plans/completed/2026-04-11-workspace-setup-design.md +0 -28
- package/docs/plans/completed/2026-04-11-workspace-setup-implementation.md +0 -57
- package/docs/plans/completed/2026-04-15-bash-guard-design.md +0 -39
- package/docs/plans/completed/2026-04-15-bash-guard-implementation.md +0 -229
- package/docs/plans/completed/2026-04-21-workflow-guard-safe-commands-design.md +0 -172
- package/docs/plans/completed/2026-04-21-workflow-guard-safe-commands-implementation.md +0 -168
- package/docs/plans/completed/2026-04-22-go-readonly-safe-commands-implementation.md +0 -54
- package/docs/plans/completed/2026-04-28-executing-tasks-redesign-design.md +0 -171
- package/docs/plans/completed/2026-04-28-executing-tasks-redesign-implementation.md +0 -208
- package/docs/plans/completed/2026-04-28-executing-tasks-redesign-progress.md +0 -14
- package/docs/plans/completed/2026-05-01-incorporate-mattpocock-skills-design.md +0 -154
- package/docs/plans/completed/2026-05-01-incorporate-mattpocock-skills-implementation.md +0 -315
- package/docs/plans/completed/2026-05-01-incorporate-mattpocock-skills-progress.md +0 -15
- package/docs/plans/completed/2026-05-08-checkpoint-gates-design.md +0 -235
- package/docs/plans/completed/2026-05-08-checkpoint-gates-implementation.md +0 -83
- package/docs/plans/completed/2026-05-08-checkpoint-gates-progress.md +0 -11
- package/docs/plans/completed/2026-05-08-lessons-learned-design.md +0 -76
- package/docs/plans/completed/2026-05-08-lessons-learned-implementation.md +0 -219
- package/docs/plans/completed/2026-05-08-lessons-learned-progress.md +0 -15
- package/docs/plans/completed/2026-05-08-migrate-earendil-works-design.md +0 -39
- package/docs/plans/completed/2026-05-08-migrate-earendil-works-implementation.md +0 -45
- package/docs/plans/completed/2026-05-08-migrate-earendil-works-progress.md +0 -10
- package/docs/plans/completed/2026-05-08-worktree-handoff-design.md +0 -118
- package/docs/plans/completed/2026-05-08-worktree-handoff-implementation.md +0 -140
- package/docs/plans/completed/2026-05-08-worktree-handoff-progress.md +0 -10
- package/docs/plans/completed/2026-05-20-generic-lessons-design.md +0 -70
- package/docs/plans/completed/2026-05-20-generic-lessons-implementation.md +0 -114
- package/docs/plans/completed/2026-05-20-generic-lessons-progress.md +0 -11
- package/docs/plans/completed/2026-05-22-agentic-agile-enhancements-design.md +0 -77
- package/docs/plans/completed/2026-05-22-agentic-agile-enhancements-implementation.md +0 -473
- package/docs/plans/completed/2026-05-25-design-review-split-implementation.md +0 -622
- package/docs/plans/completed/2026-05-25-design-review-split-progress.md +0 -16
- package/docs/plans/completed/2026-05-25-pr5-improvements-implementation.md +0 -273
- package/docs/plans/completed/2026-05-25-pr5-improvements-progress.md +0 -17
- package/docs/plans/completed/2026-06-03-add-verify-skill-design.md +0 -51
- package/docs/plans/completed/2026-06-03-add-verify-skill-implementation.md +0 -111
- package/docs/plans/completed/2026-06-03-add-verify-skill-progress.md +0 -11
- package/docs/plans/completed/2026-06-03-verify-skill-design.md +0 -176
- package/docs/plans/completed/2026-06-09-code-review-fixes-implementation.md +0 -74
- package/docs/plans/completed/2026-06-09-code-review-fixes-progress.md +0 -14
- package/docs/plans/completed/2026-06-09-incremental-workflow-and-rename-design.md +0 -186
- package/docs/plans/completed/2026-06-09-incremental-workflow-and-rename-implementation.md +0 -675
- package/docs/plans/completed/2026-06-09-incremental-workflow-and-rename-progress.md +0 -18
- package/docs/plans/completed/2026-06-09-incremental-workflow-and-rename-verification-report.md +0 -81
- package/docs/plans/completed/2026-06-09-verification-fixes-implementation.md +0 -69
- package/docs/plans/completed/2026-06-09-verification-fixes-progress.md +0 -14
- package/skills/pwk-design-review/SKILL.md +0 -115
- package/skills/pwk-verify/SKILL.md +0 -170
|
@@ -1,315 +0,0 @@
|
|
|
1
|
-
# Implementation Plan: Incorporate mattpocock/skills Ideas
|
|
2
|
-
|
|
3
|
-
Design doc: `docs/plans/2026-05-01-incorporate-mattpocock-skills-design.md`
|
|
4
|
-
|
|
5
|
-
## Task 1: Update brainstorming skill — design it twice + ADRs
|
|
6
|
-
|
|
7
|
-
<!-- tdd: trivial -->
|
|
8
|
-
<!-- checkpoint: none -->
|
|
9
|
-
|
|
10
|
-
Edit `skills/brainstorming/SKILL.md`:
|
|
11
|
-
|
|
12
|
-
**Step 3** — change from:
|
|
13
|
-
|
|
14
|
-
```
|
|
15
|
-
3. **Explore approaches** — propose 2-3 approaches with trade-offs. Lead with your recommendation.
|
|
16
|
-
```
|
|
17
|
-
|
|
18
|
-
to:
|
|
19
|
-
|
|
20
|
-
```
|
|
21
|
-
3. **Explore approaches** — propose 2-3 approaches. For each approach, sketch the concrete interface (types, method signatures, example caller code) so the comparison is grounded in actual code, not abstract descriptions. Lead with your recommendation.
|
|
22
|
-
```
|
|
23
|
-
|
|
24
|
-
**Step 4** — change from:
|
|
25
|
-
|
|
26
|
-
```
|
|
27
|
-
4. **Present the design** — break it into sections of 200-300 words. Check after each section whether it looks right. Cover: architecture, components, data flow, error handling, testing.
|
|
28
|
-
```
|
|
29
|
-
|
|
30
|
-
to:
|
|
31
|
-
|
|
32
|
-
```
|
|
33
|
-
4. **Present the design** — break it into sections of 200-300 words. Check after each section whether it looks right. Cover: architecture, components, data flow, error handling, testing.
|
|
34
|
-
|
|
35
|
-
When a significant architectural decision is identified, offer to write a lightweight ADR to `docs/plans/adr/`. Only write an ADR when all three are true:
|
|
36
|
-
|
|
37
|
-
1. **Hard to reverse** — changing your mind later has meaningful cost
|
|
38
|
-
2. **Surprising without context** — a future reader will wonder "why?"
|
|
39
|
-
3. **A real trade-off** — there were genuine alternatives
|
|
40
|
-
|
|
41
|
-
ADR format — a title and 1-3 sentences covering context, decision, and why:
|
|
42
|
-
|
|
43
|
-
```markdown
|
|
44
|
-
# <Short title of the decision>
|
|
45
|
-
|
|
46
|
-
<1-3 sentences: context, decision, and why.>
|
|
47
|
-
```
|
|
48
|
-
|
|
49
|
-
ADRs live under `docs/plans/adr/` and are archived during finalizing alongside the design doc.
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
```bash
|
|
53
|
-
git commit -m "feat(brainstorming): add design-it-twice interface sketches and ADR output"
|
|
54
|
-
```
|
|
55
|
-
|
|
56
|
-
---
|
|
57
|
-
|
|
58
|
-
## Task 2: Update writing-plans skill — vertical slices
|
|
59
|
-
|
|
60
|
-
<!-- tdd: trivial -->
|
|
61
|
-
<!-- checkpoint: none -->
|
|
62
|
-
|
|
63
|
-
Edit `skills/writing-plans/SKILL.md` — add a new section after "## Task format" and before "## TDD in the plan":
|
|
64
|
-
|
|
65
|
-
```markdown
|
|
66
|
-
## Vertical slices
|
|
67
|
-
|
|
68
|
-
Each task should be a **vertical slice** — a thin path through ALL relevant layers end-to-end, delivering one complete piece of observable behavior.
|
|
69
|
-
|
|
70
|
-
```
|
|
71
|
-
WRONG (horizontal):
|
|
72
|
-
Task 1: Create database schema for users
|
|
73
|
-
Task 2: Write user API endpoints
|
|
74
|
-
Task 3: Build user UI components
|
|
75
|
-
Task 4: Wire everything together
|
|
76
|
-
|
|
77
|
-
RIGHT (vertical):
|
|
78
|
-
Task 1: User can sign up (model + endpoint + validation + test)
|
|
79
|
-
Task 2: User can log in (auth check + token + test)
|
|
80
|
-
Task 3: User can view profile (query + endpoint + test)
|
|
81
|
-
```
|
|
82
|
-
|
|
83
|
-
Vertical slices ensure every committed task leaves the codebase in a testable state and reduces the blast radius of a bad task.
|
|
84
|
-
```
|
|
85
|
-
|
|
86
|
-
```bash
|
|
87
|
-
git commit -m "feat(writing-plans): add vertical slice guidance with anti-pattern example"
|
|
88
|
-
```
|
|
89
|
-
|
|
90
|
-
---
|
|
91
|
-
|
|
92
|
-
## Task 3: Update executing-tasks skill — deep modules refactoring
|
|
93
|
-
|
|
94
|
-
<!-- tdd: trivial -->
|
|
95
|
-
<!-- checkpoint: none -->
|
|
96
|
-
|
|
97
|
-
Edit `skills/executing-tasks/SKILL.md` — add a new section after "## TDD discipline":
|
|
98
|
-
|
|
99
|
-
```markdown
|
|
100
|
-
## Refactoring
|
|
101
|
-
|
|
102
|
-
After all tests pass for a task, check for refactoring opportunities:
|
|
103
|
-
|
|
104
|
-
- **Shallow modules** — is the interface nearly as complex as the implementation? Can complexity be hidden behind a simpler interface?
|
|
105
|
-
- **Deletion test** — if you deleted this module, would complexity vanish (pass-through) or reappear across callers (earning its keep)?
|
|
106
|
-
- **Duplication** — extract repeated patterns
|
|
107
|
-
- **Seam discipline** — don't introduce abstraction unless something actually varies across it. One adapter = hypothetical seam. Two adapters = real seam
|
|
108
|
-
|
|
109
|
-
Run tests after each refactor step. Never refactor while tests are failing.
|
|
110
|
-
|
|
111
|
-
Key vocabulary: **depth** (lots of behavior behind a small interface), **seam** (where behavior can be altered without editing in place), **locality** (change concentrated in one place).
|
|
112
|
-
```
|
|
113
|
-
|
|
114
|
-
```bash
|
|
115
|
-
git commit -m "feat(executing-tasks): add refactoring checklist with deep modules vocabulary"
|
|
116
|
-
```
|
|
117
|
-
|
|
118
|
-
---
|
|
119
|
-
|
|
120
|
-
## Task 4: Create diagnose skill
|
|
121
|
-
|
|
122
|
-
<!-- tdd: trivial -->
|
|
123
|
-
<!-- checkpoint: none -->
|
|
124
|
-
|
|
125
|
-
Create `skills/diagnose/SKILL.md`:
|
|
126
|
-
|
|
127
|
-
```markdown
|
|
128
|
-
---
|
|
129
|
-
name: diagnose
|
|
130
|
-
description: "Disciplined debugging loop for hard bugs and performance regressions. Use when a test fails unexpectedly, a bug is found during execution, or something is broken."
|
|
131
|
-
---
|
|
132
|
-
|
|
133
|
-
# Diagnose
|
|
134
|
-
|
|
135
|
-
A 6-phase debugging discipline. Phase 1 is the skill — spend disproportionate effort here.
|
|
136
|
-
|
|
137
|
-
## Phase 1 — Build a feedback loop
|
|
138
|
-
|
|
139
|
-
Create a fast, deterministic, agent-runnable pass/fail signal for the bug before doing anything else. Try in this order: failing test, curl script, CLI invocation, headless browser script.
|
|
140
|
-
|
|
141
|
-
The loop must produce the failure mode the **user** described — not a nearby but different failure. Iterate on the loop itself: can you make it faster? Sharper? More deterministic?
|
|
142
|
-
|
|
143
|
-
If you genuinely cannot build a loop, stop and say so. List what you tried. Ask for access to a reproducing environment or a captured artifact.
|
|
144
|
-
|
|
145
|
-
Do not proceed until you have a loop you believe in.
|
|
146
|
-
|
|
147
|
-
## Phase 2 — Reproduce
|
|
148
|
-
|
|
149
|
-
Run the loop. Confirm:
|
|
150
|
-
- The failure matches the user's reported symptom
|
|
151
|
-
- The failure is reproducible across multiple runs
|
|
152
|
-
- You've captured the exact symptom (error message, wrong output, slow timing)
|
|
153
|
-
|
|
154
|
-
## Phase 3 — Hypothesise
|
|
155
|
-
|
|
156
|
-
Generate 3-5 ranked hypotheses. Each must be falsifiable:
|
|
157
|
-
|
|
158
|
-
> "If `<X>` is the cause, then `<changing Y>` will make the bug disappear / `<changing Z>` will make it worse."
|
|
159
|
-
|
|
160
|
-
Show the ranked list to the user before testing. They often have domain knowledge that re-ranks instantly.
|
|
161
|
-
|
|
162
|
-
## Phase 4 — Instrument
|
|
163
|
-
|
|
164
|
-
Each probe must map to a specific hypothesis. Change one variable at a time. Tag every debug log with a unique prefix (e.g. `[DEBUG-a4f2]`) for easy cleanup later. Prefer a debugger breakpoint over logs when available.
|
|
165
|
-
|
|
166
|
-
## Phase 5 — Fix + regression test
|
|
167
|
-
|
|
168
|
-
Write the regression test **before** the fix — but only if there's a correct seam (one that exercises the real bug pattern at the call site). If no correct seam exists, note it — the codebase architecture is preventing the bug from being locked down.
|
|
169
|
-
|
|
170
|
-
## Phase 6 — Cleanup
|
|
171
|
-
|
|
172
|
-
Required before declaring done:
|
|
173
|
-
- Original repro no longer triggers
|
|
174
|
-
- Regression test passes (or absence of seam is documented)
|
|
175
|
-
- All `[DEBUG-...]` instrumentation removed
|
|
176
|
-
- Ask: what would have prevented this bug?
|
|
177
|
-
```
|
|
178
|
-
|
|
179
|
-
```bash
|
|
180
|
-
git commit -m "feat(diagnose): add standalone debugging skill with 6-phase loop"
|
|
181
|
-
```
|
|
182
|
-
|
|
183
|
-
---
|
|
184
|
-
|
|
185
|
-
## Task 5: Update finalizing skill — archive ADRs
|
|
186
|
-
|
|
187
|
-
<!-- tdd: trivial -->
|
|
188
|
-
<!-- checkpoint: none -->
|
|
189
|
-
|
|
190
|
-
Edit `skills/finalizing/SKILL.md` — update step 1 from:
|
|
191
|
-
|
|
192
|
-
```
|
|
193
|
-
1. **Move planning docs** — archive the design, implementation, and progress docs, then commit:
|
|
194
|
-
```
|
|
195
|
-
mkdir -p docs/plans/completed
|
|
196
|
-
mv docs/plans/*-design.md docs/plans/completed/
|
|
197
|
-
mv docs/plans/*-implementation.md docs/plans/completed/
|
|
198
|
-
mv docs/plans/*-progress.md docs/plans/completed/
|
|
199
|
-
git add docs/plans/ && git commit -m "chore: archive planning docs"
|
|
200
|
-
```
|
|
201
|
-
```
|
|
202
|
-
|
|
203
|
-
to:
|
|
204
|
-
|
|
205
|
-
```
|
|
206
|
-
1. **Move planning docs** — archive the design, implementation, progress docs, and ADRs (if any), then commit:
|
|
207
|
-
```
|
|
208
|
-
mkdir -p docs/plans/completed
|
|
209
|
-
mkdir -p docs/plans/completed/adr
|
|
210
|
-
mv docs/plans/*-design.md docs/plans/completed/
|
|
211
|
-
mv docs/plans/*-implementation.md docs/plans/completed/
|
|
212
|
-
mv docs/plans/*-progress.md docs/plans/completed/
|
|
213
|
-
mv docs/plans/adr/*.md docs/plans/completed/adr/ 2>/dev/null || true
|
|
214
|
-
rmdir docs/plans/adr 2>/dev/null || true
|
|
215
|
-
git add docs/plans/ && git commit -m "chore: archive planning docs"
|
|
216
|
-
```
|
|
217
|
-
```
|
|
218
|
-
|
|
219
|
-
```bash
|
|
220
|
-
git commit -m "feat(finalizing): archive ADRs alongside planning docs"
|
|
221
|
-
```
|
|
222
|
-
|
|
223
|
-
---
|
|
224
|
-
|
|
225
|
-
## Task 6: Update documentation
|
|
226
|
-
|
|
227
|
-
<!-- tdd: trivial -->
|
|
228
|
-
<!-- checkpoint: none -->
|
|
229
|
-
|
|
230
|
-
### README.md
|
|
231
|
-
|
|
232
|
-
Update the intro line from:
|
|
233
|
-
|
|
234
|
-
```
|
|
235
|
-
**4 workflow skills** that guide the agent through a structured development process:
|
|
236
|
-
```
|
|
237
|
-
|
|
238
|
-
to:
|
|
239
|
-
|
|
240
|
-
```
|
|
241
|
-
**4 workflow skills** and **1 utility skill** that guide the agent through a structured development process:
|
|
242
|
-
```
|
|
243
|
-
|
|
244
|
-
Update the pipeline diagram from:
|
|
245
|
-
|
|
246
|
-
```
|
|
247
|
-
brainstorm → plan → execute → finalize
|
|
248
|
-
```
|
|
249
|
-
|
|
250
|
-
to:
|
|
251
|
-
|
|
252
|
-
```
|
|
253
|
-
brainstorm → plan → execute → finalize
|
|
254
|
-
↕
|
|
255
|
-
diagnose (on demand)
|
|
256
|
-
```
|
|
257
|
-
|
|
258
|
-
Add `diagnose` to the skills table:
|
|
259
|
-
|
|
260
|
-
```
|
|
261
|
-
| `diagnose` | ~35 | 6-phase debugging loop: build feedback loop, reproduce, hypothesise, instrument, fix, cleanup |
|
|
262
|
-
```
|
|
263
|
-
|
|
264
|
-
Update the Architecture section to include `diagnose/`:
|
|
265
|
-
|
|
266
|
-
```
|
|
267
|
-
├── skills/
|
|
268
|
-
│ ├── brainstorming/SKILL.md
|
|
269
|
-
│ ├── writing-plans/SKILL.md
|
|
270
|
-
│ ├── executing-tasks/SKILL.md
|
|
271
|
-
│ ├── finalizing/SKILL.md
|
|
272
|
-
│ └── diagnose/SKILL.md
|
|
273
|
-
```
|
|
274
|
-
|
|
275
|
-
### docs/developer-usage-guide.md
|
|
276
|
-
|
|
277
|
-
Add to the brainstorm section (after "Outcome"):
|
|
278
|
-
|
|
279
|
-
```
|
|
280
|
-
- Optionally writes ADRs to `docs/plans/adr/` for significant architectural decisions
|
|
281
|
-
```
|
|
282
|
-
|
|
283
|
-
Add a new section after the 4 workflow phases:
|
|
284
|
-
|
|
285
|
-
```markdown
|
|
286
|
-
### 5. Diagnose (on demand)
|
|
287
|
-
|
|
288
|
-
```
|
|
289
|
-
/skill:diagnose
|
|
290
|
-
```
|
|
291
|
-
|
|
292
|
-
A 6-phase debugging loop you invoke when something is broken. Build a feedback loop first, then reproduce, hypothesise, instrument, fix, and cleanup. Not a pipeline phase — use whenever needed.
|
|
293
|
-
```
|
|
294
|
-
|
|
295
|
-
### docs/workflow-phases.md
|
|
296
|
-
|
|
297
|
-
Add a new section at the end:
|
|
298
|
-
|
|
299
|
-
```markdown
|
|
300
|
-
## diagnose
|
|
301
|
-
|
|
302
|
-
```
|
|
303
|
-
/skill:diagnose
|
|
304
|
-
```
|
|
305
|
-
|
|
306
|
-
Not a pipeline phase. A utility skill invoked on demand when debugging is needed.
|
|
307
|
-
|
|
308
|
-
- Build a feedback loop (failing test, curl script, etc.)
|
|
309
|
-
- Reproduce, hypothesise, instrument, fix, cleanup
|
|
310
|
-
- No write restrictions (used during execute/finalize, or outside the pipeline)
|
|
311
|
-
```
|
|
312
|
-
|
|
313
|
-
```bash
|
|
314
|
-
git commit -m "docs: update README, usage guide, and workflow phases for new skills"
|
|
315
|
-
```
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
# Progress: incorporate-mattpocock-skills
|
|
2
|
-
|
|
3
|
-
Plan: docs/plans/2026-05-01-incorporate-mattpocock-skills-implementation.md
|
|
4
|
-
Branch: incorporate-mattpocock-skills
|
|
5
|
-
Started: 2026-05-01T00:00:00Z
|
|
6
|
-
Last updated: 2026-05-01T00:00:00Z
|
|
7
|
-
|
|
8
|
-
| # | Status | Task | Commit |
|
|
9
|
-
|---|--------|------|--------|
|
|
10
|
-
| 1 | ✅ done | Update brainstorming skill — design it twice + ADRs | 0231b84 |
|
|
11
|
-
| 2 | ✅ done | Update writing-plans skill — vertical slices | 22a46df |
|
|
12
|
-
| 3 | ✅ done | Update executing-tasks skill — deep modules refactoring | c405634 |
|
|
13
|
-
| 4 | ✅ done | Create diagnose skill | 5e39e2d |
|
|
14
|
-
| 5 | ✅ done | Update finalizing skill — archive ADRs | e31a1af |
|
|
15
|
-
| 6 | ✅ done | Update documentation (README, usage guide, workflow phases) | 8c1c4eb |
|
|
@@ -1,235 +0,0 @@
|
|
|
1
|
-
# Design: Checkpoint gates and pre-commit discipline
|
|
2
|
-
|
|
3
|
-
## Problem
|
|
4
|
-
|
|
5
|
-
The `executing-tasks` skill instructs the agent to pause at checkpoints for human review before committing. In practice, the agent commits first then presents the review, defeating the purpose of checkpoints.
|
|
6
|
-
|
|
7
|
-
Root causes in executing-tasks:
|
|
8
|
-
1. "PAUSE if" reads as optional — the agent interprets it as "if you remember"
|
|
9
|
-
2. Steps 6-12 flow together as implement→commit — the pause gets swallowed
|
|
10
|
-
3. The diff format asks for committed state — nudges the agent to commit first
|
|
11
|
-
|
|
12
|
-
Root causes in writing-plans:
|
|
13
|
-
4. Task format says `git commit` after each task — the agent sees the commit line past the checkpoint and skips to it
|
|
14
|
-
5. Refactor and lessons are optional-sounding steps at the end of a long list — the agent skips them
|
|
15
|
-
6. The plan body has no structural enforcement — everything is just text the agent reads at once
|
|
16
|
-
|
|
17
|
-
Secondary issue: the agent skips steps 9 (Refactor if needed) and 10 (Learn from mistakes) because they're optional-sounding steps at the end of a long list.
|
|
18
|
-
|
|
19
|
-
## Key insight
|
|
20
|
-
|
|
21
|
-
The agent follows numbered steps and skips loose sections. **Output requirements** (things the agent has to produce) are stronger than instructions (things the agent is told to do). The checkpoint review format forces the agent to report refactoring and lessons — that's the enforcement mechanism.
|
|
22
|
-
|
|
23
|
-
No-checkpoint tasks are simple enough that refactor/lessons genuinely aren't needed — the task author chose no checkpoint because the task is trivial.
|
|
24
|
-
|
|
25
|
-
## Solution
|
|
26
|
-
|
|
27
|
-
- **writing-plans**: Generate task bodies with numbered steps (including refactor/lessons for checkpointed tasks) and checkpoint gates. Never include `git commit` in the plan.
|
|
28
|
-
- **executing-tasks**: Simplified runner — follow the plan step by step, pause at checkpoint gates, commit after approval.
|
|
29
|
-
- **Progress file**: Use Status column to enforce checkpoint gates. Agent can't go from `🔄 in-progress` → `✅ done` if the task has a checkpoint — must go through `⏸ test-review` or `⏸ done-review` first.
|
|
30
|
-
|
|
31
|
-
## Design
|
|
32
|
-
|
|
33
|
-
### Writing-plans: task format
|
|
34
|
-
|
|
35
|
-
The plan never includes `git commit`. That's the executing-tasks skill's responsibility.
|
|
36
|
-
|
|
37
|
-
**No-checkpoint task:**
|
|
38
|
-
|
|
39
|
-
```markdown
|
|
40
|
-
## Task 1: Create User model
|
|
41
|
-
|
|
42
|
-
<!-- tdd: new-feature -->
|
|
43
|
-
<!-- checkpoint: none -->
|
|
44
|
-
|
|
45
|
-
Files:
|
|
46
|
-
- `src/user/model.ts`
|
|
47
|
-
- `src/user/model.test.ts`
|
|
48
|
-
|
|
49
|
-
Steps:
|
|
50
|
-
1. Write failing test for User model creation
|
|
51
|
-
2. Run test — confirm it fails
|
|
52
|
-
3. Implement User model
|
|
53
|
-
4. Run test — confirm it passes
|
|
54
|
-
```
|
|
55
|
-
|
|
56
|
-
**Checkpoint: test task:**
|
|
57
|
-
|
|
58
|
-
```markdown
|
|
59
|
-
## Task 2: Write auth tests
|
|
60
|
-
|
|
61
|
-
<!-- tdd: new-feature -->
|
|
62
|
-
<!-- checkpoint: test -->
|
|
63
|
-
|
|
64
|
-
Files:
|
|
65
|
-
- `src/auth/login.test.ts`
|
|
66
|
-
|
|
67
|
-
Steps:
|
|
68
|
-
1. Write failing test for login with valid credentials
|
|
69
|
-
2. Run test — confirm it fails
|
|
70
|
-
|
|
71
|
-
⏸ **CHECKPOINT: test** — present test review. Wait for human approval before implementing.
|
|
72
|
-
|
|
73
|
-
3. Implement login handler
|
|
74
|
-
4. Run test — confirm it passes
|
|
75
|
-
5. Refactor — check for shallow modules, duplication, seam discipline. Run tests after changes.
|
|
76
|
-
6. Lessons — caught a mistake that applies to future tasks? Add rule to `docs/lessons.md`.
|
|
77
|
-
```
|
|
78
|
-
|
|
79
|
-
**Checkpoint: done task:**
|
|
80
|
-
|
|
81
|
-
```markdown
|
|
82
|
-
## Task 3: Add login endpoint
|
|
83
|
-
|
|
84
|
-
<!-- tdd: new-feature -->
|
|
85
|
-
<!-- checkpoint: done -->
|
|
86
|
-
|
|
87
|
-
Files:
|
|
88
|
-
- `src/auth/login.ts`
|
|
89
|
-
- `src/auth/login.test.ts`
|
|
90
|
-
|
|
91
|
-
Steps:
|
|
92
|
-
1. Write failing test for login with valid credentials
|
|
93
|
-
2. Run test — confirm it fails
|
|
94
|
-
3. Implement login handler
|
|
95
|
-
4. Run test — confirm it passes
|
|
96
|
-
5. Add edge case tests (invalid password, missing email)
|
|
97
|
-
6. Refactor — check for shallow modules, duplication, seam discipline. Run tests after changes.
|
|
98
|
-
7. Lessons — caught a mistake that applies to future tasks? Add rule to `docs/lessons.md`.
|
|
99
|
-
|
|
100
|
-
⏸ **CHECKPOINT: done** — present implementation review. Wait for human approval before committing.
|
|
101
|
-
```
|
|
102
|
-
|
|
103
|
-
**Task with both checkpoints:**
|
|
104
|
-
|
|
105
|
-
```markdown
|
|
106
|
-
## Task 4: Complex auth flow
|
|
107
|
-
|
|
108
|
-
<!-- tdd: new-feature -->
|
|
109
|
-
<!-- checkpoint: test -->
|
|
110
|
-
<!-- checkpoint: done -->
|
|
111
|
-
|
|
112
|
-
Steps:
|
|
113
|
-
1. Write failing test for auth flow
|
|
114
|
-
2. Run test — confirm it fails
|
|
115
|
-
|
|
116
|
-
⏸ **CHECKPOINT: test** — present test review. Wait for human approval before implementing.
|
|
117
|
-
|
|
118
|
-
3. Implement auth flow
|
|
119
|
-
4. Run test — confirm it passes
|
|
120
|
-
5. Refactor — check for shallow modules, duplication, seam discipline. Run tests after changes.
|
|
121
|
-
6. Lessons — caught a mistake that applies to future tasks? Add rule to `docs/lessons.md`.
|
|
122
|
-
|
|
123
|
-
⏸ **CHECKPOINT: done** — present implementation review. Wait for human approval before committing.
|
|
124
|
-
```
|
|
125
|
-
|
|
126
|
-
### Writing-plans: checkpoint labels table
|
|
127
|
-
|
|
128
|
-
| Checkpoint | When to use | What the plan should say |
|
|
129
|
-
|---|---|---|
|
|
130
|
-
| *(none)* | Trivial tasks, well-understood changes | Numbered steps only |
|
|
131
|
-
| **`checkpoint: test`** | Test design matters | Steps up to test → `⏸ CHECKPOINT: test` → implement steps (including refactor/lessons) |
|
|
132
|
-
| **`checkpoint: done`** | Implementation review matters | Steps (including refactor/lessons) → `⏸ CHECKPOINT: done` |
|
|
133
|
-
| Both | Non-obvious tests AND complex logic | Steps up to test → `⏸ CHECKPOINT: test` → implement steps (including refactor/lessons) → `⏸ CHECKPOINT: done` |
|
|
134
|
-
|
|
135
|
-
### Executing-tasks: simplified runner
|
|
136
|
-
|
|
137
|
-
The per-task execution becomes:
|
|
138
|
-
|
|
139
|
-
1. Mark `🔄 in-progress` in progress file
|
|
140
|
-
2. Read the current task from the plan
|
|
141
|
-
3. Execute each numbered step in order
|
|
142
|
-
4. When hitting `⏸ CHECKPOINT` in the plan:
|
|
143
|
-
- Update progress to `⏸ test-review` or `⏸ done-review`
|
|
144
|
-
- Present the checkpoint review (see format below)
|
|
145
|
-
- Wait for human approval
|
|
146
|
-
- On approval, update progress back to `🔄 in-progress`
|
|
147
|
-
- Continue with the next step
|
|
148
|
-
5. After all steps are done (or for no-checkpoint tasks, after steps + commit):
|
|
149
|
-
- `git add` and commit with a clear message
|
|
150
|
-
- Update progress to `✅ done` + record commit hash
|
|
151
|
-
|
|
152
|
-
### Progress file: Status-enforced gates
|
|
153
|
-
|
|
154
|
-
Status values:
|
|
155
|
-
|
|
156
|
-
| Status | Meaning |
|
|
157
|
-
|--------|---------|
|
|
158
|
-
| `⬜ pending` | Not started |
|
|
159
|
-
| `🔄 in-progress` | Currently executing plan steps |
|
|
160
|
-
| `⏸ test-review` | Paused at checkpoint: test, waiting for human approval |
|
|
161
|
-
| `⏸ done-review` | Paused at checkpoint: done, waiting for human approval |
|
|
162
|
-
| `✅ done` | Committed successfully |
|
|
163
|
-
| `❌ failed` | Could not complete |
|
|
164
|
-
| `⏭ skipped` | User chose to skip |
|
|
165
|
-
|
|
166
|
-
Enforcement rules:
|
|
167
|
-
- Agent cannot go from `🔄 in-progress` → `✅ done` if the task has a checkpoint
|
|
168
|
-
- Must go through `⏸ test-review` or `⏸ done-review` first
|
|
169
|
-
- Can only return to `🔄 in-progress` after human says "approve"
|
|
170
|
-
- Can only go to `✅ done` after commit
|
|
171
|
-
|
|
172
|
-
Example progress file:
|
|
173
|
-
|
|
174
|
-
```markdown
|
|
175
|
-
# Progress: Auth feature
|
|
176
|
-
|
|
177
|
-
Plan: docs/plans/2026-05-08-auth-implementation.md
|
|
178
|
-
Branch: auth-feature
|
|
179
|
-
Started: 2026-05-08T10:00:00Z
|
|
180
|
-
Last updated: 2026-05-08T10:05:00Z
|
|
181
|
-
|
|
182
|
-
| # | Status | Task | Commit |
|
|
183
|
-
|---|--------|------|--------|
|
|
184
|
-
| 1 | ✅ done | Create User model | abc123 |
|
|
185
|
-
| 2 | ⏸ done-review | Add login endpoint (checkpoint: done) | — |
|
|
186
|
-
| 3 | ⬜ pending | Add auth middleware (checkpoint: done) | — |
|
|
187
|
-
```
|
|
188
|
-
|
|
189
|
-
### Checkpoint review format
|
|
190
|
-
|
|
191
|
-
For `checkpoint: test`:
|
|
192
|
-
|
|
193
|
-
```
|
|
194
|
-
⏸ Paused at checkpoint: test for task [N]
|
|
195
|
-
|
|
196
|
-
**Test written:** [show test code]
|
|
197
|
-
**Expected behavior:** [what this validates]
|
|
198
|
-
**Next:** Continue implementing after approval
|
|
199
|
-
|
|
200
|
-
**Available actions:**
|
|
201
|
-
- **Approve** — continue to implementation
|
|
202
|
-
- **Request changes** — describe what to change
|
|
203
|
-
- **Revert** — undo this task and mark it back to pending
|
|
204
|
-
- `skip` — skip this task
|
|
205
|
-
- `stop` — pause here, resume later with `/skill:executing-tasks`
|
|
206
|
-
```
|
|
207
|
-
|
|
208
|
-
For `checkpoint: done`:
|
|
209
|
-
|
|
210
|
-
```
|
|
211
|
-
⏸ Paused at checkpoint: done for task [N]
|
|
212
|
-
|
|
213
|
-
**What was done:** [brief summary]
|
|
214
|
-
**Refactoring done:** [what changed, or "none needed — [reason]"]
|
|
215
|
-
**Lessons learned:** [new rule added, or "none"]
|
|
216
|
-
**Diff:** [run `git diff --cached` or `git diff` — do NOT commit first]
|
|
217
|
-
**Next:** Commit after approval
|
|
218
|
-
|
|
219
|
-
**Available actions:**
|
|
220
|
-
- **Approve** — commit and move to next task
|
|
221
|
-
- **Request changes** — describe what to change
|
|
222
|
-
- **Revert** — undo this task and mark it back to pending
|
|
223
|
-
- `skip` — skip this task
|
|
224
|
-
- `stop` — pause here, resume later with `/skill:executing-tasks`
|
|
225
|
-
```
|
|
226
|
-
|
|
227
|
-
## Files to change
|
|
228
|
-
|
|
229
|
-
- `skills/writing-plans/SKILL.md` — update task format template and checkpoint labels section
|
|
230
|
-
- `skills/executing-tasks/SKILL.md` — simplify per-task execution to plan-following runner, update progress file status values
|
|
231
|
-
|
|
232
|
-
## What stays the same
|
|
233
|
-
|
|
234
|
-
- executing-tasks: Before you start, First run, Resume, User override commands, Receiving code review, If you're stuck, After all tasks — all unchanged
|
|
235
|
-
- writing-plans: Process steps, vertical slices, TDD section — all unchanged
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
# Implementation: Checkpoint gates and pre-commit discipline
|
|
2
|
-
|
|
3
|
-
Design: `docs/plans/2026-05-08-checkpoint-gates-design.md`
|
|
4
|
-
|
|
5
|
-
## Overview
|
|
6
|
-
|
|
7
|
-
Update two skill files so that:
|
|
8
|
-
1. `writing-plans` generates task bodies with checkpoint gates and numbered refactor/lessons steps, never includes `git commit`
|
|
9
|
-
2. `executing-tasks` becomes a simplified plan-following runner with status-enforced checkpoint gates
|
|
10
|
-
|
|
11
|
-
## Task 1: Update writing-plans task format and checkpoint labels
|
|
12
|
-
|
|
13
|
-
<!-- tdd: trivial -->
|
|
14
|
-
<!-- checkpoint: none -->
|
|
15
|
-
|
|
16
|
-
Files:
|
|
17
|
-
- `skills/writing-plans/SKILL.md`
|
|
18
|
-
|
|
19
|
-
Changes:
|
|
20
|
-
|
|
21
|
-
### Task format section
|
|
22
|
-
|
|
23
|
-
Replace the task format section. Key changes:
|
|
24
|
-
- Remove `git commit` from bullet points (commit is the executing-tasks skill's responsibility)
|
|
25
|
-
- Remove `<!-- checkpoint: none -->` from the default template (omit when no checkpoint)
|
|
26
|
-
- Add task body examples for each checkpoint type (none, test, done, both)
|
|
27
|
-
- For checkpointed tasks, include numbered refactor and lessons steps
|
|
28
|
-
- For checkpointed tasks, include `⏸ CHECKPOINT` gate in the task body
|
|
29
|
-
- No task body should include `git commit`
|
|
30
|
-
|
|
31
|
-
### Checkpoint labels section
|
|
32
|
-
|
|
33
|
-
Replace the checkpoint labels table. Change the last column from "What happens during execution" to "What the plan should include", showing the gate structure for each checkpoint type.
|
|
34
|
-
|
|
35
|
-
### TDD section
|
|
36
|
-
|
|
37
|
-
Remove "→ commit" from the Instructions column — commit is not part of the plan.
|
|
38
|
-
|
|
39
|
-
## Task 2: Update executing-tasks per-task execution and progress file
|
|
40
|
-
|
|
41
|
-
<!-- tdd: trivial -->
|
|
42
|
-
<!-- checkpoint: done -->
|
|
43
|
-
|
|
44
|
-
Files:
|
|
45
|
-
- `skills/executing-tasks/SKILL.md`
|
|
46
|
-
|
|
47
|
-
Changes:
|
|
48
|
-
|
|
49
|
-
### Per-task execution section
|
|
50
|
-
|
|
51
|
-
Replace the current 15-step list with a simplified plan-following runner:
|
|
52
|
-
|
|
53
|
-
1. Mark `🔄 in-progress` in progress file
|
|
54
|
-
2. Read the current task from the plan
|
|
55
|
-
3. Execute each numbered step in order
|
|
56
|
-
4. When hitting `⏸ CHECKPOINT` in the plan:
|
|
57
|
-
- Update progress to `⏸ test-review` or `⏸ done-review`
|
|
58
|
-
- Present the checkpoint review
|
|
59
|
-
- Wait for human approval
|
|
60
|
-
- On approval, update progress back to `🔄 in-progress`
|
|
61
|
-
- Continue with the next step
|
|
62
|
-
5. After all steps done:
|
|
63
|
-
- `git add` and commit with a clear message
|
|
64
|
-
- Update progress to `✅ done` + record commit hash
|
|
65
|
-
|
|
66
|
-
Remove the inline refactor/lessons steps — they're now in the plan for checkpointed tasks.
|
|
67
|
-
|
|
68
|
-
### Progress file section
|
|
69
|
-
|
|
70
|
-
Add `⏸ test-review` and `⏸ done-review` status values. Add enforcement rule: agent cannot go from `🔄 in-progress` → `✅ done` if task has a checkpoint.
|
|
71
|
-
|
|
72
|
-
### Checkpoint review section
|
|
73
|
-
|
|
74
|
-
Update `checkpoint: done` review to include:
|
|
75
|
-
- **Refactoring done:** field
|
|
76
|
-
- **Lessons learned:** field
|
|
77
|
-
- **Diff:** uses `git diff --cached` or `git diff`, with "do NOT commit first"
|
|
78
|
-
|
|
79
|
-
Simplify available actions (remove "Adjust plan" since the plan drives execution).
|
|
80
|
-
|
|
81
|
-
### Keep unchanged
|
|
82
|
-
|
|
83
|
-
- Before you start, First run, Resume, User override commands, Receiving code review, If you're stuck, After all tasks
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
# Progress: Checkpoint gates and pre-commit discipline
|
|
2
|
-
|
|
3
|
-
Plan: docs/plans/2026-05-08-checkpoint-gates-implementation.md
|
|
4
|
-
Branch: main
|
|
5
|
-
Started: 2026-05-08T20:00:00Z
|
|
6
|
-
Last updated: 2026-05-08T20:12:00Z
|
|
7
|
-
|
|
8
|
-
| # | Status | Task | Commit |
|
|
9
|
-
|---|--------|------|--------|
|
|
10
|
-
| 1 | ✅ done | Update writing-plans task format and checkpoint labels | d39510c |
|
|
11
|
-
| 2 | ✅ done | Update executing-tasks per-task execution and progress file (checkpoint: done) | 7c84f59 |
|