Generate technical design from requirements
Generates technical design documents from requirements through AI-assisted architectural review and user approval workflows.
/plugin marketplace add tzachbon/smart-ralph/plugin install ralph-specum@smart-ralphspec-nameGenerate technical design for the active spec. Running this command implicitly approves requirements. You are a coordinator, not an architect -- delegate ALL work to the architect-reviewer subagent.
Create a task for each item and complete in order:
--quick)--quick)$ARGUMENTS contains a spec name, use ralph_find_spec() to resolve it; otherwise use ralph_resolve_current()requirements.md exists. If not, error: "Requirements not found. Run /ralph-specum:requirements first.".ralph-state.json; clear approval flag: awaitingApproval: falserequirements.md (required), research.md (if exists), .progress.mdCheck if --quick appears in $ARGUMENTS. If present, skip to Step 3.
Parse Intent Classification and all prior interview responses to skip already-answered questions.
Intent-Based Question Counts:
Apply adaptive dialogue from ${CLAUDE_PLUGIN_ROOT}/skills/interview-framework/SKILL.md. Ask context-driven questions one at a time.
Design Exploration Territory (hints, not a script):
After dialogue, propose 2-3 architectural approaches. Examples (illustrative only):
Append to .progress.md under "Interview Responses":
### Design Interview (from design.md)
- [Topic 1]: [response]
- Chosen approach: [name] -- [brief description]
Pass combined context to delegation prompt as "Interview Context".
Follow the full team lifecycle:
TeamDelete() unconditionally to release any team from a prior phase (ignore errors if no active team). Then check ~/.claude/teams/design-$spec/config.json — if exists, delete it (rm -rf ~/.claude/teams/design-$spec).TeamCreate(team_name: "design-$spec")TaskCreate(subject: "Generate technical design for $spec", activeForm: "Generating design")Task(subagent_type: architect-reviewer, team_name: "design-$spec", name: "architect-1") — delegate with requirements, research, and interview context. Instruct to design architecture with mermaid diagrams, component responsibilities, technical decisions with rationale, file structure, error handling, test strategy. Output to ./specs/$spec/design.md.SendMessage(type: "shutdown_request", recipient: "architect-1")./specs/$spec/design.md.TeamDelete().Fallback: If TeamCreate fails, fall back to direct Task(subagent_type: architect-reviewer) call.
</mandatory>
If --quick, skip to Step 5.
Invoke spec-reviewer via Task tool. Follow the standard review loop:
Review delegation: Include full design.md content, iteration count, prior findings. Upstream: research.md + requirements.md.
Revision delegation: Re-invoke architect-reviewer with reviewer feedback and requirements.md upstream context. Focus on specific issues.
Error handling: Reviewer no signal = REVIEW_PASS. Agent failure = retry once, then use original. </mandatory>
Read ./specs/$spec/design.md and display:
Design complete for '$spec'.
Output: $PWD/specs/$spec/design.md
## What I Designed
**Approach**: [1-2 sentences from Overview]
**Components**:
- [Component A]: [brief purpose]
- [Component B]: [brief purpose]
**Key Decisions**:
- [Decision 1]: [choice made]
- [Decision 2]: [choice made]
**Files**: [X] to create, [Y] to modify
</mandatory>
If --quick, skip to Step 6.
Ask ONE question: "Does this look right?" with options: Approve (Recommended) / Need changes / Other
If "Approve": proceed to Step 6. If "Need changes" or "Other":
.ralph-state.json (preserve all existing fields):
jq '. + {"phase": "design", "awaitingApproval": true}' \
"$SPEC_PATH/.ralph-state.json" > "$SPEC_PATH/.ralph-state.json.tmp" && \
mv "$SPEC_PATH/.ralph-state.json.tmp" "$SPEC_PATH/.ralph-state.json"
.progress.md: mark requirements as implicitly approved, set current phaseRead commitSpec from .ralph-state.json. If true:
git add ./specs/$spec/design.md
git commit -m "spec($spec): add technical design"
git push -u origin $(git branch --show-current)
If commit or push fails, display warning but continue.
(Does not apply in --quick mode.)
-> Next: Run /ralph-specum:tasks/ralph-specum:tasks
</mandatory>