From rp1-dev
Guides creation of project charter and PRDs through phased, stateless interview wizard using state machine and bash tools.
npx claudepluginhub rp1-run/rp1 --plugin rp1-devThis skill is limited to using the following tools:
Extract these parameters from the user's input:
Guides creation of project charters and PRDs via state-machine wizard with detect-charter-prd phases and stateless interview loops using rp1 tools.
Generates Product Requirements Document (PRD) by analyzing project README, documentation, structure, and metadata. Use for onboarding existing projects to Blueprint Development system.
Generates structured Product Requirements Documents via interview, codebase research using Explore/librarian, planning, and approval workflow. Triggers on '/ralph-plan <topic>', 'create prd', 'generate prd', 'plan this'.
Share bugs, ideas, or general feedback.
Extract these parameters from the user's input:
| Parameter | Required | Default | Description |
|---|---|---|---|
PRD_NAME | No | - | PRD name to create (omit for default charter + main PRD flow) |
EXTRA_CONTEXT | No | "" | Additional context provided by the user |
Environment values (resolve via shell):
RP1_ROOT: !rp1 agent-tools rp1-root-dir (extract data.root from JSON response)stateDiagram-v2
[*] --> detect
detect --> charter : needs_charter
detect --> prd : charter_exists
charter --> prd : charter_complete
prd --> [*] : done
On each phase transition, report via:
rp1 agent-tools emit \
--workflow blueprint \
--type status_change \
--run-id {RUN_ID} \
--step {CURRENT_STATE} \
--data '{"status": "running"}'
RUN_ID as a UUID at workflow startState Progression Protocol:
--step with --data '{"status": "running"}' when you enter that state→ [*] transitions): report with --data '{"status": "completed"}' when the step's work finishesExample sequence (with charter):
--workflow blueprint --step detect --data '{"status": "running"}' # entering detect phase
--workflow blueprint --step charter --data '{"status": "running"}' # needs charter, entering charter phase
--workflow blueprint --step prd --data '{"status": "running"}' # charter done, entering prd phase
--workflow blueprint --step prd --data '{"status": "completed"}' # prd done, workflow complete
Doc Hierarchy:
{{$RP1_ROOT}}/context/charter.md) - Project-level: problem/context, users, business rationale, scope guardrails, success criteria{{$RP1_ROOT}}/work/prds/<name>.md) - Surface-specific: overview, in/out scope, requirements, dependencies, timeline. Inherit from charter, link back, no duplication.Read {{$RP1_ROOT}}/context/charter.md:
| Condition | Mode | Message |
|---|---|---|
| Not exist | CREATE | "Starting new charter creation. I'll guide you through defining your project vision." |
Exists + has ## Scratch Pad | RESUME | "Resuming interrupted charter session. I'll continue from where you left off." |
| Exists + no scratch pad | UPDATE | "Updating existing charter. I'll ask focused questions about changes you want to make." |
CREATE - Write charter.md:
# Project Charter: [To Be Determined]
**Version**: 1.0.0
**Status**: Draft
**Created**: {YYYY-MM-DD}
## Scratch Pad
<!-- Interview state - will be removed upon completion -->
<!-- Mode: CREATE -->
<!-- Started: {ISO timestamp} -->
<!-- End scratch pad -->
UPDATE - Edit: append scratch pad after last line:
## Scratch Pad
<!-- Interview state - will be removed upon completion -->
<!-- Mode: UPDATE -->
<!-- Started: {ISO timestamp} -->
<!-- End scratch pad -->
RESUME - No init (scratch pad exists).
question_number = 0 loop:
Task tool: subagent_type: rp1-dev:charter-interviewer prompt: CHARTER_PATH={{$RP1_ROOT}}/context/charter.md, MODE={mode}, RP1_ROOT={{$RP1_ROOT}}
Parse JSON response
Handle by type:
next_question:
question_number = metadata.question_number
topic = map_gap_to_topic(metadata.gaps_remaining[0])
answer = AskUserQuestion: "response.next_question"
Edit charter.md (insert before <!-- End scratch pad -->):
### Q{N}: {topic}
**Asked**: {question}
**Answer**: {answer}
continue
success: Write charter sections from response.charter_content Remove "## Scratch Pad" section entirely Update status to "Complete" Register artifact:
rp1 agent-tools emit \
--workflow blueprint \
--type artifact_registered \
--run-id {RUN_ID} \
--step charter \
--data '{"path": "{{$RP1_ROOT}}/context/charter.md"}'
Output: "Charter complete! Proceeding to PRD creation..." break -> Step 4
skip:
question_number = metadata.question_number
topic = from message
Edit charter.md:
### Q{N}: {topic}
**Skipped**: {message}
continue
error: Output: "Charter interview encountered an error. Scratch pad state preserved for retry." Preserve scratch pad, EXIT (no PRD)
Topic Map:
| Gap | Topic |
|---|---|
| problem | Problem & Context |
| users | Target Users |
| value_prop | Value Proposition |
| scope | Scope |
| success | Success Criteria |
| (Q1 CREATE) | Brain Dump |
Scratch Pad Edits:
old_string: <!-- End scratch pad --> -> prepend entry## Scratch Pad through <!-- End scratch pad -->, replace w/ emptyPRD_NAME = PRD_NAME || "main"
Create {{$RP1_ROOT}}/work/prds/{PRD_NAME}.md:
# PRD: {PRD_NAME}
**Charter**: [Project Charter]({{$RP1_ROOT}}/context/charter.md)
**Version**: 1.0.0
**Status**: Draft
**Created**: {YYYY-MM-DD}
## Scratch Pad
<!-- Mode: CREATE -->
<!-- Section: 1 -->
<!-- Started: {timestamp} -->
### Q&A History
<!-- End scratch pad -->
PRD_PATH = {{$RP1_ROOT}}/work/prds/{PRD_NAME}.md
question_count = 0
loop: Task tool: subagent_type: rp1-dev:blueprint-wizard prompt: PRD_NAME={PRD_NAME}, EXTRA_CONTEXT={EXTRA_CONTEXT}, RP1_ROOT={{$RP1_ROOT}}
Parse JSON response
next_question | validate:
answer = AskUserQuestion: "response.next_question"
question_count++
Edit PRD (insert before <!-- End scratch pad -->):
#### S{section}: {topic}
**Asked**: {question}
**Answer**: {answer}
continue
section_complete:
Update section marker: <!-- Section: {N} --> -> <!-- Section: {N+1} -->
Write section content to PRD above scratch pad
continue
uncertainty:
guess = AskUserQuestion: "response.message"
Add: **Assumption**: {guess}
continue
success:
Write PRD w/ response.prd_content (removes scratch pad)
Register artifact:
bash rp1 agent-tools emit \ --workflow blueprint \ --type artifact_registered \ --run-id {RUN_ID} \ --step prd \ --data '{"path": "{PRD_PATH}"}'
Output: "PRD created at {PRD_PATH}"
break
error: Output: "PRD creation error: {message}" If metadata.missing == "charter": Output: "Please run /blueprint without arguments to create the charter first." break
PRD created!
Created:
- {{$RP1_ROOT}}/work/prds/{PRD_NAME}.md
Next Steps:
- Create features: /rp1-dev:build <feature-id>
- Add more surfaces: /rp1-dev:blueprint mobile-app
Default (charter + main PRD): /rp1-dev:blueprint
Named PRD (requires charter): /rp1-dev:blueprint mobile-app
/rp1-dev:build <feature-id> - Build specific features