5-phase-workflow 1.9.2 → 1.9.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "5-phase-workflow",
3
- "version": "1.9.2",
3
+ "version": "1.9.3",
4
4
  "description": "A 5-phase feature development workflow for Claude Code",
5
5
  "bin": {
6
6
  "5-phase-workflow": "bin/install.js"
@@ -163,44 +163,92 @@ Task tool call:
163
163
 
164
164
  For duplicates, note which local finding covers it.
165
165
 
166
+ For every actionable_fix and manual comment, also provide:
167
+ - **recommendation**: one of `address`, `defer`, `decline`, or `discuss`
168
+ - `address` — should be fixed now, clear and reasonable
169
+ - `defer` — valid concern but low urgency, can wait
170
+ - `decline` — out of scope or disagree with the suggestion
171
+ - `discuss` — needs more context before deciding
172
+ - **reasoning**: one plain-English sentence explaining the recommendation
173
+
166
174
  ## Output Format
167
175
  Return a structured list:
168
176
 
169
177
  ---PR-COMMENTS---
170
- {id} | {file}:{line} | {category} | {description} | {duplicate_of or "none"}
178
+ {id} | {file}:{line} | {category} | {description} | {duplicate_of or "none"} | {recommendation or "n/a"} | {one-sentence reasoning or "n/a"}
171
179
  ---END-PR-COMMENTS---
172
180
 
173
181
  Rules:
174
182
  - DO NOT apply fixes
175
183
  - DO NOT interact with user
176
184
  - Include every comment in the output
185
+ - recommendation and reasoning are required for actionable_fix and manual; use "n/a" for skip and duplicate
177
186
  ```
178
187
 
179
- Parse the `---PR-COMMENTS---` block. Collect:
180
- - `pr_to_fix` — actionable_fix items
181
- - `pr_duplicates` — duplicate items
182
- - `pr_manual` — manual items
188
+ Parse the `---PR-COMMENTS---` block. For each line extract all seven fields. Build:
189
+ - `pr_actionable` — actionable_fix items (with recommendation + reasoning)
190
+ - `pr_manual` — manual items (with recommendation + reasoning)
191
+ - `pr_duplicates` — duplicate items (auto-assign `decision: wont_fix`, no Q&A)
192
+ - `pr_skip` — skip items (auto-assign `decision: wont_fix`, no Q&A)
193
+
194
+ Initialize `pr_decisions` as an empty list. Append all `pr_duplicates` and `pr_skip` entries with `decision: wont_fix` and `user_note: ""`.
183
195
 
184
- **Present PR comment summary to user:**
196
+ **Display count summary:**
185
197
  ```
186
- PR Review Comments:
187
- - Actionable (new): {N}
188
- - Duplicates (covered by local findings): {N}
189
- - Manual/Discussion: {N}
190
- - Skipped (bot/resolved): {N}
198
+ PR Review Comments found:
199
+ - Actionable (new): {N}
200
+ - Manual/Discussion: {N}
201
+ - Duplicates (covered by local): {N}
202
+ - Skipped (bot/resolved): {N}
191
203
 
192
- Actionable PR comments:
193
- {#} {file}:{line} — {description}
204
+ You will now be asked to decide on each actionable and manual comment individually.
205
+ ```
194
206
 
195
- Manual PR comments:
196
- {#} {file}:{line} — {description}
207
+ If there are no `pr_actionable` and no `pr_manual` items, display `"No actionable or manual PR comments to review."` and skip the loop below.
208
+
209
+ **Per-comment decision loop** — iterate over all items in `pr_actionable + pr_manual` in order, using a counter `i` from 1 to total:
210
+
211
+ For each comment:
212
+
213
+ 1. Display:
214
+ ```
215
+ ── PR Comment {i} of {total} ──────────────────────────
216
+ Category: {category}
217
+ File: {file}:{line}
218
+ Comment: {description}
219
+
220
+ Recommendation: {recommendation} — {reasoning}
221
+ ──────────────────────────────────────────────────────
222
+ ```
223
+
224
+ 2. Ask via AskUserQuestion:
225
+ - Question: `"[{i}/{total}] {file}:{line} — How do you want to handle this comment?"`
226
+ - Options: `"fix — apply the suggested change"` / `"won't fix — decline"` / `"wait — defer for later"`
227
+
228
+ 3. Record the decision (map to internal values: `fix`, `wont_fix`, `wait`).
229
+
230
+ 4. Ask via AskUserQuestion:
231
+ - Question: `"Add a note for this comment? (shown in PR reply and summary report)"`
232
+ - Options: `"No note"` / `"Add a note"`
233
+ - If "Add a note": ask via AskUserQuestion with free-text input (no fixed options):
234
+ - Question: `"Enter your note for: {file}:{line}"`
235
+
236
+ 5. Append to `pr_decisions`:
237
+ ```
238
+ { comment_id, file_line, category, description, decision, user_note (or ""), recommendation, reasoning }
239
+ ```
240
+
241
+ After the loop, display:
197
242
  ```
243
+ Decision summary:
244
+ - fix: {N} comments
245
+ - won't fix: {N} comments
246
+ - wait: {N} comments
198
247
 
199
- Ask via AskUserQuestion for each actionable PR comment batch:
200
- - "Apply actionable PR fixes?" Options: "All" / "None" / "Let me choose"
201
- - If "Let me choose": present each one and ask Fix / Skip per item.
248
+ Proceeding to apply fixes...
249
+ ```
202
250
 
203
- Collect final `pr_approved_fixes` list.
251
+ Derive `pr_approved_fixes` as the subset of `pr_decisions` where `decision == fix`. This list is used by Step 5.
204
252
 
205
253
  ### Step 5: Apply Fixes
206
254
 
@@ -265,9 +313,7 @@ For each `[MANUAL]` item with custom instructions:
265
313
 
266
314
  ### Step 6: Reply to GitHub PR Comments
267
315
 
268
- For each PR comment that was processed (from `pr_approved_fixes`, `pr_duplicates`, and `pr_manual`):
269
-
270
- Post a reply using the GitHub API:
316
+ Iterate over every entry in `pr_decisions` (excluding entries with category `skip` — do not reply to those). For each entry, post a reply using the GitHub API.
271
317
 
272
318
  **For review comments (inline):**
273
319
  ```bash
@@ -283,12 +329,22 @@ gh api repos/{owner}/{repo}/issues/{number}/comments \
283
329
  --field body="{reply text}"
284
330
  ```
285
331
 
286
- Reply templates:
287
- - **Fixed:** `Applied fix: {description}. Will be included in the next push.`
288
- - **Skipped:** `Reviewed not addressing: {reason if known, else "will handle separately"}`
289
- - **Duplicate (applied):** `Covered by local review findings fix applied.`
290
- - **Duplicate (skipped):** `Covered by local review findings marked as skip.`
291
- - **Manual/Discussion:** `Noted. This requires manual review: {description}`
332
+ **Template selection logic:**
333
+
334
+ 1. If `category == "duplicate"`: use the auto-duplicate template below
335
+ 2. Else if `decision == "fix"`: use fix template, with or without note based on `user_note` presence
336
+ 3. Else if `decision == "wont_fix"`: use wont_fix template, with or without note based on `user_note` presence
337
+ 4. Else if `decision == "wait"`: use wait template, with or without note based on `user_note` presence
338
+
339
+ **Templates:**
340
+
341
+ - **`fix` (with user note):** `Applied fix: {description}. Will be included in the next push. Note: {user_note}`
342
+ - **`fix` (no note):** `Applied fix: {description}. Will be included in the next push.`
343
+ - **`wont_fix` (with user note):** `Reviewed — not addressing: {user_note}`
344
+ - **`wont_fix` (no note):** `Reviewed — not addressing: will handle separately`
345
+ - **`wait` (with user note):** `Noted for later: {user_note}`
346
+ - **`wait` (no note):** `Noted for later: deferring for now`
347
+ - **`wont_fix` (auto, duplicate):** `Covered by local review findings — {local_decision}` where `{local_decision}` is `"fix applied"` if the matched local finding has action `[FIX]`, otherwise `"marked as skipped"` or `"flagged for manual review"` accordingly
292
348
 
293
349
  If `gh api` is unavailable or fails, log the failure and continue. Do NOT abort for reply failures.
294
350
 
@@ -317,15 +373,16 @@ Use the template structure from `.claude/templates/workflow/REVIEW-SUMMARY.md`.
317
373
 
318
374
  **Reviewed:** {feature} — findings from {findings-filename}
319
375
  **Timestamp:** {ISO-timestamp}
320
- **User Decisions:** Applied {N} fixes, skipped {N}, {N} manual
376
+ **User Decisions:** Applied {N} fixes, declined {N}, deferred {N}
321
377
 
322
378
  ## Summary
323
379
 
324
380
  - **Local Fixes Applied:** {N}
325
381
  - **Local Fixes Skipped:** {N}
326
382
  - **Manual Items Applied:** {N}
327
- - **PR Comments Fixed:** {N}
328
- - **PR Comments Skipped:** {N}
383
+ - **PR Comments Fixed:** {N} (decision = fix)
384
+ - **PR Comments Deferred:** {N} (decision = wait)
385
+ - **PR Comments Declined:** {N} (decision = won't fix, excluding auto)
329
386
  - **Build:** {passed/failed}
330
387
  - **Tests:** {passed/failed}
331
388
 
@@ -338,6 +395,12 @@ Use the template structure from `.claude/templates/workflow/REVIEW-SUMMARY.md`.
338
395
  ## Manual Items
339
396
  ...
340
397
 
398
+ ## PR Comment Decisions
399
+
400
+ | # | File:Line | Description | Decision | Note |
401
+ |---|-----------|-------------|----------|------|
402
+ | {i} | {file}:{line} | {description} | {fix/won't fix/wait} | {user_note or "—"} |
403
+
341
404
  ## PR Comment Replies
342
405
  ...
343
406
  ```