@tianhai/pi-workflow-kit 0.17.1 → 0.18.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,81 @@
1
+ # Verification Report: Incremental workflow and skill rename
2
+
3
+ **Date:** 2026-06-09
4
+ **Scope:** 10 commits on `incremental-workflow-and-rename` — pwk- prefix rename, feature-based planning, design-review repositioning, verify phase in workflow-guard
5
+ **Reviewer:** AI verify skill (security + optimization + traceability)
6
+
7
+ ## Summary
8
+
9
+ | Pass | Critical | High | Medium | Low |
10
+ |------|----------|------|--------|-----|
11
+ | Security | 0 | 0 | 0 | 0 |
12
+ | Optimization | — | 0 | 0 | 3 |
13
+ | Traceability | 0 | 0 | 2 | 1 |
14
+ | **Total** | **0** | **0** | **2** | **4** |
15
+
16
+ ## 🔴 Security Findings
17
+
18
+ No findings. This is a documentation/configuration-only change — no HTTP endpoints, no SQL queries, no user inputs, no secrets, no auth logic. No external attack surface.
19
+
20
+ ## 🟡 Optimization Findings
21
+
22
+ ### [O-001] P2 — Stale `shouldBlockFilePath` docstring
23
+
24
+ **Location:** `extensions/workflow-guard.ts:150`
25
+
26
+ **Issue:** JSDoc says "Only writes under docs/plans/ are allowed during brainstorm and plan phases" — missing the verify phase added in this change.
27
+
28
+ **Fix:** Change to "...during brainstorm, plan, and verify phases."
29
+
30
+ ### [O-002] P2 — Stale `DESTRUCTIVE_PATTERNS` comment
31
+
32
+ **Location:** `extensions/workflow-guard.ts:15`
33
+
34
+ **Issue:** Comment says "Destructive commands blocked in brainstorm/plan phases" — missing verify.
35
+
36
+ **Fix:** Change to "...in brainstorm/plan/verify phases."
37
+
38
+ ### [O-003] P2 — Inconsistent backtick formatting
39
+
40
+ **Location:** `skills/pwk-executing-tasks/SKILL.md:158`
41
+
42
+ **Issue:** `**Read \`docs/lessons.md\` if it exists**` is missing the closing backtick. All other skills use backtick-enclosed format: `**Read \`docs/lessons.md\`**`.
43
+
44
+ **Fix:** Add closing backtick: `**Read \`docs/lessons.md\` if it exists**`
45
+
46
+ ## 🔵 Traceability Findings
47
+
48
+ ### [T-001] Medium — `writing-plans` hazard check runs before feature identification
49
+
50
+ **Location:** `skills/pwk-writing-plans/SKILL.md:11-27`
51
+
52
+ **Issue:** Step 1 evaluates the hazard checklist (database, auth, etc.) *before* reading the Features table to identify the next `⬜ pending` feature. The hazard prompt says "This feature involves..." but the feature isn't known yet. Flow is: read design doc → evaluate hazards → *then* read Features table → mark `🔄 planned`.
53
+
54
+ **Fix:** Move the Features table reading before the hazard check. Flow should be: read design doc → find next `⬜ pending` feature → mark `🔄 planned` → *then* evaluate hazards for that specific feature.
55
+
56
+ ### [T-002] Medium — `executing-tasks` step 2 re-reads full Features table every task
57
+
58
+ **Location:** `skills/pwk-executing-tasks/SKILL.md:158`
59
+
60
+ **Issue:** Per-task step 2 says "Read the design doc's Features table for context on the overall feature set." This re-reads the entire table on every task execution — redundant and imprecise.
61
+
62
+ **Fix:** Change to "skim the Features table for current feature status" to avoid re-processing the whole table.
63
+
64
+ ### [T-003] Low — `design-review` trivial case may target nonexistent plan doc
65
+
66
+ **Location:** `skills/pwk-design-review/SKILL.md:12-22`
67
+
68
+ **Issue:** Step 1 allows proceeding if either doc exists. Step 2 says to append to the plan doc. If only the design doc exists (no plan doc yet), the agent would try to append to a nonexistent file. Edge case since design-review runs after writing-plans, but the instructions don't enforce this.
69
+
70
+ **Fix:** In step 2, add: "If no plan doc exists, skip and say: 'No plan doc found. Run `/skill:pwk-writing-plans` first.'"
71
+
72
+ ## Remediation Task List
73
+
74
+ | ID | Priority | Finding | Estimated Effort |
75
+ |----|----------|---------|-----------------|
76
+ | O-001 | P2 | Stale `shouldBlockFilePath` docstring missing verify | small |
77
+ | O-002 | P2 | Stale `DESTRUCTIVE_PATTERNS` comment missing verify | small |
78
+ | O-003 | P2 | Missing closing backtick in executing-tasks lessons reference | small |
79
+ | T-001 | Medium | Hazard check ordering in writing-plans (should run after feature identification) | small |
80
+ | T-002 | Medium | executing-tasks re-reads full Features table every task | small |
81
+ | T-003 | Low | design-review trivial case may target nonexistent plan doc | small |
@@ -0,0 +1,69 @@
1
+ # Implementation Plan: Verification findings fix
2
+
3
+ ## Overview
4
+
5
+ Fix 6 findings from `docs/plans/2026-06-09-incremental-workflow-and-rename-verification-report.md`.
6
+
7
+ All findings are small effort — documentation/comment fixes and minor instruction reordering.
8
+
9
+ ## Task 1: Fix stale comments in workflow-guard.ts
10
+
11
+ <!-- tdd: trivial -->
12
+
13
+ Fix O-001 and O-002.
14
+
15
+ Files:
16
+ - `extensions/workflow-guard.ts`
17
+
18
+ Steps:
19
+ 1. Change `shouldBlockFilePath` JSDoc: "during brainstorm and plan phases" → "during brainstorm, plan, and verify phases"
20
+ 2. Change `DESTRUCTIVE_PATTERNS` comment: "blocked in brainstorm/plan phases" → "blocked in brainstorm/plan/verify phases"
21
+
22
+ ## Task 2: Fix backtick formatting in executing-tasks
23
+
24
+ <!-- tdd: trivial -->
25
+
26
+ Fix O-003.
27
+
28
+ Files:
29
+ - `skills/pwk-executing-tasks/SKILL.md`
30
+
31
+ Steps:
32
+ 1. In per-task step 2, change `**Read \`docs/lessons.md` if it exists**` to `**Read \`docs/lessons.md\` if it exists**` (add closing backtick)
33
+
34
+ ## Task 3: Reorder writing-plans hazard check after feature identification
35
+
36
+ <!-- tdd: trivial -->
37
+
38
+ Fix T-001. The hazard checklist currently runs before reading the Features table. Move the Features table reading to before the hazard check so the prompt can say "This feature involves..." accurately.
39
+
40
+ Files:
41
+ - `skills/pwk-writing-plans/SKILL.md`
42
+
43
+ Steps:
44
+ 1. Move the Features table paragraph (currently at the end of step 1) to just after the design doc reading, before the hazard checklist
45
+ 2. Verify the flow is now: read design doc → find next `⬜ pending` feature → mark `🔄 planned` → evaluate hazards for that feature
46
+
47
+ ## Task 4: Narrow executing-tasks Features table read
48
+
49
+ <!-- tdd: trivial -->
50
+
51
+ Fix T-002.
52
+
53
+ Files:
54
+ - `skills/pwk-executing-tasks/SKILL.md`
55
+
56
+ Steps:
57
+ 1. In per-task step 2, change "Read the design doc's Features table for context on the overall feature set" to "Check the current feature's status in the design doc's Features table"
58
+
59
+ ## Task 5: Add plan doc guard to design-review trivial case
60
+
61
+ <!-- tdd: trivial -->
62
+
63
+ Fix T-003.
64
+
65
+ Files:
66
+ - `skills/pwk-design-review/SKILL.md`
67
+
68
+ Steps:
69
+ 1. In step 2, add a guard before the triviality check: "If no plan doc was found in step 1, skip this check and say: 'No plan doc found to append to. Run `/skill:pwk-writing-plans` first.' and stop."
@@ -0,0 +1,14 @@
1
+ # Progress: Verification fixes
2
+
3
+ Plan: docs/plans/2026-06-09-verification-fixes-implementation.md
4
+ Branch: incremental-workflow-and-rename
5
+ Started: 2026-06-09T23:10:00
6
+ Last updated: 2026-06-09T23:10:00
7
+
8
+ | # | Status | Task | Commit |
9
+ |---|--------|------|--------|
10
+ | 1 | ✅ done | Fix stale comments in workflow-guard.ts (O-001, O-002) | c5ab39f |
11
+ | 2 | ✅ done | Fix backtick formatting in executing-tasks (O-003) | c5ab39f |
12
+ | 3 | ✅ done | Reorder writing-plans hazard check after feature identification (T-001) | c5ab39f |
13
+ | 4 | ✅ done | Narrow executing-tasks Features table read (T-002) | c5ab39f |
14
+ | 5 | ✅ done | Add plan doc guard to design-review trivial case (T-003) | c5ab39f |
@@ -3,50 +3,56 @@
3
3
  `pi-workflow-kit` has 4 phases and 1 utility skill. You invoke each one explicitly with `/skill:`.
4
4
 
5
5
  ```
6
- brainstorm → plan → execute → finalize
6
+ brainstorm → plan → [design-review?] → execute → [verify?] → finalize
7
+ ```
8
+
9
+ For complex features, each phase loops per feature:
10
+ ```
11
+ brainstorm (name features) → plan next feature → [design-review?] → execute feature → [verify?] → loop...
7
12
  ```
8
13
 
9
14
  ## brainstorm
10
15
 
11
16
  ```
12
- /skill:brainstorming
17
+ /skill:pwk-brainstorming
13
18
  ```
14
19
 
15
20
  - Explore requirements and shape the design
16
21
  - Ask questions one at a time, propose approaches
17
- - Produce `docs/plans/YYYY-MM-DD-<topic>-design.md`
22
+ - Produce `docs/plans/YYYY-MM-DD-<topic>-design.md` with a `## Features` table listing all features and their status
18
23
 
19
24
  Write boundary: only `docs/plans/` is writable. Source files are hard-blocked.
20
25
 
21
26
  ## plan
22
27
 
23
28
  ```
24
- /skill:writing-plans
29
+ /skill:pwk-writing-plans
25
30
  ```
26
31
 
27
- - Read the design doc
28
- - Break into bite-sized tasks with TDD scenarios
29
- - Optionally set up a branch or worktree
30
- - Produce `docs/plans/YYYY-MM-DD-<topic>-implementation.md`
32
+ - Read the design doc's Features table, identify the next `⬜ pending` feature
33
+ - Mark it `🔄 planned` and create a per-feature implementation plan
34
+ - Produce `docs/plans/YYYY-MM-DD-<topic>-<feature-name>-implementation.md`
35
+ - Optionally trigger design review for non-trivial features
31
36
 
32
37
  Write boundary: only `docs/plans/` is writable. Source files are hard-blocked.
33
38
 
34
39
  ## execute
35
40
 
36
41
  ```
37
- /skill:executing-tasks
42
+ /skill:pwk-executing-tasks
38
43
  ```
39
44
 
40
- - Read the implementation plan
45
+ - Read the plan doc, resolve the design doc and feature row from metadata
41
46
  - Implement tasks one at a time: implement → test → fix → commit
42
- - Handle code review feedback by verifying criticism before implementing
47
+ - Mark feature `✅ done` in the design doc's Features table when complete
48
+ - Suggest planning the next feature or verifying
43
49
 
44
50
  No write restrictions. All tools available.
45
51
 
46
52
  ## finalize
47
53
 
48
54
  ```
49
- /skill:finalizing
55
+ /skill:pwk-finalizing
50
56
  ```
51
57
 
52
58
  - Archive plan docs to `docs/plans/completed/`
@@ -59,7 +65,7 @@ No write restrictions. All tools available.
59
65
  ## diagnose
60
66
 
61
67
  ```
62
- /skill:diagnose
68
+ /skill:pwk-diagnose
63
69
  ```
64
70
 
65
71
  Not a pipeline phase. A utility skill invoked on demand when debugging is needed.
@@ -4,14 +4,14 @@ import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
4
4
  /**
5
5
  * Workflow Guard extension.
6
6
  *
7
- * Blocks write/edit outside docs/plans/ and unsafe bash during brainstorm and plan phases.
7
+ * Blocks write/edit outside docs/plans/ and unsafe bash during brainstorm, plan, and verify phases.
8
8
  * You control phases explicitly via /skill: commands — no auto-detection,
9
9
  * no state persistence, no prompts.
10
10
  */
11
11
 
12
- type Phase = "brainstorm" | "plan" | null;
12
+ type Phase = "brainstorm" | "plan" | "verify" | null;
13
13
 
14
- // Destructive commands blocked in brainstorm/plan phases
14
+ // Destructive commands blocked in brainstorm/plan/verify phases
15
15
  const DESTRUCTIVE_PATTERNS = [
16
16
  /\brm\b/i,
17
17
  /\brmdir\b/i,
@@ -145,12 +145,13 @@ export function isSafeCommand(command: string): boolean {
145
145
  }
146
146
 
147
147
  const SKILL_TO_PHASE: Record<string, Phase> = {
148
- brainstorming: "brainstorm",
149
- "writing-plans": "plan",
148
+ "pwk-brainstorming": "brainstorm",
149
+ "pwk-writing-plans": "plan",
150
+ "pwk-verify": "verify",
150
151
  };
151
152
 
152
153
  /** Determine if a write/edit to filePath should be blocked during the given phase.
153
- * Only writes under docs/plans/ are allowed during brainstorm and plan phases.
154
+ * Only writes under docs/plans/ are allowed during brainstorm, plan, and verify phases.
154
155
  */
155
156
  export function shouldBlockFilePath(filePath: string, cwd: string): boolean {
156
157
  const absolute = resolve(cwd, filePath);
@@ -179,7 +180,7 @@ export default function (pi: ExtensionAPI) {
179
180
  return;
180
181
  }
181
182
  }
182
- if (text.startsWith("/skill:executing-tasks") || text.startsWith("/skill:finalizing")) {
183
+ if (text.startsWith("/skill:pwk-executing-tasks") || text.startsWith("/skill:pwk-finalizing")) {
183
184
  phase = null;
184
185
  }
185
186
  });
@@ -195,7 +196,7 @@ export default function (pi: ExtensionAPI) {
195
196
  }
196
197
  return {
197
198
  block: true,
198
- reason: `⚠️ ${phase.toUpperCase()} PHASE: Bash command blocked (not allowlisted). Only read-only commands are permitted during brainstorming and planning.\nCommand: ${command}`,
199
+ reason: `⚠️ ${phase.toUpperCase()} PHASE: Bash command blocked (not allowlisted). Only read-only commands are permitted during brainstorming, planning, and verification.\nCommand: ${command}`,
199
200
  };
200
201
  }
201
202
  return;
@@ -217,7 +218,7 @@ export default function (pi: ExtensionAPI) {
217
218
 
218
219
  return {
219
220
  block: true,
220
- reason: `⚠️ ${phase.toUpperCase()} PHASE: Cannot ${event.toolName} to ${filePath}. Only docs/plans/ is writable during brainstorming and planning.`,
221
+ reason: `⚠️ ${phase.toUpperCase()} PHASE: Cannot ${event.toolName} to ${filePath}. Only docs/plans/ is writable during brainstorming, planning, and verification.`,
221
222
  };
222
223
  });
223
224
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tianhai/pi-workflow-kit",
3
- "version": "0.17.1",
3
+ "version": "0.18.1",
4
4
  "description": "Enforce structured brainstorm→plan→execute→finalize workflow with TDD discipline in AI coding agents",
5
5
  "keywords": [
6
6
  "pi-package",
@@ -46,6 +46,7 @@
46
46
  "devDependencies": {
47
47
  "@biomejs/biome": "^2.3.15",
48
48
  "@earendil-works/pi-coding-agent": "*",
49
+ "@types/node": "^25.9.2",
49
50
  "vitest": "^4.0.18"
50
51
  }
51
52
  }
@@ -1,5 +1,5 @@
1
1
  ---
2
- name: brainstorming
2
+ name: pwk-brainstorming
3
3
  description: "Use this before any creative work — creating features, building components, adding functionality, or modifying behavior. Explores intent and design before implementation. Use this skill whenever the user describes something they want to build, change, or improve, even if they don't say 'brainstorm' — phrases like 'I want to add X', 'let's build Y', 'we need a way to Z', or 'help me design' all apply."
4
4
  ---
5
5
 
@@ -30,10 +30,22 @@ Read-only exploration. You may **not** edit or create any files except under `do
30
30
 
31
31
  ADRs live under `docs/plans/adr/` and are archived during finalizing alongside the design doc.
32
32
 
33
- For non-trivial designs, note any areas that may need production-risk review (database schema changes, authentication or authorization, external API integrations, concurrency or batch processing, file uploads or large data flows, Redis/caching/message queues). You don't need to audit them here — just flag them for the design-review stage.
33
+ 5. **Write the design doc** save it to `docs/plans/YYYY-MM-DD-<topic>-design.md`. Include a `## Features` table listing each feature as a testable, observable behavior. Simple features get one row. Complex features get many.
34
34
 
35
- For trivial changes (config, naming, simple field additions), note "Simple change — no design review needed" in the design doc.
36
- 5. **Write the design doc** — save it to `docs/plans/YYYY-MM-DD-<topic>-design.md`. Organize features as end-to-end slices (each slice delivers one observable behavior through all relevant layers) so the planning phase can decompose them directly into tasks. Branch creation, committing, and workspace setup are handled by `/skill:executing-tasks`.
35
+ Table format:
36
+ ```markdown
37
+ ## Features
38
+
39
+ | # | Feature | Status | Observable Behavior |
40
+ |---|---------|--------|---------------------|
41
+ | 1 | Feature name | ⬜ pending | What the user can do when this is complete |
42
+ ```
43
+
44
+ Status values: `⬜ pending`, `🔄 planned`, `✅ done`, `⏭ skipped`.
45
+
46
+ For trivial changes where the entire feature is a single row, note "Simple change — no design review needed" below the table. For non-trivial designs, note areas that may need production-risk review (database schema changes, authentication or authorization, external API integrations, concurrency or batch processing, file uploads or large data flows, Redis/caching/message queues).
47
+
48
+ Branch creation, committing, and workspace setup are handled by `/skill:pwk-executing-tasks`.
37
49
 
38
50
  ## Principles
39
51
 
@@ -44,5 +56,4 @@ Read-only exploration. You may **not** edit or create any files except under `do
44
56
 
45
57
  ## After the design
46
58
 
47
- - **Non-trivial design**: Ask: "Design looks good. Run `/skill:design-review` to check for production risks before planning."
48
- - **Trivial change**: Ask: "Simple change — skip design review. Ready to plan? Run `/skill:writing-plans`"
59
+ Ask: "Ready to plan? Run `/skill:pwk-writing-plans`"
@@ -1,17 +1,17 @@
1
1
  ---
2
- name: design-review
3
- description: "Audit a design doc for production risks — security, scalability, fault tolerance, and operational hazards. Use after brainstorming for non-trivial designs, or when you want to stress-test a design for production readiness."
2
+ name: pwk-design-review
3
+ description: "Audit a plan and design doc for production risks — security, scalability, fault tolerance, and operational hazards. Use after writing-plans for non-trivial features, when the plan has concrete code that makes hazard checks meaningful."
4
4
  ---
5
5
 
6
6
  # Design Review
7
7
 
8
- Read-only exploration of the design doc. You **may** edit the design doc to append review findings. You may **not** edit source code or configuration.
8
+ Read-only exploration of the design and plan docs. You **may** edit the plan doc to append review findings. You may **not** edit source code or configuration.
9
9
 
10
10
  ## Process
11
11
 
12
- 1. **Find the design doc** — look for `docs/plans/*-design.md`. If none exists, say "No design doc found. Run `/skill:brainstorming` first." and stop.
12
+ 1. **Find the design and plan docs** — look for `docs/plans/*-design.md` and `docs/plans/*-implementation.md`. If neither exists, say "No design or plan doc found. Run `/skill:pwk-brainstorming` first." and stop. Read the plan doc for concrete code context alongside the design doc for architectural context.
13
13
 
14
- 2. **Check triviality** — if the design doc notes "Simple change — no design review needed", append a brief section:
14
+ 2. **Check triviality** — if a plan doc was found in step 1 and the design doc notes "Simple change — no design review needed", append a brief section to the plan doc:
15
15
 
16
16
  ```markdown
17
17
  ## Architectural Review
@@ -19,9 +19,11 @@ Read-only exploration of the design doc. You **may** edit the design doc to appe
19
19
  **Status**: Skipped — trivial change. No high-risk operations detected.
20
20
  ```
21
21
 
22
- Then say: "Ready to plan? Run `/skill:writing-plans`" and stop.
22
+ Then say: "Review complete — no action needed. Ready to execute? Run `/skill:pwk-executing-tasks`" and stop.
23
23
 
24
- 3. **Read the design doc in full** understand the architecture, data flow, components, and error handling proposed.
24
+ If no plan doc was found, skip this check and say: "No plan doc found to append to. Run `/skill:pwk-writing-plans` first." and stop.
25
+
26
+ 3. **Read the design and plan docs in full** — understand the architecture from the design doc, and concrete code from the plan doc. The plan doc's implementation details (SQL queries, type definitions, function bodies) are what the hazard checks audit.
25
27
 
26
28
  4. **🏛️ Architectural Pillars Review** — evaluate the design against the 6 Pillars of Production-Grade Design:
27
29
 
@@ -55,7 +57,7 @@ Read-only exploration of the design doc. You **may** edit the design doc to appe
55
57
 
56
58
  7. **Present findings** — show the full review to the user. For each triggered hazard or Socratic risk, propose a concrete mitigation. Wait for user feedback and incorporate changes.
57
59
 
58
- 8. **Append to design doc** — add a `## Architectural Review` section to the design doc. Two cases:
60
+ 8. **Append to plan doc** — add a `## Architectural Review` section to the plan doc (not the design doc — review is per-feature, and the plan doc is the per-feature artifact). Two cases:
59
61
 
60
62
  **All clear** (no hazards triggered, no Socratic risks):
61
63
  ```markdown
@@ -110,4 +112,4 @@ Read-only exploration of the design doc. You **may** edit the design doc to appe
110
112
 
111
113
  ## After the review
112
114
 
113
- Ask: "Ready to plan? Run `/skill:writing-plans`"
115
+ Ask: "Review complete. Ready to execute? Run `/skill:pwk-executing-tasks`"
@@ -1,5 +1,5 @@
1
1
  ---
2
- name: diagnose
2
+ name: pwk-diagnose
3
3
  description: "Disciplined debugging loop for hard bugs and performance regressions. Use when a test fails unexpectedly, a bug is found during execution, or something is broken. Use this skill whenever the user reports a bug, says 'this doesn't work', 'something's wrong', 'help me debug', or when tests fail for unclear reasons. Works at any point in the workflow — brainstorm, execute, or standalone."
4
4
  ---
5
5
 
@@ -1,6 +1,6 @@
1
1
  ---
2
- name: executing-tasks
3
- description: "Use this to implement an approved plan task-by-task. Run after writing-plans, before finalizing."
2
+ name: pwk-executing-tasks
3
+ description: "Use this to implement an approved plan task-by-task. Run after pwk-writing-plans, before finalizing."
4
4
  ---
5
5
 
6
6
  # Executing Tasks
@@ -10,7 +10,7 @@ Implement the plan from `docs/plans/*-implementation.md` task by task, with file
10
10
  ## Before you start
11
11
 
12
12
  1. **Check git state** — run `git status` and `git log --oneline -5`. Note any uncommitted changes.
13
- 2. **Find the plan** — look for `docs/plans/*-implementation.md`. If none exist, say "No implementation plan found. Run `/skill:writing-plans` first." and stop. If multiple exist, ask the user which one to execute.
13
+ 2. **Find the plan** — look for `docs/plans/*-design.md` to get the Features table. Find the feature with status `🔄 planned`. The plan doc is `docs/plans/YYYY-MM-DD-<topic>-<slugified-feature-name>-implementation.md`. If no design doc exists, fall back to looking for a single `*-implementation.md` (backward compatibility with plans not using the feature table). This covers plans created without a brainstorm session (no design doc or Features table). If multiple plan docs exist and no design doc, ask the user which one to execute.
14
14
  3. **Check for existing progress** — look for `docs/plans/*-progress.md`. If one exists matching the plan, this is a **resume** (see [Resume](#resume)). If not, this is a **first run** (see [First run](#first-run)).
15
15
 
16
16
  ## First run
@@ -38,6 +38,9 @@ Implement the plan from `docs/plans/*-implementation.md` task by task, with file
38
38
  ```
39
39
 
40
40
  b. Move plan docs into the worktree:
41
+
42
+ > When using the feature table, all plan docs for this design move together — completed feature plans, the current feature's plan, and the design doc. This is intentional: the worktree works on one design at a time.
43
+
41
44
  ```
42
45
  mv docs/plans/*-design.md <worktree>/docs/plans/ 2>/dev/null || true
43
46
  mv docs/plans/*-implementation.md <worktree>/docs/plans/ 2>/dev/null || true
@@ -60,7 +63,7 @@ Implement the plan from `docs/plans/*-implementation.md` task by task, with file
60
63
  To continue, start a new session there:
61
64
  cd ../<repo>-<feature-name> && pi
62
65
 
63
- Then run: /skill:executing-tasks
66
+ Then run: /skill:pwk-executing-tasks
64
67
  ```
65
68
 
66
69
  e. **Create the progress file** in the worktree — save to `<worktree>/docs/plans/<plan-name>-progress.md`:
@@ -119,7 +122,7 @@ Implement the plan from `docs/plans/*-implementation.md` task by task, with file
119
122
  - Show the failure reason from the progress file
120
123
  - Ask: "Retry, skip, or abort?"
121
124
  4. **Handle pending task** — proceed normally
122
- 5. **All done** — if no `⬜ pending` or `❌ failed` tasks remain, show summary and suggest `/skill:finalizing`
125
+ 5. **All done** — if no `⬜ pending` or `❌ failed` tasks remain, show summary and suggest `/skill:pwk-finalizing`
123
126
  6. **Begin task execution** — proceed from the identified task
124
127
 
125
128
  ## Progress file
@@ -155,7 +158,7 @@ Implement the plan from `docs/plans/*-implementation.md` task by task, with file
155
158
  For each task:
156
159
 
157
160
  1. **Mark in-progress** — update the progress file: `🔄 in-progress`
158
- 2. **Read the plan** — read the plan's overview section (everything before `## Task 1:`). Skim all `## Task N:` headings for dependency awareness. Then read the current task's body in full. **Read `docs/lessons.md` if it exists** — follow all rules listed there while working on this task.
161
+ 2. **Read the plan** — read the plan's overview section (everything before `## Task 1:`). Extract the `Design:` and `Feature:` metadata to know which design doc and feature row this execution covers. If no `Design:` or `Feature:` metadata is present, the plan covers the entire design (no feature table). Skip design doc reading and proceed directly to task execution. Otherwise, check the current feature's status in the design doc's Features table. Skim all `## Task N:` headings for dependency awareness. Then read the current task's body in full. **Read `docs/lessons.md`** if it exists — follow all rules listed there while working on this task.
159
162
  3. **Execute the plan steps** — follow each numbered step in the task body, in order. As you work, shift your cognitive focus through three frames:
160
163
 
161
164
  **QA Test frame** (when writing/running tests): Focus entirely on translating the task's `Given/When/Then` Acceptance Criteria into precise failing tests. Before running tests, verify the test environment is sandboxed — no real database connections, API calls, or live services. External dependencies must be mocked or stubbed. Ensure the test environment is isolated (e.g., `NODE_ENV=test`, `GO_ENV=test`, or equivalent for your stack).
@@ -183,17 +186,18 @@ For each task:
183
186
  > "Always validate required ID fields at the service boundary — missing IDs should return 400, not 500"
184
187
  6. **Commit** — after all steps are done (no checkpoint gates remain in the task), `git add` the relevant files and commit with a clear message.
185
188
  7. **Update progress** — mark `✅ done` + record the commit hash.
186
- 8. **Suggest session break if needed** after completing ~3-5 tasks since the last break, suggest:
189
+ 8. **Update design doc** if the progress file shows all tasks for the current feature are `✅ done`, find the design doc (from plan metadata), and mark the current feature row as `✅ done` in the Features table.
190
+ 9. **Suggest session break if needed** — after completing ~3-5 tasks since the last break, suggest:
187
191
  ```
188
192
  ✅ Tasks N-M done (commits: abc, def)
189
193
  Progress: X/Y tasks done
190
194
  ⏭ Next: Task [N+1] — [description]
191
195
  💡 Context is building up. For clean context on remaining tasks:
192
- /new then /skill:executing-tasks
196
+ /new then /skill:pwk-executing-tasks
193
197
  (or just say "continue" to keep going here)
194
198
  ```
195
199
  Also suggest at checkpoint review pauses when multiple tasks have been completed since the last break. Respect the user's choice if they say "continue".
196
- 9. **Loop** — go back to step 1 for the next `⬜ pending` task, or see [After all tasks](#after-all-tasks) if none remain.
200
+ 10. **Loop** — go back to step 1 for the next `⬜ pending` task, or see [After all tasks](#after-all-tasks) if none remain.
197
201
 
198
202
  ### `docs/lessons.md` format
199
203
 
@@ -263,7 +267,7 @@ What would you like to do?
263
267
  - **request changes** — tell me what to change in the tests
264
268
  - **revert** — undo this task and go back to pending
265
269
  - **skip** — skip this task entirely
266
- - **stop** — pause here, resume later with /skill:executing-tasks
270
+ - **stop** — pause here, resume later with /skill:pwk-executing-tasks
267
271
  - **status** — show the full progress table
268
272
  ```
269
273
 
@@ -291,7 +295,7 @@ What would you like to do?
291
295
  - **request changes** — tell me what to change, I'll update and re-present
292
296
  - **revert** — undo this task and go back to pending
293
297
  - **skip** — skip this task entirely
294
- - **stop** — pause here, resume later with /skill:executing-tasks
298
+ - **stop** — pause here, resume later with /skill:pwk-executing-tasks
295
299
  - **status** — show the full progress table
296
300
  ```
297
301
 
@@ -335,16 +339,42 @@ When the user shares code review feedback (outside of a checkpoint pause):
335
339
 
336
340
  ## After all tasks
337
341
 
338
- When no `⬜ pending` or `❌ failed` tasks remain, show a summary:
342
+ When no `⬜ pending` or `❌ failed` tasks remain for the current feature, read the design doc's Features table. Show the per-task summary from the progress file, then check for more features:
343
+
344
+ ### More features remaining
339
345
 
340
346
  ```
341
- All tasks complete!
347
+ Feature "<feature name>" complete.
348
+
349
+ | # | Status | Task |
350
+ |---|--------|------|
351
+ | 1 | ✅ done | Create User model |
352
+ | 2 | ✅ done | Add signup endpoint |
353
+
354
+ ⏭ Next: "<next pending feature name>"
355
+ 💡 Options:
356
+ - Plan next feature: /skill:pwk-writing-plans
357
+ - Verify this feature first: /skill:pwk-verify
358
+ - Or just say "continue"
359
+ ```
360
+
361
+ ### All features complete
362
+
363
+ ```
364
+ ✅ All features complete!
365
+
366
+ | # | Status | Feature |
367
+ |---|--------|---------|
368
+ | 1 | ✅ done | User signup |
369
+ | 2 | ✅ done | Email verification |
370
+ | 3 | ⏭ skipped | Password reset |
342
371
 
343
372
  | # | Status | Task |
344
373
  |---|--------|------|
345
374
  | 1 | ✅ done | Create User model |
346
- | 2 | ✅ done | Write User model tests |
347
- | 3 | skipped | Add auth middleware |
375
+ | 2 | ✅ done | Add signup endpoint |
376
+ | ... | ... | ... |
348
377
 
349
- Ready to ship? Run `/skill:finalizing`
378
+ - Verify everything: /skill:pwk-verify
379
+ - Ship: /skill:pwk-finalizing
350
380
  ```
@@ -1,5 +1,5 @@
1
1
  ---
2
- name: finalizing
2
+ name: pwk-finalizing
3
3
  description: "Use this after all tasks are complete to clean up, document, and ship the work."
4
4
  ---
5
5
 
@@ -21,13 +21,20 @@ Wait for the user to confirm before proceeding.
21
21
 
22
22
  ## Process
23
23
 
24
- 1. **Move planning docs** — archive the design, implementation, progress docs, and ADRs (if any), then commit:
24
+ 1. **Move planning docs** — before archiving, check the design doc's `## Features` table (if one exists). If any features have status `⬜ pending` or `🔄 planned`, warn:
25
+
26
+ ```
27
+ ⚠️ Design doc has N unplanned features. Archive anyway, or go back to plan them?
28
+ ```
29
+
30
+ Wait for the user to confirm before proceeding. Then archive the design, implementation, progress docs, and ADRs (if any), then commit:
25
31
  ```
26
32
  mkdir -p docs/plans/completed
27
33
  mkdir -p docs/plans/completed/adr
28
34
  mv docs/plans/*-design.md docs/plans/completed/ 2>/dev/null || true
29
35
  mv docs/plans/*-implementation.md docs/plans/completed/ 2>/dev/null || true
30
36
  mv docs/plans/*-progress.md docs/plans/completed/ 2>/dev/null || true
37
+ mv docs/plans/*-verification-report.md docs/plans/completed/ 2>/dev/null || true
31
38
  mv docs/plans/adr/*.md docs/plans/completed/adr/ 2>/dev/null || true
32
39
  rmdir docs/plans/adr 2>/dev/null || true
33
40
  git add docs/plans/ && git commit -m "chore: archive planning docs"
@@ -1,5 +1,5 @@
1
1
  ---
2
- name: verify
2
+ name: pwk-verify
3
3
  description: "Post-implementation code verification with three expert review passes — security, optimization, and traceability. Use after executing-tasks and before finalizing to catch issues that pass tests but break in production. Runs the 'last prompt' pattern: adversarial security review, dead code and duplication audit, and end-to-end contract verification across every layer. Use this skill whenever the user says 'verify', 'review the code', 'check for issues', 'security review', 'the last prompt', 'audit', or when code has been implemented and needs a quality gate before shipping."
4
4
  ---
5
5
 
@@ -11,7 +11,7 @@ The core insight: code that passes tests is not code that's ready. Working code
11
11
 
12
12
  ## Process
13
13
 
14
- 1. **Check what's been done** — run `git log --oneline` and `git diff --stat` to understand the scope of recent changes. If nothing has been implemented, say "No code changes found. Run `/skill:executing-tasks` first." and stop.
14
+ 1. **Check what's been done** — run `git log --oneline` and `git diff --stat` to understand the scope of recent changes. If nothing has been implemented, say "No code changes found. Run `/skill:pwk-executing-tasks` first." and stop.
15
15
 
16
16
  2. **Identify the project's layers** — before reviewing, map the codebase's architecture. Look for layer boundaries: UI/handlers/routes → services/business logic → repositories/data access → database/models. Note the patterns: does the project use controllers, handlers, or routes? Services or use cases? Repositories or DAOs? This map drives the traceability pass.
17
17
 
@@ -19,7 +19,7 @@ The core insight: code that passes tests is not code that's ready. Working code
19
19
 
20
20
  4. **Compile the report** — write all findings to `docs/plans/*-verification-report.md`. Present the report to the user and wait for feedback.
21
21
 
22
- 5. **Offer to create a remediation plan** — after the report, ask: "Want me to create a fix plan from these findings? Run `/skill:writing-plans` to turn the task list into executable tasks."
22
+ 5. **Offer to create a remediation plan** — after the report, ask: "Want me to create a fix plan from these findings? Run `/skill:pwk-writing-plans` to turn the task list into executable tasks."
23
23
 
24
24
  ## Pass 1 — Security Review 🔴
25
25