@tianhai/pi-workflow-kit 0.17.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.
Files changed (67) hide show
  1. package/README.md +91 -64
  2. package/agents/pwk-hazard-reviewer.md +24 -0
  3. package/agents/pwk-smell-reviewer.md +17 -0
  4. package/agents/pwk-spec-reviewer.md +14 -0
  5. package/agents/pwk-tracing-reviewer.md +14 -0
  6. package/docs/developer-usage-guide.md +49 -37
  7. package/docs/lessons.md +13 -0
  8. package/docs/oversight-model.md +19 -9
  9. package/docs/workflow-phases.md +58 -29
  10. package/extensions/workflow-guard.ts +190 -91
  11. package/package.json +19 -3
  12. package/skills/pwk-brainstorming/SKILL.md +60 -0
  13. package/skills/pwk-code-review/SKILL.md +46 -0
  14. package/skills/{diagnose → pwk-diagnose}/SKILL.md +3 -2
  15. package/skills/pwk-executing-tasks/SKILL.md +154 -0
  16. package/skills/pwk-finalizing/SKILL.md +78 -0
  17. package/skills/pwk-status/SKILL.md +28 -0
  18. package/skills/pwk-writing-plans/SKILL.md +83 -0
  19. package/docs/plans/2026-06-03-karpathy-guidelines-ab-comparison.md +0 -166
  20. package/docs/plans/completed/2026-04-11-checkpoint-review-gates-design.md +0 -50
  21. package/docs/plans/completed/2026-04-11-checkpoint-review-gates-implementation.md +0 -98
  22. package/docs/plans/completed/2026-04-11-finalizing-merge-options-design.md +0 -33
  23. package/docs/plans/completed/2026-04-11-finalizing-merge-options-implementation.md +0 -75
  24. package/docs/plans/completed/2026-04-11-workspace-setup-design.md +0 -28
  25. package/docs/plans/completed/2026-04-11-workspace-setup-implementation.md +0 -57
  26. package/docs/plans/completed/2026-04-15-bash-guard-design.md +0 -39
  27. package/docs/plans/completed/2026-04-15-bash-guard-implementation.md +0 -229
  28. package/docs/plans/completed/2026-04-21-workflow-guard-safe-commands-design.md +0 -172
  29. package/docs/plans/completed/2026-04-21-workflow-guard-safe-commands-implementation.md +0 -168
  30. package/docs/plans/completed/2026-04-22-go-readonly-safe-commands-implementation.md +0 -54
  31. package/docs/plans/completed/2026-04-28-executing-tasks-redesign-design.md +0 -171
  32. package/docs/plans/completed/2026-04-28-executing-tasks-redesign-implementation.md +0 -208
  33. package/docs/plans/completed/2026-04-28-executing-tasks-redesign-progress.md +0 -14
  34. package/docs/plans/completed/2026-05-01-incorporate-mattpocock-skills-design.md +0 -154
  35. package/docs/plans/completed/2026-05-01-incorporate-mattpocock-skills-implementation.md +0 -315
  36. package/docs/plans/completed/2026-05-01-incorporate-mattpocock-skills-progress.md +0 -15
  37. package/docs/plans/completed/2026-05-08-checkpoint-gates-design.md +0 -235
  38. package/docs/plans/completed/2026-05-08-checkpoint-gates-implementation.md +0 -83
  39. package/docs/plans/completed/2026-05-08-checkpoint-gates-progress.md +0 -11
  40. package/docs/plans/completed/2026-05-08-lessons-learned-design.md +0 -76
  41. package/docs/plans/completed/2026-05-08-lessons-learned-implementation.md +0 -219
  42. package/docs/plans/completed/2026-05-08-lessons-learned-progress.md +0 -15
  43. package/docs/plans/completed/2026-05-08-migrate-earendil-works-design.md +0 -39
  44. package/docs/plans/completed/2026-05-08-migrate-earendil-works-implementation.md +0 -45
  45. package/docs/plans/completed/2026-05-08-migrate-earendil-works-progress.md +0 -10
  46. package/docs/plans/completed/2026-05-08-worktree-handoff-design.md +0 -118
  47. package/docs/plans/completed/2026-05-08-worktree-handoff-implementation.md +0 -140
  48. package/docs/plans/completed/2026-05-08-worktree-handoff-progress.md +0 -10
  49. package/docs/plans/completed/2026-05-20-generic-lessons-design.md +0 -70
  50. package/docs/plans/completed/2026-05-20-generic-lessons-implementation.md +0 -114
  51. package/docs/plans/completed/2026-05-20-generic-lessons-progress.md +0 -11
  52. package/docs/plans/completed/2026-05-22-agentic-agile-enhancements-design.md +0 -77
  53. package/docs/plans/completed/2026-05-22-agentic-agile-enhancements-implementation.md +0 -473
  54. package/docs/plans/completed/2026-05-25-design-review-split-implementation.md +0 -622
  55. package/docs/plans/completed/2026-05-25-design-review-split-progress.md +0 -16
  56. package/docs/plans/completed/2026-05-25-pr5-improvements-implementation.md +0 -273
  57. package/docs/plans/completed/2026-05-25-pr5-improvements-progress.md +0 -17
  58. package/docs/plans/completed/2026-06-03-add-verify-skill-design.md +0 -51
  59. package/docs/plans/completed/2026-06-03-add-verify-skill-implementation.md +0 -111
  60. package/docs/plans/completed/2026-06-03-add-verify-skill-progress.md +0 -11
  61. package/docs/plans/completed/2026-06-03-verify-skill-design.md +0 -176
  62. package/skills/brainstorming/SKILL.md +0 -48
  63. package/skills/design-review/SKILL.md +0 -113
  64. package/skills/executing-tasks/SKILL.md +0 -350
  65. package/skills/finalizing/SKILL.md +0 -119
  66. package/skills/verify/SKILL.md +0 -170
  67. package/skills/writing-plans/SKILL.md +0 -343
@@ -1,208 +0,0 @@
1
- # Implementation Plan: Executing Tasks Redesign
2
-
3
- **Design:** `docs/plans/2026-04-28-executing-tasks-redesign-design.md`
4
-
5
- ## Task 1: Rewrite executing-tasks skill — progress file and startup flow
6
-
7
- <!-- tdd: modifying-tested-code -->
8
- <!-- checkpoint: done -->
9
-
10
- Rewrite `skills/executing-tasks/SKILL.md` with the new startup and resume logic.
11
-
12
- **File to modify:** `/Users/yinlootan/.nvm/versions/node/v22.16.0/lib/node_modules/@tianhai/pi-workflow-kit/skills/executing-tasks/SKILL.md`
13
-
14
- Replace the entire file with the new skill content. The new skill has these sections:
15
-
16
- 1. **Startup flow** — check git state, find the implementation plan (glob `docs/plans/*-implementation.md`), check for existing progress file (`docs/plans/*-progress.md`)
17
- 2. **First run** — parse the implementation plan for `## Task N:` headings, create a progress file with all tasks as `⬜ pending`, then proceed to workspace isolation and task execution
18
- 3. **Resume** — read the progress file, find the first `⬜ pending`, `❌ failed`, or `🔄 in-progress` task, and continue from there
19
- 4. **Mid-task crash recovery** — if a task is `🔄 in-progress`, check `git log` since the last `✅ done` task's commit. If commits exist, ask the user to verify. If no commits, restart the task
20
- 5. **Workspace isolation** — keep the existing branch/worktree suggestion logic (unchanged from current skill)
21
- 6. **Commit plan docs** — keep the existing logic to commit uncommitted plan files on the new branch
22
-
23
- The frontmatter stays:
24
- ```
25
- ---
26
- name: executing-tasks
27
- description: "Use this to implement an approved plan task-by-task. Run after writing-plans, before finalizing."
28
- ---
29
- ```
30
-
31
- The progress file format section should include the full table structure and all 5 status values (`⬜ pending`, `🔄 in-progress`, `✅ done`, `❌ failed`, `⏭ skipped`).
32
-
33
- After editing, verify by reading the file back. No tests needed — this is a markdown skill file.
34
-
35
- ```
36
- git add skills/executing-tasks/SKILL.md
37
- git commit -m "rewrite(executing-tasks): progress file, startup flow, and resume logic"
38
- ```
39
-
40
- ## Task 2: Add per-task execution, batching, and session management to executing-tasks
41
-
42
- <!-- tdd: modifying-tested-code -->
43
- <!-- checkpoint: done -->
44
-
45
- Continue building on the rewritten skill file. Add the per-task execution sections.
46
-
47
- **File to modify:** `/Users/yinlootan/.nvm/versions/node/v22.16.0/lib/node_modules/@tianhai/pi-workflow-kit/skills/executing-tasks/SKILL.md`
48
-
49
- Add these sections after the startup flow (append or integrate into the existing file from task 1):
50
-
51
- ### Per-task execution
52
-
53
- For each task the agent works on:
54
- 1. Mark task `🔄 in-progress` in the progress file
55
- 2. Read only the relevant `## Task N:` section from the implementation plan (not the whole file)
56
- 3. Implement following the existing TDD discipline and checkpoint logic (keep the current `checkpoint: test` and `checkpoint: done` flows verbatim)
57
- 4. After commit: update progress file with `✅ done` + commit hash
58
- 5. Check the next task:
59
- - **Has checkpoint** → pause for review
60
- - **No checkpoint** → continue to the next task in the same session
61
-
62
- ### Batching and /new suggestions
63
-
64
- After completing ~3-5 non-checkpoint tasks in the same session, the agent should suggest a fresh session with this output format:
65
-
66
- ```
67
- ✅ Tasks 3-5 done (commits: a1b2, e4f5, i7j8)
68
-
69
- Progress: 5/10 tasks done
70
-
71
- ⏭ Next: Task 6 — Add auth middleware (no checkpoint)
72
-
73
- 💡 Context is building up. For clean context on remaining tasks:
74
- /new then /skill:executing-tasks
75
- (or just say "continue" to keep going here)
76
- ```
77
-
78
- The user can say "continue" to keep going in the same session.
79
-
80
- ### User override commands
81
-
82
- Add a section for commands the user can issue at any time:
83
-
84
- | User says | Agent does |
85
- |-----------|-----------|
86
- | `skip` | Mark current task `⏭ skipped`, move to next |
87
- | `status` | Show the progress table |
88
- | `stop` | Mark current task back to `⬜ pending`, suggest `/new` |
89
- | `retry` | Re-read current task section, start over |
90
-
91
- ### After all tasks
92
-
93
- When no `⬜ pending` or `❌ failed` tasks remain, show a summary and suggest `/skill:finalizing`.
94
-
95
- Keep the existing "Receiving code review" and "If you're stuck" sections from the current skill — they're still useful.
96
-
97
- After editing, verify by reading the file back.
98
-
99
- ```
100
- git add skills/executing-tasks/SKILL.md
101
- git commit -m "feat(executing-tasks): add per-task batching, session management, and user commands"
102
- ```
103
-
104
- ## Task 3: Update writing-plans skill — enforce task heading format
105
-
106
- <!-- tdd: modifying-tested-code -->
107
-
108
- Minor update to `writing-plans` to enforce the `## Task N:` heading format and metadata comments.
109
-
110
- **File to modify:** `/Users/yinlootan/.nvm/versions/node/v22.16.0/lib/node_modules/@tianhai/pi-workflow-kit/skills/writing-plans/SKILL.md`
111
-
112
- In the **Task format** section, add:
113
-
114
- > Each task must use a numbered heading: `## Task N: <description>` where N starts at 1.
115
- >
116
- > Optionally include metadata comments on the line after the heading:
117
- > ```
118
- > ## Task 1: Create User model
119
- >
120
- > <!-- tdd: new-feature -->
121
- > <!-- checkpoint: none -->
122
- > ```
123
- >
124
- > Valid TDD values: `new-feature`, `modifying-tested-code`, `trivial`
125
- >
126
- > Valid checkpoint values: `none`, `test`, `done`
127
- >
128
- > These comments are optional — if omitted, the agent infers TDD scenario and checkpoint from context.
129
-
130
- Also update the checkpoint labels table to reference the `<!-- checkpoint: ... -->` comment format as the canonical way to specify checkpoints (while still supporting the inline label format as fallback).
131
-
132
- After editing, verify by reading the file back.
133
-
134
- ```
135
- git add skills/writing-plans/SKILL.md
136
- git commit -m "docs(writing-plans): enforce Task N heading format with metadata comments"
137
- ```
138
-
139
- ## Task 4: Update finalizing skill — archive progress file and warn on skipped tasks
140
-
141
- <!-- tdd: modifying-tested-code -->
142
-
143
- Minor update to `finalizing` to handle the progress file.
144
-
145
- **File to modify:** `/Users/yinlootan/.nvm/versions/node/v22.16.0/lib/node_modules/@tianhai/pi-workflow-kit/skills/finalizing/SKILL.md`
146
-
147
- ### Change 1: Archive progress file
148
-
149
- In step 1 ("Move planning docs"), add the progress file to the archive command:
150
- ```
151
- mv docs/plans/*-progress.md docs/plans/completed/
152
- ```
153
-
154
- ### Change 2: Warn on skipped tasks
155
-
156
- Before step 1, add a new pre-check:
157
-
158
- > **Check for skipped tasks** — if a progress file exists (`docs/plans/*-progress.md`), read it and check for any `⏭ skipped` tasks. If found, warn:
159
- >
160
- > ```
161
- > ⚠️ Tasks 4 and 7 were skipped. Continue with finalizing, or go back?
162
- > ```
163
- >
164
- > Wait for the user to confirm before proceeding.
165
-
166
- ### Change 3: Use progress file for summaries
167
-
168
- In step 3 ("Choose a merge strategy"), when generating PR descriptions or squash commit messages, read the progress file to build a task-by-task summary:
169
-
170
- > Use the progress file to generate the summary. Convert the task table to a bulleted list:
171
- > ```
172
- > - ✅ Create User model
173
- > - ✅ Write User model tests
174
- > - ⏭ Add auth middleware (skipped)
175
- > - ✅ Add login endpoint
176
- > ```
177
-
178
- After editing, verify by reading the file back.
179
-
180
- ```
181
- git add skills/finalizing/SKILL.md
182
- git commit -m "feat(finalizing): archive progress file, warn on skipped tasks"
183
- ```
184
-
185
- ## Task 5: End-to-end review — read all four skill files and verify consistency
186
-
187
- <!-- tdd: trivial -->
188
- <!-- checkpoint: done -->
189
-
190
- Read all four skill files and verify they form a coherent workflow:
191
-
192
- 1. `skills/writing-plans/SKILL.md` — produces `*implementation.md` with `## Task N:` headings
193
- 2. `skills/executing-tasks/SKILL.md` — reads the plan, creates/maintains `*progress.md`, works across sessions
194
- 3. `skills/finalizing/SKILL.md` — archives `*progress.md`, warns on skipped tasks
195
-
196
- Check for:
197
- - [ ] Terminology is consistent across all three skills (status names, file paths, checkpoint labels)
198
- - [ ] `executing-tasks` correctly describes how to parse the `## Task N:` format that `writing-plans` enforces
199
- - [ ] `finalizing` correctly references the progress file path that `executing-tasks` creates
200
- - [ ] No orphaned references to old behavior (e.g., no references to in-memory task tracking)
201
- - [ ] The user override commands in `executing-tasks` are complete and non-contradictory
202
-
203
- Fix any inconsistencies found. This is a checkpoint: done task — present the review findings and wait for approval before committing.
204
-
205
- ```
206
- git add skills/
207
- git commit -m "chore: consistency review across workflow skills"
208
- ```
@@ -1,14 +0,0 @@
1
- # Progress: executing-tasks-redesign
2
-
3
- Plan: docs/plans/2026-04-28-executing-tasks-redesign-implementation.md
4
- Branch: executing-tasks-redesign
5
- Started: 2026-04-28T12:00:00Z
6
- Last updated: 2026-04-28T12:04:00Z
7
-
8
- | # | Status | Task | Commit |
9
- |---|--------|------|--------|
10
- | 1 | ✅ done | Rewrite executing-tasks skill — progress file and startup flow | a1b2c3d¹ |
11
- | 2 | ✅ done | Add per-task execution, batching, and session management to executing-tasks | d4e5f6a² |
12
- | 3 | ✅ done | Update writing-plans skill — enforce task heading format | b7c8d9e³ |
13
- | 4 | ✅ done | Update finalizing skill — archive progress file and warn on skipped tasks | f0a1b2c⁴ |
14
- | 5 | ✅ done | checkpoint: done — End-to-end review — read all four skill files and verify consistency | b0c1d2e⁵ |
@@ -1,154 +0,0 @@
1
- # Incorporate mattpocock/skills Ideas into pi-workflow-kit
2
-
3
- ## Source
4
-
5
- Incorporates engineering best practices from [mattpocock/skills](https://github.com/mattpocock/skills) into pi-workflow-kit's existing workflow. The ideas are adapted to fit pi-workflow-kit's tight plan→execute pipeline and artifact lifecycle philosophy.
6
-
7
- ## Design principles
8
-
9
- - **No new forever-documents.** No CONTEXT.md, no persistent glossary. Every artifact has a clear birth and death within the brainstorm→finalize lifecycle.
10
- - **No new external dependencies.** No issue tracker integration, no sub-agent infrastructure.
11
- - **Small, precise edits.** Each change is a few lines in the right place in the existing skill files.
12
-
13
- ## Changes
14
-
15
- ### 1. "Design it twice" in brainstorming
16
-
17
- **File:** `skills/brainstorming/SKILL.md`
18
-
19
- **Current behavior (step 3):**
20
- > Explore approaches — propose 2-3 approaches with trade-offs. Lead with your recommendation.
21
-
22
- **New behavior:** Each approach includes a concrete interface sketch — types, method signatures, and example caller code — so the comparison is grounded in actual code, not abstract descriptions.
23
-
24
- **Rationale:** Without a concrete interface sketch, the agent can describe two approaches that sound different but collapse to the same implementation. Showing the actual caller code makes the trade-offs visible and forces the agent to think about the interface, not just the architecture.
25
-
26
- **Reference:** Matt's `grill-with-docs` and `improve-codebase-architecture` skills both require concrete interface sketches before any discussion proceeds.
27
-
28
- ---
29
-
30
- ### 2. ADRs in brainstorming
31
-
32
- **File:** `skills/brainstorming/SKILL.md`
33
-
34
- **Current behavior:** The brainstorming skill produces a design doc. No mechanism for recording *why* decisions were made.
35
-
36
- **New behavior:** During the design presentation (step 4), when a significant architectural decision is identified, the agent offers to write a lightweight ADR to `docs/plans/adr/`. ADRs are short (one paragraph), and only written when all three conditions are met:
37
-
38
- 1. **Hard to reverse** — changing your mind later has meaningful cost
39
- 2. **Surprising without context** — a future reader will wonder "why?"
40
- 3. **A real trade-off** — there were genuine alternatives
41
-
42
- ADR format:
43
-
44
- ```markdown
45
- # <Short title of the decision>
46
-
47
- <1-3 sentences: context, decision, and why.>
48
- ```
49
-
50
- **Lifecycle:** ADRs live under `docs/plans/adr/` (writable during brainstorm phase). They get archived to `docs/plans/completed/adr/` during finalizing alongside the design doc. No forever-document.
51
-
52
- **Rationale:** The design doc captures *what* was decided. ADRs capture *why*. This matters when someone (human or agent) encounters the code later and wonders about a surprising implementation choice. The strict gating (all 3 conditions) prevents ADR bloat.
53
-
54
- **Reference:** Matt's ADR format (single paragraph, optional sections only when genuinely useful). The key adaptation: ADRs live inside `docs/plans/` so they're subject to the same lifecycle as design docs, rather than being a permanent `docs/adr/` directory.
55
-
56
- ---
57
-
58
- ### 3. Vertical slices in planning
59
-
60
- **File:** `skills/writing-plans/SKILL.md`
61
-
62
- **Current behavior:** Tasks are 2-5 minutes of work with exact file paths and code. No guidance on task *structure* — horizontal slices (all DB tasks, then all API tasks) are as valid as vertical slices.
63
-
64
- **New behavior:** Each task should be a **vertical slice** — a thin path through ALL relevant layers end-to-end, delivering one complete piece of observable behavior. The plan should explicitly call out horizontal slicing as an anti-pattern.
65
-
66
- ```
67
- WRONG (horizontal):
68
- Task 1: Create database schema for users
69
- Task 2: Write user API endpoints
70
- Task 3: Build user UI components
71
- Task 4: Wire everything together
72
-
73
- RIGHT (vertical):
74
- Task 1: User can sign up (model + endpoint + validation + test)
75
- Task 2: User can log in (auth check + token + test)
76
- Task 3: User can view profile (query + endpoint + test)
77
- ```
78
-
79
- **Rationale:** Horizontal slicing produces plans where tasks don't compile or run in isolation — you can't test the schema without the API, you can't test the API without the schema. Vertical slices mean every committed task leaves the codebase in a testable state. This also reduces the blast radius of a bad task — rolling back one vertical slice doesn't break unrelated layers.
80
-
81
- **Reference:** Matt's TDD skill ("Anti-Pattern: Horizontal Slices") and `to-issues` skill ("vertical slice rules"). The key adaptation: in pi-workflow-kit, vertical slices are guidance in the planning skill, not a separate skill with issue tracker integration.
82
-
83
- ---
84
-
85
- ### 4. Deep modules in TDD refactoring
86
-
87
- **File:** `skills/executing-tasks/SKILL.md`
88
-
89
- **Current behavior:** TDD discipline is: write test first → see it fail → implement → see it pass. No refactoring guidance after tests pass.
90
-
91
- **New behavior:** After all tests pass for a task, add a refactoring check:
92
-
93
- - Look for shallow modules (interface nearly as complex as implementation) — can complexity be hidden behind a simpler interface?
94
- - Apply the deletion test: if you deleted this module, would complexity vanish (pass-through) or reappear across callers (earning its keep)?
95
- - Extract duplication
96
- - Ensure one adapter = hypothetical seam, two adapters = real seam (don't introduce abstraction unless something actually varies across it)
97
-
98
- Key vocabulary to use: **depth** (lots of behavior behind a small interface), **seam** (where behavior can be altered without editing in place), **locality** (change concentrated in one place).
99
-
100
- **Rationale:** Without a refactoring pass, the agent treats "tests pass" as "done." Over many tasks, this accumulates shallow modules — thin wrappers that add indirection without hiding complexity. A lightweight refactoring checklist prevents this accumulation.
101
-
102
- **Reference:** Matt's TDD skill (refactoring checklist) and `improve-codebase-architecture` skill (depth, seam, locality vocabulary). The key adaptation: a brief checklist in the existing TDD section, not a full architecture review skill.
103
-
104
- ---
105
-
106
- ### 5. Diagnose skill (new standalone skill)
107
-
108
- **File:** `skills/diagnose/SKILL.md` (new)
109
-
110
- **What it is:** A 6-phase debugging discipline the user invokes when a test fails, a bug is found, or something is broken during execution. It sits outside the brainstorm→finalize pipeline — a utility skill used on demand.
111
-
112
- **Phases:**
113
-
114
- 1. **Build a feedback loop** — the core insight. Before doing anything else, create a fast, deterministic, agent-runnable pass/fail signal for the bug (failing test, curl script, CLI invocation, etc.). "Build the right feedback loop, and the bug is 90% fixed."
115
- 2. **Reproduce** — run the loop, confirm it matches the user's reported symptom
116
- 3. **Hypothesise** — generate 3-5 ranked falsifiable hypotheses. Show the list to the user before testing — they often have domain knowledge that re-ranks instantly
117
- 4. **Instrument** — add targeted debug logs with unique tags (e.g. `[DEBUG-a4f2]`) for easy cleanup. One variable at a time
118
- 5. **Fix + regression test** — write the regression test before the fix, if a correct test seam exists
119
- 6. **Cleanup** — remove all debug logs, verify original repro no longer triggers, document what would have prevented the bug
120
-
121
- **Design decisions:**
122
-
123
- - **No extension changes needed.** Diagnose is a standalone skill invoked explicitly by the user. It doesn't need workflow-guard integration — if the user invokes it during execution, the workflow-guard already allows all tools.
124
- - **Not a pipeline phase.** It's a utility skill like a wrench — you pick it up when needed. The brainstorm→plan→execute→finalize pipeline remains unchanged.
125
- - **Phase 1 is the skill.** The other phases are mechanical. The skill should emphasize that spending disproportionate effort on building the feedback loop is the correct strategy.
126
-
127
- **Rationale:** Pi-workflow-kit currently has no debugging flow. When a test fails during execution, the agent is unguided — it might stare at code, add random logs, or try shotgun debugging. A disciplined loop prevents wasted time and ensures bugs are properly locked down with regression tests.
128
-
129
- **Reference:** Matt's `diagnose` skill. The key adaptation: simplified to fit pi-workflow-kit's concise skill style (~30-40 lines instead of ~120 lines with supporting files). No CONTEXT.md dependency — the agent uses the codebase's own terminology.
130
-
131
- ---
132
-
133
- ## What's NOT being incorporated
134
-
135
- | Idea | Why not |
136
- |------|---------|
137
- | CONTEXT.md | Accumulates without bound, rots over time, doesn't scale to monorepos |
138
- | Triage / to-issues / to-prd | Tightly coupled to GitHub/GitLab issue trackers, outside pi-workflow-kit's scope |
139
- | setup skill | Scaffolding for issue tracker config — not relevant without issue tracker integration |
140
- | caveman / grill-me | Fun but orthogonal to workflow |
141
- | Full improve-codebase-architecture | Too heavy (~100+ lines, multiple reference files, depends on CONTEXT.md) |
142
- | Parallel sub-agents | Not available in pi currently |
143
-
144
- ## Files changed
145
-
146
- | File | Change |
147
- |------|--------|
148
- | `skills/brainstorming/SKILL.md` | Add "design it twice" interface sketches, add ADR output |
149
- | `skills/writing-plans/SKILL.md` | Add vertical slice guidance with anti-pattern example |
150
- | `skills/executing-tasks/SKILL.md` | Add refactoring checklist with deep modules vocabulary |
151
- | `skills/diagnose/SKILL.md` | New skill file (6-phase debugging loop) |
152
- | `docs/developer-usage-guide.md` | Mention diagnose skill and ADR output |
153
- | `docs/workflow-phases.md` | Mention diagnose as a utility skill |
154
- | `README.md` | Add diagnose to skills table |
@@ -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
- ```