@tianhai/pi-workflow-kit 0.15.0 → 0.16.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.
@@ -0,0 +1,273 @@
1
+ # Implementation Plan: PR #5 Improvements
2
+
3
+ Fixes CI failures, tightens consistency across the workflow chain, and improves the design-review integration so every skill speaks with one voice.
4
+
5
+ ---
6
+
7
+ ## Task 1: Fix biome lint and format errors in workflow-guard
8
+
9
+ <!-- tdd: modifying-tested-code -->
10
+
11
+ Acceptance Criteria (QA Engineer Hat):
12
+ - **Happy Path**:
13
+ - Given: The biome linter runs on `extensions/workflow-guard.ts` and `tests/workflow-guard.test.ts`
14
+ - When: `npx biome check` is executed
15
+ - Then: Zero errors and zero warnings are emitted
16
+ - **Edge Case (no functional regression)**:
17
+ - Given: The existing test suite for workflow-guard
18
+ - When: `npx vitest run` is executed
19
+ - Then: All 27 existing tests still pass
20
+
21
+ Files:
22
+ - `extensions/workflow-guard.ts`
23
+ - `tests/workflow-guard.test.ts`
24
+
25
+ Steps:
26
+ 1. Fix `extensions/workflow-guard.ts` line 163 — replace string concatenation with template literal:
27
+ ```ts
28
+ // Before:
29
+ return !absolute.startsWith(plansDir + "/");
30
+ // After:
31
+ return !absolute.startsWith(`${plansDir}/`);
32
+ ```
33
+ 2. Fix `tests/workflow-guard.test.ts` line 1 — remove unused `beforeEach` import:
34
+ ```ts
35
+ // Before:
36
+ import { describe, it, expect, beforeEach } from "vitest";
37
+ // After:
38
+ import { describe, it, expect } from "vitest";
39
+ ```
40
+ 3. Fix `tests/workflow-guard.test.ts` line 19 — remove unused `getCurrentPhase` import:
41
+ ```ts
42
+ // Before:
43
+ import { getCurrentPhase, isSafeCommand, shouldBlockFilePath } from "../extensions/workflow-guard";
44
+ // After:
45
+ import { isSafeCommand, shouldBlockFilePath } from "../extensions/workflow-guard";
46
+ ```
47
+ 4. Run `npx biome check extensions/ tests/` — confirm zero errors.
48
+ 5. Run `npx vitest run` — confirm all tests pass.
49
+
50
+ ---
51
+
52
+ ## Task 2: Fix CHANGELOG `[Unreleased]` link
53
+
54
+ <!-- tdd: trivial -->
55
+
56
+ Acceptance Criteria (QA Engineer Hat):
57
+ - **Happy Path**:
58
+ - Given: The CHANGELOG.md file with version link references
59
+ - When: A reader clicks the `[Unreleased]` link
60
+ - Then: It shows changes between v0.16.0 and HEAD (not v0.14.0)
61
+
62
+ Files:
63
+ - `CHANGELOG.md`
64
+
65
+ Steps:
66
+ 1. Update the `[Unreleased]` link at the bottom of CHANGELOG.md:
67
+ ```markdown
68
+ // Before:
69
+ [Unreleased]: https://github.com/yinloo-ola/pi-workflow-kit/compare/v0.14.0...HEAD
70
+ // After:
71
+ [Unreleased]: https://github.com/yinloo-ola/pi-workflow-kit/compare/v0.16.0...HEAD
72
+ ```
73
+
74
+ ---
75
+
76
+ ## Task 3: Align skill descriptions — trim design-review, match tone
77
+
78
+ <!-- tdd: trivial -->
79
+
80
+ All six skills should follow the same description pattern: a one-sentence summary of what the skill does, followed by trigger guidance. The `design-review` description currently front-loads usage instructions that belong in the skill body.
81
+
82
+ Acceptance Criteria (QA Engineer Hat):
83
+ - **Happy Path**:
84
+ - Given: The `description` frontmatter of `skills/design-review/SKILL.md`
85
+ - When: Compared to the other five skill descriptions
86
+ - Then: It follows the same pattern — concise purpose first, trigger guidance second
87
+ - **Edge Case (no information loss)**:
88
+ - Given: The trimmed description
89
+ - When: An agent reads it for skill matching
90
+ - Then: It still contains enough signal to trigger correctly (keywords: audit, design, production risks, security, scalability)
91
+
92
+ Files:
93
+ - `skills/design-review/SKILL.md`
94
+
95
+ Steps:
96
+ 1. Replace the description in `skills/design-review/SKILL.md` frontmatter:
97
+ ```yaml
98
+ // Before:
99
+ description: "Audit a design doc for production risks — security, scalability, fault tolerance, and operational hazards. Run after brainstorming, before writing-plans. Use when the brainstorm flags a non-trivial design, or when you want to stress-test a design for production readiness."
100
+ // After:
101
+ 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."
102
+ ```
103
+ This trims the redundant "Run after brainstorming, before writing-plans" (the workflow order is documented in README) while keeping the trigger guidance.
104
+
105
+ ---
106
+
107
+ ## Task 4: Remove redundant user confirmation for trivial design-review
108
+
109
+ <!-- tdd: modifying-tested-code -->
110
+
111
+ The brainstorming skill already asked the user to classify trivial vs non-trivial. When the design doc says "Simple change — no design review needed", the user already made that decision. Asking again in design-review step 2 adds friction without value.
112
+
113
+ Acceptance Criteria (QA Engineer Hat):
114
+ - **Happy Path (trivial skip)**:
115
+ - Given: A design doc with "Simple change — no design review needed"
116
+ - When: `/skill:design-review` is run
117
+ - Then: The agent automatically appends the "Skipped — trivial change" section and moves on, without asking the user to confirm
118
+ - **Edge Case (non-trivial proceeds normally)**:
119
+ - Given: A design doc without the trivial marker
120
+ - When: `/skill:design-review` is run
121
+ - Then: The full audit proceeds as before (no behavior change)
122
+
123
+ Files:
124
+ - `skills/design-review/SKILL.md`
125
+
126
+ Steps:
127
+ 1. In step 2 ("Check triviality"), replace the interactive confirmation with an automatic skip:
128
+ ```markdown
129
+ // Before:
130
+ 2. **Check triviality** — if the design doc notes "Simple change — no design review needed", confirm with the user: "This looks like a trivial change. Skip the full audit?" If yes, append a brief section:
131
+
132
+ // After:
133
+ 2. **Check triviality** — if the design doc notes "Simple change — no design review needed", append a brief section:
134
+ ```
135
+ 2. Remove the "If yes," conditional — the append and stop is now unconditional for trivial docs.
136
+ 3. Verify the file reads cleanly — the flow is now: find doc → check trivial → (if trivial: append + stop, else: continue to step 3).
137
+
138
+ ---
139
+
140
+ ## Task 5: Evaluate design for review need regardless of design doc presence
141
+
142
+ <!-- tdd: trivial -->
143
+
144
+ The brainstorming skill flags "database changes, external services, auth, concurrency, large data flows" for design-review. The writing-plans safety net checks for a slightly different list and only when a design doc exists. When writing-plans is used standalone (no design doc), the safety net never fires — so a non-trivial standalone design skips design-review entirely.
145
+
146
+ The fix: always evaluate whether the design involves high-risk patterns, regardless of source. A design doc with no `## Architectural Review` section and a standalone user description both deserve the same scrutiny.
147
+
148
+
149
+ Acceptance Criteria (QA Engineer Hat):
150
+ - **Happy Path (design doc, no review section)**:
151
+ - Given: A design doc exists without an `## Architectural Review` section, and the design involves database schema changes
152
+ - When: Writing-plans step 1 runs
153
+ - Then: The agent prompts the user to run `/skill:design-review` or type 'proceed'
154
+ - **Happy Path (standalone, non-trivial)**:
155
+ - Given: No design doc exists, and the user describes a feature involving authentication and external API integrations
156
+ - When: Writing-plans gathers context
157
+ - Then: The agent prompts: "This design involves [auth, external APIs] but hasn't been reviewed for production risks. Run `/skill:design-review` first, or type 'proceed' to skip."
158
+ - **Edge Case (design doc already reviewed)**:
159
+ - Given: A design doc with an `## Architectural Review` section
160
+ - When: Writing-plans step 1 runs
161
+ - Then: No prompt — the review already happened
162
+ - **Edge Case (trivial)**:
163
+ - Given: A trivial design (config rename, simple field addition) with or without a design doc
164
+ - When: Writing-plans evaluates the design
165
+ - Then: No prompt — no trigger categories matched
166
+
167
+ Files:
168
+ - `skills/brainstorming/SKILL.md`
169
+ - `skills/writing-plans/SKILL.md`
170
+
171
+ Steps:
172
+ 1. Update `skills/brainstorming/SKILL.md` step 4 to match writing-plans' more specific list:
173
+ ```markdown
174
+ // Before:
175
+ For non-trivial designs, note any areas that may need production-risk review (database changes, external services, auth, concurrency, large data flows). You don't need to audit them here — just flag them for the design-review stage.
176
+
177
+ // After:
178
+ 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.
179
+ ```
180
+ 2. Update `skills/writing-plans/SKILL.md` step 1 — consolidate the safety net into one check that applies regardless of whether a design doc exists. Replace the current conditional with:
181
+ ```markdown
182
+ // Before (current text — only checks design docs):
183
+ Then check whether the design doc has an `## Architectural Review` section. If it doesn't, and the design involves any of the following, prompt the user...
184
+
185
+ // After (unified check):
186
+ Then evaluate whether the design — whether from the design doc or from the user's description and codebase exploration — involves any of the following:
187
+
188
+ - Database schema changes or migrations
189
+ - Authentication or authorization logic
190
+ - External API or service integrations
191
+ - Concurrency or batch processing
192
+ - File uploads or large data flows
193
+ - Redis, caching, or message queues
194
+
195
+ If any apply AND the design doc does not already have an `## Architectural Review` section, prompt the user: "This design involves [list what you found] but hasn't been reviewed for production risks. Run `/skill:design-review` first, or type 'proceed' to skip."
196
+
197
+ If the design doc explicitly notes "Simple change — no design review needed", skip this check.
198
+ ```
199
+ 3. Verify the safety net fires for both design-doc and standalone paths, and skips when the review already exists.
200
+
201
+ ---
202
+
203
+ ## Task 6: Generalize `NODE_ENV` reference in executing-tasks
204
+
205
+ <!-- tdd: trivial -->
206
+
207
+ The QA Test frame references `NODE_ENV` which is Node.js-specific. Since the workflow kit is used across languages (the examples reference SQL, Go, etc.), this should be generalized.
208
+
209
+ Acceptance Criteria (QA Engineer Hat):
210
+ - **Happy Path**:
211
+ - Given: The QA Test frame in `skills/executing-tasks/SKILL.md`
212
+ - When: A developer working in Python or Go reads it
213
+ - Then: The guidance makes sense without Node.js context
214
+ - **Edge Case (Node.js users still understand)**:
215
+ - Given: A Node.js developer reading the same text
216
+ - When: They see the generalized phrasing
217
+ - Then: They understand it means `NODE_ENV=test` or equivalent
218
+
219
+ Files:
220
+ - `skills/executing-tasks/SKILL.md`
221
+
222
+ Steps:
223
+ 1. In the QA Test frame, replace the `NODE_ENV` reference:
224
+ ```markdown
225
+ // Before:
226
+ External dependencies must be mocked or stubbed. `NODE_ENV` must be `test` (or equivalent).
227
+
228
+ // After:
229
+ 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).
230
+ ```
231
+
232
+ ---
233
+
234
+ ## Task 7: Deduplicate test coverage requirement in writing-plans task format
235
+
236
+ <!-- tdd: trivial -->
237
+
238
+ The "Each task must include" section has two overlapping bullets about test coverage:
239
+ 1. The new Acceptance Criteria block (Happy Path + Edge Cases)
240
+ 2. The old "Each task's tests should cover the happy path and at least one edge case" bullet
241
+
242
+ The Acceptance Criteria block supersedes the old bullet. Keeping both is redundant and confusing.
243
+
244
+ Acceptance Criteria (QA Engineer Hat):
245
+ - **Happy Path**:
246
+ - Given: The task format section in `skills/writing-plans/SKILL.md`
247
+ - When: Reading the "Each task must include" bullets
248
+ - Then: Test coverage is specified exactly once (in the Acceptance Criteria block), not duplicated
249
+
250
+ Files:
251
+ - `skills/writing-plans/SKILL.md`
252
+
253
+ Steps:
254
+ 1. Remove the redundant bullet from "Each task must include":
255
+ ```markdown
256
+ // Remove this line (now covered by Acceptance Criteria):
257
+ - Each task's tests should cover the happy path and at least one edge case or error path, with concrete assertions
258
+ ```
259
+ 2. Verify the Acceptance Criteria bullet already covers this requirement with its "Happy Path" and "Edge Cases & Error Paths" sub-bullets.
260
+
261
+ ---
262
+
263
+ ## Task 8: Run tests and verify CI passes
264
+
265
+ <!-- tdd: trivial -->
266
+
267
+ Files:
268
+ - None (verification only)
269
+
270
+ Steps:
271
+ 1. Run `npx biome check extensions/ tests/` — confirm zero errors.
272
+ 2. Run `npx vitest run` — confirm all existing tests pass.
273
+ 3. Verify the CHANGELOG link renders correctly.
@@ -0,0 +1,17 @@
1
+ # Progress: PR #5 Improvements
2
+
3
+ Plan: docs/plans/2026-05-25-pr5-improvements-implementation.md
4
+ Branch: design-review-split
5
+ Started: 2026-05-25T12:00:00Z
6
+ Last updated: 2026-05-25T12:26:00Z
7
+
8
+ | # | Status | Task | Commit |
9
+ |---|--------|------|--------|
10
+ | 1 | ✅ done | Fix biome lint and format errors in workflow-guard | 6f2eb8c |
11
+ | 2 | ✅ done | Fix CHANGELOG `[Unreleased]` link | 4866c25 |
12
+ | 3 | ✅ done | Align skill descriptions — trim design-review, match tone | 541ea9b |
13
+ | 4 | ✅ done | Remove redundant user confirmation for trivial design-review | 953b6d6 |
14
+ | 5 | ✅ done | Evaluate design for review need regardless of design doc presence | 20ea47e |
15
+ | 6 | ✅ done | Generalize `NODE_ENV` reference in executing-tasks | b117a44 |
16
+ | 7 | ✅ done | Deduplicate test coverage requirement in writing-plans task format | 3a34266 |
17
+ | 8 | ✅ done | Run tests and verify CI passes | — |