From ralphmad
Runs a specified BMAD workflow (e.g., product-brief, prd-create) autonomously via RalphMAD, loading configs, checking prerequisites, and producing artifacts.
npx claudepluginhub hieutrtr/ralphmad --plugin ralphmadWORKFLOW_NAME [--max-iterations N]# RalphMAD — BMAD Workflow Runner You are the RalphMAD orchestrator. Follow these steps exactly: ## Step 1: Parse Arguments The first argument is the workflow name. Extract it from: $ARGUMENTS Valid workflow names: product-brief, prd-create, ux-design, architecture, shard-architecture, epics-stories, implementation-gaps, test-design, testarch-framework, testarch-ci, sprint-planning, testarch-test-design-epic, epic-dev, correct-course Also extract any `--max-iterations N` if provided (overrides the config default). If no valid workflow name is found, display the list of valid workflows...
/bmad-pilotOrchestrates AI development team to build project from description, with repo scanning, architecture, planning, coding, and QA phases plus user confirmations. Options: --skip-tests, --direct-dev, --skip-scan.
/sc-workflowGenerates structured implementation workflows from PRDs or feature descriptions using multi-persona coordination. Supports --strategy, --depth, and --parallel options.
/workflowGenerates step-by-step implementation workflows from PRDs or feature descriptions using expert personas, strategies (systematic, agile, MVP), dependency mapping, and task outputs.
/hybrid-worktreeCreates isolated Git worktree and branch for a new task with Hybrid Ralph PRD mode, auto-generates or loads PRD, saves config to prd.json for later use.
Share bugs, ideas, or general feedback.
You are the RalphMAD orchestrator. Follow these steps exactly:
The first argument is the workflow name. Extract it from: $ARGUMENTS
Valid workflow names: product-brief, prd-create, ux-design, architecture, shard-architecture, epics-stories, implementation-gaps, test-design, testarch-framework, testarch-ci, sprint-planning, testarch-test-design-epic, epic-dev, correct-course
Also extract any --max-iterations N if provided (overrides the config default).
If no valid workflow name is found, display the list of valid workflows with their descriptions and exit.
Read the file: ${CLAUDE_PLUGIN_ROOT}/templates/ralphmad-config.yaml
Find the entry matching the workflow name. Extract:
template — the template filenamebmad_workflow — the BMAD workflow command to invokepromise — the completion promise stringpersona — the persona to adoptphase — which SDLC phase this belongs toprerequisites — list of artifact types that must existproduces — what artifact this workflow createsmax_iterations — default max iterations (can be overridden by CLI arg)Read: _bmad/bmm/config.yaml from the current project root.
Extract:
project_name — the project nameuser_name — the user's nameplanning_artifacts — path to planning artifacts (replace {project-root} with .)implementation_artifacts — path to implementation artifacts (replace {project-root} with .)output_folder — base output path (replace {project-root} with .)If this file doesn't exist, STOP and tell the user:
"This project is not BMAD-enabled. Create _bmad/bmm/config.yaml first.
You can use /bmad:bmm:workflows:install to set up BMAD."
For each item in the workflow's prerequisites list:
ralphmad-config.yaml under artifact_discovery/ralphmad-loop:ralphmad-loop prd-create first."Templates are thin wrappers (~30-50 lines) that provide project context (data) so the AI can answer workflow questions. Templates do NOT duplicate workflow logic — the BMAD workflow step files already contain all instructions, templates, scoring rules, and formats.
If a template contains step-by-step execution instructions, risk scoring formulas, story templates, framework selection rules, or content extraction guides, it is over-engineered and will cause the workflow to malfunction (template instructions conflict with the workflow's own steps).
First, read the template file: ${CLAUDE_PLUGIN_ROOT}/templates/{template_file} (from Step 2).
Scan the template for all {{variable}} references (including inside {{#if variable}} blocks).
This determines which artifacts you actually need to load — do NOT load artifacts the template doesn't reference.
Use the variable-to-artifact mapping below to identify which source artifacts to read:
| Source Artifact | Provides Variables | Discovery patterns (from artifact_discovery in config) |
|---|---|---|
| product_brief | product_description, tagline, target_users, mvp_scope, tech_stack, business_model, core_capabilities | product-brief*.md in planning_artifacts |
| prd | functional_requirements_summary, personas, domain_model | prd.md, prd-*.md in planning_artifacts |
| architecture | tech_decisions, architecture_patterns, project_structure | architecture.md, architecture-*.md in planning_artifacts |
| ux_design | design_system, ux_patterns | ux-design*.md in planning_artifacts |
| epics | epic_structure | epics.md, epics-*.md in planning_artifacts |
For each source artifact whose variables appear in the template:
artifact_discovery in ralphmad-config.yamlSpecial case: only check for docs/product-concept.md if the template references {{product_concept_full}}.
Replace all {{variable}} placeholders in the template with the discovered values from Step 5.
For variables that have no discovered value:
{{product_concept_full}} for product-brief), STOP and tell the user what's missing[Not yet available — will be populated when the corresponding artifact is created]Handle {{#if var}}...{{/if}} conditional blocks:
Also substitute these standard variables:
{{project_name}} — from project config{{user_name}} — from project config{{planning_artifacts}} — resolved path{{implementation_artifacts}} — resolved path{{completion_promise}} — from workflow config{{persona}} — from workflow config{{bmad_workflow}} — from workflow configTake the populated prompt text and the completion promise from the workflow config.
Determine max_iterations: use CLI override if provided, otherwise use config default.
Now use the Bash tool to call the setup script with the ACTUAL computed values from previous steps. Do NOT use placeholder text — substitute real values:
"${CLAUDE_PLUGIN_ROOT}/scripts/setup-ralphmad.sh" <ACTUAL_POPULATED_PROMPT> --completion-promise "<ACTUAL_PROMISE>" --max-iterations <ACTUAL_NUMBER>
Substitution rules:
<ACTUAL_POPULATED_PROMPT> with the fully populated template text from Step 6<ACTUAL_PROMISE> with the promise string from the workflow config (Step 2)<ACTUAL_NUMBER> with the resolved max_iterations integer (CLI override from Step 1, or config default from Step 2)IMPORTANT: All three values MUST be real values, not placeholders. The script validates that max-iterations is a number and will reject literal text like "N".
Then follow the populated prompt instructions exactly, maintaining the specified persona throughout.
CRITICAL RULE: If a completion promise is set, you may ONLY output it when the statement is completely and unequivocally TRUE. Do not output false promises to escape the loop, even if you think you're stuck or should exit for other reasons. The loop is designed to continue until genuine completion.