@tianhai/pi-workflow-kit 1.0.0 → 1.2.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 +4 -4
- package/docs/developer-usage-guide.md +10 -9
- package/docs/lessons.md +2 -0
- package/docs/oversight-model.md +7 -5
- package/docs/workflow-phases.md +20 -8
- package/extensions/workflow-guard.ts +12 -8
- package/package.json +3 -2
- package/skills/pwk-brainstorming/SKILL.md +54 -26
- package/skills/pwk-code-review/SKILL.md +2 -2
- package/skills/pwk-diagnose/SKILL.md +3 -1
- package/skills/pwk-executing-tasks/SKILL.md +64 -68
- package/skills/pwk-finalizing/SKILL.md +43 -55
- package/skills/pwk-status/SKILL.md +11 -12
- package/skills/pwk-writing-plans/SKILL.md +32 -35
package/README.md
CHANGED
|
@@ -41,7 +41,7 @@ Enforces phase-appropriate tool access — not just guidelines, but hard blocks:
|
|
|
41
41
|
|
|
42
42
|
The agent can read code and discuss design with you during brainstorm/plan, but it physically cannot modify source files. Bash during gated phases is governed by a simple common-blacklist (a command is allowed unless it matches a destructive pattern), and a short phase reminder is shown once when the gated phase begins so the model self-restricts.
|
|
43
43
|
|
|
44
|
-
Phases transition only when you invoke a skill (`/skill:pwk-brainstorming` → read-only; `/skill:pwk-executing-tasks` → unrestricted) — no message keyword unlocks the guard. Need to override it? `/pwk-guard on` forces a read-only lock, `off` disables the guard entirely, `auto` (default) returns to skill-driven phases. The subcommands autocomplete after the command.
|
|
44
|
+
Phases transition only when you invoke a skill (`/skill:pwk-brainstorming` → read-only; `/skill:pwk-executing-tasks` → unrestricted) — no message keyword unlocks the guard. Unlocking skills: `pwk-executing-tasks`, `pwk-finalizing`, `pwk-code-review`, `pwk-diagnose` (all need source writes); `pwk-status` deliberately stays gated (read-only orientation). The canonical list is the exported `UNLOCK_SKILLS` in `extensions/workflow-guard.ts`, lint-asserted against the skills by `npm run check`. Need to override it? `/pwk-guard on` forces a read-only lock, `off` disables the guard entirely, `auto` (default) returns to skill-driven phases. The subcommands autocomplete after the command.
|
|
45
45
|
|
|
46
46
|
### 🧠 7 Workflow Skills
|
|
47
47
|
|
|
@@ -54,7 +54,7 @@ brainstorm → writing-plans → executing-tasks → finalizing
|
|
|
54
54
|
diagnose (anytime) · status (anytime)
|
|
55
55
|
```
|
|
56
56
|
|
|
57
|
-
A **design doc is one PR**; a **requirement is one testable slice within it**.
|
|
57
|
+
A **design doc is one PR**; a **requirement is one testable slice within it**. A requirement too big for one design doc but shipping as one PR is an **umbrella** — multiple design docs under one status-free overview, on one branch, finalized once.
|
|
58
58
|
|
|
59
59
|
| Phase | Trigger | What Happens |
|
|
60
60
|
|-------|---------|--------------|
|
|
@@ -63,8 +63,8 @@ A **design doc is one PR**; a **requirement is one testable slice within it**. F
|
|
|
63
63
|
| **Execute** | `/skill:pwk-executing-tasks` | Per requirement: write tests (red) → **checkpoint: tests** → implement (green) → **checkpoint: complete** → code-review |
|
|
64
64
|
| **Code review** | `/skill:pwk-code-review` | Per requirement: code tracing, spec alignment, code smells (applies fixes), production hazard check |
|
|
65
65
|
| **Finalize** | `/skill:pwk-finalizing` | Delete consumed plan docs, update README/CHANGELOG, create PR |
|
|
66
|
-
| **Diagnose** | `/skill:pwk-diagnose` | Debugging loop: reproduce → hypothesise → instrument → fix → cleanup |
|
|
67
|
-
| **Status** | `/skill:pwk-status` | Read-only overview of all active design topics — phase + progress. Use when resuming or juggling several designs in parallel worktrees. Not a pipeline phase
|
|
66
|
+
| **Diagnose** | `/skill:pwk-diagnose` | Debugging loop: reproduce → hypothesise → instrument → fix → cleanup. **Exits the gated phase** (debugging writes tests/instrumentation) |
|
|
67
|
+
| **Status** | `/skill:pwk-status` | Read-only overview of all active design topics — phase + progress. Use when resuming or juggling several designs in parallel worktrees. Not a pipeline phase; **does not exit the gated phase**. |
|
|
68
68
|
|
|
69
69
|
## The Workflow in Detail
|
|
70
70
|
|
|
@@ -32,7 +32,7 @@ Or in `.pi/settings.json` / `~/.pi/agent/config.json`:
|
|
|
32
32
|
|
|
33
33
|
## The workflow
|
|
34
34
|
|
|
35
|
-
You control each phase by invoking the skill. A design doc is one PR; a requirement is one testable slice within it.
|
|
35
|
+
You control each phase by invoking the skill. A design doc is one PR; a requirement is one testable slice within it. A requirement too big for one design doc but shipping as one PR is an **umbrella** — multiple design docs under one status-free overview, on one branch, finalized once:
|
|
36
36
|
|
|
37
37
|
```
|
|
38
38
|
/skill:pwk-brainstorming → /skill:pwk-writing-plans → /skill:pwk-executing-tasks → /skill:pwk-finalizing
|
|
@@ -46,7 +46,7 @@ You control each phase by invoking the skill. A design doc is one PR; a requirem
|
|
|
46
46
|
|
|
47
47
|
Explore the idea through collaborative dialogue. The agent reads code, asks questions, proposes approaches, and presents the design for your review.
|
|
48
48
|
|
|
49
|
-
Outcome: `docs/plans/YYYY-MM-DD-<topic>-design.md` — descriptive, opening with a `## Requirements` list.
|
|
49
|
+
Outcome: `docs/plans/YYYY-MM-DD-<topic>-design.md` — descriptive, opening with a `## Requirements` list. For a too-big requirement, may start an **umbrella** (writes a status-free overview + the first part's design doc). ADRs go to `docs/adr/` (permanent).
|
|
50
50
|
|
|
51
51
|
### 2. Plan
|
|
52
52
|
|
|
@@ -82,7 +82,7 @@ pi install npm:pi-subagents
|
|
|
82
82
|
/skill:pwk-finalizing
|
|
83
83
|
```
|
|
84
84
|
|
|
85
|
-
**Pre-check: run the full test suite** — never ship a red suite (resume spans sessions). Then delete consumed plan docs (
|
|
85
|
+
**Pre-check: run the full test suite** — never ship a red suite (resume spans sessions). Then archive or delete consumed plan docs (the human's choice), curate lessons, update CHANGELOG/README, create PR or merge.
|
|
86
86
|
|
|
87
87
|
### Diagnose (on demand)
|
|
88
88
|
|
|
@@ -90,7 +90,7 @@ pi install npm:pi-subagents
|
|
|
90
90
|
/skill:pwk-diagnose
|
|
91
91
|
```
|
|
92
92
|
|
|
93
|
-
A debugging loop you invoke when something is broken. Not a pipeline phase.
|
|
93
|
+
A debugging loop you invoke when something is broken. Not a pipeline phase. **Invoking it exits the gated brainstorm/plan phase** — diagnosis needs to write failing tests and debug instrumentation. If you only want read-only investigation mid-design, use `pwk-status` or re-lock with `/pwk-guard on`.
|
|
94
94
|
|
|
95
95
|
### Status (on demand)
|
|
96
96
|
|
|
@@ -98,15 +98,15 @@ A debugging loop you invoke when something is broken. Not a pipeline phase.
|
|
|
98
98
|
/skill:pwk-status
|
|
99
99
|
```
|
|
100
100
|
|
|
101
|
-
A read-only overview of all active design topics — which phase each is in and how far along. Use when resuming work or juggling several designs in parallel (e.g. across worktrees) and you're unsure which topic to continue. Not a pipeline phase.
|
|
101
|
+
A read-only overview of all active design topics — which phase each is in and how far along. Use when resuming work or juggling several designs in parallel (e.g. across worktrees) and you're unsure which topic to continue. Not a pipeline phase, and **it does not exit the gated phase** — it needs no writes, so the brainstorm/plan write boundary stays up.
|
|
102
102
|
|
|
103
103
|
## What the extension does
|
|
104
104
|
|
|
105
105
|
The `workflow-guard` extension watches `write`/`edit` and `bash` tool calls:
|
|
106
106
|
|
|
107
107
|
- **During brainstorm and writing-plans**: blocks writes outside `docs/plans/`, and blocks destructive bash via a simple common-blacklist (a command is allowed unless it matches a destructive pattern). A short phase reminder is shown once when the gated phase begins so the model self-restricts.
|
|
108
|
-
- **During executing-tasks, code-review, finalizing**: no restrictions.
|
|
109
|
-
- **Phases are skill-driven**: the guard follows the skill you invoke — it never unlocks on message keywords. To override, run `/pwk-guard on` (force read-only), `off` (disable), or `auto` (default; skill-driven). Subcommands autocomplete.
|
|
108
|
+
- **During executing-tasks, code-review, finalizing, diagnose**: no restrictions.
|
|
109
|
+
- **Phases are skill-driven**: the guard follows the skill you invoke — it never unlocks on message keywords. The exact unlock set is `pwk-executing-tasks`, `pwk-finalizing`, `pwk-code-review`, `pwk-diagnose`; `pwk-status` stays gated. To override, run `/pwk-guard on` (force read-only), `off` (disable), or `auto` (default; skill-driven). Subcommands autocomplete.
|
|
110
110
|
|
|
111
111
|
The destructive blacklist covers common file-mutating vectors (redirects, `tee`, `cp`/`mv`/`touch`/`rm`, `git commit`/`apply`, `npm install`, in-place editors like `sed -i`/`perl -i`, `patch`, `find -delete`). Exotic vectors (interpreter escapes like `node -e`, `python -c`, `| bash`) rely on the phase reminder — the guard is advisory, not a security boundary.
|
|
112
112
|
|
|
@@ -120,5 +120,6 @@ Plans specify *what* (acceptance criteria + integration tests); the executor wri
|
|
|
120
120
|
|
|
121
121
|
- Start with brainstorming for anything non-trivial.
|
|
122
122
|
- The plan is a behavioral spec, not an implementation recipe — let the executor choose how.
|
|
123
|
-
- Each requirement has two mandatory checkpoints: use them to steer test design and implementation.
|
|
124
|
-
-
|
|
123
|
+
- Each requirement has two mandatory checkpoints by default: use them to steer test design and implementation.
|
|
124
|
+
- **Right-size each requirement at plan time** with the `### Checkpoints` (`full`/`spec`/`none`) and `### Review` (`parallel`/`inline`/`skip`) tags — defaults are conservative (`full` + `parallel`), so behavior is unchanged unless you opt in. `spec` keeps the cheap spec-correctness gate and drops the complete checkpoint (covered by review), so it's the lowest-iteration option that doesn't sacrifice quality — but it requires at least `inline` review. A trivial fix can also use the brainstorming trivial fast-path (one-turn brainstorm, minimal design doc).
|
|
125
|
+
- Put all plan artifacts under `docs/plans/`; ADRs under `docs/adr/`.
|
package/docs/lessons.md
CHANGED
|
@@ -9,5 +9,7 @@ Retire rules that no longer apply during finalizing.
|
|
|
9
9
|
|
|
10
10
|
## Cross-Skill Consistency
|
|
11
11
|
|
|
12
|
+
- **skill-lint assertions for new behavior need a marker that distinguishes new from old.** A token present in both models gives a false green — e.g. `/umbrella/` matched the old `<umbrella>-overview.md` filename placeholder before the new behavior landed; switched to `/status-free/`, a property only the new model has.
|
|
13
|
+
- **Test-first for skill/doc content:** add the skill-lint assertion first (red — the skill doesn't yet claim the behavior), then edit the skill markdown to satisfy it (green). After edits run biome — it collapses short `if (cond) ok();` to one line and rejects array holes like `[, ""]` (restructure instead).
|
|
12
14
|
|
|
13
15
|
## Documentation
|
package/docs/oversight-model.md
CHANGED
|
@@ -6,11 +6,11 @@
|
|
|
6
6
|
|
|
7
7
|
Skills teach the agent the workflow. There are 5 pipeline skills:
|
|
8
8
|
|
|
9
|
-
- **pwk-brainstorming** — explore ideas, produce a descriptive design doc that opens with a `## Requirements` list
|
|
9
|
+
- **pwk-brainstorming** — explore ideas, produce a descriptive design doc that opens with a `## Requirements` list. For a requirement too big for one design doc, may start an **umbrella** (multiple design docs under one status-free overview, shipping as one PR)
|
|
10
10
|
- **pwk-writing-plans** — turn each requirement into acceptance criteria + integration-test cases (a behavioral spec, no implementation code)
|
|
11
11
|
- **pwk-executing-tasks** — implement requirement-by-requirement, test-first, with two mandatory human checkpoints per requirement
|
|
12
12
|
- **pwk-code-review** — the inline reviewer (code tracing, spec alignment, code smells, production hazards). During `pwk-executing-tasks`, per-requirement review instead runs **four specialized reviewers in parallel** via the `subagent` tool, each from a fresh context (spec gaps & scope creep, tracing, smells, hazards). These ship as package agents (`agents/pwk-*.md`) discovered natively by the optional **`pi-subagents`** package; all report findings only — fixes are applied by the executing-tasks main agent. Falls back to inline `/skill:pwk-code-review` when `pi-subagents` is not installed.
|
|
13
|
-
- **pwk-finalizing** —
|
|
13
|
+
- **pwk-finalizing** — dispose consumed plan docs (archive or delete; for an umbrella, the overview + every part), curate lessons, update docs, create PR or merge
|
|
14
14
|
|
|
15
15
|
Plus 2 on-demand skills:
|
|
16
16
|
|
|
@@ -27,12 +27,14 @@ The `workflow-guard` extension enforces one rule:
|
|
|
27
27
|
|
|
28
28
|
The agent can still use `read` and `bash` for investigation. During those gated phases, `bash` is governed by a simple destructive-command blacklist (`rm`, `>`, `git commit`, `npm install`, in-place editors, etc.) — a command is allowed unless it matches a destructive pattern. A short phase reminder is shown once when the gated phase begins so the model self-restricts.
|
|
29
29
|
|
|
30
|
-
During executing-tasks, code-review,
|
|
30
|
+
During executing-tasks, code-review, finalizing, **and diagnose**, nothing is restricted (diagnosis needs to write failing tests and debug instrumentation, so it exits the gate). `pwk-status` stays inside the gate.
|
|
31
31
|
|
|
32
|
-
|
|
32
|
+
Reviewer-agent checklists live only in `agents/pwk-*-reviewer.md` (single source of truth); `pwk-executing-tasks` passes each reviewer just the requirement scope + diff and names the agent.
|
|
33
|
+
|
|
34
|
+
Phases follow the skill you invoke — there is no message-keyword unlock. Invoking `/skill:pwk-executing-tasks`, `pwk-finalizing`, `pwk-code-review`, or `pwk-diagnose` exits the gated phase (those skills write source); `pwk-status` deliberately does **not** (read-only orientation). `/pwk-guard on|off|auto` manually overrides the guard.
|
|
33
35
|
|
|
34
36
|
## Enforcement style
|
|
35
37
|
|
|
36
|
-
Hard block for write boundaries during gated phases. No warnings, no escalation, no prompts. Either the tool call is allowed or it's blocked.
|
|
38
|
+
Hard block for write boundaries during gated phases. No warnings, no escalation, no prompts. Either the tool call is allowed or it's blocked. The unlock list is hard-coded in the extension and verified by `tests/skill-lint.mjs` against the skills' claims, so a skill that promises "read-only" can't silently unlock.
|
|
37
39
|
|
|
38
40
|
TDD, checkpoints, debugging, and code review are guidance in the skill instructions, not runtime-enforced. The bash blacklist covers common destructive vectors only; exotic escapes (interpreter one-liners, piped shells) rely on the phase reminder — the guard is advisory, not a security boundary.
|
package/docs/workflow-phases.md
CHANGED
|
@@ -7,7 +7,7 @@ brainstorm → writing-plans → executing-tasks → finalizing
|
|
|
7
7
|
(per requirement: tests → ⏸ checkpoint → implement → ⏸ checkpoint → code-review)
|
|
8
8
|
```
|
|
9
9
|
|
|
10
|
-
A design doc is one PR; a requirement is one testable slice within it.
|
|
10
|
+
A design doc is one PR; a requirement is one testable slice within it. A requirement too big for one design doc but shipping as one PR is an **umbrella**: multiple design docs under one status-free overview, on one branch, finalized once (`(brainstorm → plan → execute) × N → finalize`).
|
|
11
11
|
|
|
12
12
|
## brainstorm
|
|
13
13
|
|
|
@@ -16,8 +16,8 @@ A design doc is one PR; a requirement is one testable slice within it. For multi
|
|
|
16
16
|
```
|
|
17
17
|
|
|
18
18
|
- Explore requirements and shape the design.
|
|
19
|
-
- Produce `docs/plans/YYYY-MM-DD-<topic>-design.md` — descriptive, opening with a `## Requirements` list.
|
|
20
|
-
- May
|
|
19
|
+
- Produce `docs/plans/YYYY-MM-DD-<topic>-design.md` — descriptive, opening with a `## Requirements` list, ending with a `## Feature acceptance` section (end-to-end scenarios that prove the requirements compose into the PRD's behavior — the feature's definition-of-done).
|
|
20
|
+
- May start an **umbrella** for a requirement too big for one design doc (human-approved): writes the status-free `docs/plans/YYYY-MM-DD-<umbrella>-overview.md` (roster of parts + build order) and the **first** part's `-design.md`. Later parts are brainstormed one by one against the overview + implemented predecessors.
|
|
21
21
|
- ADRs go to `docs/adr/` (permanent, never archived).
|
|
22
22
|
|
|
23
23
|
Write boundary: only `docs/plans/` is writable. Source files are hard-blocked.
|
|
@@ -30,6 +30,8 @@ Write boundary: only `docs/plans/` is writable. Source files are hard-blocked.
|
|
|
30
30
|
|
|
31
31
|
- Creates the feature branch first (`git checkout -b <topic>`), so design + plan docs live on the branch, not `main`.
|
|
32
32
|
- Reads the design doc's `## Requirements`; for each, derives **acceptance criteria + integration-test cases** (a behavioral spec, no implementation code), lists requirements in build order (dependencies positioned earlier), and challenges the design when `## Production-risk areas` is present.
|
|
33
|
+
- For an umbrella part, reads the `*-overview.md` to plan one slice (composing with earlier parts' code) and reuses the existing feature branch instead of creating a new one.
|
|
34
|
+
- Derives a **`## Feature acceptance` section** in the plan from the design's Feature acceptance — an end-to-end integration test that exercises the requirements together (distinct from per-requirement tests). If the design has none, stops and asks the human to brainstorm one.
|
|
33
35
|
- Produce `docs/plans/YYYY-MM-DD-<topic>-implementation.md`.
|
|
34
36
|
|
|
35
37
|
Write boundary: only `docs/plans/` is writable.
|
|
@@ -41,12 +43,22 @@ Write boundary: only `docs/plans/` is writable.
|
|
|
41
43
|
```
|
|
42
44
|
|
|
43
45
|
- Per requirement: write the integration tests (red) → **⏸ checkpoint: tests** → implement to green (full autonomy — the executor chooses structure/signatures/internals) → **⏸ checkpoint: complete** → commit → **per-requirement review** (four parallel reviewers via the `subagent` tool; falls back to inline `/skill:pwk-code-review` when `pi-subagents` is absent — see [code-review](#code-review)).
|
|
44
|
-
- Two **mandatory** human checkpoints per requirement.
|
|
46
|
+
- Two **mandatory** human checkpoints per requirement — unless the plan tags a requirement lighter (see [Proportionality](#proportionality)).
|
|
47
|
+
- **Composition check after each commit** — if a requirement touched shared code, the executor runs the full suite now and fixes cross-requirement regressions immediately, rather than discovering them only at the integration gate.
|
|
45
48
|
- Progress tracked in `docs/plans/*-progress.md`.
|
|
46
|
-
- After all requirements: **integration gate** — run the full suite and confirm the requirements compose into the feature before `/skill:pwk-finalizing`.
|
|
49
|
+
- After all requirements: **integration gate** — run the full suite, **run the feature-acceptance test** (the end-to-end check from the plan's `## Feature acceptance` section), and confirm the requirements compose into the feature before `/skill:pwk-finalizing`.
|
|
47
50
|
|
|
48
51
|
No write restrictions. All tools available.
|
|
49
52
|
|
|
53
|
+
## Proportionality
|
|
54
|
+
|
|
55
|
+
The defaults preserve the 1.0.0 behavior (two checkpoints + parallel review per requirement). At plan time the human can tag each requirement lighter to right-size the workflow:
|
|
56
|
+
|
|
57
|
+
- **Checkpoints** — `full` (both stops, default) | `spec` (tests stop only — cheap spec-correctness gate, implementation covered by review) | `none` (no stops, trivial only). Test-first is preserved either way: even `none` writes tests first (red) and implements to green; only the human *stops* are optional. `spec` requires at least `inline` review (never combine with `skip`).
|
|
58
|
+
- **Review** — `parallel` (four fresh-context reviewers, default) | `inline` (single `pwk-code-review` pass) | `skip` (trivial diffs with no behavioral surface only).
|
|
59
|
+
|
|
60
|
+
A trivial fix can also skip the multi-turn brainstorm dialogue via the brainstorming trivial fast-path (compress to one turn, minimal design doc) — the guard still enforces read-only. Tags default conservatively, so nothing changes unless the human opts in.
|
|
61
|
+
|
|
50
62
|
## code-review
|
|
51
63
|
|
|
52
64
|
```
|
|
@@ -66,7 +78,7 @@ No write restrictions.
|
|
|
66
78
|
```
|
|
67
79
|
|
|
68
80
|
- **Pre-check: run the full test suite** — don't ship a red suite (resume spans sessions; don't trust the last execute session).
|
|
69
|
-
-
|
|
81
|
+
- Dispose of consumed plan docs (per-`<topic>`) — the human picks **delete** (default — code + tests are the source of truth) or **archive** to `docs/plans/completed/` (keep planning history). ADRs stay at `docs/adr/`. For an umbrella (an `*-overview.md` exists), disposes the overview **and every part's** docs in one pass and ships **one PR**.
|
|
70
82
|
- Curate `docs/lessons.md`, update README/CHANGELOG, create PR or merge.
|
|
71
83
|
|
|
72
84
|
No write restrictions.
|
|
@@ -77,7 +89,7 @@ No write restrictions.
|
|
|
77
89
|
/skill:pwk-status
|
|
78
90
|
```
|
|
79
91
|
|
|
80
|
-
Read-only overview of all active pipeline topics (phase + progress) when several designs are in flight. Not a pipeline phase.
|
|
92
|
+
Read-only overview of all active pipeline topics (phase + progress) when several designs are in flight; an umbrella rolls up under its overview (shipped / in-flight / not-started). Not a pipeline phase — and it **does not exit the gated phase** (`pwk-status` is read-only; it runs fine under the brainstorm/plan write block, so the boundary stays up).
|
|
81
93
|
|
|
82
94
|
## diagnose
|
|
83
95
|
|
|
@@ -85,7 +97,7 @@ Read-only overview of all active pipeline topics (phase + progress) when several
|
|
|
85
97
|
/skill:pwk-diagnose
|
|
86
98
|
```
|
|
87
99
|
|
|
88
|
-
Not a pipeline phase. A utility skill invoked on demand when debugging is needed.
|
|
100
|
+
Not a pipeline phase. A utility skill invoked on demand when debugging is needed. Invoking it **exits the gated phase** — diagnosis needs to write failing tests and `[DEBUG-…]` instrumentation. To stay read-only mid-brainstorm, use `/skill:pwk-status` instead, or re-lock with `/pwk-guard on`.
|
|
89
101
|
|
|
90
102
|
No write restrictions.
|
|
91
103
|
|
|
@@ -128,6 +128,10 @@ const SKILL_TO_PHASE: Record<string, Phase> = {
|
|
|
128
128
|
"pwk-writing-plans": "plan",
|
|
129
129
|
};
|
|
130
130
|
|
|
131
|
+
/** Skills whose invocation exits a gated phase (used by the input handler; exported for tests/
|
|
132
|
+
* skill-lint). Deliberately excludes pwk-status (read-only by design; stays gated). */
|
|
133
|
+
export const UNLOCK_SKILLS = ["pwk-executing-tasks", "pwk-finalizing", "pwk-code-review", "pwk-diagnose"] as const;
|
|
134
|
+
|
|
131
135
|
/** Phase-aware reminder appended after the user's message each turn while a gated phase is active.
|
|
132
136
|
* Returned as a message (not a system-prompt change) so it sits at the tail of the request and
|
|
133
137
|
* never invalidates the cached prefix. */
|
|
@@ -247,14 +251,14 @@ export default function (pi: ExtensionAPI) {
|
|
|
247
251
|
}
|
|
248
252
|
}
|
|
249
253
|
// Phase transitions happen only via skills — no message keyword unlocks the plan phase.
|
|
250
|
-
// Run /skill:pwk-executing-tasks (or
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
) {
|
|
254
|
+
// Run /skill:pwk-executing-tasks (or another write-needing skill) to leave a gated phase.
|
|
255
|
+
//
|
|
256
|
+
// Unlock list rationale: execute/finalize/code-review/diagnose all need to write source
|
|
257
|
+
// (implement, edit review fixes, add [DEBUG-] instrumentation), so they exit the gate.
|
|
258
|
+
// pwk-status is NOT here on purpose: it is read-only orientation, so it stays inside the
|
|
259
|
+
// gated phase and never drops the write boundary the user is relying on.
|
|
260
|
+
// (Orientation never needs write access; see skills/pwk-status.)
|
|
261
|
+
if (UNLOCK_SKILLS.some((s) => text.startsWith(`/skill:${s}`))) {
|
|
258
262
|
phase = null;
|
|
259
263
|
}
|
|
260
264
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tianhai/pi-workflow-kit",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"description": "Enforce structured brainstorm→plan→execute→finalize workflow with TDD discipline in AI coding agents",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"pi-package",
|
|
@@ -16,7 +16,8 @@
|
|
|
16
16
|
"scripts": {
|
|
17
17
|
"test": "vitest run",
|
|
18
18
|
"lint": "biome check .",
|
|
19
|
-
"
|
|
19
|
+
"skill-lint": "node tests/skill-lint.mjs",
|
|
20
|
+
"check": "biome check . && vitest run && node tests/skill-lint.mjs"
|
|
20
21
|
},
|
|
21
22
|
"license": "MIT",
|
|
22
23
|
"author": "yinloo-ola",
|
|
@@ -5,56 +5,84 @@ description: "Use this before any creative work — creating features, building
|
|
|
5
5
|
|
|
6
6
|
# Brainstorming
|
|
7
7
|
|
|
8
|
-
Read-only exploration
|
|
8
|
+
Read-only exploration of source code; every file you create or edit goes under `docs/plans/`. (Once an ADR is approved by the human, `docs/adr/` becomes writable too — ask the user to unlock or run the write.) Planning produces the document the executor builds from; source-writing happens in later phases.
|
|
9
9
|
|
|
10
|
-
##
|
|
10
|
+
## Proportionality: trivial vs non-trivial
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
Classify the change at the start.
|
|
13
13
|
|
|
14
|
-
- **
|
|
15
|
-
- **
|
|
14
|
+
- **Trivial** — typo or obvious bugfix with no open design questions, config/version bump, single-function change, or anything the human flags as trivial. Skip steps 3–5; write a **minimal** design doc in one turn (one-line context, a `## Requirements` list with the single requirement, optional `## Production-risk areas` line), and hand off to `/skill:pwk-writing-plans`. The guard still enforces read-only — trivial compresses the phase to one turn, it doesn't skip it.
|
|
15
|
+
- **Non-trivial** — open design questions, multiple approaches, cross-module impact, or new behavior. Run the full process below.
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
When unsure, ask: "This looks trivial — fast-path it, or full brainstorm?" Default to full.
|
|
18
18
|
|
|
19
|
-
##
|
|
19
|
+
## Granularity
|
|
20
|
+
|
|
21
|
+
**One design doc = one PR; one requirement = one testable slice within it.** Most work is a single design doc.
|
|
22
|
+
|
|
23
|
+
- Within a doc, decompose into **requirements**, each one testable behavior.
|
|
24
|
+
- A requirement too big for one design doc but shipping as a single PR is an **umbrella** — multiple design docs decomposed under one overview, on one branch, finalized once. See [Umbrella](#umbrella) below.
|
|
20
25
|
|
|
21
|
-
|
|
22
|
-
2. **Discovery** *(skip if this is a brand-new repo with no `docs/plans/`)* — glob `docs/plans/*-design.md`. Report active topics found (e.g. `In-flight: auth (plan), billing (brainstorm)`). Multiple designs may run in parallel. If the new idea continues an existing topic, ask the human whether to extend it or start fresh before designing.
|
|
23
|
-
3. **Understand the idea** — read existing code, docs, and recent commits. Grep for related functionality, check package.json/dependencies and module structure. **Check `docs/lessons.md`** if it exists — known constraints and patterns may affect the design. Read only what's necessary to ground the design — don't read the entire codebase. Ask questions to refine the idea. Prefer multiple choice when possible. After each question, check: can you clearly articulate (a) what the user wants to build, (b) why, and (c) key constraints? If yes, present your understanding as a short summary and ask: "Should I proceed with this, or is there more to add?" The human decides when to move on.
|
|
24
|
-
4. **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.
|
|
25
|
-
5. **Present the design** — break it into focused sections. Each section should be one screen of reading. Present each section to the human and wait for approval before continuing. Cover: architecture, components, data flow, error handling, testing. On feedback, incorporate it and re-present the revised section.
|
|
26
|
+
## Umbrella
|
|
26
27
|
|
|
27
|
-
|
|
28
|
+
An umbrella splits one large requirement into multiple design docs that ship together as **one PR**. One branch; one `pwk-finalizing` at the end. The split is intra-PR decomposition — a way to keep each design/plan/execute cycle small and focused, not a multi-PR strategy.
|
|
28
29
|
|
|
29
|
-
|
|
30
|
-
2. **Surprising without context** — a future reader will wonder "why?"
|
|
31
|
-
3. **A real trade-off** — there were genuine alternatives
|
|
30
|
+
**First brainstorm** (the requirement is too big for one design doc):
|
|
32
31
|
|
|
33
|
-
|
|
32
|
+
1. **Propose the split** — the parts, a one-line scope each, and build order. Get human approval before writing anything beyond discovery.
|
|
33
|
+
2. **Write the overview** — `docs/plans/YYYY-MM-DD-<umbrella>-overview.md`, a **status-free roster**:
|
|
34
34
|
|
|
35
35
|
```markdown
|
|
36
|
-
# <
|
|
36
|
+
# Overview: <umbrella>
|
|
37
37
|
|
|
38
|
-
<
|
|
38
|
+
Goal: <one line — what the whole requirement delivers>
|
|
39
|
+
|
|
40
|
+
## Parts (build order)
|
|
41
|
+
1. <topic> — <one-line scope>
|
|
42
|
+
2. <topic> — <one-line scope>
|
|
39
43
|
```
|
|
40
44
|
|
|
41
|
-
|
|
45
|
+
Goal, parts with one-line scopes, build order — **no status column**. No skill mutates the overview between this write and `pwk-finalizing` (which disposes it); part-completion is inferred from each part's own `*-progress.md`.
|
|
46
|
+
3. **Write the first part's** `YYYY-MM-DD-<part>-design.md`, then hand off to `/skill:pwk-writing-plans`.
|
|
47
|
+
|
|
48
|
+
**Later parts** — re-run `/skill:pwk-brainstorming` for the next part. Read the overview for big-picture/roster context (which slice is yours, which siblings exist), then explore the codebase to design your slice **as brainstorm always does** — prior parts are just implemented code in the repo by then. There is no special "read your predecessors" step; cross-slice decisions that must persist go in an ADR, not the overview.
|
|
42
49
|
|
|
43
|
-
|
|
50
|
+
The whole umbrella is one branch and one PR: `pwk-writing-plans` creates the branch on the first part and reuses it for later parts; `pwk-executing-tasks` suggests the next part (or finalize after the last); `pwk-finalizing` disposes the overview + every part's docs and ships one PR.
|
|
51
|
+
|
|
52
|
+
## Process
|
|
53
|
+
|
|
54
|
+
1. **Check git state** — `git status` + `git log --oneline -5`. Uncommitted work? Ask the user what to do first.
|
|
55
|
+
2. **Discovery** *(skip in a brand-new repo with no `docs/plans/`)* — glob `docs/plans/*-design.md` and `*-overview.md`; report in-flight topics and any active umbrella. If the new idea continues an existing topic, ask whether to extend it or start fresh. Part of an umbrella? An existing `*-overview.md` means the split is already decided — read it for the roster and design this part's `-design.md` against it (see [Umbrella](#umbrella)).
|
|
56
|
+
3. **Understand the idea** — read only enough code/docs/commits to ground the design. **Check `docs/lessons.md`** — known constraints may shape it. Ask questions one at a time, prefer multiple choice. Once you can articulate what/why/constraints, present a short summary and ask: "Should I proceed, or is there more?" The human decides when to move on.
|
|
57
|
+
4. **Explore approaches** — propose 2–3, leading with your recommendation. Sketch the concrete interface (types, signatures, example caller) for each so the comparison is grounded in code, not abstractions.
|
|
58
|
+
5. **Present the design** in one pass, organized into sections (architecture, components, data flow, error handling, testing) — the human comments on any section; re-present only revised sections.
|
|
59
|
+
|
|
60
|
+
Identified a significant architectural decision? Offer an ADR in `docs/adr/`. Only when all three hold: **hard to reverse**, **surprising without context**, **a real trade-off**. Format: title + 1–3 sentences of context/decision/why. ADRs are permanent institutional memory — they stay out of archive/rotation forever. (Guard note: `docs/adr/` is outside the writable `docs/plans/`; write it only after the user approves and unlocks.)
|
|
61
|
+
6. **Write the design doc** — `docs/plans/YYYY-MM-DD-<topic>-design.md`, descriptive (not a task list). **Open with `## Requirements`** — one testable behavior each; `pwk-writing-plans` derives acceptance criteria and tests from these. Then: problem, approaches considered, architecture, components, data flow, error handling, testing.
|
|
62
|
+
|
|
63
|
+
Touches a production-risk area (DB schema/migrations, auth, external APIs, concurrency/batch, uploads/large data flows, Redis/caching/queues)? Add a brief `## Production-risk areas` — `pwk-writing-plans` carries it into the plan and `pwk-code-review` audits it per requirement.
|
|
64
|
+
|
|
65
|
+
**End with `## Feature acceptance`** — one or more end-to-end `Given/When/Then` scenarios proving the requirements *compose* into the feature. This is the feature's definition-of-done; the human approves it as what "the feature works" means. `pwk-writing-plans` derives a feature-level test from it; `pwk-executing-tasks` runs it at the integration gate. Treat "I can write this scenario" as the green light to finish designing — if you can't, keep designing because the requirements don't yet compose into a coherent feature.
|
|
66
|
+
|
|
67
|
+
```markdown
|
|
68
|
+
## Feature acceptance
|
|
69
|
+
|
|
70
|
+
- Given <starting state>, When <trigger>, Then <end-to-end outcome the feature promises>.
|
|
71
|
+
```
|
|
44
72
|
|
|
45
|
-
|
|
73
|
+
Example (rate limiting): "Given a new API consumer with no prior usage, When they exceed 100 requests/minute for 3 consecutive minutes, Then they're throttled, a `rate_limited` event is emitted, and further requests return 429."
|
|
46
74
|
|
|
47
|
-
**Splitting large issues:** if the
|
|
75
|
+
**Splitting large issues:** if the requirement needs more than one design doc, propose an umbrella split (one `<topic>` per part) and get human approval first — see [Umbrella](#umbrella). On approval, write the status-free `*-overview.md` and the **first part's** `-design.md`, then hand off to `/skill:pwk-writing-plans`. Later parts are brainstormed one by one (each re-reading the overview) — do not write every part's design doc up front.
|
|
48
76
|
|
|
49
|
-
|
|
77
|
+
The session stays read-only and uncommitted through brainstorm and plan: branch creation happens at the end of `/skill:pwk-writing-plans`; plan docs are committed at the start of `pwk-executing-tasks`.
|
|
50
78
|
|
|
51
79
|
## Principles
|
|
52
80
|
|
|
53
81
|
- One question at a time
|
|
54
82
|
- YAGNI — remove unnecessary features
|
|
55
83
|
- Design for testability
|
|
56
|
-
-
|
|
84
|
+
- Explore alternatives before settling
|
|
57
85
|
|
|
58
86
|
## After the design
|
|
59
87
|
|
|
60
|
-
Ask: "Ready to plan? Run `/skill:pwk-writing-plans`"
|
|
88
|
+
Ask: "Ready to plan? Run `/skill:pwk-writing-plans`"
|
|
@@ -38,8 +38,8 @@ Review the code just implemented for a requirement. **Unlocked** — you may edi
|
|
|
38
38
|
## Principles
|
|
39
39
|
|
|
40
40
|
- **Tracing and spec alignment are the core** — they catch what tests miss: untested branches, missing criteria, scope creep.
|
|
41
|
-
- **Fix smells in place; flag everything else.**
|
|
42
|
-
- **Be proportional** — a one-function change doesn't need the depth of a batch pipeline.
|
|
41
|
+
- **Fix smells in place; flag everything else.** Keep the review scoped — the goal is polish on the requirement that just landed, not a redesign pass.
|
|
42
|
+
- **Be proportional** — a one-function change doesn't need the depth of a batch pipeline. When this skill runs as the inline path because the plan tagged the requirement `Review: inline`, that was a deliberate call at plan time — keep the review focused and don't second-guess the tag.
|
|
43
43
|
|
|
44
44
|
## After the review
|
|
45
45
|
|
|
@@ -7,6 +7,8 @@ description: "Disciplined debugging loop for hard bugs and performance regressio
|
|
|
7
7
|
|
|
8
8
|
A 6-phase debugging discipline. Phase 1 is the skill — spend disproportionate effort here.
|
|
9
9
|
|
|
10
|
+
Invoking `/skill:pwk-diagnose` **exits the gated brainstorm/plan phase** (the workflow guard unlocks) — diagnosis needs to write failing tests and `[DEBUG-…]` instrumentation. If you only wanted read-only investigation, use `/skill:pwk-status` (stays gated) or reinstate the lock with `/pwk-guard on`.
|
|
11
|
+
|
|
10
12
|
## Phase 1 — Build a feedback loop
|
|
11
13
|
|
|
12
14
|
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.
|
|
@@ -19,7 +21,7 @@ The loop must produce the failure mode the **user** described — not a nearby b
|
|
|
19
21
|
|
|
20
22
|
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.
|
|
21
23
|
|
|
22
|
-
|
|
24
|
+
Hold at Phase 1 until you have a loop you believe in. Everything downstream — hypotheses, instrumentation, the fix — depends on that loop actually reproducing the user's symptom.
|
|
23
25
|
|
|
24
26
|
## Phase 2 — Reproduce
|
|
25
27
|
|
|
@@ -5,24 +5,21 @@ description: "Implement a plan requirement-by-requirement with test-first discip
|
|
|
5
5
|
|
|
6
6
|
# Executing Tasks
|
|
7
7
|
|
|
8
|
-
Implement the plan from `docs/plans/*-implementation.md` requirement
|
|
8
|
+
Implement the plan from `docs/plans/*-implementation.md` requirement by requirement, tracking progress in a file.
|
|
9
9
|
|
|
10
|
-
The plan is a **behavioral spec** (acceptance criteria + integration tests)
|
|
10
|
+
The plan is a **behavioral spec** (acceptance criteria + integration tests) — it deliberately contains no implementation steps. You choose structure, signatures, and internals; the criteria define *what*, you decide *how*.
|
|
11
11
|
|
|
12
12
|
## Before you start
|
|
13
13
|
|
|
14
|
-
1. **
|
|
15
|
-
2. **Find the plan
|
|
16
|
-
3. **Workspace
|
|
14
|
+
1. **Git state** — `git status` + `git log --oneline -5`; note uncommitted changes.
|
|
15
|
+
2. **Find the plan** — glob `docs/plans/*-implementation.md`; if several, ask which. Report one line, e.g. `Found: design "auth" — execute phase (1/3 done)`. A matching `*-progress.md` means this is a **resume** (see [Resume](#resume)).
|
|
16
|
+
3. **Workspace** — `pwk-writing-plans` already created the branch/worktree. If you're still on `main`, tell the user the workspace wasn't set up and suggest fixing that before executing.
|
|
17
17
|
|
|
18
18
|
## First run
|
|
19
19
|
|
|
20
|
-
1. **Parse the plan** — read
|
|
21
|
-
2. **Setup pre-flight**
|
|
22
|
-
|
|
23
|
-
- **request changes** → revise and re-present.
|
|
24
|
-
(Only runs on the first `First run` — the progress file is created after this step, so a resumed session skips setup.)
|
|
25
|
-
3. **Create the progress file** at `docs/plans/<plan-name>-progress.md`:
|
|
20
|
+
1. **Parse the plan** — read every `## Requirement N:` heading and its `### Checkpoints` / `### Review` tags (defaults `full` / `parallel`). Requirements run in **listed order** — the plan is already in build order; do not reorder.
|
|
21
|
+
2. **Setup pre-flight** *(only if the plan has a `## Setup` section)* — install dependencies, apply migrations, seed data, then run the existing test suite. **⏸ CHECKPOINT: setup** — present results and wait for approval. Record `setup: done` in the progress-file header so a resume can confirm it rather than assume it.
|
|
22
|
+
3. **Create the progress file** `docs/plans/YYYY-MM-DD-<topic>-progress.md` (same dated stem as the implementation doc, so `pwk-finalizing`'s glob matches):
|
|
26
23
|
|
|
27
24
|
```markdown
|
|
28
25
|
# Progress: <topic>
|
|
@@ -37,97 +34,101 @@ The plan is a **behavioral spec** (acceptance criteria + integration tests). You
|
|
|
37
34
|
| 1 | ⬜ pending | <requirement name> | — |
|
|
38
35
|
```
|
|
39
36
|
4. **Commit the plan docs** — `git add docs/plans/ && git commit -m "docs: add implementation plan"`.
|
|
40
|
-
5.
|
|
37
|
+
5. Start requirement 1.
|
|
41
38
|
|
|
42
39
|
## Resume
|
|
43
40
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
- `⬜ pending` → start it.
|
|
41
|
+
Find the first row that is `⬜ pending`, `🔄 in-progress`, `⏸ tests-review`, or `⏸ complete-review`:
|
|
42
|
+
- `⏸ *-review` → re-present that checkpoint and wait.
|
|
43
|
+
- `🔄 in-progress` → continue the requirement.
|
|
44
|
+
- `⬜ pending` → start it.
|
|
49
45
|
|
|
50
46
|
## Progress file
|
|
51
47
|
|
|
52
|
-
|
|
48
|
+
Update the matching row directly (not via pattern matching that could corrupt the table). Update `Last updated` on every change.
|
|
53
49
|
|
|
54
50
|
| Status | Meaning |
|
|
55
51
|
|--------|---------|
|
|
56
52
|
| `⬜ pending` | Not started |
|
|
57
53
|
| `🔄 in-progress` | Writing tests or implementing |
|
|
58
|
-
| `⏸ tests-review` | Paused at checkpoint
|
|
59
|
-
| `⏸ complete-review` | Paused at checkpoint
|
|
60
|
-
| `🔎 review` | Committed;
|
|
61
|
-
| `✅ done` |
|
|
62
|
-
| `❌ failed` |
|
|
54
|
+
| `⏸ tests-review` | Paused at tests checkpoint, awaiting approval |
|
|
55
|
+
| `⏸ complete-review` | Paused at complete checkpoint, awaiting approval |
|
|
56
|
+
| `🔎 review` | Committed; code review in progress |
|
|
57
|
+
| `✅ done` | Reviewed (smells fixed, hazards noted), all green |
|
|
58
|
+
| `❌ failed` | Abandoned; partial work discarded/reverted (append `Failed: <reason>`) |
|
|
63
59
|
| `⏭ skipped` | User chose to skip |
|
|
64
60
|
|
|
65
61
|
## Per-requirement execution
|
|
66
62
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
-
|
|
78
|
-
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
Gather the requirement's scope: acceptance criteria, integration test cases, and git diff (`git log --oneline -5 && git diff HEAD~N..HEAD`).
|
|
83
|
-
|
|
84
|
-
**If the `subagent` tool is available**, invoke it with parallel tasks:
|
|
63
|
+
1. **Mark 🔄 in-progress** and read this requirement's `### Checkpoints` / `### Review` tags.
|
|
64
|
+
2. **Write the integration tests (red).** Encode the acceptance criteria + test cases from the plan as real test files; run them; confirm they **fail**. If they pass immediately, the behavior may already exist or the tests are wrong — investigate before proceeding.
|
|
65
|
+
3. **⏸ CHECKPOINT: tests** *(fires for `full` and `spec`)* — mark `⏸ tests-review`, present the tests + failing output, wait. **request changes** → revise, re-run, re-present. With `none`, show the red output inline and proceed.
|
|
66
|
+
4. **Implement (green)** with full autonomy. Run tests after each meaningful change; refactor for clarity (deep modules, no duplication, seam discipline) while tests stay green.
|
|
67
|
+
5. **Learn.** Caught a repeat mistake? Append a **generic** rule to `docs/lessons.md` (strip domain specifics).
|
|
68
|
+
6. **⏸ CHECKPOINT: complete** *(fires for `full` only)* — mark `⏸ complete-review`, show passing tests + `git diff`, wait. With `spec`/`none`, show them inline and proceed (**review** covers implementation quality; `spec` requires at least `inline` review).
|
|
69
|
+
7. **Commit** the relevant files with a clear message. Status stays `🔄 in-progress` — not done yet.
|
|
70
|
+
8. **Composition check** — if this diff touched code shared with other requirements in the plan, run the **full test suite** now and fix any cross-requirement regression while the context is fresh. Otherwise keep running just this requirement's tests.
|
|
71
|
+
9. **Code review** — mark `🔎 review`; drive review by the `### Review` tag (`parallel | inline | skip`):
|
|
72
|
+
- **`parallel`** — four fresh-context reviewers via the `subagent` tool (see below).
|
|
73
|
+
- **`inline`** — run `/skill:pwk-code-review` as a single pass.
|
|
74
|
+
- **`skip`** — mark `✅ done` and move to the next requirement.
|
|
75
|
+
|
|
76
|
+
**Parallel path** — gather scope (acceptance criteria, test cases, `git log --oneline -5 && git diff HEAD~N..HEAD`) and invoke:
|
|
85
77
|
```json
|
|
86
78
|
{
|
|
87
79
|
"tasks": [
|
|
88
|
-
{"agent": "pwk-spec-reviewer", "task": "<scope + diff here
|
|
89
|
-
{"agent": "pwk-tracing-reviewer", "task": "<scope + diff here
|
|
90
|
-
{"agent": "pwk-smell-reviewer", "task": "<scope + diff here
|
|
91
|
-
{"agent": "pwk-hazard-reviewer", "task": "<scope + diff here
|
|
80
|
+
{"agent": "pwk-spec-reviewer", "task": "<scope + diff here>"},
|
|
81
|
+
{"agent": "pwk-tracing-reviewer", "task": "<scope + diff here>"},
|
|
82
|
+
{"agent": "pwk-smell-reviewer", "task": "<scope + diff here>"},
|
|
83
|
+
{"agent": "pwk-hazard-reviewer", "task": "<scope + diff here>"}
|
|
92
84
|
],
|
|
93
85
|
"agentScope": "both",
|
|
94
86
|
"cwd": "<repo-root>"
|
|
95
87
|
}
|
|
96
88
|
```
|
|
89
|
+
The reviewer checklists live only in `agents/pwk-*-reviewer.md` — don't restate them in the task strings (duplication guarantees drift). Reviewers are read-only reporters; the executing agent applies fixes and commits.
|
|
97
90
|
|
|
98
|
-
**On success
|
|
91
|
+
**On success** — apply smell fixes yourself (re-run integration tests, must stay green, commit), flag trace/spec/hazard findings as follow-ups for the human, mark `✅ done`.
|
|
99
92
|
|
|
100
|
-
**Fallback**
|
|
101
|
-
|
|
93
|
+
**Fallback** — subagent tool unavailable or errors → run `/skill:pwk-code-review` inline instead.
|
|
94
|
+
10. **Loop** to step 1 for the next `⬜ pending` requirement, or see [After all requirements](#after-all-requirements).
|
|
102
95
|
|
|
103
|
-
### Checkpoint gates are mandatory
|
|
96
|
+
### Checkpoint gates are mandatory (when the tag says so)
|
|
104
97
|
|
|
105
|
-
|
|
106
|
-
- Stop
|
|
107
|
-
- **Never** `git add` or `git commit` before
|
|
98
|
+
`### Checkpoints` accepted values: `full | spec | none` → both stops / tests stop only / no stops. When a checkpoint fires it is a **hard stop**:
|
|
99
|
+
- Stop immediately; never proceed without explicit human approval.
|
|
100
|
+
- **Never** `git add` or `git commit` before approval at a checkpoint.
|
|
108
101
|
- Mark the progress file to the review status **before** pausing.
|
|
109
102
|
|
|
103
|
+
`Checkpoints: spec` with `Review: skip` is invalid (nothing would cover implementation quality) — stop and ask the human to fix the tags; use `Checkpoints: none` for truly trivial diffs.
|
|
104
|
+
|
|
110
105
|
## User override commands
|
|
111
106
|
|
|
112
107
|
| User says | Agent does |
|
|
113
108
|
|-----------|-----------|
|
|
114
109
|
| `skip` | Mark current requirement `⏭ skipped`, move to next |
|
|
115
110
|
| `status` | Show the progress table |
|
|
116
|
-
| `stop` | Restore current requirement to its pre-in-progress state, suggest `/new`
|
|
111
|
+
| `stop` | Restore current requirement to its pre-in-progress state, suggest `/new` |
|
|
117
112
|
| `retry` | Re-read the requirement, start over |
|
|
118
113
|
|
|
119
114
|
## Receiving feedback (outside a checkpoint)
|
|
120
115
|
|
|
121
|
-
|
|
116
|
+
Verify the criticism against the code, evaluate the suggestion, then implement (with tests) or push back with evidence. Don't blindly apply.
|
|
122
117
|
|
|
123
118
|
## After all requirements
|
|
124
119
|
|
|
125
|
-
When no `⬜ pending` or
|
|
120
|
+
When no `⬜ pending` or `🔄 in-progress` requirements remain, run the **integration gate** before suggesting finalize — per-requirement review only saw each diff in isolation; this proves the requirements *compose* into the feature:
|
|
121
|
+
|
|
122
|
+
1. **Run the FULL test suite.** A failure here means one requirement regressed another — fix it now, in execute context.
|
|
123
|
+
2. **Run the feature-acceptance test.** The plan's `## Feature acceptance` section specifies one end-to-end test exercising the requirements *together* against the design's claim. Write it if missing; run it; it must pass. If the plan has no such section, stop and tell the human — the gate has nothing concrete to verify.
|
|
124
|
+
3. **Confirm composition.** Do the requirements together deliver the end-to-end behavior the design doc described? Fix gaps here, with tests, before shipping.
|
|
125
|
+
|
|
126
|
+
Then determine the next step from the artifacts (the human drives every transition — this is a suggestion, not a gate):
|
|
126
127
|
|
|
127
|
-
|
|
128
|
-
|
|
128
|
+
- **Standalone design doc** (no `docs/plans/*-overview.md`) → suggest `/skill:pwk-finalizing`.
|
|
129
|
+
- **Umbrella part** (an `*-overview.md` exists) → read the overview roster and find this part's `<topic>`. If it's the **last** in build order, the umbrella is complete → suggest `/skill:pwk-finalizing` (one PR for the whole umbrella). If **more parts remain**, suggest `/skill:pwk-brainstorming` for the next part (the next `<topic>` in the roster).
|
|
129
130
|
|
|
130
|
-
|
|
131
|
+
Present:
|
|
131
132
|
|
|
132
133
|
```
|
|
133
134
|
✅ All requirements complete — integration verified!
|
|
@@ -137,18 +138,13 @@ Only when the full suite is green and the feature works end-to-end:
|
|
|
137
138
|
| 1 | ✅ done | <name> |
|
|
138
139
|
| … | … | … |
|
|
139
140
|
|
|
140
|
-
-
|
|
141
|
+
- Next part: /skill:pwk-brainstorming (<next topic>) ← umbrella, more parts remain
|
|
142
|
+
- Ship: /skill:pwk-finalizing ← standalone, or last umbrella part
|
|
141
143
|
```
|
|
142
144
|
|
|
143
145
|
## If you're stuck
|
|
144
146
|
|
|
145
147
|
1. Re-read the requirement's acceptance criteria — you may have drifted.
|
|
146
|
-
2. Check `git log` for context.
|
|
147
|
-
3.
|
|
148
|
-
4.
|
|
149
|
-
- Discard uncommitted changes (`git restore .`).
|
|
150
|
-
- If the requirement has already been committed (step 7 completed), also revert its commit(s) so partial work leaves no trace on the shipped branch (`git revert HEAD --no-edit` if only the requirement commit; `git revert HEAD~N..HEAD --no-edit` if multiple commits including code-review smell fixes).
|
|
151
|
-
|
|
152
|
-
**Never leave a failed requirement's partial work on the shipped branch.** Dead code from incomplete requirements must be cleaned up before moving on.
|
|
153
|
-
5. Mark `❌ failed` with the reason and move on.
|
|
154
|
-
6. Check `docs/lessons.md` — a prior lesson may apply.
|
|
148
|
+
2. Check `git log` for context. Ask the user — clarify beats guessing.
|
|
149
|
+
3. Still stuck → discard uncommitted changes (`git restore .`); if already committed, also `git revert` the requirement's commit(s). **Never leave a failed requirement's partial work on the shipped branch.**
|
|
150
|
+
4. Mark `❌ failed` with the reason and move on. Check `docs/lessons.md` — a prior lesson may apply.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: pwk-finalizing
|
|
3
|
-
description: "Use after all requirements are complete to delete consumed plan docs, curate lessons, update documentation, and ship the work."
|
|
3
|
+
description: "Use after all requirements are complete to archive or delete consumed plan docs, curate lessons, update documentation, and ship the work."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Finalizing
|
|
@@ -9,70 +9,58 @@ Ship the completed work.
|
|
|
9
9
|
|
|
10
10
|
## Pre-finalization checks
|
|
11
11
|
|
|
12
|
-
1. **Run the FULL test suite
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
- **Any `❌ failed`** → **block**. Present the count and reasons to the user. Do not continue until one of:
|
|
17
|
-
- The user sends the task back to `/skill:pwk-executing-tasks` to fix the failures, or
|
|
18
|
-
- The user explicitly types `--force-failed` to acknowledge shipping with known incomplete requirements.
|
|
19
|
-
|
|
20
|
-
Never merge a branch that carries incomplete requirements without explicit acknowledgment.
|
|
21
|
-
|
|
22
|
-
- **Only `⏭ skipped`** (no `❌ failed`) → present a warning and confirm:
|
|
23
|
-
|
|
24
|
-
```
|
|
25
|
-
⚠️ Requirement 4 was skipped. Continue with finalizing, or go back?
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
Continue on confirmation; abort otherwise.
|
|
12
|
+
1. **Run the FULL test suite** — every test must pass, and only a green suite ships. Resume spans sessions; re-run the suite yourself rather than trust the previous session's ending state. Anything failing → send the user back to `/skill:pwk-executing-tasks`.
|
|
13
|
+
2. Read **every** relevant progress file — for an umbrella that's each part's `docs/plans/*-progress.md`; for a standalone design doc, the one:
|
|
14
|
+
- **Any `❌ failed`** (in any part) → **block**. Present counts and reasons; continue only when the user sends the task back to executing-tasks, or explicitly types `--force-failed` to acknowledge shipping with incomplete requirements.
|
|
15
|
+
- **Only `⏭ skipped`** → warn and confirm ("Requirement N was skipped. Continue, or go back?").
|
|
29
16
|
|
|
30
17
|
## Process
|
|
31
18
|
|
|
32
|
-
1. **Derive the topic** —
|
|
33
|
-
|
|
34
|
-
|
|
19
|
+
1. **Derive the topic set** —
|
|
20
|
+
- **Umbrella** (a `docs/plans/*-overview.md` exists): read its roster; the set is every part's `<topic>`. The overview is disposed too.
|
|
21
|
+
- **Standalone**: progress file → `Plan:` ref → plan's `Design:` ref → design-doc filename → `<topic>`. One topic.
|
|
35
22
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
rm -f docs/plans/*<topic>*-implementation.md
|
|
39
|
-
rm -f docs/plans/*<topic>*-progress.md
|
|
40
|
-
```
|
|
23
|
+
Ambiguous with several designs in flight? Ask.
|
|
24
|
+
2. **Dispose of consumed plan docs — ask archive or delete** — for **every topic** in the set, dispose its `-design.md`, `-implementation.md`, `-progress.md` (matched by the exact dated topic slug so similarly-named plans for other topics survive); for an umbrella, also dispose the `-overview.md`. Each path is matched with the `????-??-??-` prefix. Present both options and let the human choose:
|
|
41
25
|
|
|
42
|
-
|
|
26
|
+
- **Delete (default)** — code + tests are the source of truth; removing the scaffold prevents stale plan docs from misleading future sessions:
|
|
43
27
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
28
|
+
```bash
|
|
29
|
+
# for each <topic> in the set:
|
|
30
|
+
rm -f docs/plans/????-??-??-<topic>-design.md docs/plans/????-??-??-<topic>-implementation.md docs/plans/????-??-??-<topic>-progress.md
|
|
31
|
+
# umbrella only:
|
|
32
|
+
rm -f docs/plans/????-??-??-<umbrella>-overview.md
|
|
33
|
+
git add -A docs/plans/ && git commit -m "chore: delete planning docs for <topic-or-umbrella>"
|
|
34
|
+
```
|
|
47
35
|
|
|
48
|
-
|
|
36
|
+
- **Archive** — keep the planning history for future readers (e.g. a complex design worth preserving) by moving the artifacts into `docs/plans/completed/`:
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
mkdir -p docs/plans/completed
|
|
40
|
+
# for each <topic> in the set:
|
|
41
|
+
mv docs/plans/????-??-??-<topic>-design.md docs/plans/completed/ 2>/dev/null || true
|
|
42
|
+
mv docs/plans/????-??-??-<topic>-implementation.md docs/plans/completed/ 2>/dev/null || true
|
|
43
|
+
mv docs/plans/????-??-??-<topic>-progress.md docs/plans/completed/ 2>/dev/null || true
|
|
44
|
+
# umbrella only:
|
|
45
|
+
mv docs/plans/????-??-??-<umbrella>-overview.md docs/plans/completed/ 2>/dev/null || true
|
|
46
|
+
git add docs/plans/ && git commit -m "chore: archive planning docs for <topic-or-umbrella>"
|
|
47
|
+
```
|
|
49
48
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
```
|
|
55
|
-
2. **Rebase & merge** *(recommended)* — rebase onto parent, fast-forward merge, push parent, delete branch:
|
|
56
|
-
```
|
|
57
|
-
parent=$(git show-branch -a 2>/dev/null | grep '\*' | grep -v "$(git branch --show-current)" | head -1 | sed 's/.*\[\(.*\)\].*/\1/' | sed 's/[\^~].*//')
|
|
58
|
-
git checkout "$parent" && git pull
|
|
59
|
-
git checkout - && git rebase "$parent"
|
|
60
|
-
git checkout "$parent" && git merge --ff-only -
|
|
61
|
-
git push origin "$parent"
|
|
62
|
-
git branch -d - && git push origin --delete -
|
|
63
|
-
```
|
|
64
|
-
3. **Squash & merge** — squash all commits into one on parent, push, delete branch.
|
|
65
|
-
4. **Merge commit** — merge with `--no-ff`, push parent, delete branch.
|
|
49
|
+
The `????-??-??-` glob enforces the dated filename; a bare `*<topic>*` would over-match unrelated docs (e.g. topic `auth` would also hit `feature-auth-redesign-design.md`). Verify with `ls docs/plans/` before and after. `rm -f` and each `mv … || true` handle missing files. Both paths commit the disposal so the shipped branch is clean. Neither path touches `docs/adr/`, `docs/lessons.md`, `CHANGELOG.md`, or `README.md` — those are permanent.
|
|
50
|
+
3. **Curate lessons (Agile Scrum Master hat)** — if `docs/lessons.md` exists: add missed lessons, generalize domain-specific rules into generic patterns, de-duplicate, categorize, retire stale rules. None exists but lessons were learned? Create it.
|
|
51
|
+
4. **Update documentation** — if the API or surface changed: `README.md`, `CHANGELOG.md`, any inline docs.
|
|
52
|
+
5. **Choose a merge strategy** — ask the human:
|
|
66
53
|
|
|
67
|
-
|
|
54
|
+
1. **Create PR** — `git push origin <branch>` then `gh pr create`.
|
|
55
|
+
2. **Rebase & merge** *(recommended)* — rebase onto parent, `--ff-only` merge, push parent, delete branch.
|
|
56
|
+
3. **Squash & merge** — squash onto parent, push, delete branch.
|
|
57
|
+
4. **Merge commit** — `--no-ff` merge, push parent, delete branch.
|
|
68
58
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
git worktree remove ../<repo>-<topic>
|
|
72
|
-
```
|
|
59
|
+
For 2–4, confirm the detected parent branch before proceeding.
|
|
60
|
+
6. **Clean up** — remove the worktree if one was used: `git worktree remove ../<repo>-<topic>`.
|
|
73
61
|
|
|
74
62
|
## Principles
|
|
75
63
|
|
|
76
|
-
-
|
|
77
|
-
- ADRs are
|
|
78
|
-
- Bump the package version if this is a published change (major
|
|
64
|
+
- Dispose of the active work's artifacts only (archive or delete, the human's choice) — for a standalone design doc its three docs; for an umbrella its overview plus every part's docs. Unrelated topics stay in `docs/plans/`.
|
|
65
|
+
- ADRs are permanent institutional memory — they stay out of archive/rotation forever.
|
|
66
|
+
- Bump the package version if this is a published change (major for breaking changes).
|
|
@@ -5,24 +5,23 @@ description: "Show all active pipeline topics and their phase/progress. Use when
|
|
|
5
5
|
|
|
6
6
|
# Status
|
|
7
7
|
|
|
8
|
-
Report on
|
|
8
|
+
Report on in-flight pipelines in this working tree (a worktree has its own `docs/plans/`, so run status in each). Read-only. This skill **does not unlock the guard** — it needs no writes, so it runs fine inside the brainstorm/plan read-only phase. If you want source edits after a status check, invoke the skill for the next phase yourself (the guard follows the skill).
|
|
9
9
|
|
|
10
10
|
## Process
|
|
11
11
|
|
|
12
|
-
1. Glob `docs/plans/*-design.md`, `*-implementation.md`, `*-progress.md
|
|
13
|
-
2. For each
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
- `*-progress.md` → execute phase — show `done/total` requirement count
|
|
17
|
-
3. Print a one-line table, e.g.:
|
|
12
|
+
1. Glob `docs/plans/*-overview.md`, `*-design.md`, `*-implementation.md`, `*-progress.md` — this working tree only.
|
|
13
|
+
2. For each topic, infer the furthest artifact: only `*-design.md` → plan next; `*-implementation.md` no progress → execute next; `*-progress.md` → execute, show `done/total`.
|
|
14
|
+
3. **Group by umbrella** — for each `*-overview.md`, take its **parts** roster and roll up each part by state, inferred from artifacts (the overview is **status-free** — read no status from it): **in-flight** if it has an active `*-implementation.md`/`*-progress.md` (show `done/total`); else **not-started**. Print one roll-up line (`<umbrella> (umbrella): n in-flight · n not-started`), then nest the parts under it with their phase. Once the umbrella finalizes, its docs — overview included — are disposed, so it no longer appears here. Topics not part of an overview print flat.
|
|
15
|
+
4. Print a compact table, grouped under any umbrellas, e.g.:
|
|
18
16
|
|
|
19
17
|
```
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
18
|
+
payments-revamp (umbrella): 2 in-flight · 1 not-started
|
|
19
|
+
payments-core execute 2/3 done
|
|
20
|
+
payments-ui plan —
|
|
21
|
+
payments-webhooks not started
|
|
22
|
+
auth execute 1/2 done
|
|
24
23
|
```
|
|
25
24
|
|
|
26
|
-
|
|
25
|
+
If nothing, suggest `/skill:pwk-brainstorming`.
|
|
27
26
|
|
|
28
27
|
Keep it short — this is orientation, not analysis. No writes; the `<topic>` slug is the identity.
|
|
@@ -7,22 +7,24 @@ description: "Turn a design doc's requirements into a behavioral spec — accept
|
|
|
7
7
|
|
|
8
8
|
Turn the design doc's requirements into a **behavioral spec** the executor implements against.
|
|
9
9
|
|
|
10
|
-
One design doc = one plan = one PR. The plan lists **all** the design's requirements; the executor builds them one at a time
|
|
10
|
+
One design doc = one plan = one PR. The plan lists **all** the design's requirements in build order; the executor builds them one at a time.
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
Your writes go into `docs/plans/` and nowhere else. Source code and configuration get written later, in `pwk-executing-tasks` — this phase produces the document the executor builds from.
|
|
13
13
|
|
|
14
14
|
## Process
|
|
15
15
|
|
|
16
|
-
1. **Find the design doc** —
|
|
17
|
-
2. **Create the feature branch
|
|
18
|
-
3. **Read the
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
- **
|
|
22
|
-
-
|
|
23
|
-
-
|
|
24
|
-
-
|
|
25
|
-
- **Production-risk notes**
|
|
16
|
+
1. **Find the design doc** — glob `docs/plans/*-design.md`. If none, ask the user to run `/skill:pwk-brainstorming` first; if several, ask which. **Read `docs/lessons.md`** if it exists — known patterns belong in the acceptance criteria. **Umbrella part?** If `docs/plans/*-overview.md` exists and this design is one of its roster parts, read the overview for the umbrella goal + roster — plan this part as one slice, composing with what earlier parts already established in the code. Note the umbrella in the plan's Overview so the executor inherits the context.
|
|
17
|
+
2. **Create or reuse the feature branch** — if you're already on a feature branch (not `main`), **reuse** it: a later umbrella part continues on the same umbrella branch. Otherwise `git checkout -b <topic>` — the umbrella's `<topic>` if this is part of an overview, else the design doc's `<topic>` (branch creation is allowed in the plan phase). Design + plan docs live on this branch, committed at the start of `pwk-executing-tasks`.
|
|
18
|
+
3. **Read the `## Requirements` list** — the plan covers **all** of them. If the design has none, derive requirements from its described behaviors and confirm with the human before proceeding.
|
|
19
|
+
4. **Write the plan** — for each requirement:
|
|
20
|
+
- **Acceptance criteria** — `Given/When/Then` behavioral statements defining "done". Write observable behaviors, not implementation steps; cover edge and error cases.
|
|
21
|
+
- **Integration tests** — test name + what each asserts. This is the spec the executor writes tests from.
|
|
22
|
+
- **`### Checkpoints: full | spec | none`** — how many human stops. `full` = tests + complete (default); `spec` = tests stop only (clear spec, low implementation risk — the complete checkpoint is dropped); `none` = trivial only (config line, typo).
|
|
23
|
+
- **`### Review: parallel | inline | skip`** — `parallel` = four reviewers via subagent (default, non-trivial diffs); `inline` = one `pwk-code-review` pass (small/medium diffs); `skip` = trivial diffs with no behavioral surface.
|
|
24
|
+
- Tag every requirement — missing tags default to `full` / `parallel`. **`spec` requires at least `inline` review** — dropping the complete checkpoint is only safe when review covers implementation quality; never combine `spec` with `Review: skip` (use `Checkpoints: none` instead).
|
|
25
|
+
- **Production-risk notes** — carry forward the design's `## Production-risk areas`, if any.
|
|
26
|
+
- **Challenge the design first** *(if production-risk areas exist)* — stress-test the design against the flagged risks before writing criteria. If a risk invalidates a design choice, stop and return to `/skill:pwk-brainstorming` rather than planning around a flawed design.
|
|
27
|
+
- **Ordering** — dependencies come **earlier** in the list; the executor runs in listed order with no dependency graph. Aim for vertical slices that merge cleanly on their own.
|
|
26
28
|
|
|
27
29
|
Save to `docs/plans/YYYY-MM-DD-<topic>-implementation.md`:
|
|
28
30
|
|
|
@@ -31,6 +33,7 @@ You may only create or edit files under `docs/plans/`. Do not modify source code
|
|
|
31
33
|
|
|
32
34
|
## Overview
|
|
33
35
|
Design: docs/plans/YYYY-MM-DD-<topic>-design.md
|
|
36
|
+
Umbrella: docs/plans/YYYY-MM-DD-<umbrella>-overview.md *(umbrella part only — else omit)*
|
|
34
37
|
|
|
35
38
|
## Requirement 1: <name>
|
|
36
39
|
|
|
@@ -42,41 +45,35 @@ You may only create or edit files under `docs/plans/`. Do not modify source code
|
|
|
42
45
|
- `should <behavior>` — asserts <observable outcome>
|
|
43
46
|
- `should <error case>` — asserts <failure outcome>
|
|
44
47
|
|
|
48
|
+
### Checkpoints: full | spec | none
|
|
49
|
+
### Review: parallel | inline | skip
|
|
50
|
+
|
|
45
51
|
### Production-risk notes
|
|
46
52
|
- <from the design's Production-risk areas, if any>
|
|
47
53
|
|
|
48
54
|
## Requirement 2: <name>
|
|
49
55
|
…
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
**If the design has `## Production-risk areas`** that flag schema migrations, new dependencies, external API integrations, or seed data, emit a `## Setup` section between `## Overview` and `## Requirement 1`:
|
|
53
56
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
- **Dependencies:** what to install (and how)
|
|
58
|
-
- **Migrations:** each migration with a brief description
|
|
59
|
-
- **Seed / test data:** what data to prepare
|
|
60
|
-
- **Verify:** how to confirm setup worked (e.g. `npm test` still passes)
|
|
57
|
+
## Feature acceptance
|
|
58
|
+
Derived from the design doc. One end-to-end test exercising the requirements *together*:
|
|
59
|
+
- `should <the PRD's end-to-end claim>` — Given <starting state>, When <trigger>, Then <composed outcome across requirements>.
|
|
61
60
|
```
|
|
62
61
|
|
|
63
|
-
|
|
64
|
-
- Every requirement has acceptance criteria **and** matching integration tests.
|
|
65
|
-
- Acceptance criteria are observable behaviors, not implementation steps.
|
|
66
|
-
- Edge/error cases are covered.
|
|
67
|
-
- Production-risk areas from the design are reflected.
|
|
68
|
-
Fix gaps before presenting.
|
|
62
|
+
**If the design has no `## Feature acceptance` section**, stop and ask the human to run `/skill:pwk-brainstorming` to add one — the feature's definition-of-done is missing. (A trivial single-requirement design may fold the scenario into that requirement's criteria; note it and skip the separate section.)
|
|
69
63
|
|
|
70
|
-
|
|
71
|
-
7. **Present the plan** — show the complete plan and wait for approval. On approval, hand off to `/skill:pwk-executing-tasks` — running it is what transitions out of the gated plan phase (the guard unlocks on the skill, not on the word "approve").
|
|
64
|
+
**If `## Production-risk areas` flagged** schema migrations, new dependencies, external APIs, or seed data, emit a `## Setup` section between `## Overview` and `## Requirement 1` (dependencies, migrations, seed data, and how to verify setup worked).
|
|
72
65
|
|
|
73
|
-
|
|
66
|
+
5. **Audit before presenting:**
|
|
67
|
+
- Every requirement has criteria **and** matching tests, a checkpoint tag, a review tag.
|
|
68
|
+
- No `spec` + `skip` combination.
|
|
69
|
+
- A `## Feature acceptance` section exists (or the trivial-fold note).
|
|
70
|
+
- Production-risk areas from the design are reflected.
|
|
71
|
+
6. **Workspace isolation** — you're on the `<topic>` branch. For larger work, offer a worktree (`git worktree add ../<repo>-<topic> <topic>`) and hand off to a new session there so `pwd` is the worktree. Wait for the user's choice.
|
|
72
|
+
7. **Present the plan** and wait for approval. On approval, hand off: "Ready to execute? Run `/skill:pwk-executing-tasks`" (running it is what exits the gated plan phase).
|
|
74
73
|
|
|
75
|
-
|
|
76
|
-
- **Not micro-tasks** — one coarse block per requirement. The executor decides how to structure and slice the implementation.
|
|
77
|
-
- **Not the tests themselves** — the plan specifies *what* the tests prove (names + assertions); `pwk-executing-tasks` writes the actual test files first (red), then implements to green.
|
|
74
|
+
## What belongs in the plan — and what stays out
|
|
78
75
|
|
|
79
|
-
The
|
|
76
|
+
The plan carries: observable behavior (acceptance criteria), the test names + assertions that prove it, and per-requirement tags. Everything about implementation *how* — code, signatures, file-by-file breakdowns, micro-task decomposition — stays with the executor, which picks structure against the spec. That's the division that keeps the plan stable when a detail shifts mid-implementation.
|
|
80
77
|
|
|
81
78
|
## After the plan
|
|
82
79
|
|