Generate Ralph Wiggum Method artifacts for autonomous AI coding
Generates Ralph Wiggum Method artifacts for autonomous AI coding loops.
/plugin marketplace add dariuszparys/claude-code-toolkit/plugin install ralph-prep@claude-code-toolkit[--from-file <template.yaml>] <output-dir>Generate a complete set of Ralph artifacts for autonomous AI coding loops.
--from-file <path>: Load task details from a YAML template file<output-dir>: Directory to create artifacts in (required)Parse arguments from: $ARGUMENTS
Check if --from-file is in the arguments:
If no --from-file provided, gather information step by step using AskUserQuestion:
Ask for:
Ask for: 3. Prior Work: What existing code, patterns, or infrastructure to build on
Ask for: 5. Scope Checklist: What IS in scope (bullet points)
Ask for: 7. Gotchas: Critical things the agent must know
If --from-file <path> provided, read the YAML file:
task:
name: feature-name
description: What needs to be built
branch: ralph/feature-name # optional, defaults to ralph/<name>
prior_work:
- Existing patterns to build on
- Previous work completed
constraints:
- Technical limitations
- Dependencies
scope:
- "[ ] Deliverable 1"
- "[ ] Deliverable 2"
key_paths:
source: path/to/source/
tests: path/to/tests/
config: path/to/config/
gotchas:
- Critical edge cases
- Known pitfalls
mkdir -p <output-dir>
Verify the directory was created successfully.
Use the Task tool to invoke the story-decomposer agent:
Provide to the agent:
The agent will:
Read templates from ${CLAUDE_PLUGIN_ROOT}/templates/ and substitute variables.
| Variable | Source |
|---|---|
${TASK_NAME} | User input |
${TASK_DESCRIPTION} | User input |
${BRANCH_NAME} | User input or ralph/<task-name> |
${PRIOR_WORK} | User input, formatted as bullet list |
${CONSTRAINTS} | User input, formatted as bullet list |
${KEY_PATHS} | User input, formatted as list |
${GOTCHAS} | User input, formatted as bullet list |
${SCOPE} | User input, formatted as checklist |
${STORY_COUNT} | From prd.json userStories length |
${STORY_LIST} | Summary of stories from prd.json |
${CODEBASE_PATTERNS} | From agent analysis |
${BUILD_COMMAND} | From agent analysis |
${DATE} | Current date |
${MAX_ITERATIONS} | Story count + 10 buffer |
${STORY_ID} | Placeholder for prompt.md |
${STORY_TITLE} | Placeholder for prompt.md |
ralph.sh.templateprompt.md.templateprogress.txt.templateAGENTS.md.templateREADME.md.templateFor each template:
${VARIABLE} patterns with collected valuesAfter generating all files, display:
Ralph artifacts generated in: <output-dir>/
Files created:
- ralph.sh (loop runner script)
- prompt.md (AI prompt context)
- prd.json (N user stories)
- progress.txt (progress tracking)
- AGENTS.md (agent instructions)
- README.md (usage guide)
First story to implement:
US-001: <title>
<description>
To start the autonomous loop:
cd <output-dir>
chmod +x ralph.sh
./ralph.sh
/ralph:generate ./my-feature
# Claude asks questions step by step
# Generates all artifacts in ./my-feature/
/ralph:generate --from-file task.yaml ./my-feature
# Reads task.yaml for all details
# Generates all artifacts in ./my-feature/
/generateGenerate ready-to-execute hypershift cluster creation commands from natural language descriptions
/generateGenerate documentation from TypeScript/JavaScript code, OpenAPI specs, GraphQL schemas, and SpecWeave specifications.