BMAD-METHOD/src/modules/bmm/workflows/2-plan/instructions-router.md

12 KiB

PRD Workflow Router Instructions

This is the INITIAL ASSESSMENT phase - determines which instruction set to load ALWAYS check for existing project-workflow-status.md first The workflow execution engine is governed by: {project_root}/bmad/core/tasks/workflow.xml

Check if any project-workflow-status*.md files exist in {output_folder}/

Find the most recent project-workflow-status-YYYY-MM-DD.md file Load the status file Check for existing workflow outputs based on level in status file:
  • Level 0: Check for tech-spec.md
  • Level 1-2: Check for PRD.md, epic-stories.md, tech-spec.md
  • Level 3-4: Check for PRD.md, epics.md

Found existing workflow status file: project-workflow-status-{{file_date}}.md (Level {{project_level}})

Existing documents detected: {{list_existing_docs}}

Options:

  1. Continue with this workflow (will update existing status file)

  2. Start new workflow (will create new dated status file: project-workflow-status-{{today}}.md)

  3. Review and modify previous status

  4. I'm working on something else (ignore this file)

Set status_file_path = existing file path Set continuation_mode = true Set status_file_path = "{output_folder}/project-workflow-status-{{today}}.md" Archive old status file to: "{output_folder}/archive/project-workflow-status-{{old_date}}.md" Set continuation_mode = false Proceed to new assessment Do not use status file for this session Proceed with user's requested workflow Exit router (user is not using BMM planning workflow) Create new versioned status file Set status_file_path = "{output_folder}/project-workflow-status-{{today}}.md" Set start_date = {{today}} Proceed to assessment

What type of planning do you need?

Quick Selection:

  1. Full project planning (PRD, Tech Spec, etc.)
  2. UX/UI specification only
  3. Tech spec only (for small changes)
  4. Generate AI Frontend Prompt from existing specs

Select an option or describe your needs:

Capture user selection as {{planning_type}}

{installed_path}/ux/workflow.yaml Pass mode="standalone" to UX workflow Exit router workflow (skip remaining steps) Check for existing UX spec or PRD {project-root}/bmad/bmm/tasks/ai-fe-prompt.md Exit router workflow after prompt generation

Continue to step 3 for project assessment

Let's understand your project needs:

1. Project Type:

  1. Game
  2. Web application
  3. Mobile application
  4. Desktop application
  5. Backend service/API
  6. Library/package
  7. Other - Please specify

2. Project Context:

a. New project (greenfield) b. Adding to existing clean codebase (brownfield - well documented) c. Working with messy/legacy code (brownfield - needs documentation)

3. What are you building? (brief description)

Capture field_type = "greenfield" or "brownfield"

Check for {project-root}/docs/index.ts or {project-root}/docs/index.md This brownfield project needs codebase documentation for effective planning.

Documentation Status: No index.ts or index.md found in docs/

Options:

  1. Generate docs now (run document-project workflow - ~10-15 min, recommended)
  2. I'll provide context through questions during planning
  3. Continue anyway (may need more context later during implementation)

Recommendation for Level 0-1: Option 1 or 2 ensures faster, more accurate planning

Choose option (1-3):

<check if='option == "1"'>
  <action>Set needs_documentation = true</action>
  <action>Will invoke document-project after assessment</action>
</check>

<check if='option == "2"'>
  <action>Set gather_context_via_questions = true</action>
  <action>Will ask detailed questions during tech-spec generation</action>
</check>

<check if='option == "3"'>
  <action>Set proceed_without_docs = true</action>
  <action>Note: May require additional context gathering during implementation</action>
</check>
Set has_documentation = true Will reference docs/index.ts during planning

Detect if project_type == "game"

Set workflow_type = "gdd" Skip level classification (GDD workflow handles all game project levels) Jump to step 5 for GDD-specific assessment

Else, based on their description, analyze and suggest scope level:

Examples:

  • "Fix login bug" → Suggests Level 0 (single atomic change)
  • "Add OAuth to existing app" → Suggests Level 1 (coherent feature)
  • "Build internal admin dashboard" → Suggests Level 2 (small system)
  • "Create customer portal with payments" → Suggests Level 3 (full product)
  • "Multi-tenant SaaS platform" → Suggests Level 4 (platform)

Based on your description, this appears to be a {{suggested_level}} project.

3. Quick Scope Guide - Please confirm or adjust:

  1. Single atomic change → Bug fix, add endpoint, single file change (Level 0)
  2. Coherent feature → Add search, implement SSO, new component (Level 1)
  3. Small complete system → Admin tool, team app, prototype (Level 2)
  4. Full product → Customer portal, SaaS MVP (Level 3)
  5. Platform/ecosystem → Enterprise suite, multi-tenant system (Level 4)

4. Do you have existing documentation?

  1. Product Brief
  2. Market Research
  3. Technical docs/Architecture
  4. None

Based on responses, determine:

Level Classification:

  • Level 0: Single atomic change → tech-spec only
  • Level 1: Single feature, 1-10 stories → minimal PRD + tech-spec
  • Level 2: Small system, 5-15 stories → focused PRD + tech-spec
  • Level 3: Full product, 12-40 stories → full PRD + architect handoff
  • Level 4: Platform, 40+ stories → enterprise PRD + architect handoff

For brownfield without docs:

  • Levels 0-2: Can proceed with context gathering
  • Levels 3-4: MUST run architect assessment first
Invoke document-project workflow before continuing with planning {project-root}/bmad/bmm/workflows/1-analysis/document-project/workflow.yaml Wait for documentation to complete Verify docs/index.ts or docs/index.md was created

Initialize status file using status_template from workflow.yaml Write to versioned file path: {{status_file_path}} Set start_date = {{today}} in template variables

Capture any technical preferences mentioned during assessment Initialize Workflow Status Tracker with current state

Generate comprehensive status document with all assessment data.

project_type project_level instruction_set scope_description story_count epic_count timeline field_type existing_docs team_size deployment_intent expected_outputs workflow_steps next_steps special_notes technical_preferences

Initialize Workflow Status Tracker section:

current_phase Set to: "2-Plan"

current_workflow Set to: "tech-spec (Level 0 - starting)" Set to: "tech-spec (Level 1 - starting)" Set to: "PRD (Level {{project_level}} - starting)"

progress_percentage Set to: 10% (assessment complete)

artifacts_table Initialize with:

| project-workflow-status.md | Complete | {output_folder}/project-workflow-status.md | {{date}} |

next_action Set to: "Generate technical specification and single user story" Set to: "Generate technical specification and epic/stories (2-3 stories)" Set to: "Generate PRD and epic breakdown"

decisions_log Add first entry:

- **{{date}}**: Project assessment completed. Classified as Level {{project_level}} {{field_type}} project. Routing to {{instruction_set}} workflow.

Based on project type and level, load ONLY the needed instructions:

{installed_path}/gdd/workflow.yaml GDD workflow handles all game project levels internally {installed_path}/tech-spec/workflow.yaml Pass level=0 to tech-spec workflow Tech-spec workflow will generate user-story.md after tech-spec completion {installed_path}/tech-spec/workflow.yaml Pass level=1 to tech-spec workflow Tech-spec workflow will generate epic-stories.md after tech-spec completion {installed_path}/prd/workflow.yaml Pass level context to PRD workflow (loads instructions-med.md) {installed_path}/prd/workflow.yaml Pass level context to PRD workflow (loads instructions-lg.md)

Pass continuation context to invoked workflow:

  • continuation_mode: true/false
  • last_completed_step: {{step_number}}
  • existing_documents: {{document_list}}
  • project_level: {{level}}

The invoked workflow's instruction set should check continuation_mode and adjust accordingly