LLM-Optimized Guide for Command Design
When executing agent commands, understand these reference patterns:
<!-- Pattern 1: Inline action -->
<item cmd="*example" action="do this specific thing">Description</item>
→ Execute the text "do this specific thing" directly
<!-- Pattern 2: Internal reference with # prefix -->
<item cmd="*example" action="#prompt-id">Description</item>
→ Find <prompt id="prompt-id"> in the current agent and execute its content
<!-- Pattern 3: External file reference -->
<item cmd="*example" exec="{project-root}/path/to/file.md">Description</item>
→ Load and execute the external fileThe # prefix is your signal that this is an internal XML node reference, not a file path.
<menu>
<item cmd="*trigger" [attributes]>Description</item>
</menu>Components:
cmd- The trigger word (always starts with *)attributes- Action directives (optional):run-workflow- Path to workflow YAMLexec- Path to task/operationtmpl- Path to template (used with exec)action- Embedded prompt/instructiondata- Path to supplementary data (universal)
Description- What shows in menu
Quick Reference:
- Workflow Commands - Execute multi-step workflows (
run-workflow) - Task Commands - Execute single operations (
exec) - Template Commands - Generate from templates (
exec+tmpl) - Meta Commands - Agent control (no attributes)
- Action Commands - Embedded prompts (
action) - Embedded Commands - Logic in persona (no attributes)
Universal Attributes:
data- Can be added to ANY command type for supplementary infoif- Conditional execution (advanced pattern)params- Runtime parameters (advanced pattern)
Execute complete multi-step processes
<!-- Standard workflow -->
<item cmd="*create-prd"
run-workflow="{project-root}/{bmad_folder}/bmm/workflows/prd/workflow.yaml">
Create Product Requirements Document
</item>
<!-- Workflow with validation -->
<item cmd="*validate-prd"
validate-workflow="{output_folder}/prd-draft.md"
workflow="{project-root}/{bmad_folder}/bmm/workflows/prd/workflow.yaml">
Validate PRD Against Checklist
</item>
<!-- Auto-discover validation workflow from document -->
<item cmd="*validate-doc"
validate-workflow="{output_folder}/document.md">
Validate Document (auto-discover checklist)
</item>
<!-- Placeholder for future development -->
<item cmd="*analyze-data"
run-workflow="todo">
Analyze dataset (workflow coming soon)
</item>Workflow Attributes:
run-workflow- Execute a workflow to create documentsvalidate-workflow- Validate an existing document against its checklistworkflow- (optional with validate-workflow) Specify the workflow.yaml directly
Best Practices:
- Use descriptive trigger names
- Always use variable paths
- Mark incomplete as "todo"
- Description should be clear action
- Include validation commands for workflows that produce documents
Execute single operations
<!-- Simple task -->
<item cmd="*validate"
exec="{project-root}/{bmad_folder}/core/tasks/validate-workflow.xml">
Validate document against checklist
</item>
<!-- Task with data -->
<item cmd="*standup"
exec="{project-root}/{bmad_folder}/mmm/tasks/daily-standup.xml"
data="{project-root}/{bmad_folder}/_cfg/agent-manifest.csv">
Run agile team standup
</item>Data Property:
- Can be used with any command type
- Provides additional reference or context
- Path to supplementary files or resources
- Loaded at runtime for command execution
Generate documents from templates
<item cmd="*brief"
exec="{project-root}/{bmad_folder}/core/tasks/create-doc.md"
tmpl="{project-root}/{bmad_folder}/bmm/templates/brief.md">
Produce Project Brief
</item>
<item cmd="*competitor-analysis"
exec="{project-root}/{bmad_folder}/core/tasks/create-doc.md"
tmpl="{project-root}/{bmad_folder}/bmm/templates/competitor.md"
data="{project-root}/{bmad_folder}/_data/market-research.csv">
Produce Competitor Analysis
</item>Agent control and information
<!-- Required meta commands -->
<item cmd="*help">Show numbered cmd list</item>
<item cmd="*exit">Exit with confirmation</item>
<!-- Optional meta commands -->
<item cmd="*yolo">Toggle Yolo Mode</item>
<item cmd="*status">Show current status</item>
<item cmd="*config">Show configuration</item>Direct prompts embedded in commands (Simple agents)
<!-- Short action attribute with embedded prompt -->
<item cmd="*list-tasks"
action="list all tasks from {project-root}/{bmad_folder}/_cfg/task-manifest.csv">
List Available Tasks
</item>
<item cmd="*summarize"
action="summarize the key points from the current document">
Summarize Document
</item>For multiline/complex prompts, define them separately and reference by id:
<agent name="Research Assistant">
<!-- Define complex prompts as separate nodes -->
<prompts>
<prompt id="deep-analysis">
Perform a comprehensive analysis following these steps:
1. Identify the main topic and key themes
2. Extract all supporting evidence and data points
3. Analyze relationships between concepts
4. Identify gaps or contradictions
5. Generate insights and recommendations
6. Create an executive summary
Format the output with clear sections and bullet points.
</prompt>
<prompt id="literature-review">
Conduct a systematic literature review:
1. Summarize each source's main arguments
2. Compare and contrast different perspectives
3. Identify consensus points and controversies
4. Evaluate the quality and relevance of sources
5. Synthesize findings into coherent themes
6. Highlight research gaps and future directions
Include proper citations and references.
</prompt>
</prompts>
<!-- Commands reference the prompts by id -->
<menu>
<item cmd="*help">Show numbered cmd list</item>
<item cmd="*deep-analyze"
action="#deep-analysis">
<!-- The # means: use the <prompt id="deep-analysis"> defined above -->
Perform Deep Analysis
</item>
<item cmd="*review-literature"
action="#literature-review"
data="{project-root}/{bmad_folder}/_data/sources.csv">
Conduct Literature Review
</item>
<item cmd="*exit">Exit with confirmation</item>
</menu>
</agent>Reference Convention:
action="#prompt-id"means: "Find and execute the node with id='prompt-id' within this agent"action="inline text"means: "Execute this text directly as the prompt"exec="{path}"means: "Load and execute external file at this path"- The
#prefix signals to the LLM: "This is an internal reference - look for a prompt node with this ID within the current agent XML"
LLM Processing Instructions:
When you see action="#some-id" in a command:
- Look for
<prompt id="some-id">within the same agent - Use the content of that prompt node as the instruction
- If not found, report error: "Prompt 'some-id' not found in agent"
Use Cases:
- Quick operations (inline action)
- Complex multi-step processes (referenced prompt)
- Self-contained agents with task-like capabilities
- Reusable prompt templates within agent
Logic embedded in agent persona (Simple agents)
<!-- No exec/run-workflow/action attribute -->
<item cmd="*calculate">Perform calculation</item>
<item cmd="*convert">Convert format</item>
<item cmd="*generate">Generate output</item>*create- <!-- Generate new content -->
*build- <!-- Construct components -->
*analyze- <!-- Examine and report -->
*validate- <!-- Check correctness -->
*generate- <!-- Produce output -->
*update- <!-- Modify existing -->
*review- <!-- Examine quality -->
*test- <!-- Verify functionality -->*brainstorm <!-- Creative ideation -->
*architect <!-- Design systems -->
*refactor <!-- Improve code -->
*deploy <!-- Release to production -->
*monitor <!-- Watch systems --><!-- ❌ Too vague -->
<item cmd="*do">Do something</item>
<!-- ❌ Too long -->
<item cmd="*create-comprehensive-product-requirements-document-with-analysis">
<!-- ❌ No verb -->
<item cmd="*prd">Product Requirements</item>
<!-- ✅ Clear and concise -->
<item cmd="*create-prd">Create Product Requirements Document</item><menu>
<!-- 1. Always first -->
<item cmd="*help">Show numbered cmd list</item>
<!-- 2. Primary workflows -->
<item cmd="*create-prd" run-workflow="...">Create PRD</item>
<item cmd="*create-module" run-workflow="...">Build module</item>
<!-- 3. Secondary actions -->
<item cmd="*validate" exec="...">Validate document</item>
<item cmd="*analyze" exec="...">Analyze code</item>
<!-- 4. Utility commands -->
<item cmd="*config">Show configuration</item>
<item cmd="*yolo">Toggle Yolo Mode</item>
<!-- 5. Always last -->
<item cmd="*exit">Exit with confirmation</item>
</menu>By Lifecycle:
<menu>
<item cmd="*help">Help</item>
<!-- Planning -->
<item cmd="*brainstorm">Brainstorm ideas</item>
<item cmd="*plan">Create plan</item>
<!-- Building -->
<item cmd="*build">Build component</item>
<item cmd="*test">Test component</item>
<!-- Deployment -->
<item cmd="*deploy">Deploy to production</item>
<item cmd="*monitor">Monitor system</item>
<item cmd="*exit">Exit</item>
</menu>By Complexity:
<menu>
<item cmd="*help">Help</item>
<!-- Simple -->
<item cmd="*quick-review">Quick review</item>
<!-- Standard -->
<item cmd="*create-doc">Create document</item>
<!-- Complex -->
<item cmd="*full-analysis">Comprehensive analysis</item>
<item cmd="*exit">Exit</item>
</menu><!-- Clear action and object -->
<item cmd="*create-prd">Create Product Requirements Document</item>
<!-- Specific outcome -->
<item cmd="*analyze-security">Perform security vulnerability analysis</item>
<!-- User benefit -->
<item cmd="*optimize">Optimize code for performance</item><!-- Too vague -->
<item cmd="*process">Process</item>
<!-- Technical jargon -->
<item cmd="*exec-wf-123">Execute WF123</item>
<!-- Missing context -->
<item cmd="*run">Run</item>The data attribute can be added to ANY command type to provide supplementary information:
<!-- Workflow with data -->
<item cmd="*brainstorm"
run-workflow="{project-root}/{bmad_folder}/core/workflows/brainstorming/workflow.yaml"
data="{project-root}/{bmad_folder}/core/workflows/brainstorming/brain-methods.csv">
Creative Brainstorming Session
</item>
<!-- Action with data -->
<item cmd="*analyze-metrics"
action="analyze these metrics and identify trends"
data="{project-root}/{bmad_folder}/_data/performance-metrics.json">
Analyze Performance Metrics
</item>
<!-- Template with data -->
<item cmd="*report"
exec="{project-root}/{bmad_folder}/core/tasks/create-doc.md"
tmpl="{project-root}/{bmad_folder}/bmm/templates/report.md"
data="{project-root}/{bmad_folder}/_data/quarterly-results.csv">
Generate Quarterly Report
</item>Common Data Uses:
- Reference tables (CSV files)
- Configuration data (YAML/JSON)
- Agent manifests (XML)
- Historical context
- Domain knowledge
- Examples and patterns
<!-- Only show if certain conditions met -->
<item cmd="*advanced-mode"
if="user_level == 'expert'"
run-workflow="...">
Advanced configuration mode
</item>
<!-- Environment specific -->
<item cmd="*deploy-prod"
if="environment == 'production'"
exec="...">
Deploy to production
</item><!-- Accept runtime parameters -->
<item cmd="*create-agent"
run-workflow="..."
params="agent_type,agent_name">
Create new agent with parameters
</item><!-- Multiple triggers for same action -->
<item cmd="*prd|*create-prd|*product-requirements"
run-workflow="...">
Create Product Requirements Document
</item><item cmd="*create-prd">Product Requirements</item>
<item cmd="*market-research">Market Research</item>
<item cmd="*competitor-analysis">Competitor Analysis</item>
<item cmd="*brief">Project Brief</item><item cmd="*create-agent">Build Agent</item>
<item cmd="*create-module">Build Module</item>
<item cmd="*create-workflow">Create Workflow</item>
<item cmd="*module-brief">Module Brief</item><item cmd="*brainstorm">Brainstorming Session</item>
<item cmd="*ideate">Ideation Workshop</item>
<item cmd="*storytell">Story Creation</item>1. *help - Show numbered cmd list
2. *create-prd - Create Product Requirements Document
3. *create-agent - Build new BMAD agent
4. *validate - Validate document
5. *exit - Exit with confirmation
<!-- Group separator (visual only) -->
<item cmd="---">━━━━━━━━━━━━━━━━━━━━</item>
<!-- Section header (non-executable) -->
<item cmd="SECTION">═══ Workflows ═══</item><!-- Workflow not yet created -->
<item cmd="*future-feature"
run-workflow="todo">
Coming soon: Advanced feature
</item>
<!-- Graceful degradation -->
<item cmd="*analyze"
run-workflow="{optional-path|fallback-path}">
Analyze with available tools
</item>- Unique trigger (no duplicates)
- Clear description
- Valid path or "todo"
- Uses variables not hardcoded paths
- Executes without error
- Returns to menu after execution
- Duplicate triggers - Each cmd must be unique
- Missing paths - File must exist or be "todo"
- Hardcoded paths - Always use variables
- No description - Every command needs text
- Wrong order - help first, exit last
<!-- Create document -->
<item cmd="*{action}-{object}"
run-workflow="{project-root}/{bmad_folder}/{module}/workflows/{workflow}/workflow.yaml">
{Action} {Object Description}
</item>
<!-- Validate document -->
<item cmd="*validate-{object}"
validate-workflow="{output_folder}/{document}.md"
workflow="{project-root}/{bmad_folder}/{module}/workflows/{workflow}/workflow.yaml">
Validate {Object Description}
</item><item cmd="*{action}"
exec="{project-root}/{bmad_folder}/{module}/tasks/{task}.md">
{Action Description}
</item><item cmd="*{document}"
exec="{project-root}/{bmad_folder}/core/tasks/create-doc.md"
tmpl="{project-root}/{bmad_folder}/{module}/templates/{template}.md">
Create {Document Name}
</item>Inline Action (action="prompt")
- Prompt is < 2 lines
- Simple, direct instruction
- Not reused elsewhere
- Quick transformations
Referenced Prompt (action="#prompt-id")
- Prompt is multiline/complex
- Contains structured steps
- May be reused by multiple commands
- Maintains readability
External Task (exec="path/to/task.md")
- Logic needs to be shared across agents
- Task is independently valuable
- Requires version control separately
- Part of larger workflow system
<agent id="{bmad_folder}/research/agents/analyst.md" name="Research Analyst" icon="🔬">
<!-- Embedded prompt library -->
<prompts>
<prompt id="swot-analysis">
Perform a SWOT analysis:
STRENGTHS (Internal, Positive)
- What advantages exist?
- What do we do well?
- What unique resources?
WEAKNESSES (Internal, Negative)
- What could improve?
- Where are resource gaps?
- What needs development?
OPPORTUNITIES (External, Positive)
- What trends can we leverage?
- What market gaps exist?
- What partnerships are possible?
THREATS (External, Negative)
- What competition exists?
- What risks are emerging?
- What could disrupt us?
Provide specific examples and actionable insights for each quadrant.
</prompt>
<prompt id="competitive-intel">
Analyze competitive landscape:
1. Identify top 5 competitors
2. Compare features and capabilities
3. Analyze pricing strategies
4. Evaluate market positioning
5. Assess strengths and vulnerabilities
6. Recommend competitive strategies
</prompt>
</prompts>
<menu>
<item cmd="*help">Show numbered cmd list</item>
<!-- Simple inline actions -->
<item cmd="*summarize"
action="create executive summary of findings">
Create Executive Summary
</item>
<!-- Complex referenced prompts -->
<item cmd="*swot"
action="#swot-analysis">
Perform SWOT Analysis
</item>
<item cmd="*compete"
action="#competitive-intel"
data="{project-root}/{bmad_folder}/_data/market-data.csv">
Analyze Competition
</item>
<!-- Hybrid: external task with internal data -->
<item cmd="*report"
exec="{project-root}/{bmad_folder}/core/tasks/create-doc.md"
tmpl="{project-root}/{bmad_folder}/research/templates/report.md">
Generate Research Report
</item>
<item cmd="*exit">Exit with confirmation</item>
</menu>
</agent>For agents that primarily use embedded logic:
<agent name="Data Analyst">
<menu>
<item cmd="*help">Show numbered cmd list</item>
<!-- Action commands for direct operations -->
<item cmd="*list-metrics"
action="list all available metrics from the dataset">
List Available Metrics
</item>
<item cmd="*analyze"
action="perform statistical analysis on the provided data"
data="{project-root}/{bmad_folder}/_data/dataset.csv">
Analyze Dataset
</item>
<item cmd="*visualize"
action="create visualization recommendations for this data">
Suggest Visualizations
</item>
<!-- Embedded logic commands -->
<item cmd="*calculate">Perform calculations</item>
<item cmd="*interpret">Interpret results</item>
<item cmd="*exit">Exit with confirmation</item>
</menu>
</agent>When creating commands:
- Start with *help and *exit
- Choose appropriate command type:
- Complex multi-step? Use
run-workflow - Single operation? Use
exec - Need template? Use
exec+tmpl - Simple prompt? Use
action - Agent handles it? Use no attributes
- Complex multi-step? Use
- Add
dataattribute if supplementary info needed - Add primary workflows (main value)
- Add secondary tasks
- Include utility commands
- Test each command works
- Verify no duplicates
- Ensure clear descriptions