LMS-BGN/.bmad/bmm/workflows/workflow-status/init/instructions.md

28 KiB

Workflow Init - Project Setup Instructions

The workflow execution engine is governed by: {project-root}/.bmad/core/tasks/workflow.xml You MUST have already loaded and processed: workflow-init/workflow.yaml Communicate in {communication_language} with {user_name} This workflow handles BOTH new projects AND legacy projects being migrated to BMad Method

Welcome to BMad Method, {user_name}!

Perform comprehensive scan for ALL existing work (not just quick scan):

Check for BMM planning artifacts:

  • PRD files: {outputfolder}/_prd.md or {outputfolder}/_prd/index.md
  • Tech-spec files: {outputfolder}/_tech-spec.md or {outputfolder}/_spec.md
  • Epic files: {outputfolder}/_epic.md or {outputfolder}/_epic/index.md
  • Architecture: {outputfolder}/_architecture.md or {outputfolder}/_arch.md
  • UX Design: {outputfolder}/_ux.md or {outputfolder}/_design.md
  • Product Brief: {outputfolder}/_brief.md
  • Research docs: {outputfolder}/_research.md
  • Brainstorm docs: {outputfolder}/_brainstorm.md

Check for implementation artifacts:

  • The following could be in or nested under {output_folder} OR {ephemeral_location} - CHECK BOTH LOCATIONS
    • Story files: {outputfolder}/stories/.md or {ephemerallocation}/stories/.md
    • Sprint status: {output_folder}/sprint-status.yaml or {ephemeral_location}/sprint-status.yaml
    • Existing workflow status: {output_folder}/bmm-workflow-status.yaml or {ephemeral_location}/bmm-workflow-status.yaml

Check for codebase:

  • Source code directories: src/, lib/, app/, components/, etc.
  • Package files: package.json, requirements.txt, Cargo.toml, go.mod, pom.xml, etc.
  • Git repository: .git/
  • Framework indicators: next.config.js, vite.config.js, etc.

Analyze findings and categorize project state:

  • STATE 1: Clean slate (no artifacts, no code or scaffold only)
  • STATE 2: Planning in progress (has PRD or tech-spec, no stories/implementation yet)
  • STATE 3: Implementation in progress (has stories or sprint status)
  • STATE 4: Legacy codebase (has code but no BMM artifacts)
  • STATE 5: Partial/unclear (some artifacts, state unclear)

What's your project called? {{#if project_name}}(Config shows: {{project_name}}){{/if}} Store project_name project_name

Perfect! This looks like a fresh start. Set new_project = true Continue to Step 3 (ask about their work) I found existing planning documents:

{{#if found_prd}} 📋 PRD: {{prd_path}} {{#if epic_count}}- {{epic_count}} epics, {{story_count}} stories{{/if}}

  • Last modified: {{prd_modified}} {{/if}}

{{#if found_tech_spec}} 📋 Tech-Spec: {{spec_path}} {{#if story_count}}- {{story_count}} stories{{/if}}

  • Last modified: {{spec_modified}} {{/if}}

{{#if found_architecture}} 🏗️ Architecture: {{arch_path}}

  • Last modified: {{arch_modified}} {{/if}}

{{#if found_ux}} 🎨 UX Design: {{ux_path}}

  • Last modified: {{ux_modified}} {{/if}}

{{#if found_brief}} 📄 Product Brief: {{brief_path}}

  • Last modified: {{brief_modified}} {{/if}}

{{#if found_research}} 🔍 Research: {{research_paths}} {{/if}}

{{#if found_brainstorm}} 🧠 Brainstorm: {{brainstorm_paths}} {{/if}}

What's your situation with these documents?

a) Continue this work - These docs describe what I'm building now b) Override/replace - These are old, I'm starting something NEW c) Already done - This work is complete, I'm starting a NEW project d) Not sure - Let me explain my situation

Your choice [a/b/c/d]:

Got it! I'll create workflow tracking for your existing planning. Set continuing_existing_planning = true Store found artifacts for auto-completion in workflow status Continue to Step 5 (detect track from artifacts) Should I archive these old documents before we start fresh?

I can move them to {output_folder}/archive/ so they're not in the way.

Archive old docs? (y/n)

<action if="answer == y">Create archive folder if needed</action>
<action if="answer == y">Move all found planning artifacts to {output_folder}/archive/</action>
<output>{{#if archived}}✅ Old documents archived to {output_folder}/archive/{{else}}Starting fresh - old docs will be ignored{{/if}}</output>
<action>Set new_project = true</action>
<action>Continue to Step 3 (ask about their work)</action>
Should I archive the completed work before starting your new project? (y/n) Archive old planning docs {{#if archived}} Completed work archived{{else}}Ready for your new project!{{/if}} Set new_project = true Continue to Step 3 (ask about their work) Tell me what you're trying to accomplish: Analyze response and guide to appropriate choice (a, b, or c) Loop back to present choices again with guidance 🚨 **I found active implementation work:**

{{#if found_stories}} 📝 Story files: {{story_count}} stories in {output_folder}/stories/ {{#if story_examples}}- Examples: {{story_examples}}{{/if}} {{/if}}

{{#if found_sprint_status}} 📊 Sprint tracking: {{sprint_status_path}}

  • {{completed_stories}} completed
  • {{in_progress_stories}} in progress
  • {{pending_stories}} pending {{/if}}

{{#if found_workflow_status}} 📋 Workflow status: {{workflow_status_path}}

  • Generated: {{workflow_status_date}} {{/if}}

{{#if found_planning_docs}} 📚 Planning docs: {{found_planning_summary}} {{/if}}

What's happening here?

a) Continue implementation - I'm still working on these stories b) Completed - This work is done, starting something NEW c) Abandoned - Stopping this, starting over d) Not sure - Let me explain

Your choice [a/b/c/d]:

Check if bmm-workflow-status.yaml exists
<check if="workflow_status_exists">
  <output>✅ **You already have workflow tracking set up!**

Your current status file: {{workflow_status_path}}

You don't need workflow-init - you're already using the workflow system.

To check your progress:

  • Load your current agent (PM, SM, Architect, etc.)
  • Run: /bmad:bmm:workflows:workflow-status

This will show you what to do next.

Happy building! 🚀 Exit workflow gracefully (workflow already initialized)

<check if="no_workflow_status">
  <output>You have work in progress but no workflow tracking.

I'll create workflow tracking that recognizes your existing work. Set migrating_legacy_project = true Store found artifacts for workflow status generation Continue to Step 5 (detect track from artifacts)

Archive the old work before starting fresh? (y/n) Create archive folder Move stories, sprint status, and planning docs to archive {{#if archived}} Old work archived{{else}}Clean slate! Ready for your new project.{{/if}} Set new_project = true Continue to Step 3 (ask about their work) Tell me more about your situation: Analyze and guide to appropriate choice I see you have an existing codebase:

{{codebase_summary}}

No BMM artifacts found - this project hasn't used BMad Method yet.

Set field_type = "brownfield" Set new_project = true Note: Will need document-project before planning

💡 Note for brownfield projects: You'll need to run document-project workflow before planning. This analyzes your codebase and creates documentation that AI agents can use.

I'll include this as a prerequisite in your workflow path. Continue to Step 3 (ask about their work)

I found some artifacts but the project state is unclear:

{{list_found_artifacts}}

Let me understand your situation.

What are you trying to do?

a) Continue working on an existing project b) Start something completely NEW c) Fix/enhance the existing code d) Let me explain my situation

Your choice:

Analyze response carefully Guide to appropriate state (Continue existing = Step 5, New = Step 3)

Tell me about what you're working on. What's the goal?

Store user_description

Analyze description for field type:

  • Brownfield indicators: "existing", "current", "add to", "modify", "enhance", "refactor"
  • Greenfield indicators: "new", "build", "create", "from scratch", "start"
  • Codebase presence overrides: If found codebase = brownfield unless user says "scaffold"
I see you have existing code here. Are you:
  1. Adding to or modifying the existing codebase (brownfield)
  2. Starting fresh - the existing code is just a scaffold/template (greenfield)
  3. Something else - let me clarify

Your choice [1/2/3]:

Set field_type = "brownfield" Set field_type = "greenfield" Got it - treating as greenfield despite the scaffold. Please explain your situation: Analyze explanation and set field_type accordingly

Set field_type based on codebase presence (codebase = brownfield, none = greenfield)

Detect project_type (game vs software):

  • Game keywords: "game", "player", "level", "gameplay", "rpg", "fps", "puzzle game"
  • Default to "software" if not clearly a game
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

🎮 GAME DEVELOPMENT DETECTED

Game development workflows are now part of the BMad Game Development (BMGD) module.

The BMM module is designed for software development. For game development, you'll need the BMGD module which provides specialized game development workflows and agents.

Would you like to: a) Install BMGD module now (recommended for game projects) b) Continue with BMM workflows (for software projects only)

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Your choice [a/b]:

Please run the following command to install the BMGD module:
```bash
bmad install bmgd
```

After installation, you can start your game development workflow with the Game Designer agent.

This workflow-init will now exit. Re-run it after installing BMGD.
</output>
<action>Exit workflow with success status</action>
⚠️ **Warning:** BMM workflows are optimized for software development, not game development.
You may encounter mismatched terminology and workflows. Consider installing BMGD for
a better game development experience.

Continuing with software development workflows...
</output>
<action>Set project_type = "software" (override game detection)</action>

user_description field_type project_type

Before we determine your planning approach, I want to offer some optional workflows that can help you think through your project more deeply:

Would you like to:

  • 🧠 Brainstorm your project? (Creative exploration and idea generation)
  • 🔍 Research your domain? (Technical research, competitive analysis, deep-dives)

These are completely OPTIONAL but can help clarify your vision before planning.

Your choice: a) Yes, brainstorm first b) Yes, research first c) Yes, both d) No, I'm ready to plan

Your choice [a/b/c/d]:

Set brainstorm_requested = true Set research_requested = false Set brainstorm_requested = false Set research_requested = true Set brainstorm_requested = true Set research_requested = true Set brainstorm_requested = false Set research_requested = false

brainstorm_requested research_requested

Detect track from existing artifacts:

Track Detection Logic:

  • Has PRD + Architecture → BMad Method

  • Has PRD only → BMad Method (architecture was optional/skipped)

  • Has tech-spec only → BMad Quick Flow

  • Has Security/DevOps docs → BMad Enterprise Method

    Based on your existing planning documents, I've detected you're using:

{{detected_track_name}}

{{#if found_artifacts_list}} Found completed workflows: {{#each found_artifacts_list}}

  • {{workflow_name}}: {{file_path}} {{/each}} {{/if}}

I'll create workflow tracking that matches your existing approach and automatically marks these completed workflows as done.

Does this look right? (y/n)

Which track should I use instead?

  1. BMad Quick Flow
  2. BMad Method
  3. BMad Enterprise Method

Your choice:

Update selected_track based on choice Store selected_track selected_track

Continue to Step 6 (product brief question if applicable)

Now, let me explain your planning options.

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

🚀 BMad Quick Flow - Fast Implementation Path

⏱️ Time: Hours to 1 day of planning 📝 Approach: Tech-spec focused - just enough detail to start coding Best for: Simple features, bug fixes, scope is crystal clear ⚠️ Trade-off: Less upfront planning = higher risk of rework if complexity emerges 🤖 Agent Support: Basic - AI will have minimal context

Example: "Fix login bug" or "Add export button"

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

🎯 BMad Method - Full Product Planning (RECOMMENDED)

⏱️ Time: 1-3 days of planning 📝 Approach: PRD + UX + Architecture - complete product and system design Best for:

  • GREENFIELD: Products, platforms, multi-feature initiatives
  • BROWNFIELD: Complex additions (new UIs + APIs, major refactors, new modules)

Benefits:

  • AI agents have COMPLETE context for better code generation
  • Architecture distills massive codebases into focused solution design
  • Prevents architectural drift and ensures consistency
  • Fewer surprises and less rework during implementation
  • Faster overall delivery (planning investment pays off!)
  • Better code quality and maintainability

🤖 Agent Support: Exceptional - AI becomes a true coding partner with full context

{{#if brownfield}} 💡 Why Architecture for Brownfield? Your brownfield documentation might be huge (thousands of lines). The Architecture workflow takes all that context and creates a SUCCINCT solution design specific to YOUR project. This keeps AI agents focused on YOUR changes without getting lost in the existing codebase details. {{/if}}

Example: "User dashboard with analytics" or "Payment integration system" or "Add real-time collaboration to existing editor"

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

🏢 BMad Enterprise Method - Extended Enterprise Planning

⏱️ Time: 3-7 days of planning 📝 Approach: BMad Method + Security Architecture + DevOps + Test Strategy Best for: Enterprise requirements, compliance, multi-tenant, mission-critical Benefits: All of BMad Method PLUS specialized planning for:

  • Security architecture and threat modeling
  • DevOps pipeline and infrastructure planning
  • Comprehensive test strategy
  • Compliance and audit requirements

🤖 Agent Support: Elite - comprehensive planning for complex enterprise systems

Example: "Multi-tenant SaaS platform" or "HIPAA-compliant patient portal" or "Add SOC2-compliant audit logging to enterprise app"

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Generate recommendation based on user_description and field_type:

Recommendation Logic:

  • Complexity keywords (dashboard, platform, system, integration, multiple features) → Recommend BMad Method

  • Simple keywords (fix, bug, add button, simple) → Mention Quick Flow as option

  • Enterprise keywords (multi-tenant, compliance, security, audit) → Recommend Enterprise

  • Brownfield + complex → Strongly recommend Method (explain architecture benefit)

  • Greenfield + complex → Recommend Method

💡 My Honest Recommendation:

{{recommendation_with_reasoning}}

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Which approach fits your situation?

  1. BMad Quick Flow - Fast, minimal planning (I accept rework risk)
  2. BMad Method - Full planning for better AI results (RECOMMENDED)
  3. BMad Enterprise Method - Extended planning for enterprise needs
  4. I'm not sure - Help me decide

Your choice [1/2/3/4]:

Tell me more about your concerns or uncertainties: Provide tailored guidance based on their specific concerns Present choices again with more specific recommendation

Map choice to track name:

  • 1 → "quick-flow"
  • 2 → "method"
  • 3 → "enterprise"

Store selected_track selected_track

Skip this step - product brief not applicable for brownfield or quick flow Set product_brief_requested = false Continue to Step 7 (generate workflow path) One more optional workflow for greenfield projects:

📋 Product Brief - Strategic product planning document

This is OPTIONAL but recommended for greenfield BMad Method projects. It helps you articulate:

  • Product vision and unique value proposition
  • Target users and their needs
  • Success criteria and goals
  • Market positioning and strategy

This comes BEFORE your PRD and helps inform it with strategic thinking.

Would you like to include Product Brief in your workflow?

a) Yes, include Product Brief b) No, skip to PRD

Your choice [a/b]:

Set product_brief_requested = true Set product_brief_requested = false

product_brief_requested

Determine path file based on selected track and field type:

Path File Mapping:

  • quick-flow + greenfield → "quick-flow-greenfield.yaml"
  • quick-flow + brownfield → "quick-flow-brownfield.yaml"
  • method + greenfield → "method-greenfield.yaml"
  • method + brownfield → "method-brownfield.yaml"
  • enterprise + greenfield → "enterprise-greenfield.yaml"
  • enterprise + brownfield → "enterprise-brownfield.yaml"
  • game → "game-design.yaml"

Load {path_files}/{determined_path_file} Parse workflow path file to extract phases and workflows

Build workflow_items list:

For each phase in path file:

  1. Check if phase should be included based on:
    • User choices (brainstorm_requested, research_requested, product_brief_requested)
    • Phase conditions (prerequisite phases, optional phases)
  2. Add comment header: # Phase {n}: {Phase Name}
  3. For each workflow in phase:
    • Check if workflow should be included based on user choices
    • Add entry: {workflow-id}: {default_status} # agent: {agent}
    • Default status from path file (required/optional/recommended/conditional)
    • Agent from path file (pm/architect/ux-designer/sm/analyst/etc.)
  4. Add blank line between phases

Scan for existing completed workflows and update workflow_items:

Scan locations:

  • Brainstorm: {output_folder}/brainstorm*.md
  • Research: {output_folder}/research*.md
  • Product Brief: {outputfolder}/_brief.md
  • PRD: {outputfolder}/_prd.md or {outputfolder}/_prd/index.md
  • Tech-spec: {outputfolder}/_tech-spec.md or {outputfolder}/_spec.md
  • Epics: {outputfolder}/_epic.md or {outputfolder}/_epic/index.md
  • UX Design: {outputfolder}/_ux.md or {outputfolder}/_design.md
  • Architecture: {outputfolder}/_architecture.md or {outputfolder}/_arch.md
  • Sprint Planning: {outputfolder}/_sprint.yaml

CRITICAL: If file exists, replace workflow status with ONLY the file path, preserving agent comment. Example: prd: docs/prd.md # agent: pm (NOT "completed - docs/prd.md")

workflow_path_file workflow_items

Set generated date to current date generated

Perfect! Here's your personalized BMad workflow path:

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Track: {{selected_track_display_name}} Field Type: {{field_type}} Project: {{project_name}}

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

{{#if brownfield AND needs_documentation}} 🔧 Prerequisites: document-project - Create comprehensive codebase documentation (analyst agent) (Required before planning workflows) {{/if}}

{{#if has_discovery_phase}} 🧠 Phase 0: Discovery (Optional - based on your choices) {{#if brainstorm_requested}} Brainstorm - Creative exploration session (analyst agent) {{/if}} {{#if research_requested}} Research - Domain and technical research (analyst agent) {{/if}} {{#if product_brief_requested}} Product Brief - Strategic product planning (analyst agent) {{/if}} {{/if}}

{{#if selected_track == quick-flow}} 📝 Phase 1: Planning Tech-Spec - Implementation-focused specification (pm agent) (Auto-detects epic structure if 2+ stories)

🚀 Phase 2: Implementation Sprint Planning - Create sprint tracking (sm agent) Story Development - Implement story-by-story (sm agent) {{/if}}

{{#if selected_track in [method, enterprise]}} 📋 Phase 1: Planning PRD - Product Requirements Document (pm agent) Validate PRD (optional quality check) (pm agent) UX Design (if UI components - determined after PRD) (ux-designer agent)

🏗️ Phase 2: Solutioning {{#if brownfield}} Architecture - Integration design (RECOMMENDED for brownfield) (architect agent) Creates focused solution design from your existing codebase context {{else}} Architecture - System design document (architect agent) {{/if}} Validate Architecture (optional quality check) (architect agent) Solutioning Gate Check - Validate all planning aligns before coding (architect agent)

🚀 Phase 3: Implementation Sprint Planning - Create sprint tracking (sm agent) Story Development - Implement story-by-story with epic-tech-specs (sm agent) {{/if}}

{{#if selected_track == enterprise}}

🏢 Additional Enterprise Planning: Security Architecture - Threat modeling and security design (architect agent) DevOps Strategy - Pipeline and infrastructure planning (architect agent) Test Strategy - Comprehensive testing approach (tea agent) {{/if}}

{{#if found_existing_artifacts}} ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

📁 Existing Work Detected:

I found these completed workflows and will mark them as done: {{#each completed_workflows}} {{workflow_name}}: {{file_path}} {{/each}}

Your workflow tracking will start from where you left off!

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ {{/if}}

Ready to create your workflow tracking file? (y/n)

Prepare all template variables for workflow-status-template.yaml: - generated: {current_date} - project_name: {project_name} - project_type: {project_type} - selected_track: {selected_track} - field_type: {field_type} - workflow_path_file: {workflow_path_file} - workflow_items: {workflow_items from step 7}

Generate YAML from workflow-status-template.yaml with all variables Save status file to {output_folder}/bmm-workflow-status.yaml

Identify the first non-completed workflow in workflow_items Look up that workflow's agent and command from the loaded path file

Workflow tracking created: {output_folder}/bmm-workflow-status.yaml

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

{{#if completed_workflows_found}} 🎉 Great news! I found {{completed_count}} workflow(s) already completed. {{/if}}

Next Workflow: {{next_workflow_name}} Agent: {{next_agent}} Command: /bmad:bmm:workflows:{{next_workflow_id}}

{{#if next_agent != 'analyst' AND next_agent != 'pm'}} 💡 Tip: Start a new chat and load the {{next_agent}} agent before running this workflow. {{/if}}

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Happy building with BMad Method! 🚀

To check your progress anytime:

  • Load any BMM agent
  • Run: /bmad:bmm:workflows:workflow-status
No problem! You can run workflow-init again anytime you're ready.

To get started later, just load the Analyst agent and run: /bmad:bmm:workflows:workflow-init