Skip to content
Development
Command

/requirements

Generate requirements from goal and research

From plugin
smart-ralph
53624 skills13 agents24 commands
Install
> /plugin marketplace add tzachbon/smart-ralph

How it fires

How this command gets triggered: by you, by Claude, or both.

  • Fires itselfClaude auto-loads it when your prompt matches the work.
  • You can call itInvoke it directly when you want it.
  • Slash command/requirements

Context preview

What this command does when you run it.

Generate requirements from goal and research

Command definition

requirements.md
description: Generate requirements from goal and research
argument-hint: [spec-name] [--quick|--interactive]
allowed-tools: "*"

Requirements Phase

Generate requirements for the active spec. Require the research artifact to have explicit approval first. You are a **coordinator, not a product manager** -- delegate ALL work to the `product-manager` subagent.

Read `${CLAUDE_PLUGIN_ROOT}/references/normal-mode-gates.md` before gathering context.

Checklist

Create a task for each item and complete in order:

1. **Gather context** -- resolve spec, read research and goal 2. **Interview gate** -- critical frontier and approval, or authorized quick bypass 3. **Execute requirements** -- dispatch product-manager via team 4. **Artifact review** -- spec-reviewer validation loop (both modes) 5. **Walkthrough & approval** -- display summary, get user approval 6. **Finalize** -- update state, commit, stop

Step 1: Gather Context

1. If `$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`. 2. If no active spec, error: "No active spec. Run /ralph-specum:new <name> first." 3. Check the resolved spec directory exists 4. Read `.ralph-state.json`, reject simultaneous exact `--quick` and `--interactive`, and normalize persistent mode with `phase_gate.py mode`. 5. If `research.md` exists and normalized `quickMode` is false, require its explicit artifact approval before clearing the approval flag. Exact quick mode continues with the validated file. When `research.md` is absent, record that there is no upstream research artifact and require no prior-artifact approval. 6. Clear the approval flag through the locked helper while preserving every other field:

   python3 "${CLAUDE_PLUGIN_ROOT}/hooks/scripts/locked-state.py" merge \
     --state "$SPEC_PATH/.ralph-state.json" \
     --set "awaitingApproval=false"

7. Read context: `research.md` (if exists), `.progress.md`, original goal. 8. Run skill discovery pass 1 if missing. Run pass 2 now when `research.md` exists and pass 2 is missing.

Step 2: Skill Load, Critical Grill, and Approval

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 `requirements`. 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 `requirements`. Candidate critical decisions include user outcome boundaries, materially different scope cuts, priority tradeoffs, and compliance obligations that research cannot resolve. Inspect existing roles, terminology, policies, behavior, and constraints instead of asking about them.

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 requirements 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.

**Requirements Exploration Territory** (hints, not a script):

  • **Primary users** -- who will use this feature? Developers, end users, specific roles?
  • **Priority tradeoffs** -- speed of delivery vs code quality vs feature completeness
  • **Success criteria** -- what does success look like? Metrics, behaviors, user outcomes
  • **Scope boundaries** -- what is explicitly out of scope for this iteration?
  • **Compliance or regulatory needs** -- security, privacy, or regulatory considerations?

Scope Approach Branch

When scope requires a user decision, add 2-3 grounded approaches to the design tree. Examples (illustrative only):

  • **(A)** Full feature set -- comprehensive user stories covering all use cases
  • **(B)** MVP scope -- core user stories only, defer edge cases to v2
  • **(C)** Phased delivery -- essential stories now, planned expansion later

Store Grill Results

Append to `.progress.md` under "Interview Responses":

### Requirements Grill (from requirements.md)
- [Round decisions and resolved facts]
- Chosen approach: [name] -- [brief description]
- Shared understanding: confirmed

Pass combined context to delegation prompt as "Interview Context".

Step 3: Execute Requirements (Team-Based)

<mandatory> **Use Claude Code Teams with `product-manager` as the teammate subagent type.**

Follow the full team lifecycle:

1. **Clean up stale team (MANDATORY FIRST ACTION)**: Call `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. 2. **Create team**: `TeamCreate(team_name: "requirements-$spec")` 3. **Create task**: `TaskCreate(subject: "Generate requirements for $spec", activeForm: "Generating requirements")` 4. **Spawn teammate**: Immediately run `check-delegation`, then call `Task(subagent_type: product-manager, team_name: "requirements-$spec", name: "pm-1")`. Include the absolute state and helper paths, complete `[RALPH_PHASE_GATE]` tuple (`state`, `phase`, `interviewId`, `discoveryRevision`, `contextDigest`), verbatim manifest, fresh artifact agent ID `pm-1`, matching load/write-check instructions, approved decision brief, research context, goal, and `Interview Context`. Instruct the agent to follow `${CLAUDE_PLUGIN_ROOT}/templates/requirements.md`, including canonical section order, user stories with acceptance criteria, functional

Read more
Ships withsmart-ralph

Spec-driven development with smart compaction. Claude Code plugin combining Ralph Wiggum loop with structured specification workflow.

Get the whole plugin

Other commands on smart-ralph.