/ralph-specum:design [spec-name] [--quick|--interactive]from ralph-specum
Generates a technical design document from approved requirements. Coordinates context gathering, architect review, artifact review, and user approval workflow.
Ships in ralph-specum. Installing the plugin adds it to Claude Code.
Generate technical design for the active spec after explicit requirements artifact approval. You are a coordinator, not an architect -- delegate ALL work to the architect-reviewer subagent.
Read ${CLAUDE_PLUGIN_ROOT}/references/normal-mode-gates.md before gathering context.
Create a task for each item and complete in order:
$ARGUMENTS contains a spec name, use ralph_find_spec() to resolve it; otherwise use ralph_resolve_current(). Store the resolved spec directory as SPEC_PATH.requirements.md exists. If not, error: "Requirements not found. Run /ralph-specum:requirements first.".ralph-state.json, reject simultaneous exact --quick and --interactive, and normalize persistent mode with phase_gate.py mode.quickMode is false, require explicit requirements artifact approval before clearing its approval flag. Exact quick mode continues with the validated file.python3 "${CLAUDE_PLUGIN_ROOT}/hooks/scripts/locked-state.py" merge \
--state "$SPEC_PATH/.ralph-state.json" \
--set "awaitingApproval=false"
requirements.md (required), research.md (if exists), .progress.md.python3 "${CLAUDE_PLUGIN_ROOT}/hooks/scripts/prototype-records.py" select-downstream --base-path "$SPEC_PATH" --state "$SPEC_PATH/.ralph-state.json" --target design --target 'transition:requirements->design' --path requirements.md --path design.md
gateApproved: true, non-superseded prototype evidence that affects design. Exclude skipped, failed, inconclusive, malformed, superseded, and explicitly excluded records.activePrototypes blocker for the design transition, stop before Step 2 and report the active prototype ID, blocker reason, and resume command.targetDecisions entries. Proven unrelated work may continue only when each entry has proofAvailable: true and eligible: true; this proves no active blocker, stale input, or approved transfer path overlaps design. Missing or unavailable proof blocks conservatively.Apply ${CLAUDE_PLUGIN_ROOT}/skills/interview-framework/SKILL.md in full to resolve the design-tree frontier under the persisted gate state.
In both interactive and exact quick mode, reload all selected contracts and required current-work resources, hash them, record the current manifest, then call begin-interview for phase design. A core load failure blocks either mode.
If normalized quickMode is true, the helper records bypassed_quick; continue to Step 3 without questions.
In interactive mode, apply the interview-framework with phase design. Candidate critical decisions include architecture boundaries with materially different coupling, failure-policy choices, compatibility or migration commitments, and rollout risk. Inspect existing architecture, libraries, integration seams, deployment tooling, and conventions instead of asking about them.
Treat this exploration territory as hints for the design tree, not a script:
When multiple grounded architecture approaches remain viable, add them as explicit design-tree branches with their coupling and delivery tradeoffs. Apply domain-language modeling from the interview framework and append each completed frontier round to .progress.md.
Ask the whole currently unblocked critical frontier, in calls of at most four questions. Persist partial answers. Apply control-only and bare-skip semantics. Present the design decision brief and require explicit Approve and delegate. On approval, run check-delegation and launch Step 3 immediately in the same response.
Use classify-reply before applying every reply, revise --decision-id for final-approval revisions, and confirm --source approve-and-delegate only for the explicit approval selection.
Follow the full team lifecycle:
TeamDelete() before anything else. This releases whatever team the session is currently leading (could be from any prior phase). Errors mean no team was active -- harmless, proceed.TeamCreate(team_name: "design-$spec")TaskCreate(subject: "Generate technical design for $spec", activeForm: "Generating design")check-delegation, then call Task(subagent_type: architect-reviewer, team_name: "design-$spec", name: "architect-1"). Include the absolute state and helper paths, complete [RALPH_PHASE_GATE] tuple (state, phase, interviewId, discoveryRevision, contextDigest), verbatim manifest, fresh artifact agent ID architect-1, matching load/write-check instructions, approved decision brief, requirements, research, selected prototype evidence, and the clean blocker/stale-gate result. Instruct the agent to design architecture with mermaid diagrams, component responsibilities, technical decisions with rationale, file structure, error handling, and test strategy. Output to $SPEC_PATH/design.md.SendMessage(type: "shutdown_request", recipient: "architect-1")$SPEC_PATH/design.md.TeamDelete().Fallback: If TeamCreate fails with "already leading" error, call TeamDelete() and retry TeamCreate once. If still failing, run check-delegation and use a direct Task(subagent_type: architect-reviewer) with the same complete gate packet and a fresh unique artifact agent ID.
If normalized quickMode is false, 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: Run check-delegation, create a fresh unique artifact agent ID, and re-invoke architect-reviewer with the absolute state/helper paths, complete marker identity tuple, verbatim manifest, matching load/write-check instructions, reviewer feedback, current artifact, and requirements.md. Focus on specific issues.
Error handling: Reviewer no signal = REVIEW_PASS. Agent failure = retry once, then use original.
Read $SPEC_PATH/design.md and display:
Design complete for '$spec'.
Output: $SPEC_PATH/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
If normalized quickMode is true, skip to Step 6.
Ask ONE question: "How do you want to proceed?" with these options via AskUserQuestion:
If "Approve": proceed to Step 6.
If "Run review": Invoke spec-reviewer via Task tool with full design.md content (upstream: research.md + requirements.md). Display findings table. If REVIEW_PASS, note it. If REVIEW_FAIL, show feedback. Then loop back to this same 3-choice question (user decides next action).
If "Request changes", "Other", or apply the changes:
check-delegation, then re-invoke architect-reviewer using the cleanup-and-recreate team pattern with the same complete packet and a new unique artifact agent ID, current artifact, and feedback.ralph-state.json through the locked helper (preserve all existing and unknown fields):
python3 "${CLAUDE_PLUGIN_ROOT}/hooks/scripts/locked-state.py" merge \
--state "$SPEC_PATH/.ralph-state.json" \
--set "phase=design" \
--set "awaitingApproval=true"
.progress.md: retain the explicit requirements approval and set current phaseRead commitSpec from .ralph-state.json. It authorizes the local commit only. If true:
git add "$SPEC_PATH/design.md"
git commit -m "spec($spec): add technical design"
In quick mode, skip only this push: do not ask a remote question, do not push, and continue the quick phase flow. In normal mode, run the Prototype Evidence Push Gate from ${CLAUDE_PLUGIN_ROOT}/references/commit-discipline.md immediately before the existing push. If outbound commits contain **/prototypes/*.md, require separate explicit authorization naming every exact record; otherwise preserve the existing push behavior.
git push -u origin $(git branch --show-current)
If commit or push fails, display warning but continue.
(Does not apply when normalized quick mode is authorized.)
-> Next: Run /ralph-specum:tasks/ralph-specum:tasks
What the command file sets; muted values are Claude Code's defaults
7-day visitors to each command page
npx claudepluginhub tzachbon/smart-ralph --plugin ralph-specum16 commands in this plugin
/cancelCancel ExecutionCancel active execution safely and optionally remove the spec/feedbackSubmit FeedbackSubmit feedback or report an issue for Ralph Specum plugin./helpRalph Specum HelpShow help for Ralph Specum plugin commands and workflow./implementStart ExecutionStart task execution loop/indexIndex CommandIndex codebase components and external resources into searchable specs/newCreate New SpecCreate new spec and start research phaseOther plugins' commands for the same job