選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

step-04-present.md 6.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. ---
  2. deferred_work_file: '{implementation_artifacts}/deferred-work.md'
  3. ---
  4. # Step 4: Present and Act
  5. ## RULES
  6. - YOU MUST ALWAYS SPEAK OUTPUT in your Agent communication style with the config `{communication_language}`
  7. - When `{spec_file}` is set, always write findings to the story file before offering action choices.
  8. - `decision-needed` findings must be resolved before handling `patch` findings.
  9. ## INSTRUCTIONS
  10. ### 1. Clean review shortcut
  11. If zero findings remain after triage (all dismissed or none raised): state that and proceed to section 6 (Sprint Status Update).
  12. ### 2. Write findings to the story file
  13. If `{spec_file}` exists and contains a Tasks/Subtasks section, append a `### Review Findings` subsection. Write all findings in this order:
  14. 1. **`decision-needed`** findings (unchecked):
  15. `- [ ] [Review][Decision] <Title> — <Detail>`
  16. 2. **`patch`** findings (unchecked):
  17. `- [ ] [Review][Patch] <Title> [<file>:<line>]`
  18. 3. **`defer`** findings (checked off, marked deferred):
  19. `- [x] [Review][Defer] <Title> [<file>:<line>] — deferred, pre-existing`
  20. Also append each `defer` finding to `{deferred_work_file}` under a heading `## Deferred from: code review ({date})`. If `{spec_file}` is set, include its basename in the heading (e.g., `code review of story-3.3 (2026-03-18)`). One bullet per finding with description.
  21. ### 3. Present summary
  22. Announce what was written:
  23. > **Code review complete.** <D> `decision-needed`, <P> `patch`, <W> `defer`, <R> dismissed as noise.
  24. If `{spec_file}` is set, add: `Findings written to the review findings section in {spec_file}.`
  25. Otherwise add: `Findings are listed above. No story file was provided, so nothing was persisted.`
  26. ### 4. Resolve decision-needed findings
  27. If `decision_needed` findings exist, present each one with its detail and the options available. The user must decide — the correct fix is ambiguous without their input. Walk through each finding (or batch related ones) and get the user's call. Once resolved, each becomes a `patch`, `defer`, or is dismissed.
  28. If the user chooses to defer, ask: Quick one-line reason for deferring this item? (helps future reviews): — then append that reason to both the story file bullet and the `{deferred_work_file}` entry.
  29. **HALT** — I am waiting for your numbered choice. Reply with only the number. Do not proceed until you select an option.
  30. ### 5. Handle `patch` findings
  31. If `patch` findings exist (including any resolved from step 4), HALT. Ask the user:
  32. If `{spec_file}` is set, present all three options:
  33. > **How would you like to handle the `<P>` `patch` findings?**
  34. > 1. **Apply every patch** — fix all of them now, no per-finding confirmation. Defer and decision-needed items are not touched.
  35. > 2. **Leave as action items** — they are already in the story file
  36. > 3. **Walk through each patch** — show details for each before deciding
  37. If `{spec_file}` is **not** set, present only options 1 and 2 (omit "Leave as action items" — findings were not written to a file):
  38. > **How would you like to handle the `<P>` `patch` findings?**
  39. > 1. **Apply every patch** — fix all of them now, no per-finding confirmation. Defer and decision-needed items are not touched.
  40. > 2. **Walk through each patch** — show details for each before deciding
  41. **HALT** — I am waiting for your numbered choice. Reply with only the number. Do not proceed until you select an option.
  42. - **Apply every patch**: Apply every patch finding without per-finding confirmation. Do not modify defer or decision-needed items. After all patches are applied, present a summary of changes made. If `{spec_file}` is set, check off the patch items in the story file (leave defer items as-is).
  43. - **Leave as action items** (only when `{spec_file}` is set): Done — findings are already written to the story.
  44. - **Walk through each patch**: Present each finding with full detail, diff context, and suggested fix. After walkthrough, re-offer the applicable options above.
  45. **HALT** — I am waiting for your numbered choice. Do not proceed until you select an option.
  46. **✅ Code review actions complete**
  47. - Decision-needed resolved: <D>
  48. - Patches handled: <P>
  49. - Deferred: <W>
  50. - Dismissed: <R>
  51. ### 6. Update story status and sync sprint tracking
  52. Skip this section if `{spec_file}` is not set.
  53. #### Determine new status based on review outcome
  54. - If all `decision-needed` and `patch` findings were resolved (fixed or dismissed) AND no unresolved HIGH/MEDIUM issues remain: set `{new_status}` = `done`. Update the story file Status section to `done`.
  55. - If `patch` findings were left as action items, or unresolved issues remain: set `{new_status}` = `in-progress`. Update the story file Status section to `in-progress`.
  56. Save the story file.
  57. #### Sync sprint-status.yaml
  58. If `{story_key}` is not set, skip this subsection and note that sprint status was not synced because no story key was available.
  59. If `{sprint_status}` file exists:
  60. 1. Load the FULL `{sprint_status}` file.
  61. 2. Find the `development_status` entry matching `{story_key}`.
  62. 3. If found: update `development_status[{story_key}]` to `{new_status}`. Update `last_updated` to current date. Save the file, preserving ALL comments and structure including STATUS DEFINITIONS.
  63. 4. If `{story_key}` not found in sprint status: warn the user that the story file was updated but sprint-status sync failed.
  64. If `{sprint_status}` file does not exist, note that story status was updated in the story file only.
  65. #### Completion summary
  66. > **Review Complete!**
  67. >
  68. > **Story Status:** `{new_status}`
  69. > **Issues Fixed:** <fixed_count>
  70. > **Action Items Created:** <action_count>
  71. > **Deferred:** <W>
  72. > **Dismissed:** <R>
  73. ### 7. Next steps
  74. Present the user with follow-up options:
  75. > **What would you like to do next?**
  76. > 1. **Start the next story** — run `dev-story` to pick up the next `ready-for-dev` story
  77. > 2. **Re-run code review** — address findings and review again
  78. > 3. **Done** — end the workflow
  79. **HALT** — I am waiting for your choice. Do not proceed until the user selects an option.
  80. ## On Complete
  81. Run: `python3 {project-root}/_bmad/scripts/resolve_customization.py --skill {skill-root} --key workflow.on_complete`
  82. If the resolved `workflow.on_complete` is non-empty, follow it as the final terminal instruction before exiting.