@tianhai/pi-workflow-kit 2.8.1 → 2.11.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 +9 -1
- package/docs/developer-usage-guide.md +1 -1
- package/docs/workflow-phases.md +5 -4
- package/package.json +1 -1
- package/skills/pwk-brainstorming/SKILL.md +24 -18
- package/skills/pwk-brainstorming/references/design-format.md +14 -14
- package/skills/pwk-brainstorming/references/umbrella.md +7 -8
- package/skills/pwk-brainstorming/scripts/validate-design.mjs +239 -0
- package/skills/pwk-code-review/SKILL.md +4 -4
- package/skills/pwk-executing-tasks/SKILL.md +55 -63
- package/skills/pwk-executing-tasks/references/progress-format.md +20 -21
- package/skills/pwk-executing-tasks/references/resume.md +3 -3
- package/skills/pwk-executing-tasks/references/review.md +12 -19
- package/skills/pwk-executing-tasks/scripts/build-review-packet.mjs +399 -0
- package/skills/pwk-executing-tasks/scripts/progress.mjs +180 -0
- package/skills/pwk-executing-tasks/scripts/ref.mjs +71 -0
- package/skills/pwk-executing-tasks/scripts/stage-check.mjs +48 -0
- package/skills/pwk-finalizing/SKILL.md +21 -31
- package/skills/pwk-status/SKILL.md +4 -4
- package/skills/pwk-brainstorming/scripts/validate-design.py +0 -194
- package/skills/pwk-executing-tasks/scripts/build-review-packet.py +0 -320
|
@@ -5,15 +5,17 @@ description: "Implement a design doc via the feature-gate flow: write the featur
|
|
|
5
5
|
|
|
6
6
|
# Executing Tasks
|
|
7
7
|
|
|
8
|
-
Implement the design doc
|
|
8
|
+
Implement the design doc under `docs/plans/` via the **feature-gate flow**; its `### R<n>` blocks carry each requirement's acceptance criteria and tags. The criteria define *what*, you decide *how*.
|
|
9
9
|
|
|
10
10
|
Any command or tool recipe in this skill is an example, not the requirement — when your host grants a better tool for an operation (a sandboxed batch executor — e.g. `codemode` on pi ≥ 1.0.0 — a structured file API), use the better tool and treat the recipe as a fallback; the only exact exceptions are this kit's `scripts/` helpers and plain `git` invocations, whose deterministic output is the point.
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
Reference pointers name the section a step needs: run the section helper `scripts/ref.mjs <reference-path>#<anchor>` instead of reading the whole reference file.
|
|
13
|
+
|
|
14
|
+
The feature-acceptance E2E test is the primary enforced gate and the primary enforced spec. The flow is always on: E2E first (red), the requirements back-to-back, then the feature review and the **ship checkpoint**. Per-requirement checkpoints and reviews are **opt-in** — they fire only when the design doc tags them, and the feature gate covers the rest. A trivial design doc (no `## Feature acceptance`) skips the E2E and ships on the full suite.
|
|
13
15
|
|
|
14
16
|
## Before you start
|
|
15
17
|
|
|
16
|
-
Resolve local references and scripts from this
|
|
18
|
+
Resolve local references and scripts from this skill directory; a missing required resource is a blocker to report, never to skip.
|
|
17
19
|
|
|
18
20
|
1. **Git state** — `git status` + `git log --oneline -5`; note uncommitted changes.
|
|
19
21
|
2. **Find the doc** — first verify the repo root: run `pwd` (or your shell's equivalent) and `git rev-parse --show-toplevel`; mismatch → report both paths and stop; never `cd` (a worktree root counts). Then list `docs/plans` recursively, excluding docs/plans/completed/, for `*-design.md` (topic docs live in `docs/plans/<date>-<topic>/` folders — archived work is not in flight). Use whatever recurses in your harness; one example: `find docs/plans -name '<suffix>' -not -path '*/completed/*'`; take each topic’s `Feature phase:` line header-only (`grep -m1 '^Feature phase:' <file>`). With a sandboxed batch executor (e.g. `codemode` on pi ≥ 1.0.0) the listing and every phase extraction are one call, returning only the summary lines (adapt the paths to the verified root when your cwd differs):
|
|
@@ -27,55 +29,51 @@ Resolve local references and scripts from this installed skill directory. If a r
|
|
|
27
29
|
return text(files.map((d, i) => d + ' — ' + heads[i]).join('\n') || 'no in-flight topics');
|
|
28
30
|
```
|
|
29
31
|
|
|
30
|
-
|
|
31
|
-
3. **Workspace — choose this topic’s branch
|
|
32
|
+
No doc → ask for `/skill:pwk-brainstorming`; several → ask which. A matching `*-progress.md` means a **resume** ([Resume and progress](#resume-and-progress)); an umbrella part whose prior leaves are not all `done` shows their `Feature phase:` lines as advisory context.
|
|
33
|
+
3. **Workspace** — choose this topic’s branch or worktree: read [Workspace and resume details](references/resume.md#workspace) first; it owns the command order including worktree handoffs. Reuse this topic’s branch (one umbrella = one branch); a different topic’s branch never hosts these commits. Offer or adopt only after checking existing worktrees, then wait for the user.
|
|
32
34
|
|
|
33
35
|
## First run
|
|
34
36
|
|
|
35
|
-
1. **Parse the design doc** — read every `### R<n>:` heading
|
|
36
|
-
2. **Create the progress file** beside the design at `docs/plans/<date>-<topic>/<leaf>-progress.md
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
5. **Write the feature-acceptance E2E test (red).** Read the design doc's `## Feature acceptance` section and encode it as a real test file; run it; confirm it **fails** (it must — little or none of the feature exists yet). If it passes immediately, probe why before proceeding: the behavior may already exist, or the test may be asserting too little. If it still passes and the expected behavior looks wrong, **stop and present** rather than implementing against a wrong spec. Iterate it to green as you implement — fixing the implementation is the default, and you **stop and present only when you are genuinely blocked** (nothing you can do makes it pass, or the E2E itself is wrong). That stop is the reserved failure case; it is not the flow's default pause.
|
|
42
|
-
6. **Notice, not a stop — report the E2E and continue.** Post 1–2 plain-language lines stating **what the E2E proves** ("this test proves that …"), plus the E2E test and its failing output, then go straight into the implement phase **without waiting for approval** — the `## Feature acceptance` text was approved during brainstorm, so there is nothing new here for the human to sign off. The notice is the window to object *before* implementation starts: a human who sees the E2E asserting the wrong thing says so, and you revise, re-run, and re-notice. Keep `Feature phase: e2e-written`.
|
|
37
|
+
1. **Parse the design doc** — read every `### R<n>:` heading with its `### Checkpoints` / `### Review` tags and the feature-level `### Feature review` tag. Requirements run in **listed order**. The `## Feature acceptance` section is the E2E you gate on first; a trivial doc skips steps 5–6.
|
|
38
|
+
2. **Create the progress file** beside the design at `docs/plans/<date>-<topic>/<leaf>-progress.md`, writing it with `scripts/progress.mjs` (read [Progress format](references/progress-format.md#progress-file) first for the template). Start at `Feature phase: e2e-written` (trivial doc: `implementing (0/N)`); `Setup: pending` when the design has `## Setup`, otherwise `Setup: n/a`.
|
|
39
|
+
3. **Setup pre-flight** *(only if the design doc has a `## Setup` section)* — install dependencies, apply migrations, seed data, then run the suite. **⏸ CHECKPOINT: setup** — present results and wait for approval, then set `Setup: done`.
|
|
40
|
+
4. **Commit the design docs** — `git add docs/plans/<date>-<topic>/ && git commit -m "docs: add design doc"`, scoped to the topic folder so another topic’s drafts never ride it.
|
|
41
|
+
5. **Write the feature-acceptance E2E test (red)** — encode the `## Feature acceptance` section as a real test, run it, confirm it **fails**. If it passes immediately, probe why before proceeding — the behavior may already exist, or the test may be asserting too little — and if the expected behavior looks wrong, **stop and present** rather than implementing against a wrong spec. Iterate to green; fixing the implementation is the default, and you **stop and present only when you are genuinely blocked** (nothing makes it pass, or the E2E itself is wrong).
|
|
42
|
+
6. **Notice, not a stop — report the E2E and continue.** Post 1–2 plain-language lines stating **what the E2E proves** ("this test proves that …") plus its failing output, then go straight into the implement phase **without waiting for approval** — the `## Feature acceptance` text was approved during brainstorm.
|
|
43
43
|
|
|
44
44
|
## Resume and progress
|
|
45
45
|
|
|
46
46
|
`Feature phase` is one of: `e2e-written`, `implementing (k/N)`, `reviewing`, `ship-paused`, `done`.
|
|
47
47
|
|
|
48
|
-
**Done cell:** `⬜` not started · `🔄` in progress · `✅` done · `❌` failed · `⏭` skipped. A row is **terminal** when its Done cell is `✅`, `❌`, or `⏭` — resolved, not necessarily passed. Only executing changes Done cells; a
|
|
48
|
+
**Done cell:** `⬜` not started · `🔄` in progress · `✅` done · `❌` failed · `⏭` skipped. A row is **terminal** when its Done cell is `✅`, `❌`, or `⏭` — resolved, not necessarily passed. Only executing changes Done cells; a reviewed row stays `🔄` until a clean pass permits `✅`.
|
|
49
49
|
|
|
50
|
-
When a matching progress file exists, read [Resume](references/resume.md#resume)
|
|
50
|
+
When a matching progress file exists, read [Resume](references/resume.md#resume), then the header, Requirements table, and Execution summary only (`ship-paused` also needs the Code digest). Resume the first nonterminal row (`⬜`, `🔄`, blank). Match `grep -m1 '^Feature phase:' <file>`; `reviewing` resumes review; `ship-paused` re-presents and waits, never approving itself. Missing reviewer reports require review again before coverage.
|
|
51
51
|
|
|
52
|
-
|
|
52
|
+
Read [Progress format](references/progress-format.md#progress-file) before any progress-row or code-digest write, and drive every structural edit through `scripts/progress.mjs` — it updates the row, `Last updated`, and `Feature phase` together, so write execution-summary content with the ✅ and deviations at deviation time. A failed/skipped row carries its reason and reconciles its test coverage.
|
|
53
53
|
|
|
54
54
|
## Implement phase
|
|
55
55
|
|
|
56
|
-
Bugs found mid-execution are mandatory execution-summary content: record the fix in the requirement
|
|
56
|
+
Bugs found mid-execution are mandatory execution-summary content: record the fix in the requirement’s `How it was built` cell and fill its Deviated? column then.
|
|
57
57
|
|
|
58
58
|
Set `Feature phase: implementing (0/N)` and work the requirements in listed order. For each:
|
|
59
59
|
|
|
60
|
-
1. **Mark the requirement 🔄** (Done column), read its `### Checkpoints` / `### Review` tags, and check `docs/lessons.md` for
|
|
61
|
-
2. **Write a meaningful test (red), then implement (green)** —
|
|
62
|
-
3. **⏸ per-requirement checkpoint** *(fires only when the tag says so
|
|
63
|
-
4. **Regression check after each commit** — run the **full existing suite
|
|
64
|
-
5. **Learn.** Caught a repeat mistake? Append a **generic** rule to `docs/lessons.md
|
|
65
|
-
6. **Commit** the requirement
|
|
66
|
-
7. **Per-requirement review** *(
|
|
67
|
-
8. **Mark the requirement ✅** and write its execution-summary row in the same step; advance `Feature phase: implementing (k/N)`.
|
|
60
|
+
1. **Mark the requirement 🔄** (Done column), read its `### Checkpoints` / `### Review` tags, and check `docs/lessons.md` for an applicable rule.
|
|
61
|
+
2. **Write a meaningful test (red), then implement (green)** — encode the acceptance criteria as a real test through the public interface: red, then green; a slice with no independent observable behavior is covered by the feature E2E. **Test observable behavior** — assert on what the feature produces or changes (a return value, persisted data, an emitted event, an HTTP response) through its public interface.
|
|
62
|
+
3. **⏸ per-requirement checkpoint** *(fires only when the tag says so)* — with `### Checkpoints: full`, stop and present after the tests and again after the slice is complete, both before its commit; with the default `none`, show the red→green inline and proceed.
|
|
63
|
+
4. **Regression check after each commit** — run the **full existing suite**, which catches a later requirement breaking an earlier one’s test. The **feature E2E stays red until the last requirement lands**; never expect it green per-commit.
|
|
64
|
+
5. **Learn.** Caught a repeat mistake? Append a **generic** rule to `docs/lessons.md`.
|
|
65
|
+
6. **Commit** the requirement; record its commit hash in the Commit column.
|
|
66
|
+
7. **Per-requirement review** *(only when the `### Review` tag is `parallel` or `inline`)* — review the slice now (see [Per-requirement review](#per-requirement-review-opt-in)); the row stays 🔄.
|
|
67
|
+
8. **Mark the requirement ✅** and write its execution-summary row in the same step — Evidence cell non-empty, plain words plus pointer; advance `Feature phase: implementing (k/N)`. A reviewed requirement fires only after a clean review.
|
|
68
68
|
|
|
69
69
|
### Per-requirement review (opt-in)
|
|
70
70
|
|
|
71
|
-
If the requirement
|
|
72
|
-
|
|
73
|
-
With the default `none`, no per-requirement stop fires — the per-requirement test still runs red→green, and the feature review covers implementation quality.
|
|
71
|
+
If the requirement’s `### Review` tag is `parallel` or `inline` (default `skip`), review that slice at step 7: run the [Review mechanics](references/review.md#assemble-evidence) helper with `--scope requirement --requirement N` over that requirement’s commits and criteria, written to `<design doc's directory>/<leaf>-review-packet-r<N>.md`. The four delegated roles — or the one `pwk-code-review` pass on `inline` — only report; you apply the smell fixes and commit them, then a clean pass returns to step 8. With `skip`, no per-requirement review — step 8 fires directly, and the feature-level review covers it.
|
|
74
72
|
|
|
75
73
|
### Checkpoint gates are mandatory (when the tag says so)
|
|
76
74
|
|
|
77
75
|
When a per-requirement checkpoint fires it is a **hard stop**:
|
|
78
|
-
- Stop immediately; never proceed without explicit
|
|
76
|
+
- Stop immediately; never proceed without explicit approval.
|
|
79
77
|
- **Never** `git add` or `git commit` before approval at a checkpoint.
|
|
80
78
|
- Set the progress phase/status **before** pausing.
|
|
81
79
|
|
|
@@ -83,41 +81,36 @@ When a per-requirement checkpoint fires it is a **hard stop**:
|
|
|
83
81
|
|
|
84
82
|
When every requirement's Done cell is terminal — `✅` (done), `❌` (failed, reason in row), or `⏭` (skipped, reason in row):
|
|
85
83
|
|
|
86
|
-
1. **Run the FULL test suite** — a failure means one requirement regressed another; fix it
|
|
87
|
-
2. **Run the feature-acceptance E2E** —
|
|
88
|
-
3. **Run the feature review** (below) per the design
|
|
89
|
-
4. **Write the code digest** into the progress file — the review has succeeded
|
|
90
|
-
|
|
91
|
-
**Reconcile the Flow against reviewed reality before writing it.** The Flow is written from what was reviewed, not from recollection: in `parallel` mode every hop must correspond to a path the tracing reviewer's report names — no hop invented, no reported path dropped. In `inline` mode there is no separate tracing report — the inline pass itself performs code tracing — so check the Flow against that pass's tracing findings and spec-coverage result instead. A discrepancy you cannot resolve is **surfaced** to the human in the ship checkpoint's findings status, never smoothed over by writing a Flow that omits the path.
|
|
84
|
+
1. **Run the FULL test suite** — a failure means one requirement regressed another; fix it here. Then run `scripts/stage-check.mjs` and stop on a non-zero exit: the reviewed diff is a commit range, so anything uncommitted outside `docs/plans/` is missing from it.
|
|
85
|
+
2. **Run the feature-acceptance E2E** — it must be **green** now that all requirements have landed; still red means a requirement is wrong.
|
|
86
|
+
3. **Run the feature review** (below) per the design’s `### Feature review` tag — set `Feature phase: reviewing` first, so a mid-review resume routes into this step instead of the implement loop. The review runs **before** your final approval, so the pause is fully informed; apply smell fixes and re-green first.
|
|
87
|
+
4. **Write the code digest** into the progress file — the review has succeeded and the code is final: read the packet’s `## Commits`, `## Changed files`, and `## Diff` sections and fill the file’s `## Code digest` per [Progress format](references/progress-format.md#code-digest); if the packet is stale, re-run the helper first. Never a gate — it explains the change, it does not block shipping. A resumed `Feature phase: reviewing` that completes lands on this same write point. **Reconcile the Flow against reviewed reality**: every hop must match a path the tracing report names — in `inline` mode the inline pass itself performs code tracing, so check the Flow against that pass’s tracing findings and spec-coverage result — no hop invented and none dropped; an unresolvable discrepancy is **surfaced** in the findings status.
|
|
92
88
|
5. **Set `Feature phase: ship-paused`** and **⏸ CHECKPOINT: ship** — present, in this order:
|
|
93
|
-
- a green-gates line: full suite green, feature E2E green (trivial doc: the suite line alone
|
|
94
|
-
- the **execution summary** — what each requirement became, deviations included;
|
|
95
|
-
- the **verdict rows** — list every `❌`/`⏭` row with its reason, so
|
|
96
|
-
- the **code digest** — the plain-language change explanation from the progress file
|
|
97
|
-
- the **coverage table** (one verdict row per R#) — from the spec-reviewer report in `parallel` mode, from the inline pass
|
|
89
|
+
- a green-gates line: full suite green, feature E2E green (trivial doc: the suite line alone);
|
|
90
|
+
- the **execution summary** — what each requirement became, deviations included, Evidence cells quoted;
|
|
91
|
+
- the **verdict rows** — list every `❌`/`⏭` row with its reason, so approval is given knowing what failed;
|
|
92
|
+
- the **code digest** — the plain-language change explanation from the progress file;
|
|
93
|
+
- the **coverage table** (one verdict row per R#) — from the spec-reviewer report in `parallel` mode, from the inline pass’s spec-coverage result otherwise;
|
|
98
94
|
- findings status: fixed / open for the human;
|
|
99
|
-
- "full diff on request" —
|
|
100
|
-
|
|
101
|
-
Wait for approval. **request changes** → fix, re-run the gates (and the review if the change is substantive), re-present.
|
|
95
|
+
- "full diff on request" — show a hunk only where a finding makes the human ask.
|
|
102
96
|
|
|
103
|
-
|
|
97
|
+
Wait for approval. **request changes** → fix, re-run the gates (and the review if substantive), re-present.
|
|
104
98
|
|
|
105
|
-
|
|
99
|
+
A spec-reviewer report without a per-requirement coverage table is invalid — retry the role or complete it inline before pausing.
|
|
106
100
|
|
|
107
101
|
## Feature review
|
|
108
102
|
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
**Assemble the review packet first** — read [Review mechanics](references/review.md), then invoke the installed skill’s `scripts/build-review-packet.py` with explicit `--project`, `--design`, `--progress`, and `--scope feature`. Check `python3 --version` for Python 3.9+ and helper availability before this step; if Python is missing or unavailable, report the blocker, request a suitable runtime, and stop. Do not auto-install a runtime, use a fallback implementation, or claim packet generation succeeded. No packet byte passes through model output. A failed helper is not usable evidence or approval; correct the inputs, never guess ranges. The helper writes `<leaf>-review-packet.md` beside the design; opt-in packets use `<leaf>-review-packet-r<N>.md`.
|
|
103
|
+
Run **one** review over the **whole feature diff**, driven by the design doc’s `### Feature review` tag — exactly one per part, never once per requirement.
|
|
112
104
|
|
|
113
|
-
|
|
105
|
+
**Assemble the review packet first** — run `scripts/stage-check.mjs` and stop on a non-zero exit, then read [Review mechanics](references/review.md#assemble-evidence) and invoke `scripts/build-review-packet.mjs` with explicit `--project`, `--design`, `--progress`, and `--scope feature`. Check `node --version`; if missing, report the blocker, request a suitable runtime, and stop — never auto-install, use a fallback, or claim the packet succeeded. No packet byte passes through model output; a failed helper is never evidence or approval. It writes `<leaf>-review-packet.md` beside the design; opt-in packets use `<leaf>-review-packet-r<N>.md`.
|
|
114
106
|
|
|
115
|
-
-
|
|
107
|
+
- **Resolve the tag first.** `auto` (the default, and what a missing tag means) resolves on the design’s production-risk content: a non-empty `## Production-risk areas` section or any `### Production-risk notes` → `parallel`; otherwise `inline`. An explicit tag wins over `auto` in both directions.
|
|
108
|
+
- **`parallel`** — use the host’s `parallel-review` capability for four independent, fresh-context, read-only roles: `pwk-spec-reviewer`, `pwk-tracing-reviewer`, `pwk-smell-reviewer`, `pwk-hazard-reviewer`. Follow [Review mechanics](references/review.md#delegate-or-review-inline): a one-liner packet-file pointer with role framing last — the packet never appears in spawn arguments. Collect one outcome per role. Reviewers only report; you apply smell fixes, commit, and re-green. Surface trace/spec/hazard findings to the human.
|
|
116
109
|
- **`inline`** — perform `/skill:pwk-code-review` over the whole diff as a single pass.
|
|
117
|
-
- **Fallback** — if compatible capability is absent,
|
|
118
|
-
- **Refresh** — if commits land during review,
|
|
110
|
+
- **Fallback** — if compatible capability is absent, constraints cannot be proved, or delegation fails, do the missing work inline. Retain successful reports; a missing required role leaves the review incomplete.
|
|
111
|
+
- **Refresh** — if commits land during review, refresh the packet before any replacement role or digest write, appending requirement-fix IDs and keeping the initial ID. Packet creation never substitutes for review or approval.
|
|
119
112
|
|
|
120
|
-
On success, continue assembling the ship checkpoint; once the human approves it
|
|
113
|
+
On success, continue assembling the ship checkpoint; once the human approves it, set `Feature phase: done`. (An umbrella part’s gate is its own progress file; `pwk-finalizing` reads every part's file, and a `❌` in any part blocks the umbrella until the human types `--force-failed`.)
|
|
121
114
|
|
|
122
115
|
## Tags reference
|
|
123
116
|
|
|
@@ -129,7 +122,7 @@ The design doc tags each requirement and the feature level:
|
|
|
129
122
|
| `### Review` | `skip \| parallel \| inline` | `skip` | per-requirement review — `parallel` = four delegated reviewers; `inline` = one `pwk-code-review` pass |
|
|
130
123
|
| `### Feature review` | `auto \| parallel \| inline` | `auto` | the one whole-feature review — always run, never per requirement (a trivial doc carries no tag; the missing tag resolves to `auto`) |
|
|
131
124
|
|
|
132
|
-
Nothing is tagged silently: **only the human tags** a slice
|
|
125
|
+
Nothing is tagged silently: **only the human tags** a slice; each tag resolves where its decision executes.
|
|
133
126
|
|
|
134
127
|
## User override commands
|
|
135
128
|
|
|
@@ -142,14 +135,14 @@ Nothing is tagged silently: **only the human tags** a slice, and the feature rev
|
|
|
142
135
|
|
|
143
136
|
## Receiving feedback (outside a checkpoint)
|
|
144
137
|
|
|
145
|
-
Verify the criticism against the code,
|
|
138
|
+
Verify the criticism against the code, then implement (with tests) or push back with evidence.
|
|
146
139
|
|
|
147
140
|
## After the feature review
|
|
148
141
|
|
|
149
|
-
|
|
142
|
+
Determine the next step from the artifacts — a suggestion, not a gate. The overview check is **folder-local** — the `overview.md` beside this leaf, inside the same `docs/plans/<date>-<topic>/` directory, never a repo-wide `docs/plans/**/overview.md`, and always excluding docs/plans/completed/:
|
|
150
143
|
|
|
151
144
|
- **Standalone topic** (no `overview.md` in the topic folder) → suggest `/skill:pwk-finalizing`.
|
|
152
|
-
- **Umbrella part** (an `overview.md` sits beside this leaf) → read
|
|
145
|
+
- **Umbrella part** (an `overview.md` sits beside this leaf) → read its `## Parts (build order)` roster; complete when every roster leaf has a `done` progress file → `/skill:pwk-finalizing` (one PR for the whole umbrella). Otherwise the **next leaf** is the first roster part with no `done` progress file — not the next entry in build order: a leaf with no progress file and no `<leaf>-design.md` → `/skill:pwk-brainstorming`; one with a `<leaf>-design.md` but no progress file → `/skill:pwk-executing-tasks`; one whose progress file is not `done` → `/skill:pwk-executing-tasks` to resume it.
|
|
153
146
|
|
|
154
147
|
Present:
|
|
155
148
|
|
|
@@ -160,7 +153,6 @@ Feature phase: done
|
|
|
160
153
|
| # | Done | Requirement |
|
|
161
154
|
|---|------|-------------|
|
|
162
155
|
| 1 | ✅ | <name> |
|
|
163
|
-
| … | … | … |
|
|
164
156
|
|
|
165
157
|
- Next part: /skill:pwk-brainstorming (unstarted leaf) or /skill:pwk-executing-tasks (designed or mid-flight) — per the routing above ← umbrella, more parts remain
|
|
166
158
|
- Ship: /skill:pwk-finalizing ← standalone, or last umbrella part
|
|
@@ -168,10 +160,10 @@ Feature phase: done
|
|
|
168
160
|
|
|
169
161
|
## If you're stuck
|
|
170
162
|
|
|
171
|
-
1. Re-read the requirement
|
|
172
|
-
2. Check `git log` for context
|
|
173
|
-
3. Still stuck → discard uncommitted changes (`git restore .`); if already committed, also `git revert` the requirement
|
|
174
|
-
4. Set its Done cell `❌` (with the reason as a suffix in the Requirement cell), reconcile its test coverage, and move on
|
|
163
|
+
1. Re-read the requirement’s acceptance criteria — you may have drifted.
|
|
164
|
+
2. Check `git log` for context; ask the user — clarify beats guessing.
|
|
165
|
+
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.**
|
|
166
|
+
4. Set its Done cell `❌` (with the reason as a suffix in the Requirement cell), reconcile its test coverage, and move on; `docs/lessons.md` may hold an applicable rule.
|
|
175
167
|
|
|
176
168
|
## Contract index
|
|
177
169
|
|
|
@@ -200,7 +192,7 @@ Feature phase: e2e-written
|
|
|
200
192
|
## Requirements
|
|
201
193
|
| # | Done | Requirement | Per-req ceremony | Commit |
|
|
202
194
|
## Execution summary
|
|
203
|
-
| R# | Requirement | How it was built | Deviated? |
|
|
195
|
+
| R# | Requirement | How it was built | Deviated? | Evidence |
|
|
204
196
|
## Code digest
|
|
205
197
|
### Summary
|
|
206
198
|
### Flow
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Read before creating or changing progress rows, or writing/re-presenting the code digest. This reference owns the unchanged progress artifact schema.
|
|
4
4
|
|
|
5
|
-
2. **Create the progress file** `docs/plans/<date>-<topic>/<leaf>-progress.md`, beside the design doc it belongs to (`<leaf>` is `<topic>` for a single-part topic; an umbrella part uses its roster slug)
|
|
5
|
+
2. **Create the progress file** `docs/plans/<date>-<topic>/<leaf>-progress.md`, beside the design doc it belongs to (`<leaf>` is `<topic>` for a single-part topic; an umbrella part uses its roster slug). Keep the blank lines between the header fields: the blank lines are load-bearing, because CommonMark merges consecutive plain lines into one paragraph.
|
|
6
6
|
|
|
7
7
|
```markdown
|
|
8
8
|
# Progress: <topic>
|
|
@@ -19,7 +19,7 @@ Read before creating or changing progress rows, or writing/re-presenting the cod
|
|
|
19
19
|
|
|
20
20
|
Feature phase: e2e-written
|
|
21
21
|
|
|
22
|
-
<!-- a trivial design doc (no `## Feature acceptance`) starts at `implementing (0/N)`
|
|
22
|
+
<!-- a trivial design doc (no `## Feature acceptance`) starts at `implementing (0/N)` -->
|
|
23
23
|
|
|
24
24
|
## Requirements
|
|
25
25
|
| # | Done | Requirement | Per-req ceremony | Commit |
|
|
@@ -27,13 +27,13 @@ Read before creating or changing progress rows, or writing/re-presenting the cod
|
|
|
27
27
|
| 1 | ⬜ | <requirement name> | — | — |
|
|
28
28
|
|
|
29
29
|
## Execution summary
|
|
30
|
-
| R# | Requirement | How it was built | Deviated? |
|
|
31
|
-
|
|
32
|
-
| 1 | <requirement name> | | |
|
|
30
|
+
| R# | Requirement | How it was built | Deviated? | Evidence |
|
|
31
|
+
|----|-------------|------------------|-----------|----------|
|
|
32
|
+
| 1 | <requirement name> | | | |
|
|
33
33
|
|
|
34
34
|
## Deviation records
|
|
35
35
|
|
|
36
|
-
<!-- One short paragraph per design-decision reversal
|
|
36
|
+
<!-- One short paragraph per design-decision reversal -->
|
|
37
37
|
|
|
38
38
|
## Code digest
|
|
39
39
|
|
|
@@ -52,35 +52,34 @@ Read before creating or changing progress rows, or writing/re-presenting the cod
|
|
|
52
52
|
- `<file>` — <what shifted inside it>
|
|
53
53
|
```
|
|
54
54
|
|
|
55
|
-
|
|
55
|
+
## Code digest
|
|
56
56
|
|
|
57
|
-
|
|
57
|
+
The `## Code digest` is filled once, at the write point in the ship checkpoint — never back-filled per requirement. Fill rules: plain language, R# anchors where natural, no test names. `### Summary` is 2–3 sentences: what the code now does differently, and why. `### Flow` uses `A -> B -> C` arrow chains, one spine or branch per bullet line. `### Gotchas` lifts real risks from the review findings, one real risk per bullet — `[ALERT]` only for reviewer-confirmed issues, never invented; with none, write `none beyond review findings`. `### Key files` is capped at 5 pivotal files, one bullet each.
|
|
58
58
|
|
|
59
|
-
|
|
60
|
-
- **
|
|
61
|
-
- **
|
|
62
|
-
- **
|
|
63
|
-
- **
|
|
59
|
+
**Flow shape** — the ship stop's navigable map, the one digest section carrying structure:
|
|
60
|
+
- **Spine** — the happy path, each hop named by symbol — no line numbers, no file paths (those go stale). Tag each hop `[R<n>]`, so coverage verdicts trace into the code.
|
|
61
|
+
- **Branches** — every alternative and error path as `condition -> outcome`; a bare spine reads as "no edge cases". Put ⚠️ on the surprising ones, and a `was: <previous behavior>` clause on each requirement whose behavior changed — skip it for purely additive ones.
|
|
62
|
+
- **Inline worked values** — a non-obvious mapping shown concretely (`` `implementing (2/5)` -> `execute 2/5` ``).
|
|
63
|
+
- **Side effects** — what is read and written, only for I/O, network, or migrations; otherwise omit the bullet.
|
|
64
|
+
- **Cap: roughly 15 lines.** A longer Flow gets the ship checkpoint's `/skill:pwk-walkthrough` offer instead.
|
|
64
65
|
|
|
65
66
|
`Feature phase` is one of: `e2e-written`, `implementing (k/N)`, `reviewing`, `ship-paused`, `done`.
|
|
66
67
|
|
|
67
|
-
The `Setup:` header slot takes one of `Setup: pending | done | n/a` — the header starts `Setup: pending` when the design doc has a `## Setup` section, else `Setup: n/a`; the
|
|
68
|
-
|
|
68
|
+
The `Setup:` header slot takes one of `Setup: pending | done | n/a` — the header starts `Setup: pending` when the design doc has a `## Setup` section, else `Setup: n/a`; the setup checkpoint flips it to `done` on approval. The phase line stays `e2e-written` through the setup stop, and the E2E is written after setup.
|
|
69
69
|
|
|
70
70
|
## Progress file
|
|
71
71
|
|
|
72
|
-
Update the matching
|
|
72
|
+
Update the matching row directly, never via pattern matching (which corrupts the table). Update `Last updated` and `Feature phase` on every change.
|
|
73
73
|
|
|
74
74
|
**Row vocabulary (canonical — this file owns it):**
|
|
75
75
|
|
|
76
|
-
- **Done cell:** `⬜` not started · `🔄` in progress · `✅` done · `❌` failed · `⏭` skipped. A row is **terminal** when its Done cell is `✅`, `❌`, or `⏭` — resolved, not necessarily passed. A `❌`/`⏭` row carries its reason as a suffix in the Requirement cell
|
|
76
|
+
- **Done cell:** `⬜` not started · `🔄` in progress · `✅` done · `❌` failed · `⏭` skipped. A row is **terminal** when its Done cell is `✅`, `❌`, or `⏭` — resolved, not necessarily passed. A `❌`/`⏭` row carries its reason as a suffix in the Requirement cell, and its test coverage is reconciled in the same step — assertions removed or skipped with the reason, leaving the suite green. A requirement under review stays `🔄`: `pwk-code-review` never edits the Done cell — the loop only ever flips `🔄`→`✅` when the review returns clean; findings leave the row `🔄` for another pass.
|
|
77
77
|
- **Per-req ceremony cell** echoes the design doc's tag, not progress: `—` (default `none`/`skip`) · `⏸ full` (fires two stops — after the slice's tests and after it is complete) · `🔎 inline` · `🔎 parallel`.
|
|
78
78
|
|
|
79
|
-
**Execution summary rows are written in the same step as marking a requirement ✅** — never retrofitted
|
|
80
|
-
|
|
79
|
+
**Execution summary rows are written in the same step as marking a requirement ✅** — never retrofitted. "How it was built" = one or two plain sentences: what it does now plus the approach taken, file names sparingly, **no test-name lists, no code**. The `Evidence` cell pairs **what it proves in plain words** with a pointer — a commit, a `file:line`, a command with its output line, or one probe test — single-line. No requirement is marked ✅ with an empty `Evidence` cell: either the pointer exists or the requirement is not done. A deviating implementation fills the Deviated? column **at deviation time** (when the departure happens), with a one-line why — it is a log, not a stop. A departure that **reverses or alters a design decision** gets a **deviation decision-record**: a short paragraph (what changed, why, what was rejected) written while the knowledge is fresh; mechanical deviations keep the one-liner. `pwk-finalizing`'s learning sweep harvests these records for ADRs before the docs are disposed.
|
|
81
80
|
|
|
82
81
|
## Commit entries for packet assembly
|
|
83
82
|
|
|
84
|
-
Record immutable hexadecimal commit IDs (7–64 characters). A cell
|
|
83
|
+
Record immutable hexadecimal commit IDs (7–64 characters). A cell holds one ID or an ordered, whitespace-separated list: initial implementation first, review-fix commits last. Preserve the first recorded commit when appending a fix — replacing it loses the feature base. Record a hash after committing, never amend a commit to carry its own hash.
|
|
85
84
|
|
|
86
|
-
The helper reads only the Requirements table Commit column. A done or in-review row needs a recorded commit
|
|
85
|
+
The helper reads only the Requirements table Commit column. A done or in-review row needs a recorded commit; a terminal `❌`/`⏭` row may have `—`, which supplies no bound. If the selected or previous requirement lacks a bound, stop and correct the record from Git evidence; never invent one.
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
# Workspace and resume details
|
|
2
2
|
|
|
3
|
-
Read before
|
|
3
|
+
Read before adopting a topic branch/worktree, or when a matching progress file exists.
|
|
4
4
|
|
|
5
5
|
## Workspace
|
|
6
6
|
|
|
7
|
-
3. **Workspace — create the feature branch** —
|
|
7
|
+
3. **Workspace — create the feature branch** — already on **this topic's** feature branch → **reuse** it (a later umbrella part continues on part 1's branch). Else `git checkout <topic>`, or `git checkout -b <topic>` if new — **`<topic>` is the folder slug** everywhere in this skill: the `docs/plans/<date>-<topic>/` directory name, shared by every umbrella leaf, never a leaf slug — and it names the branch and the `../<repo>-<topic>` worktree. Check `git worktree list` first: adopt a worktree already on this branch rather than adding a second (one per branch); otherwise offer `git worktree add ../<repo>-<topic> <topic>` and hand off to a new session there, so the session's working directory is the worktree. **Uncommitted planning docs do not cross a worktree boundary** (brainstorm never commits the design doc): commit the topic folder with the main skill's scoped First-run add, switch this tree back to the branch it came from (git refuses `worktree add` of a branch still checked out here), then add the worktree. If this tree holds uncommitted topic docs while another worktree holds the branch, git refuses to commit from here — copy the topic folder into that worktree's `docs/plans/`, confirm the copy landed, and remove the source copy. Wait for the user's choice.
|
|
8
8
|
|
|
9
9
|
## Resume
|
|
10
10
|
|
|
11
|
-
Read the progress file's `Feature phase` (match the line — e.g. `grep -m1 '^Feature phase:' <file>`), the Requirements table (the first row whose Done cell is not terminal routes the next requirement — `⬜`, `🔄`, and blank all mean not-done; `✅`/`❌`/`⏭` are resolved and are skipped past), and the Execution summary rows
|
|
11
|
+
Read the progress file's `Feature phase` (match the line — e.g. `grep -m1 '^Feature phase:' <file>`), the Requirements table (the first row whose Done cell is not terminal routes the next requirement — `⬜`, `🔄`, and blank all mean not-done; `✅`/`❌`/`⏭` are resolved and are skipped past), and the Execution summary rows; stop after `## Execution summary` — later sections carry nothing the resume needs, with one exception: the `ship-paused` route re-presents the ship checkpoint, so it also reads the `## Code digest`. Before routing: a `Setup: pending` header on a design doc with a `## Setup` section means the setup checkpoint was never approved — re-run the setup verification and wait at it:
|
|
12
12
|
- `e2e-written` → write the E2E if not yet present, post the notice, and continue into the implement phase (no stop). A trivial design doc has no `## Feature acceptance` — skip both and go straight into the implement phase.
|
|
13
13
|
- `implementing (k/N)` → continue the next not-yet-terminal requirement.
|
|
14
14
|
- `reviewing` → continue/finish the feature review, then assemble the **ship** checkpoint.
|
|
@@ -1,42 +1,35 @@
|
|
|
1
1
|
# Review mechanics and packet helper
|
|
2
2
|
|
|
3
|
-
Read before any
|
|
3
|
+
Read before any review, packet refresh, or digest write.
|
|
4
4
|
|
|
5
5
|
## Assemble evidence
|
|
6
6
|
|
|
7
|
-
**Assemble the review packet first** — once, by script, so that no packet byte passes through model output
|
|
7
|
+
**Assemble the review packet first** — once, by script, so that no packet byte passes through model output. The Commit column fixes both spans: feature base = `git rev-parse <first Commit-column entry>^`, the parent of the first recorded commit; a requirement packet spans the previous requirement's last commit (exclusive) to this one's last commit (inclusive), R1's exclusive bound being its own parent. No `merge-base` guessing. Commits landing mid-review → re-run the recipe before spawning a replacement role, so the packet matches HEAD:
|
|
8
8
|
|
|
9
|
-
Use the installed skill directory, not a repository checkout
|
|
9
|
+
Use the installed skill directory, not a repository checkout; a missing runtime or helper (`node --version`) → report it and stop, with no auto-install or fallback.
|
|
10
10
|
|
|
11
11
|
```sh
|
|
12
|
-
|
|
12
|
+
node "<executing-skill-dir>/scripts/build-review-packet.mjs" \
|
|
13
13
|
--project "<repo-root>" \
|
|
14
14
|
--design "docs/plans/<date>-<topic>/<leaf>-design.md" \
|
|
15
15
|
--progress "docs/plans/<date>-<topic>/<leaf>-progress.md" \
|
|
16
16
|
--scope feature
|
|
17
17
|
```
|
|
18
18
|
|
|
19
|
-
For an opt-in requirement review,
|
|
19
|
+
For an opt-in requirement review, the same invocation with `--scope requirement --requirement 2` (substitute the number): destination `<leaf>-review-packet-r<N>.md`, versus the feature packet's `<design doc's directory>/<leaf>-review-packet.md`. Requirement-suffixed packets never overwrite each other or the feature packet.
|
|
20
20
|
|
|
21
|
-
`--project` resolves from the caller's cwd and must name the Git worktree root
|
|
21
|
+
`--project` resolves from the caller's cwd and must name the Git worktree root; design/progress paths are absolute or relative to it and must be matched leaf files in one active `docs/plans/<topic>/` folder. The helper derives the destination and refuses a symlink; to pass arguments programmatically, use a list, never shell interpolation.
|
|
22
22
|
|
|
23
|
-
The packet retains
|
|
24
|
-
- `## Commits`
|
|
25
|
-
- `## Changed files`
|
|
26
|
-
- `## Acceptance criteria (verbatim from the design doc)`
|
|
27
|
-
- `## Feature acceptance (verbatim)` (empty for a trivial design)
|
|
28
|
-
- `## Production-risk notes (verbatim, if any)`
|
|
29
|
-
- `## Diff`
|
|
23
|
+
The packet retains, in order: `## Commits`, `## Changed files`, `## Acceptance criteria (verbatim from the design doc)`, `## Feature acceptance (verbatim)` (empty for a trivial design), `## Production-risk notes (verbatim, if any)`, `## Diff`.
|
|
30
24
|
|
|
31
|
-
Criteria and production-risk content
|
|
25
|
+
Criteria and production-risk content stay verbatim, including every line of multiple risk blocks; a fenced template heading never routes extraction. Feature criteria span from the first real requirement to Feature acceptance (or document end); a requirement packet covers only its own block, keeping design-level production-risk areas as context. The helper excludes generated `*-review-packet*.md` files from diff/stat, including committed packets.
|
|
32
26
|
|
|
33
|
-
A Commit cell is one immutable hexadecimal ID or an ordered whitespace-separated list
|
|
27
|
+
A Commit cell is one immutable hexadecimal ID or an ordered whitespace-separated list — preserve the first ID, append review-fix IDs in order. Only terminal failed/skipped rows may lack a commit, and requirement assembly never guesses a bound across such a row. Anything missing, malformed, or non-ancestral → correct the record from evidence and rerun. The helper never edits progress, commits, or approves, replacing a packet only after all parse/Git work succeeds. A nonzero exit is failure, not evidence: report stderr and stop delegation.
|
|
34
28
|
|
|
35
|
-
After late
|
|
29
|
+
After late fixes, commit, append the IDs to the selected row, and refresh the packet; feature packets refresh HEAD automatically. Re-run the helper before any replacement reviewer, and before digest writing if stale or missing. Then re-green the full suite + E2E and finish the checkpoint.
|
|
36
30
|
|
|
37
31
|
## Delegate or review inline
|
|
38
32
|
|
|
39
|
-
- **`parallel`** (the `auto` resolution when risk content is present) — request the host
|
|
40
|
-
|
|
33
|
+
- **`parallel`** (the `auto` resolution when risk content is present) — request the host's `parallel-review` capability for four fresh-context, read-only roles: `pwk-spec-reviewer`, `pwk-tracing-reviewer`, `pwk-smell-reviewer`, `pwk-hazard-reviewer`. Spawn each with a **one-liner** pointing at the packet file, role framing last — the checklist name (`spec alignment`, `code tracing`, `code smells`, `production hazards`), e.g. `Read docs/plans/<date>-<topic>/<leaf>-review-packet.md. Your role: spec alignment.` The packet never appears in spawn arguments. Require independent execution and one collected outcome per role; the contracts live in `agents/pwk-*-reviewer.md`. Reviewers only report — you apply smell fixes (full suite + E2E green, commit) and flag trace/spec/hazard findings for the human.
|
|
41
34
|
- **`inline`** — perform `/skill:pwk-code-review` over the whole diff as a single pass.
|
|
42
|
-
- **Fallback** —
|
|
35
|
+
- **Fallback** — no compatible parallel-review capability, unprovable read-only/fresh-context/bounded constraints, or failed delegation → perform the missing review work inline. Retain successful delegated reports; never mark the feature fully reviewed while a required role is missing.
|