@tianhai/pi-workflow-kit 0.17.1 → 0.18.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +47 -37
- package/docs/developer-usage-guide.md +32 -14
- package/docs/lessons.md +18 -0
- package/docs/oversight-model.md +11 -5
- package/docs/plans/completed/2026-06-09-code-review-fixes-implementation.md +74 -0
- package/docs/plans/completed/2026-06-09-code-review-fixes-progress.md +14 -0
- package/docs/plans/completed/2026-06-09-incremental-workflow-and-rename-design.md +186 -0
- package/docs/plans/completed/2026-06-09-incremental-workflow-and-rename-implementation.md +675 -0
- package/docs/plans/completed/2026-06-09-incremental-workflow-and-rename-progress.md +18 -0
- package/docs/plans/completed/2026-06-09-incremental-workflow-and-rename-verification-report.md +81 -0
- package/docs/plans/completed/2026-06-09-verification-fixes-implementation.md +69 -0
- package/docs/plans/completed/2026-06-09-verification-fixes-progress.md +14 -0
- package/docs/workflow-phases.md +19 -13
- package/extensions/workflow-guard.ts +10 -9
- package/package.json +2 -1
- package/skills/{brainstorming → pwk-brainstorming}/SKILL.md +17 -6
- package/skills/{design-review → pwk-design-review}/SKILL.md +11 -9
- package/skills/{diagnose → pwk-diagnose}/SKILL.md +1 -1
- package/skills/{executing-tasks → pwk-executing-tasks}/SKILL.md +46 -16
- package/skills/{finalizing → pwk-finalizing}/SKILL.md +9 -2
- package/skills/{verify → pwk-verify}/SKILL.md +3 -3
- package/skills/{writing-plans → pwk-writing-plans}/SKILL.md +21 -6
package/README.md
CHANGED
|
@@ -28,7 +28,7 @@ Enforces phase-appropriate tool access — not just guidelines, but hard blocks:
|
|
|
28
28
|
|
|
29
29
|
| Phase | `write` / `edit` | `bash` |
|
|
30
30
|
|-------|:-:|:-:|
|
|
31
|
-
| **Brainstorm** / **Plan** | 🔒 Blocked outside `docs/plans/` | 🔒 Read-only only (grep, find, cat, git status, curl…) |
|
|
31
|
+
| **Brainstorm** / **Plan** / **Verify** | 🔒 Blocked outside `docs/plans/` | 🔒 Read-only only (grep, find, cat, git status, curl…) |
|
|
32
32
|
| **Execute** / **Finalize** | ✅ Full access | ✅ Full access |
|
|
33
33
|
|
|
34
34
|
The agent can read code and discuss design with you during brainstorm/plan, but it physically cannot modify source files or run mutating commands.
|
|
@@ -37,19 +37,21 @@ The agent can read code and discuss design with you during brainstorm/plan, but
|
|
|
37
37
|
|
|
38
38
|
Guide the agent through a disciplined development process:
|
|
39
39
|
|
|
40
|
-
brainstorm → design-review →
|
|
41
|
-
|
|
42
|
-
|
|
40
|
+
brainstorm → plan → [design-review?] → execute → [verify?] → finalize
|
|
41
|
+
↕
|
|
42
|
+
diagnose (anytime)
|
|
43
|
+
|
|
44
|
+
For multi-feature designs, the plan→execute loop repeats per feature.
|
|
43
45
|
|
|
44
46
|
| Phase | Trigger | What Happens |
|
|
45
47
|
|-------|---------|--------------|
|
|
46
|
-
| **Brainstorm** | `/skill:brainstorming` | Explore approaches, debate tradeoffs, produce a design doc |
|
|
47
|
-
| **Design Review** | `/skill:design-review` | Audit design for production risks (security, scalability, fault tolerance) |
|
|
48
|
-
| **Plan** | `/skill:writing-plans` |
|
|
49
|
-
| **Execute** | `/skill:executing-tasks` | Implement tasks one-by-one with TDD discipline and pre-commit checkpoint review gates |
|
|
50
|
-
| **Verify** | `/skill:verify` | Three expert review passes (security, optimization, traceability) on implemented code |
|
|
51
|
-
| **Finalize** | `/skill:finalizing` | Archive plan docs, update README/CHANGELOG, create PR |
|
|
52
|
-
| **Diagnose** | `/skill:diagnose` | 6-phase debugging loop: reproduce → hypothesize → instrument → fix → verify |
|
|
48
|
+
| **Brainstorm** | `/skill:pwk-brainstorming` | Explore approaches, debate tradeoffs, produce a design doc with a Features table |
|
|
49
|
+
| **Design Review** | `/skill:pwk-design-review` | Audit plan and design for production risks (security, scalability, fault tolerance) |
|
|
50
|
+
| **Plan** | `/skill:pwk-writing-plans` | Plan one feature at a time from the Features table — bite-sized TDD tasks with acceptance criteria |
|
|
51
|
+
| **Execute** | `/skill:pwk-executing-tasks` | Implement tasks one-by-one with TDD discipline and pre-commit checkpoint review gates |
|
|
52
|
+
| **Verify** | `/skill:pwk-verify` | Three expert review passes (security, optimization, traceability) on implemented code |
|
|
53
|
+
| **Finalize** | `/skill:pwk-finalizing` | Archive plan docs, update README/CHANGELOG, create PR |
|
|
54
|
+
| **Diagnose** | `/skill:pwk-diagnose` | 6-phase debugging loop: reproduce → hypothesize → instrument → fix → verify |
|
|
53
55
|
|
|
54
56
|
## The Workflow in Detail
|
|
55
57
|
|
|
@@ -57,12 +59,24 @@ brainstorm → design-review → plan → execute → verify → finalize
|
|
|
57
59
|
|
|
58
60
|
You control each phase — the agent never advances on its own. Invoke a skill to move forward:
|
|
59
61
|
|
|
60
|
-
/skill:brainstorming → discuss and design
|
|
61
|
-
/skill:
|
|
62
|
-
/skill:
|
|
63
|
-
/skill:executing-tasks → implement with TDD
|
|
64
|
-
/skill:verify
|
|
65
|
-
/skill:finalizing
|
|
62
|
+
/skill:pwk-brainstorming → discuss and design (names features)
|
|
63
|
+
/skill:pwk-writing-plans → plan next feature from the Features table
|
|
64
|
+
/skill:pwk-design-review → audit for production risks (on demand)
|
|
65
|
+
/skill:pwk-executing-tasks → implement with TDD
|
|
66
|
+
/skill:pwk-verify → review code for security, optimization, and traceability
|
|
67
|
+
/skill:pwk-finalizing → ship it
|
|
68
|
+
|
|
69
|
+
### Feature-Based Planning
|
|
70
|
+
|
|
71
|
+
Design docs include a `## Features` table that tracks each feature's status:
|
|
72
|
+
|
|
73
|
+
| # | Feature | Status | Notes |
|
|
74
|
+
|---|---------|--------|-------|
|
|
75
|
+
| 1 | User signup | ✅ done | |
|
|
76
|
+
| 2 | Email verification | 🔄 planned | Plan: docs/plans/...-email-verification-implementation.md |
|
|
77
|
+
| 3 | Password reset | ⬜ pending | |
|
|
78
|
+
|
|
79
|
+
This enables incremental development — plan and execute one feature at a time, then loop back for the next.
|
|
66
80
|
|
|
67
81
|
### TDD Three-Scenario Model
|
|
68
82
|
|
|
@@ -110,27 +124,23 @@ Optionally label tasks with a `checkpoint` to pause for human review. At each ch
|
|
|
110
124
|
pi install npm:@tianhai/pi-workflow-kit
|
|
111
125
|
|
|
112
126
|
# Start a new feature
|
|
113
|
-
> /skill:brainstorming
|
|
127
|
+
> /skill:pwk-brainstorming
|
|
114
128
|
> I want to add OAuth2 login to our API
|
|
115
129
|
|
|
116
|
-
# (agent explores approaches, writes design doc)
|
|
130
|
+
# (agent explores approaches, writes design doc with Features table)
|
|
117
131
|
# (write/edit are blocked — your code is safe)
|
|
118
132
|
|
|
119
|
-
> /skill:
|
|
120
|
-
|
|
121
|
-
# (agent audits for security, scalability, fault tolerance)
|
|
122
|
-
# (trivial changes can skip this step)
|
|
123
|
-
|
|
124
|
-
> /skill:writing-plans
|
|
133
|
+
> /skill:pwk-writing-plans
|
|
125
134
|
|
|
126
|
-
# (agent breaks
|
|
127
|
-
|
|
135
|
+
# (agent picks next feature, breaks into TDD tasks)
|
|
136
|
+
# (triggers design review for non-trivial features)
|
|
137
|
+
> /skill:pwk-executing-tasks
|
|
128
138
|
|
|
129
139
|
# (agent implements with TDD, cognitive persona shifts, all tools unlocked)
|
|
130
|
-
> /skill:verify
|
|
140
|
+
> /skill:pwk-verify
|
|
131
141
|
|
|
132
142
|
# (agent runs security, optimization, and traceability reviews on implemented code)
|
|
133
|
-
> /skill:finalizing
|
|
143
|
+
> /skill:pwk-finalizing
|
|
134
144
|
|
|
135
145
|
# (agent archives docs, curates lessons, creates PR)
|
|
136
146
|
```
|
|
@@ -147,15 +157,15 @@ pi install npm:@tianhai/pi-workflow-kit
|
|
|
147
157
|
```
|
|
148
158
|
pi-workflow-kit/
|
|
149
159
|
├── extensions/
|
|
150
|
-
│ └── workflow-guard.ts # Write blocker during brainstorm/plan
|
|
160
|
+
│ └── workflow-guard.ts # Write blocker during brainstorm/plan/verify
|
|
151
161
|
├── skills/
|
|
152
|
-
│ ├── brainstorming/SKILL.md
|
|
153
|
-
│ ├── design-review/SKILL.md
|
|
154
|
-
│ ├── writing-plans/SKILL.md
|
|
155
|
-
│ ├── executing-tasks/SKILL.md
|
|
156
|
-
│ ├── verify/SKILL.md
|
|
157
|
-
│ ├── finalizing/SKILL.md
|
|
158
|
-
│ └── diagnose/SKILL.md
|
|
162
|
+
│ ├── pwk-brainstorming/SKILL.md
|
|
163
|
+
│ ├── pwk-design-review/SKILL.md
|
|
164
|
+
│ ├── pwk-writing-plans/SKILL.md
|
|
165
|
+
│ ├── pwk-executing-tasks/SKILL.md
|
|
166
|
+
│ ├── pwk-verify/SKILL.md
|
|
167
|
+
│ ├── pwk-finalizing/SKILL.md
|
|
168
|
+
│ └── pwk-diagnose/SKILL.md
|
|
159
169
|
├── tests/
|
|
160
170
|
│ └── workflow-guard.test.ts
|
|
161
171
|
├── package.json
|
|
@@ -4,8 +4,9 @@ How to install and use `pi-workflow-kit` with the Pi coding agent.
|
|
|
4
4
|
|
|
5
5
|
## What you get
|
|
6
6
|
|
|
7
|
-
- **4 skills** that guide the agent through a structured workflow
|
|
8
|
-
- **
|
|
7
|
+
- **4 workflow skills** that guide the agent through a structured feature-based workflow
|
|
8
|
+
- **3 on-demand skills** for design review, verification, and debugging
|
|
9
|
+
- **1 extension** that hard-blocks source writes during brainstorm, plan, and verify phases
|
|
9
10
|
|
|
10
11
|
## Installation
|
|
11
12
|
|
|
@@ -31,54 +32,70 @@ Or in `.pi/settings.json` / `~/.pi/agent/config.json`:
|
|
|
31
32
|
|
|
32
33
|
## The workflow
|
|
33
34
|
|
|
34
|
-
You control each phase by invoking the skill:
|
|
35
|
+
You control each phase by invoking the skill. For multi-feature designs, the plan→execute loop repeats per feature:
|
|
35
36
|
|
|
36
37
|
```
|
|
37
|
-
/skill:brainstorming → /skill:writing-plans → /skill:executing-tasks → /skill:finalizing
|
|
38
|
+
/skill:pwk-brainstorming → /skill:pwk-writing-plans → /skill:pwk-executing-tasks → loop or /skill:pwk-finalizing
|
|
38
39
|
```
|
|
39
40
|
|
|
40
41
|
### 1. Brainstorm
|
|
41
42
|
|
|
42
43
|
```
|
|
43
|
-
/skill:brainstorming
|
|
44
|
+
/skill:pwk-brainstorming
|
|
44
45
|
```
|
|
45
46
|
|
|
46
47
|
Explore the idea through collaborative dialogue. The agent reads code, asks questions one at a time, proposes 2-3 approaches, and presents the design in sections for your review.
|
|
47
48
|
|
|
48
|
-
Outcome: `docs/plans/YYYY-MM-DD-<topic>-design.md`
|
|
49
|
+
Outcome: `docs/plans/YYYY-MM-DD-<topic>-design.md` with a `## Features` table
|
|
49
50
|
|
|
50
51
|
Optionally writes ADRs to `docs/plans/adr/` for significant architectural decisions.
|
|
51
52
|
|
|
52
53
|
### 2. Plan
|
|
53
54
|
|
|
54
55
|
```
|
|
55
|
-
/skill:writing-plans
|
|
56
|
+
/skill:pwk-writing-plans
|
|
56
57
|
```
|
|
57
58
|
|
|
58
|
-
Read the design doc and
|
|
59
|
+
Read the design doc's Features table, pick the next `⬜ pending` feature, and create a per-feature implementation plan with exact file paths, complete code, and TDD scenarios. Optionally set up a branch or worktree.
|
|
59
60
|
|
|
60
|
-
Outcome: `docs/plans/YYYY-MM-DD-<topic>-implementation.md`
|
|
61
|
+
Outcome: `docs/plans/YYYY-MM-DD-<topic>-<feature-name>-implementation.md`
|
|
61
62
|
|
|
62
63
|
### 3. Execute
|
|
63
64
|
|
|
64
65
|
```
|
|
65
|
-
/skill:executing-tasks
|
|
66
|
+
/skill:pwk-executing-tasks
|
|
66
67
|
```
|
|
67
68
|
|
|
68
|
-
Implement the plan task-by-task. Each task: implement → run tests → fix if needed → commit.
|
|
69
|
+
Implement the plan task-by-task. Each task: implement → run tests → fix if needed → commit. When the feature is done, marks it `✅ done` in the design doc and suggests planning the next feature.
|
|
69
70
|
|
|
70
71
|
### 4. Finalize
|
|
71
72
|
|
|
72
73
|
```
|
|
73
|
-
/skill:finalizing
|
|
74
|
+
/skill:pwk-finalizing
|
|
74
75
|
```
|
|
75
76
|
|
|
76
77
|
Archive plan docs, update CHANGELOG/README, create PR, clean up worktree.
|
|
77
78
|
|
|
78
|
-
### 5.
|
|
79
|
+
### 5. Design Review (on demand)
|
|
79
80
|
|
|
80
81
|
```
|
|
81
|
-
/skill:
|
|
82
|
+
/skill:pwk-design-review
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
Audit a plan doc for production risks — security, scalability, fault tolerance, and operational hazards. Triggered by writing-plans for non-trivial features. Review findings append to the plan doc, not the design doc.
|
|
86
|
+
|
|
87
|
+
### 6. Verify (on demand)
|
|
88
|
+
|
|
89
|
+
```
|
|
90
|
+
/skill:pwk-verify
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
Post-implementation verification with three expert passes — security, optimization, and traceability. Run after executing a feature or before finalizing.
|
|
94
|
+
|
|
95
|
+
### 7. Diagnose (on demand)
|
|
96
|
+
|
|
97
|
+
```
|
|
98
|
+
/skill:pwk-diagnose
|
|
82
99
|
```
|
|
83
100
|
|
|
84
101
|
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.
|
|
@@ -88,6 +105,7 @@ A 6-phase debugging loop you invoke when something is broken. Build a feedback l
|
|
|
88
105
|
The `workflow-guard` extension watches `write` and `edit` tool calls:
|
|
89
106
|
|
|
90
107
|
- **During brainstorm and plan**: blocks writes outside `docs/plans/`. The agent can read code and use bash, but cannot modify source files.
|
|
108
|
+
- **During verify**: same read-only enforcement — the agent can inspect code but not modify it.
|
|
91
109
|
- **During execute and finalize**: no restrictions. All tools available.
|
|
92
110
|
|
|
93
111
|
No configuration needed. It activates automatically after install.
|
package/docs/lessons.md
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# Lessons Learned
|
|
2
|
+
|
|
3
|
+
<!--
|
|
4
|
+
Agent: read this at the start of each task during executing-tasks.
|
|
5
|
+
Follow every rule. Add new rules when you catch yourself making repeat mistakes.
|
|
6
|
+
Rules must be generic patterns applicable to any domain or feature — not specific to one service, entity, or use case.
|
|
7
|
+
Retire rules that no longer apply during finalizing.
|
|
8
|
+
-->
|
|
9
|
+
|
|
10
|
+
## Cross-Skill Consistency
|
|
11
|
+
|
|
12
|
+
- When adding instructions that reference artifacts from another skill (e.g., "extract metadata from plan doc"), always add a guard for when that artifact doesn't exist — not all workflows use all artifacts
|
|
13
|
+
- When reordering instructions within a step, verify all conditional branches still reference the correct context (e.g., hazard checks that say "this feature" must run after feature identification)
|
|
14
|
+
|
|
15
|
+
## Documentation
|
|
16
|
+
|
|
17
|
+
- When adding a new phase to an extension, update ALL comments and error messages — stale comments in one place create confusion about the actual behavior
|
|
18
|
+
- When renaming skills with a prefix, check for `/skill:` references in prose and code blocks separately — backtick-enclosed references in code examples may use a different pattern than prose references
|
package/docs/oversight-model.md
CHANGED
|
@@ -6,10 +6,16 @@
|
|
|
6
6
|
|
|
7
7
|
Skills teach the agent the workflow. There are 4:
|
|
8
8
|
|
|
9
|
-
- **brainstorming** — explore ideas, produce a design doc
|
|
10
|
-
- **writing-plans** —
|
|
11
|
-
- **executing-tasks** — implement tasks,
|
|
12
|
-
- **finalizing** — archive docs, create PR
|
|
9
|
+
- **pwk-brainstorming** — explore ideas, produce a design doc with a Features table
|
|
10
|
+
- **pwk-writing-plans** — plan one feature at a time from the Features table
|
|
11
|
+
- **pwk-executing-tasks** — implement tasks, mark features done, loop to next feature
|
|
12
|
+
- **pwk-finalizing** — archive docs, create PR
|
|
13
|
+
|
|
14
|
+
Plus 3 on-demand skills:
|
|
15
|
+
|
|
16
|
+
- **pwk-design-review** — audit a plan doc for production risks (triggered by writing-plans)
|
|
17
|
+
- **pwk-verify** — post-implementation verification with security, optimization, and traceability passes
|
|
18
|
+
- **pwk-diagnose** — 6-phase debugging loop
|
|
13
19
|
|
|
14
20
|
They explain *what* to do and *when* to do it.
|
|
15
21
|
|
|
@@ -17,7 +23,7 @@ They explain *what* to do and *when* to do it.
|
|
|
17
23
|
|
|
18
24
|
The `workflow-guard` extension enforces one rule:
|
|
19
25
|
|
|
20
|
-
> During brainstorm and
|
|
26
|
+
> During brainstorm, plan, and verify phases, `write` and `edit` are **hard-blocked** outside `docs/plans/`.
|
|
21
27
|
|
|
22
28
|
The agent can still use `read` and `bash` for investigation. It literally cannot call `write` or `edit` on source files — the tools are blocked at the extension level.
|
|
23
29
|
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
# Implementation Plan: Code review findings fix
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
|
|
5
|
+
Fix 5 findings from the cross-skill code review. All are small — documentation clarity and minor correctness guards.
|
|
6
|
+
|
|
7
|
+
## Task 1: Add explicit fallback documentation in executing-tasks "Find the plan"
|
|
8
|
+
|
|
9
|
+
<!-- tdd: trivial -->
|
|
10
|
+
|
|
11
|
+
Fix finding #1. The primary path expects a design doc with Features table, but the fallback for plans without one is implicit.
|
|
12
|
+
|
|
13
|
+
Files:
|
|
14
|
+
- `skills/pwk-executing-tasks/SKILL.md`
|
|
15
|
+
|
|
16
|
+
Steps:
|
|
17
|
+
1. In step 2 ("Find the plan"), after the fallback sentence, append: "This covers plans created without a brainstorm session (no design doc or Features table)."
|
|
18
|
+
|
|
19
|
+
## Task 2: Add metadata-missing guard in executing-tasks per-task step 2
|
|
20
|
+
|
|
21
|
+
<!-- tdd: trivial -->
|
|
22
|
+
|
|
23
|
+
Fix finding #2. When a plan has no `Design:` / `Feature:` metadata (no Features table), the "Extract metadata" instruction is dangling.
|
|
24
|
+
|
|
25
|
+
Files:
|
|
26
|
+
- `skills/pwk-executing-tasks/SKILL.md`
|
|
27
|
+
|
|
28
|
+
Steps:
|
|
29
|
+
1. In per-task step 2, after "Extract the `Design:` and `Feature:` metadata to know which design doc and feature row this execution covers.", add: "If no `Design:` or `Feature:` metadata is present, the plan covers the entire design (no feature table). Skip design doc reading and proceed directly to task execution."
|
|
30
|
+
|
|
31
|
+
## Task 3: Document worktree handoff behavior for multi-feature plans
|
|
32
|
+
|
|
33
|
+
<!-- tdd: trivial -->
|
|
34
|
+
|
|
35
|
+
Fix finding #3. The worktree glob moves all plan docs, which is correct but should be documented explicitly.
|
|
36
|
+
|
|
37
|
+
Files:
|
|
38
|
+
- `skills/pwk-executing-tasks/SKILL.md`
|
|
39
|
+
|
|
40
|
+
Steps:
|
|
41
|
+
1. In step 3b ("Move plan docs into the worktree"), add a note before the mv commands:
|
|
42
|
+
> When using the feature table, all plan docs for this design move together — completed feature plans, the current feature's plan, and the design doc. This is intentional: the worktree works on one design at a time.
|
|
43
|
+
|
|
44
|
+
## Task 4: Add unstarted-features guard to finalizing
|
|
45
|
+
|
|
46
|
+
<!-- tdd: trivial -->
|
|
47
|
+
|
|
48
|
+
Fix finding #4. Archiving the design doc while features are still `⬜ pending` makes them invisible to future planning.
|
|
49
|
+
|
|
50
|
+
Files:
|
|
51
|
+
- `skills/pwk-finalizing/SKILL.md`
|
|
52
|
+
|
|
53
|
+
Steps:
|
|
54
|
+
1. In step 1 ("Move planning docs"), before the archive commands, add a check:
|
|
55
|
+
> If the design doc has a `## Features` table with any `⬜ pending` or `🔄 planned` features, warn:
|
|
56
|
+
> ```
|
|
57
|
+
> ⚠️ Design doc has N unplanned features. Archive anyway, or go back to plan them?
|
|
58
|
+
> ```
|
|
59
|
+
> Wait for the user to confirm before proceeding.
|
|
60
|
+
|
|
61
|
+
## Task 5: Add verification report to finalizing archive step
|
|
62
|
+
|
|
63
|
+
<!-- tdd: trivial -->
|
|
64
|
+
|
|
65
|
+
Fix finding #5. Verification reports are left behind in `docs/plans/` after finalizing.
|
|
66
|
+
|
|
67
|
+
Files:
|
|
68
|
+
- `skills/pwk-finalizing/SKILL.md`
|
|
69
|
+
|
|
70
|
+
Steps:
|
|
71
|
+
1. In step 1, after the existing `mv` commands, add:
|
|
72
|
+
```
|
|
73
|
+
mv docs/plans/*-verification-report.md docs/plans/completed/ 2>/dev/null || true
|
|
74
|
+
```
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# Progress: Code review fixes
|
|
2
|
+
|
|
3
|
+
Plan: docs/plans/2026-06-09-code-review-fixes-implementation.md
|
|
4
|
+
Branch: incremental-workflow-and-rename
|
|
5
|
+
Started: 2026-06-09T23:15:00
|
|
6
|
+
Last updated: 2026-06-09T23:15:00
|
|
7
|
+
|
|
8
|
+
| # | Status | Task | Commit |
|
|
9
|
+
|---|--------|------|--------|
|
|
10
|
+
| 1 | ✅ done | Add explicit fallback docs in executing-tasks "Find the plan" | 1ab7825 |
|
|
11
|
+
| 2 | ✅ done | Add metadata-missing guard in executing-tasks per-task step 2 | 1ab7825 |
|
|
12
|
+
| 3 | ✅ done | Document worktree handoff for multi-feature plans | 1ab7825 |
|
|
13
|
+
| 4 | ✅ done | Add unstarted-features guard to finalizing | 1ab7825 |
|
|
14
|
+
| 5 | ✅ done | Add verification report to finalizing archive step | 1ab7825 |
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
# Incremental Workflow & Skill Rename
|
|
2
|
+
|
|
3
|
+
## Problem
|
|
4
|
+
|
|
5
|
+
Three issues with the current workflow:
|
|
6
|
+
|
|
7
|
+
1. **Design review runs too early.** The 8 hazard checks evaluate concrete code (missing indexes, raw SQL interpolation, unbounded concurrency). A design doc is too vague to audit effectively — most hazards are invisible until the plan has actual code.
|
|
8
|
+
2. **Large features create context pressure.** Planning all tasks upfront, then executing them all, means a 20-task plan accumulates massive context. Lessons learned mid-execution can't reshape later tasks. The plan goes stale.
|
|
9
|
+
3. **Skills aren't namespaced.** All 7 skills live in a flat namespace, making it hard to discover which skills belong to pi-workflow-kit versus third-party or user-installed skills.
|
|
10
|
+
|
|
11
|
+
## Decision
|
|
12
|
+
|
|
13
|
+
1. **Move design review after writing-plans.** The plan doc has concrete code, making hazard checks meaningful. Writing-plans already flags high-risk areas — when flagged, suggest design-review before executing.
|
|
14
|
+
2. **Incremental feature-based workflow.** Brainstorm names features. Each feature gets its own plan → execute → optional verify cycle. The brainstorm doc's `## Features` table tracks overall progress.
|
|
15
|
+
3. **Rename all skills with `pwk-` prefix.** All 7 skills and all cross-references updated.
|
|
16
|
+
|
|
17
|
+
## Workflow Change
|
|
18
|
+
|
|
19
|
+
### Before
|
|
20
|
+
|
|
21
|
+
```
|
|
22
|
+
brainstorm → [design-review?] → plan (all tasks) → execute (all tasks) → [verify?] → finalize
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
### After
|
|
26
|
+
|
|
27
|
+
```
|
|
28
|
+
brainstorm (name features)
|
|
29
|
+
→ plan next feature
|
|
30
|
+
→ [design-review if hazards flagged]
|
|
31
|
+
→ execute feature
|
|
32
|
+
→ [verify this feature? (optional)]
|
|
33
|
+
→ more features? → loop back to plan
|
|
34
|
+
→ all done?
|
|
35
|
+
→ [verify everything? (optional)]
|
|
36
|
+
→ finalize
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Feature Table
|
|
40
|
+
|
|
41
|
+
Brainstorm doc adds a `## Features` table. Simple features get one row. Complex features get many. The table is the feature-level state machine — it answers "what's next?" at any point.
|
|
42
|
+
|
|
43
|
+
```markdown
|
|
44
|
+
## Features
|
|
45
|
+
|
|
46
|
+
| # | Feature | Status | Observable Behavior |
|
|
47
|
+
|---|---------|--------|---------------------|
|
|
48
|
+
| 1 | User signup | ✅ done | User can create account with email+password |
|
|
49
|
+
| 2 | Email verification | 🔄 planned | User receives and confirms verification email |
|
|
50
|
+
| 3 | Password reset | ⬜ pending | User can reset password via email link |
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
Status values: `⬜ pending`, `🔄 planned`, `✅ done`, `⏭ skipped`.
|
|
54
|
+
|
|
55
|
+
### Table maintenance
|
|
56
|
+
|
|
57
|
+
- **Brainstorm** creates the table with all rows as `⬜ pending`
|
|
58
|
+
- **Writing-plans** marks the next feature as `🔄 planned` when it creates a plan for it
|
|
59
|
+
- **Executing-tasks** marks the feature as `✅ done` (or `⏭ skipped`) after completing all its tasks
|
|
60
|
+
- **Any skill can add rows** if a new feature is discovered mid-implementation (human decides, not agent)
|
|
61
|
+
- The table is a living document. If features need merging, splitting, or reordering, the human directs changes during execution
|
|
62
|
+
|
|
63
|
+
## Design Review Changes
|
|
64
|
+
|
|
65
|
+
### Timing
|
|
66
|
+
|
|
67
|
+
Design review moves from after-brainstorm to after-writing-plans.
|
|
68
|
+
|
|
69
|
+
**Trigger mechanism (already exists in writing-plans step 1):** Writing-plans checks for hazards (DB schema changes, auth, external APIs, concurrency, uploads, Redis/MQ). If any apply AND no architectural review section exists → prompt user to run `/skill:pwk-design-review` or type 'proceed' to skip.
|
|
70
|
+
|
|
71
|
+
If the plan doc notes "Simple change — no design review needed" → skip.
|
|
72
|
+
|
|
73
|
+
### Review input
|
|
74
|
+
|
|
75
|
+
Design review reads both the plan doc (concrete code) and the design doc (architectural context). This is better than the current flow — concrete code makes hazards visible.
|
|
76
|
+
|
|
77
|
+
### No mandatory per-feature review
|
|
78
|
+
|
|
79
|
+
Design review is suggested, not mandatory, for each feature. The writing-plans hazard check gates it. Low-risk features skip it entirely.
|
|
80
|
+
|
|
81
|
+
## Verify Changes
|
|
82
|
+
|
|
83
|
+
### Two modes
|
|
84
|
+
|
|
85
|
+
| | Per-feature verify | Full verify |
|
|
86
|
+
|---|---|---|
|
|
87
|
+
| **Scope** | One feature's code | All feature code together |
|
|
88
|
+
| **Catches** | Security, dead code, traceability within the feature | Cross-feature integration, duplicated patterns across features, overall consistency |
|
|
89
|
+
| **When** | After each feature (optional, human-initiated) | After all features (optional, human-initiated) |
|
|
90
|
+
| **Cost** | Low — small code surface | Higher — full codebase |
|
|
91
|
+
|
|
92
|
+
Neither is mandatory. The human decides based on risk and complexity.
|
|
93
|
+
|
|
94
|
+
### Executor prompts
|
|
95
|
+
|
|
96
|
+
After completing a feature:
|
|
97
|
+
```
|
|
98
|
+
✅ Feature "<name>" complete.
|
|
99
|
+
⏭ Next: "<next feature name>"
|
|
100
|
+
💡 Options:
|
|
101
|
+
- Plan next feature: /skill:pwk-writing-plans
|
|
102
|
+
- Verify this feature first: /skill:pwk-verify
|
|
103
|
+
- Or just say "continue"
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
After all features complete:
|
|
107
|
+
```
|
|
108
|
+
✅ All features complete!
|
|
109
|
+
- Verify everything: /skill:pwk-verify
|
|
110
|
+
- Ship: /skill:pwk-finalizing
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
## Per-Feature Execution Model
|
|
114
|
+
|
|
115
|
+
### Plan docs
|
|
116
|
+
|
|
117
|
+
One plan doc per feature: `docs/plans/YYYY-MM-DD-<topic>-<feature-name>-implementation.md`
|
|
118
|
+
|
|
119
|
+
### Progress docs
|
|
120
|
+
|
|
121
|
+
One progress doc per feature: `docs/plans/YYYY-MM-DD-<topic>-<feature-name>-progress.md`
|
|
122
|
+
|
|
123
|
+
### Feature loop
|
|
124
|
+
|
|
125
|
+
1. **Writing-plans** reads design doc, identifies next `⬜ pending` feature, marks it `🔄 planned`, writes plan doc for that feature
|
|
126
|
+
2. **Design review** (if triggered) reviews plan doc + design doc
|
|
127
|
+
3. **Executing-tasks** executes the feature's plan, marks feature `✅ done` in design doc table
|
|
128
|
+
4. **Verify** (optional) reviews just the feature's code
|
|
129
|
+
5. **Loop** back to step 1 if more `⬜ pending` features exist
|
|
130
|
+
|
|
131
|
+
### Session boundaries
|
|
132
|
+
|
|
133
|
+
Each plan → execute cycle is a natural session break. The executor suggests `/new` between features for clean context, as it already does for long task runs.
|
|
134
|
+
|
|
135
|
+
## Skill Rename
|
|
136
|
+
|
|
137
|
+
All 7 skills renamed with `pwk-` prefix:
|
|
138
|
+
|
|
139
|
+
| Current | New |
|
|
140
|
+
|---------|-----|
|
|
141
|
+
| brainstorming | pwk-brainstorming |
|
|
142
|
+
| writing-plans | pwk-writing-plans |
|
|
143
|
+
| executing-tasks | pwk-executing-tasks |
|
|
144
|
+
| design-review | pwk-design-review |
|
|
145
|
+
| verify | pwk-verify |
|
|
146
|
+
| finalizing | pwk-finalizing |
|
|
147
|
+
| diagnose | pwk-diagnose |
|
|
148
|
+
|
|
149
|
+
All cross-references between skills updated (e.g. `Run /skill:executing-tasks` → `Run /skill:pwk-executing-tasks`).
|
|
150
|
+
|
|
151
|
+
## Files Changed
|
|
152
|
+
|
|
153
|
+
### Skill files (rename + content updates)
|
|
154
|
+
- `skills/brainstorming/SKILL.md` → `skills/pwk-brainstorming/SKILL.md`
|
|
155
|
+
- `skills/writing-plans/SKILL.md` → `skills/pwk-writing-plans/SKILL.md`
|
|
156
|
+
- `skills/executing-tasks/SKILL.md` → `skills/pwk-executing-tasks/SKILL.md`
|
|
157
|
+
- `skills/design-review/SKILL.md` → `skills/pwk-design-review/SKILL.md`
|
|
158
|
+
- `skills/verify/SKILL.md` → `skills/pwk-verify/SKILL.md`
|
|
159
|
+
- `skills/finalizing/SKILL.md` → `skills/pwk-finalizing/SKILL.md`
|
|
160
|
+
- `skills/diagnose/SKILL.md` → `skills/pwk-diagnose/SKILL.md`
|
|
161
|
+
|
|
162
|
+
### Documentation
|
|
163
|
+
- `docs/workflow-phases.md` — update skill names and flow diagram
|
|
164
|
+
- `docs/oversight-model.md` — update skill names
|
|
165
|
+
- `docs/developer-usage-guide.md` — update skill names
|
|
166
|
+
|
|
167
|
+
### Extension
|
|
168
|
+
- `extensions/workflow-guard.ts` — update skill name references:
|
|
169
|
+
- `SKILL_TO_PHASE` keys: `brainstorming` → `pwk-brainstorming`, `writing-plans` → `pwk-writing-plans`
|
|
170
|
+
- Phase-clearing triggers: `/skill:executing-tasks` → `/skill:pwk-executing-tasks`, `/skill:finalizing` → `/skill:pwk-finalizing`
|
|
171
|
+
- Add `"pwk-verify": "verify"` to `SKILL_TO_PHASE` — enforce write restriction (only `docs/plans/`) during verify phase, matching the skill's read-only claim
|
|
172
|
+
- `tests/workflow-guard.test.ts` — update all skill name references and add test cases for `pwk-verify` phase
|
|
173
|
+
|
|
174
|
+
## Features (implementation slices)
|
|
175
|
+
|
|
176
|
+
1. **Rename skill directories and files** — move all 7 skill folders to `pwk-` prefix names, update frontmatter names
|
|
177
|
+
2. **Update cross-references in all skills** — find-and-replace all `/skill:` references across all 7 skill files
|
|
178
|
+
3. **Add feature table to brainstorming** — update brainstorming skill to produce a `## Features` table in design doc
|
|
179
|
+
4. **Update writing-plans for feature-at-a-time** — detect next `⬜ pending` feature, plan only that feature, mark `🔄 planned`, update file naming to per-feature
|
|
180
|
+
5. **Update executing-tasks for feature loop** — mark feature `✅ done` after all tasks, suggest next feature or verify/finalize
|
|
181
|
+
6. **Move design review trigger** — remove brainstorm's "after design" review suggestion, confirm writing-plans already has the trigger (it does)
|
|
182
|
+
7. **Update executor end-of-feature prompts** — new prompt format with verify option and next feature
|
|
183
|
+
8. **Update workflow-guard extension** — rename skill references, add `pwk-verify` to phase map
|
|
184
|
+
9. **Update documentation** — workflow-phases.md, oversight-model.md, developer-usage-guide.md
|
|
185
|
+
|
|
186
|
+
Simple change — no design review needed.
|