@tianhai/pi-workflow-kit 0.18.1 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +79 -62
- package/agents/pwk-hazard-reviewer.md +24 -0
- package/agents/pwk-smell-reviewer.md +17 -0
- package/agents/pwk-spec-reviewer.md +14 -0
- package/agents/pwk-tracing-reviewer.md +14 -0
- package/docs/developer-usage-guide.md +38 -44
- package/docs/lessons.md +2 -7
- package/docs/oversight-model.md +18 -14
- package/docs/workflow-phases.md +52 -29
- package/extensions/workflow-guard.ts +190 -92
- package/package.json +18 -3
- package/skills/pwk-brainstorming/SKILL.md +19 -18
- package/skills/pwk-code-review/SKILL.md +46 -0
- package/skills/pwk-diagnose/SKILL.md +2 -1
- package/skills/pwk-executing-tasks/SKILL.md +102 -328
- package/skills/pwk-finalizing/SKILL.md +36 -84
- package/skills/pwk-status/SKILL.md +28 -0
- package/skills/pwk-writing-plans/SKILL.md +50 -325
- package/docs/plans/2026-06-03-karpathy-guidelines-ab-comparison.md +0 -166
- package/docs/plans/completed/2026-04-11-checkpoint-review-gates-design.md +0 -50
- package/docs/plans/completed/2026-04-11-checkpoint-review-gates-implementation.md +0 -98
- package/docs/plans/completed/2026-04-11-finalizing-merge-options-design.md +0 -33
- package/docs/plans/completed/2026-04-11-finalizing-merge-options-implementation.md +0 -75
- package/docs/plans/completed/2026-04-11-workspace-setup-design.md +0 -28
- package/docs/plans/completed/2026-04-11-workspace-setup-implementation.md +0 -57
- package/docs/plans/completed/2026-04-15-bash-guard-design.md +0 -39
- package/docs/plans/completed/2026-04-15-bash-guard-implementation.md +0 -229
- package/docs/plans/completed/2026-04-21-workflow-guard-safe-commands-design.md +0 -172
- package/docs/plans/completed/2026-04-21-workflow-guard-safe-commands-implementation.md +0 -168
- package/docs/plans/completed/2026-04-22-go-readonly-safe-commands-implementation.md +0 -54
- package/docs/plans/completed/2026-04-28-executing-tasks-redesign-design.md +0 -171
- package/docs/plans/completed/2026-04-28-executing-tasks-redesign-implementation.md +0 -208
- package/docs/plans/completed/2026-04-28-executing-tasks-redesign-progress.md +0 -14
- package/docs/plans/completed/2026-05-01-incorporate-mattpocock-skills-design.md +0 -154
- package/docs/plans/completed/2026-05-01-incorporate-mattpocock-skills-implementation.md +0 -315
- package/docs/plans/completed/2026-05-01-incorporate-mattpocock-skills-progress.md +0 -15
- package/docs/plans/completed/2026-05-08-checkpoint-gates-design.md +0 -235
- package/docs/plans/completed/2026-05-08-checkpoint-gates-implementation.md +0 -83
- package/docs/plans/completed/2026-05-08-checkpoint-gates-progress.md +0 -11
- package/docs/plans/completed/2026-05-08-lessons-learned-design.md +0 -76
- package/docs/plans/completed/2026-05-08-lessons-learned-implementation.md +0 -219
- package/docs/plans/completed/2026-05-08-lessons-learned-progress.md +0 -15
- package/docs/plans/completed/2026-05-08-migrate-earendil-works-design.md +0 -39
- package/docs/plans/completed/2026-05-08-migrate-earendil-works-implementation.md +0 -45
- package/docs/plans/completed/2026-05-08-migrate-earendil-works-progress.md +0 -10
- package/docs/plans/completed/2026-05-08-worktree-handoff-design.md +0 -118
- package/docs/plans/completed/2026-05-08-worktree-handoff-implementation.md +0 -140
- package/docs/plans/completed/2026-05-08-worktree-handoff-progress.md +0 -10
- package/docs/plans/completed/2026-05-20-generic-lessons-design.md +0 -70
- package/docs/plans/completed/2026-05-20-generic-lessons-implementation.md +0 -114
- package/docs/plans/completed/2026-05-20-generic-lessons-progress.md +0 -11
- package/docs/plans/completed/2026-05-22-agentic-agile-enhancements-design.md +0 -77
- package/docs/plans/completed/2026-05-22-agentic-agile-enhancements-implementation.md +0 -473
- package/docs/plans/completed/2026-05-25-design-review-split-implementation.md +0 -622
- package/docs/plans/completed/2026-05-25-design-review-split-progress.md +0 -16
- package/docs/plans/completed/2026-05-25-pr5-improvements-implementation.md +0 -273
- package/docs/plans/completed/2026-05-25-pr5-improvements-progress.md +0 -17
- package/docs/plans/completed/2026-06-03-add-verify-skill-design.md +0 -51
- package/docs/plans/completed/2026-06-03-add-verify-skill-implementation.md +0 -111
- package/docs/plans/completed/2026-06-03-add-verify-skill-progress.md +0 -11
- package/docs/plans/completed/2026-06-03-verify-skill-design.md +0 -176
- package/docs/plans/completed/2026-06-09-code-review-fixes-implementation.md +0 -74
- package/docs/plans/completed/2026-06-09-code-review-fixes-progress.md +0 -14
- package/docs/plans/completed/2026-06-09-incremental-workflow-and-rename-design.md +0 -186
- package/docs/plans/completed/2026-06-09-incremental-workflow-and-rename-implementation.md +0 -675
- package/docs/plans/completed/2026-06-09-incremental-workflow-and-rename-progress.md +0 -18
- package/docs/plans/completed/2026-06-09-incremental-workflow-and-rename-verification-report.md +0 -81
- package/docs/plans/completed/2026-06-09-verification-fixes-implementation.md +0 -69
- package/docs/plans/completed/2026-06-09-verification-fixes-progress.md +0 -14
- package/skills/pwk-design-review/SKILL.md +0 -115
- package/skills/pwk-verify/SKILL.md +0 -170
|
@@ -1,74 +0,0 @@
|
|
|
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
|
-
```
|
|
@@ -1,14 +0,0 @@
|
|
|
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 |
|
|
@@ -1,186 +0,0 @@
|
|
|
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.
|