You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
**CRITICAL**: Use Bash to display the unified PRD + Design Document review:
680
+
After design_doc.json is generated, check new decisions against existing project decisions:
681
+
682
+
```bash
683
+
uv run python "${CLAUDE_PLUGIN_ROOT}/skills/hybrid-ralph/scripts/memory-doctor.py" \
684
+
--mode passive \
685
+
--new-decisions design_doc.json \
686
+
--project-root "$(pwd)"
687
+
```
688
+
689
+
Exit code handling:
690
+
-**Exit 0**: No issues found or no existing decisions to compare — proceed silently to Step 5.5
691
+
-**Exit 1**: Decision conflicts or duplicates detected — follow the resolution steps below
692
+
-**Exit 2** (or script crash/traceback): Infrastructure error (e.g., no LLM provider). Log the warning and proceed to Step 5.5. This check is advisory and must not block PRD generation.
693
+
694
+
If exit code is 1:
695
+
1. Display the diagnosis report to the user
696
+
2. Use `AskUserQuestion` to ask the user how to resolve each issue:
697
+
-**Deprecate** — Mark the older/conflicting decision as deprecated (recommended for conflicts and superseded)
698
+
-**Merge** — Combine duplicate decisions into one (recommended for duplicates)
699
+
-**Skip** — Keep both decisions as-is
700
+
3. Apply the user's choices using the memory-doctor `--apply` command:
701
+
702
+
**CRITICAL**: Construct a JSON array of the user's choices and save it to `_doctor_actions.json`. Each entry must include the full diagnosis context with `decision_a` and `decision_b` dicts (including `id` and `_source` fields) as returned by the diagnosis report:
uv run python "${CLAUDE_PLUGIN_ROOT}/skills/hybrid-ralph/scripts/memory-doctor.py" \
732
+
--apply _doctor_actions.json \
733
+
--project-root "$(pwd)"
734
+
```
735
+
736
+
Clean up the temporary file:
737
+
```bash
738
+
rm -f _doctor_actions.json
739
+
```
740
+
741
+
Note: Entries where the user chose **Skip** should be omitted from the actions array entirely.
742
+
743
+
## Step 5.45: Generate Markdown Documents
744
+
745
+
**CRITICAL**: Generate human-readable Markdown files from the finalized JSON:
746
+
747
+
```bash
748
+
uv run python "${CLAUDE_PLUGIN_ROOT}/skills/hybrid-ralph/scripts/render-plan-docs.py" \
749
+
--mode hybrid \
750
+
--project-root "$(pwd)"
751
+
```
752
+
753
+
This produces:
754
+
-`prd.md` — Human-readable PRD with stories, acceptance criteria, execution batches
755
+
-`design_doc.md` — Technical design with components, patterns, and full ADR details
756
+
757
+
These files are programmatically generated from JSON (not LLM) and stay in sync.
758
+
If the script fails, log a warning and continue — the Markdown files are supplementary.
759
+
760
+
## Step 5.5: Confirm Architectural Decisions
761
+
762
+
Before the unified review, display a decision summary and confirm with the user. This ensures any modifications during confirmation are reflected in the unified review displayed afterward.
763
+
764
+
### 5.5.1: Display Decision Summary
765
+
766
+
Read `design_doc.json` and for each decision with status "accepted" or "proposed", display:
**If `NO_CONFIRM_MODE` is true** (i.e., `--no-confirm` was passed):
788
+
- Skip interactive confirmation entirely
789
+
- Auto-accept all decisions: set every decision's status to "accepted" in `design_doc.json`
790
+
- Log: `"Auto-accepted N architectural decisions (--no-confirm mode)"`
791
+
- Proceed to Step 5.6
792
+
793
+
**Otherwise** (interactive mode — the default):
794
+
795
+
Use `AskUserQuestion` with these options:
796
+
797
+
```
798
+
Question: "These N architectural decisions will be used as the baseline for future conflict detection. Do you accept them?"
799
+
800
+
Options:
801
+
1. "Accept All (Recommended)" — Accept all decisions as-is
802
+
2. "Review Individually" — Review and confirm each decision one by one
803
+
3. "Discuss" — Chat about specific decisions before confirming
804
+
```
805
+
806
+
**If user selects "Accept All"**: Set all decision statuses to "accepted" in `design_doc.json`. Proceed to Step 5.6.
807
+
808
+
**If user selects "Discuss"**: Let the user discuss freely. After the discussion, repeat Step 5.5.2 (re-ask the question).
809
+
810
+
**If user selects "Review Individually"**: For each decision, use `AskUserQuestion`:
811
+
812
+
```
813
+
Question: "[ADR-F001] <title>
814
+
Context: <context>
815
+
Decision: <decision>
816
+
Rationale: <rationale>"
817
+
818
+
Options:
819
+
1. "Accept" — Accept this decision
820
+
2. "Reject" — Remove this decision
821
+
3. "Modify" — Edit this decision before accepting
822
+
4. "Discuss" — Chat about this decision
823
+
```
824
+
825
+
-**Accept**: Mark status as "accepted"
826
+
-**Reject**: Mark status as "rejected"
827
+
-**Modify**: Let the user describe changes, update the decision in `design_doc.json`, then re-confirm this specific ADR
828
+
-**Discuss**: Let the user chat, then re-ask for this specific ADR
829
+
830
+
After all decisions are reviewed, re-run Step 5.45 to regenerate the Markdown files:
831
+
```bash
832
+
uv run python "${CLAUDE_PLUGIN_ROOT}/skills/hybrid-ralph/scripts/render-plan-docs.py" \
833
+
--mode hybrid \
834
+
--project-root "$(pwd)"
835
+
```
836
+
837
+
## Step 5.6: Display Unified Review
838
+
839
+
**CRITICAL**: Use Bash to display the unified PRD + Design Document review. This is displayed after ADR confirmation so it reflects any decision modifications made during Step 5.5:
681
840
682
841
```bash
683
842
uv run python "${CLAUDE_PLUGIN_ROOT}/skills/hybrid-ralph/scripts/unified-review.py" --mode hybrid
@@ -700,14 +859,16 @@ If the script is not available, display a manual summary showing:
700
859
701
860
## Step 6: Confirm Generation Complete and Show Next Steps
702
861
703
-
After displaying the unified review, confirm and show how to proceed:
862
+
After displaying the unified review, show how to proceed:
0 commit comments