From rp1-dev
Guides creation of project charters and PRDs via state-machine wizard with detect-charter-prd phases and stateless interview loops using rp1 tools.
npx claudepluginhub rp1-run/rp1This skill is limited to using the following tools:
Extract these parameters from the user's input:
Guides creation of project charter and PRDs through phased, stateless interview wizard using state machine and bash 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 work update \
--project "$(pwd)" \
--feature {FEATURE_ID} \
--workflow blueprint \
--run-id {RUN_ID} \
--step {CURRENT_STATE} \
--status started
RUN_ID as a UUID at workflow start; use FEATURE_ID = "blueprint" or derive from PRD_NAME if providedState Progression Protocol:
--step with --status started when you enter that state→ [*] transitions): report --status completed when the step's work finishesExample sequence (with charter):
--step detect --status started # entering detect phase
--step charter --status started # needs charter, entering charter phase
--step prd --status started # charter done, entering prd phase
--step prd --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:
{% dispatch_agent "rp1-dev:charter-interviewer" %} CHARTER_PATH={{$RP1_ROOT}}/context/charter.md, MODE={mode}, RP1_ROOT={{$RP1_ROOT}} {% enddispatch_agent %}
Parse JSON response
Handle by type:
next_question:
question_number = metadata.question_number
topic = map_gap_to_topic(metadata.gaps_remaining[0])
answer = {% ask_user "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" 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: {% dispatch_agent "rp1-dev:blueprint-wizard" %} PRD_NAME={PRD_NAME}, EXTRA_CONTEXT={EXTRA_CONTEXT}, RP1_ROOT={{$RP1_ROOT}} {% enddispatch_agent %}
Parse JSON response
next_question | validate:
answer = {% ask_user "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 = {% ask_user "response.message" %}
Add: **Assumption**: {guess}
continue
success: Write PRD w/ response.prd_content (removes scratch pad) 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