@tianhai/pi-workflow-kit 0.8.4 → 0.10.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 +3 -1
- package/docs/developer-usage-guide.md +10 -0
- package/docs/plans/completed/2026-04-28-executing-tasks-redesign-design.md +171 -0
- package/docs/plans/completed/2026-04-28-executing-tasks-redesign-implementation.md +208 -0
- package/docs/plans/completed/2026-04-28-executing-tasks-redesign-progress.md +14 -0
- package/docs/plans/completed/2026-05-01-incorporate-mattpocock-skills-design.md +154 -0
- package/docs/plans/completed/2026-05-01-incorporate-mattpocock-skills-implementation.md +315 -0
- package/docs/plans/completed/2026-05-01-incorporate-mattpocock-skills-progress.md +15 -0
- package/docs/workflow-phases.md +13 -1
- package/package.json +1 -1
- package/skills/brainstorming/SKILL.md +17 -1
- package/skills/diagnose/SKILL.md +56 -0
- package/skills/executing-tasks/SKILL.md +160 -16
- package/skills/finalizing/SKILL.md +26 -2
- package/skills/writing-plans/SKILL.md +41 -0
package/README.md
CHANGED
|
@@ -44,6 +44,7 @@ During brainstorm and plan, the extension blocks `write`/`edit` outside `docs/pl
|
|
|
44
44
|
| `writing-plans` | ~35 | Break design into tasks with TDD scenarios, set up branch/worktree |
|
|
45
45
|
| `executing-tasks` | ~50 | Implement tasks with TDD discipline, checkpoint review gates, handle code review |
|
|
46
46
|
| `finalizing` | ~20 | Archive docs, update changelog, create PR, clean up |
|
|
47
|
+
| `diagnose` | ~35 | 6-phase debugging loop: build feedback loop, reproduce, hypothesise, instrument, fix, cleanup |
|
|
47
48
|
|
|
48
49
|
### TDD Three-Scenario Model
|
|
49
50
|
|
|
@@ -75,7 +76,8 @@ pi-workflow-kit/
|
|
|
75
76
|
│ ├── brainstorming/SKILL.md
|
|
76
77
|
│ ├── writing-plans/SKILL.md
|
|
77
78
|
│ ├── executing-tasks/SKILL.md
|
|
78
|
-
│
|
|
79
|
+
│ ├── finalizing/SKILL.md
|
|
80
|
+
│ └── diagnose/SKILL.md
|
|
79
81
|
├── tests/
|
|
80
82
|
│ └── workflow-guard.test.ts
|
|
81
83
|
├── package.json
|
|
@@ -47,6 +47,8 @@ Explore the idea through collaborative dialogue. The agent reads code, asks ques
|
|
|
47
47
|
|
|
48
48
|
Outcome: `docs/plans/YYYY-MM-DD-<topic>-design.md`
|
|
49
49
|
|
|
50
|
+
Optionally writes ADRs to `docs/plans/adr/` for significant architectural decisions.
|
|
51
|
+
|
|
50
52
|
### 2. Plan
|
|
51
53
|
|
|
52
54
|
```
|
|
@@ -73,6 +75,14 @@ Implement the plan task-by-task. Each task: implement → run tests → fix if n
|
|
|
73
75
|
|
|
74
76
|
Archive plan docs, update CHANGELOG/README, create PR, clean up worktree.
|
|
75
77
|
|
|
78
|
+
### 5. Diagnose (on demand)
|
|
79
|
+
|
|
80
|
+
```
|
|
81
|
+
/skill:diagnose
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
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.
|
|
85
|
+
|
|
76
86
|
## What the extension does
|
|
77
87
|
|
|
78
88
|
The `workflow-guard` extension watches `write` and `edit` tool calls:
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
# Design: Executing Tasks Redesign
|
|
2
|
+
|
|
3
|
+
**Date:** 2026-04-28
|
|
4
|
+
**Status:** Approved
|
|
5
|
+
|
|
6
|
+
## Problem
|
|
7
|
+
|
|
8
|
+
The current `executing-tasks` skill has three issues:
|
|
9
|
+
|
|
10
|
+
1. **No progress tracking** — tasks are iterated in-memory with no file-based state. If the session crashes or the user starts a new session, all progress is lost.
|
|
11
|
+
2. **High token consumption** — the entire plan, all implementation work, and accumulated tool outputs stay in a single session. Even with auto-compaction, the LLM re-reads the full plan repeatedly.
|
|
12
|
+
3. **No context separation** — one monolithic thread handles everything. Early tasks' tool outputs bleed into later tasks' context.
|
|
13
|
+
|
|
14
|
+
## Solution Overview
|
|
15
|
+
|
|
16
|
+
Introduce a **progress file** as the single source of truth for task state, and design the skill to work naturally across **multiple sessions** with fresh context.
|
|
17
|
+
|
|
18
|
+
### Core Principles
|
|
19
|
+
|
|
20
|
+
- The progress file is the state — not the session, not git history
|
|
21
|
+
- Each task is an isolated unit of work — the agent reads only what it needs
|
|
22
|
+
- The agent suggests `/new` (fresh session) at natural break points
|
|
23
|
+
- Resume is trivial — re-invoke the skill, it reads the progress file and picks up
|
|
24
|
+
|
|
25
|
+
## Progress File
|
|
26
|
+
|
|
27
|
+
**Path:** `docs/plans/YYYY-MM-DD-<topic>-progress.md`
|
|
28
|
+
|
|
29
|
+
Created by `executing-tasks` on first run by parsing the implementation plan.
|
|
30
|
+
|
|
31
|
+
**Format:**
|
|
32
|
+
|
|
33
|
+
```markdown
|
|
34
|
+
# Progress: auth
|
|
35
|
+
|
|
36
|
+
Plan: docs/plans/2026-04-28-auth-implementation.md
|
|
37
|
+
Branch: auth
|
|
38
|
+
Started: 2026-04-28T10:00:00Z
|
|
39
|
+
Last updated: 2026-04-28T10:45:00Z
|
|
40
|
+
|
|
41
|
+
| # | Status | Task | Commit |
|
|
42
|
+
|---|--------|------|--------|
|
|
43
|
+
| 1 | ✅ done | Create User model | a1b2c3d |
|
|
44
|
+
| 2 | ✅ done | Write User model tests | e4f5g6h |
|
|
45
|
+
| 3 | 🔄 in-progress | Add login endpoint | — |
|
|
46
|
+
| 4 | ⬜ pending | Write login tests | — |
|
|
47
|
+
| 5 | ⏭ skipped | checkpoint: test — Add auth middleware | — |
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
**Status values:**
|
|
51
|
+
|
|
52
|
+
| Status | Meaning |
|
|
53
|
+
|--------|---------|
|
|
54
|
+
| `⬜ pending` | Not started |
|
|
55
|
+
| `🔄 in-progress` | Currently being worked on |
|
|
56
|
+
| `✅ done` | Committed successfully |
|
|
57
|
+
| `❌ failed` | Could not complete (with reason appended) |
|
|
58
|
+
| `⏭ skipped` | User chose to skip |
|
|
59
|
+
|
|
60
|
+
**Rules:**
|
|
61
|
+
|
|
62
|
+
- Mark `🔄 in-progress` immediately when starting a task
|
|
63
|
+
- Mark `✅ done` + record commit hash only after successful `git commit`
|
|
64
|
+
- Mark `❌ failed` + append `Failed: <reason>` when the agent can't proceed after retrying
|
|
65
|
+
- Mark `⏭ skipped` when the user says "skip"
|
|
66
|
+
- Update `Last updated` timestamp on every change
|
|
67
|
+
- Preserve checkpoint labels from the plan in the task description
|
|
68
|
+
|
|
69
|
+
## Implementation Plan Format
|
|
70
|
+
|
|
71
|
+
No file splitting. Keep one `implementation.md` but enforce a strict heading format:
|
|
72
|
+
|
|
73
|
+
```markdown
|
|
74
|
+
## Task 1: Create User model
|
|
75
|
+
|
|
76
|
+
<!-- tdd: new-feature -->
|
|
77
|
+
<!-- checkpoint: none -->
|
|
78
|
+
|
|
79
|
+
- Create `src/models/user.ts`...
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
The agent reads the progress file to find the current task number, then reads only that task's section from the implementation plan (via grep/jump to heading).
|
|
83
|
+
|
|
84
|
+
## Session Lifecycle
|
|
85
|
+
|
|
86
|
+
### First Run
|
|
87
|
+
|
|
88
|
+
1. Read progress file → doesn't exist
|
|
89
|
+
2. Parse implementation.md, create progress file with all tasks as `⬜ pending`
|
|
90
|
+
3. Ensure on correct branch / worktree (same as current skill)
|
|
91
|
+
4. Read task 1 section, begin work
|
|
92
|
+
|
|
93
|
+
### Continuing in Same Session
|
|
94
|
+
|
|
95
|
+
After completing a non-checkpoint task:
|
|
96
|
+
1. Update progress file: current task → `✅ done`
|
|
97
|
+
2. Peek at next task:
|
|
98
|
+
- **Has checkpoint** → pause for review (stay in session)
|
|
99
|
+
- **No checkpoint** → continue working on next task
|
|
100
|
+
3. After ~3-5 non-checkpoint tasks, suggest `/new`:
|
|
101
|
+
|
|
102
|
+
```
|
|
103
|
+
✅ Tasks 3-5 done (commits: a1b2, e4f5, i7j8)
|
|
104
|
+
|
|
105
|
+
Progress: 5/10 tasks done
|
|
106
|
+
|
|
107
|
+
⏭ Next: Task 6 — Add auth middleware (no checkpoint)
|
|
108
|
+
|
|
109
|
+
💡 Context is building up. For clean context on remaining tasks:
|
|
110
|
+
/new then /skill:executing-tasks
|
|
111
|
+
(or just say "continue" to keep going here)
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
### Resuming in a New Session
|
|
115
|
+
|
|
116
|
+
1. Read progress file → find first `⬜ pending` or `❌ failed` task
|
|
117
|
+
2. Read that task's section from implementation.md
|
|
118
|
+
3. Continue work — no re-reading of earlier tasks
|
|
119
|
+
|
|
120
|
+
### Checkpoint Review
|
|
121
|
+
|
|
122
|
+
Same as current skill — show what was done, show the diff, wait for user approval:
|
|
123
|
+
|
|
124
|
+
```
|
|
125
|
+
⏸ Paused at checkpoint: test for task 4
|
|
126
|
+
|
|
127
|
+
**What was done:** [brief summary]
|
|
128
|
+
**Diff:** [show relevant diff]
|
|
129
|
+
|
|
130
|
+
Review and let me know how to proceed.
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
## Resume & Failure Recovery
|
|
134
|
+
|
|
135
|
+
| Scenario | What the agent sees | What it does |
|
|
136
|
+
|----------|-------------------|--------------|
|
|
137
|
+
| **Clean resume** | Next task is `⬜ pending` | Read task section, start working |
|
|
138
|
+
| **Mid-task crash** | A task is `🔄 in-progress` | Check git log since last done task. If commits exist → ask user to verify. If no commits → restart the task |
|
|
139
|
+
| **Failed task** | A task is `❌ failed` | Show failure reason, ask: retry, skip, or abort? |
|
|
140
|
+
| **All done** | No `⬜ pending` or `❌ failed` | Show summary, suggest `/skill:finalizing` |
|
|
141
|
+
| **No progress file** | File doesn't exist | Parse implementation.md, create progress file, start from task 1 |
|
|
142
|
+
| **Skipped tasks remain** | `⏭ skipped` tasks exist | Noted in finalizing, no action during execution |
|
|
143
|
+
|
|
144
|
+
## User Override Commands
|
|
145
|
+
|
|
146
|
+
Available at any time during execution:
|
|
147
|
+
|
|
148
|
+
| User says | Agent does |
|
|
149
|
+
|-----------|-----------|
|
|
150
|
+
| `skip` | Mark current task `⏭ skipped`, move to next |
|
|
151
|
+
| `status` | Show the progress table |
|
|
152
|
+
| `stop` | Mark current task back to `⬜ pending`, suggest `/new` |
|
|
153
|
+
| `retry` | Re-read current task section, start over |
|
|
154
|
+
|
|
155
|
+
## Changes to Other Skills
|
|
156
|
+
|
|
157
|
+
### writing-plans (minor)
|
|
158
|
+
|
|
159
|
+
- Enforce `## Task N: <description>` heading format
|
|
160
|
+
- Optional metadata comments: `<!-- tdd: ... -->` and `<!-- checkpoint: ... -->`
|
|
161
|
+
- Everything else stays the same
|
|
162
|
+
|
|
163
|
+
### finalizing (minor)
|
|
164
|
+
|
|
165
|
+
- Warn on skipped tasks before archiving: "Tasks 4 and 7 were skipped. Continue with finalizing, or go back?"
|
|
166
|
+
- Archive the progress file to `docs/plans/completed/`
|
|
167
|
+
- Use progress file for PR/commit summaries instead of re-reading the full plan
|
|
168
|
+
|
|
169
|
+
### brainstorming
|
|
170
|
+
|
|
171
|
+
- No changes
|
|
@@ -0,0 +1,208 @@
|
|
|
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
|
+
```
|
|
@@ -0,0 +1,14 @@
|
|
|
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⁵ |
|
|
@@ -0,0 +1,154 @@
|
|
|
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 |
|