Index of every page on this site: llms.txt
All skills
bacoco avatar

/main-workflow-router

@58378b1
by Baconnier Loicbacoco/bmad-skills67 stars
11
Run it yourself

Routes work to OpenSpec (L0-1) or BMAD (L2-4). Tracks status and guides through phases.

Use this Skill: https://skilld.dev/gh/bacoco/bmad-skills/main-workflow-router

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

REFERENCE.md

โ‰ˆ4.6k tokens on demand. Your agent reads this file only when SKILL.md points to it.

Reference โ€” End-to-End Orchestration

Routing matrices, troubleshooting guides, and status file schemas are documented here. Load only when orchestration decisions require deeper context.

BMAD Orchestrator Skill

Source: BMAD Method v6-alpha + OpenSpec by Fission-AI References:

๐ŸŽฏ Advanced Activation Patterns

Primary triggers now live in SKILL.md under "When to Invoke". Use this section for nuanced routing signals:

Elevated confidence triggers:

  • Conversation opens with ambiguous build/init language โ†’ auto-init workflow
  • Repeated "what's next" questions within same session โ†’ read status before replying
  • Mention of "handoff" or "phase complete" โ†’ validate gate files exist

Risk signals (pause routing):

  • User references missing artifacts ("we never wrote the PRD")
  • Previous phase checklists show incomplete items
  • Multiple blockers recorded in workflow-status.md

Escalation cues:

  • Scope grows from Level 1 to Level 2 โ†’ shift from OpenSpec to BMAD
  • User introduces cross-team coordination โ†’ confirm orchestrator ownership
  • Long-running implementation asks for reprioritization โ†’ refresh sprint-status.yaml

Two Workflows Available: BMAD vs OpenSpec

You orchestrate TWO different workflows based on project complexity:

๐Ÿš€ OpenSpec Workflow (Level 0-1: Simple Changes)

When: Bug fixes, small features, simple modifications to existing projects

3 Skills Available:

  1. openspec-change-proposal - Create lightweight change proposals
  2. openspec-change-implementation - Implement approved changes
  3. openspec-change-closure - Archive deployed changes

3 Stages:

  • Stage 1: Creating Changes (proposal, tasks, delta specs)
  • Stage 2: Implementing Changes (execute tasks)
  • Stage 3: Archiving Changes (update living specs)

Speed: Hours to days Overhead: Minimal (proposal + tasks) Best for: Existing projects, incremental changes

๐Ÿ—๏ธ BMAD Workflow (Level 2-4: Complex Projects)

When: New products, MVPs, comprehensive features, platforms

7 Agent Skills Available:

  1. bmad-discovery-research - Phase 1: Analysis (brainstorm, product brief, research)
  2. bmad-product-planning - Phase 2: Planning (PRD, epics)
  3. bmad-ux-design - Phase 2: Planning (UX design for UI-heavy projects)
  4. bmad-architecture-design - Phase 3: Solutioning (architecture, tech decisions)
  5. bmad-test-strategy - Cross-phase: Testing (test strategy, ATDD, automation)
  6. bmad-story-planning - Phase 4: Story Creation (developer-ready stories)
  7. bmad-development-execution - Phase 4: Implementation (coding, testing, review)

4 Phases:

  • Phase 1: Analysis (Optional for L2, Recommended for L3-4)
  • Phase 2: Planning (Required for L2-4)
  • Phase 3: Solutioning (Required for L2-4)
  • Phase 4: Implementation (Iterative)

Speed: Days to weeks Overhead: High (PRD, Architecture, Stories) Best for: New products, greenfield projects

Your Core Responsibilities

  1. Initialize Workflow (workflow-init)

    • Assess project level (0-4)
    • Create workflow-status.md
    • Recommend workflow path
  2. Track Status (workflow-status)

    • Read workflow-status.md
    • Report current phase
    • Recommend next action
  3. Manage Phase Transitions

    • Validate phase gates
    • Update workflow-status.md
    • Mark phases complete
  4. Manage Sprint Status

    • Initialize sprint-status.yaml from epics
    • Track story progress
    • Report story statuses
  5. Guide User

    • Answer "what's next?"
    • Load appropriate skills
    • Ensure proper sequence

Workflow: Initialize (workflow-init)

When: Start of new project, no workflow-status.md exists

Process:

Step 1: Assess Project

Ask user:

  1. What are you building?

    • Get brief description
  2. Project Type?

    • Greenfield (new project)
    • Brownfield (existing codebase)
  3. Complexity Assessment:

    • How many functional requirements? (rough estimate)
    • How many epics? (rough estimate)
    • Timeline/team size?

Step 2: Determine Project Level

Level Scope FRs Epics Stories Workflow
0 Trivial (bug fix, config change) N/A N/A N/A OpenSpec (or direct implementation)
1 Small change (single feature, isolated) 1-5 0-1 1-5 OpenSpec (proposal + tasks)
2 New feature (MVP) 8-15 1-2 5-15 BMAD (Planning โ†’ Solutioning โ†’ Implementation)
3 Comprehensive product 12-25 2-5 15-40 BMAD (Analysis optional โ†’ Planning โ†’ Solutioning โ†’ Implementation)
4 Enterprise platform 20-35+ 5-10+ 40-100+ BMAD (Analysis required โ†’ Planning โ†’ Solutioning โ†’ Implementation)

Determine Level: Based on answers, assign Level 0-4.

Routing Decision

If Level 0 (Trivial):

This is a trivial change (bug fix, config, typo).

Recommendation: Implement directly without workflow.

Or if you want documentation, use OpenSpec:
  - openspec-change-proposal (minimal proposal)
  - openspec-change-implementation (quick implementation)
  - openspec-change-closure (document the change)

Would you like to use OpenSpec or just implement directly?

If Level 1 (Small Change):

โœ… This is a Level 1 change - perfect for OpenSpec!

OpenSpec is a lightweight workflow for simple features:
  1. Create proposal (why, what, tasks)
  2. Implement tasks
  3. Archive when deployed

I'll invoke openspec-change-proposal to create your change proposal.

If Level 2-4 (Complex):

โœ… This is a Level {X} project - using BMAD workflow.

BMAD provides complete planning and architecture:
  - Phase 1: Analysis (optional/required based on level)
  - Phase 2: Planning (PRD, Epics)
  - Phase 3: Solutioning (Architecture)
  - Phase 4: Implementation (Stories โ†’ Dev)

I'll initialize the BMAD workflow...

Step 3: Initialize Workflow (BMAD Only - Level 2-4)

Skip this for Level 0-1 (OpenSpec doesn't use workflow-status.md)

For Level 2-4, run Python helper:

python .claude/skills/main-workflow-router/helpers/workflow_status.py init \
  "{project_name}" "{project_type}" {level} "{user_name}"

This creates docs/bmm-workflow-status.md with:

  • Project metadata
  • Phase checklist
  • Next recommended action

Step 4: Invoke Appropriate Skill

For Level 0-1 (OpenSpec)

Level 0: Either implement directly or invoke openspec-change-proposal if user wants documentation

Level 1: Invoke openspec-change-proposal to create change proposal

Tell user:

โœ… Level {X} - Using OpenSpec workflow

Quick and lightweight:
  1. Proposal - Define the change
  2. Implement - Execute tasks
  3. Archive - Update specs

Let me create your change proposal...

[Invoke openspec-change-proposal]
For Level 2-4 (BMAD)

Level 2: Invoke bmad-product-planning (Planning phase)

Level 3: Ask if user wants Analysis first, or invoke bmad-discovery-research/bmad-product-planning

Level 4: Invoke bmad-discovery-research (Analysis required)

Tell user:

โœ… BMAD Workflow initialized!

Project: {name}
Level: {level}
Type: {type}

๐Ÿ“Š Status File: docs/bmm-workflow-status.md

๐ŸŽฏ Next Phase: {phase_name}

Let me start with {skill_name}...

[Invoke appropriate BMAD skill]

Workflow: Check Status (workflow-status)

When: Anytime user wants to know "where am I?" or "what's next?"

Process:

Step 1: Check for Workflow Status File

python .claude/skills/main-workflow-router/helpers/workflow_status.py get-phase

If no file: Recommend running workflow-init first.

If file exists: Read current phase.

Step 2: Assess Current State

Check what artifacts exist:

  • docs/brainstorm-notes.md or docs/product-brief.md (Analysis)
  • docs/PRD.md (Planning)
  • docs/epics.md (Planning)
  • docs/ux-spec.md (Planning, if UI-heavy)
  • docs/ARCHITECTURE.md (Solutioning)
  • docs/sprint-status.yaml (Implementation setup)
  • stories/*.md files (Story Creation)

Step 3: Determine Next Action

Current Phase: Analysis

  • If product-brief.md exists โ†’ Proceed to Planning (bmad-product-planning)
  • If not โ†’ Continue Analysis (bmad-discovery-research)

Current Phase: Planning

  • If PRD.md and epics.md exist โ†’ Proceed to Solutioning (bmad-architecture-design)
  • If PRD exists but no epics โ†’ Complete Planning (bmad-product-planning for epics)
  • If neither โ†’ Start/continue Planning (bmad-product-planning)
  • If UI-heavy and no ux-spec.md โ†’ Consider UX Design (bmad-ux-design)

Current Phase: Solutioning

  • If ARCHITECTURE.md exists โ†’ Proceed to Implementation (Story Creation)
  • If not โ†’ Start/continue Solutioning (bmad-architecture-design)

Current Phase: Implementation

  • If sprint-status.yaml exists โ†’ Check story statuses
  • If no sprint-status โ†’ Initialize sprint status
  • If stories exist โ†’ Implement next story (bmad-development-execution)
  • If no stories โ†’ Create stories (bmad-story-planning)

Step 4: Report to User

๐Ÿ“Š BMAD Workflow Status

Project: {name} (Level {level})
Current Phase: {phase}

โœ… Completed:
- {list completed artifacts}

๐Ÿ”„ In Progress:
- {current phase}

โญ๏ธ Next Action:
{specific recommendation with skill to load}

๐Ÿ“ Artifacts:
{list of created files}

Workflow: Update Phase

When: Phase completed, need to transition to next

Process:

Step 1: Validate Phase Gate

Completing Analysis:

  • Product brief exists OR brainstorm notes exist
  • User approved

Completing Planning:

  • PRD.md exists with all sections
  • epics.md exists with story breakdown
  • UX-spec.md exists if UI-heavy (optional validation)
  • User reviewed and approved

Completing Solutioning:

  • ARCHITECTURE.md exists
  • Decision table has specific versions
  • Every epic mapped to components
  • Implementation patterns defined
  • User reviewed and approved

Completing Implementation (per story):

  • Story file exists
  • All acceptance criteria met
  • All tests passing
  • Dev Agent Record complete
  • Story marked "done" in sprint-status.yaml

Step 2: Mark Phase Complete

python .claude/skills/main-workflow-router/helpers/workflow_status.py mark-complete "{phase}"

Step 3: Update to Next Phase

python .claude/skills/main-workflow-router/helpers/workflow_status.py update-phase "{next_phase}"

Step 4: Add Artifacts

For each artifact created:

python .claude/skills/main-workflow-router/helpers/workflow_status.py add-artifact \
  "{path}" "{description}"

Step 5: Announce Transition

โœ… Phase Complete: {completed_phase}

Artifacts Created:
- {list}

๐Ÿ“Š Transitioning to: {next_phase}

๐ŸŽฏ Next Action: {recommendation}

Load {skill_name} to continue.

Workflow: Sprint Planning

When: After epics.md created, before story creation

Purpose: Initialize sprint-status.yaml from epics

Process:

Step 1: Check Prerequisites

  • epics.md exists
  • Contains story breakdown

Step 2: Initialize Sprint Status

python .claude/skills/main-workflow-router/helpers/sprint_status.py init docs/epics.md

This creates docs/sprint-status.yaml with:

  • All stories from epics
  • Initial status: "backlog"
  • Epic tracking
  • Story tracking

Step 3: Report to User

โœ… Sprint Status Initialized

๐Ÿ“Š File: docs/sprint-status.yaml

Summary:
- Total Epics: {count}
- Total Stories: {count}
- Status: All in backlog

๐ŸŽฏ Next Action:
Create first story with bmad-story-planning skill

To see next story: Ask orchestrator "what's the next story to create?"

Workflow: Story Lifecycle Management

Get Next Backlog Story

python .claude/skills/main-workflow-router/helpers/sprint_status.py next-backlog

Returns: Story key (e.g., "1-1-project-setup")

Update Story Status

When story created:

python .claude/skills/main-workflow-router/helpers/sprint_status.py update \
  "{story_key}" "drafted"

When story implementation starts:

python .claude/skills/main-workflow-router/helpers/sprint_status.py update \
  "{story_key}" "in-progress" "{developer_name}"

When story in review:

python .claude/skills/main-workflow-router/helpers/sprint_status.py update \
  "{story_key}" "review"

When story done:

python .claude/skills/main-workflow-router/helpers/sprint_status.py update \
  "{story_key}" "done"

List Stories by Status

python .claude/skills/main-workflow-router/helpers/sprint_status.py list-status "{status}"

Statuses: backlog, drafted, ready, in-progress, review, done

Decision Logic: Next Action

def get_next_action(workflow_status, sprint_status, artifacts):
    level = workflow_status.project_level
    phase = workflow_status.current_phase

    # Level 0-1: Skip BMAD
    if level <= 1:
        return "Skip BMAD. Implement directly or create brief tech-spec."

    # Phase 1: Analysis
    if phase == "Analysis":
        if level >= 4 and not artifacts.product_brief:
            return "Create Product Brief with bmad-discovery-research skill"
        elif level == 3 and ask_user("Want to do analysis first?"):
            return "Create Product Brief with bmad-discovery-research skill"
        else:
            return "Proceed to Planning: Create PRD with bmad-product-planning skill"

    # Phase 2: Planning
    if phase == "Planning":
        if not artifacts.prd:
            return "Create PRD with bmad-product-planning skill"
        elif not artifacts.epics:
            return "Complete Epics Breakdown with bmad-product-planning skill"
        elif level >= 3 and ui_heavy and not artifacts.ux_spec:
            return "Consider creating UX Design with bmad-ux-design skill (optional)"
        else:
            return "Proceed to Solutioning: Create Architecture with bmad-architecture-design skill"

    # Phase 3: Solutioning
    if phase == "Solutioning":
        if not artifacts.architecture:
            return "Create Architecture with bmad-architecture-design skill"
        elif not artifacts.sprint_status:
            return "Initialize Sprint Planning (orchestrator will do this)"
        else:
            return "Proceed to Implementation: Create Stories with bmad-story-planning skill"

    # Phase 4: Implementation
    if phase == "Implementation":
        if not sprint_status.initialized:
            return "Initialize sprint status from epics (orchestrator will do this)"

        next_story = sprint_status.get_next_backlog()
        if next_story:
            return f"Create story {next_story} with bmad-story-planning skill"

        in_progress = sprint_status.get_stories_by_status("in-progress")
        if in_progress:
            return f"Continue implementing story {in_progress[0]} with bmad-development-execution skill"

        in_review = sprint_status.get_stories_by_status("review")
        if in_review:
            return f"Review story {in_review[0]} with bmad-development-execution skill (code-review)"

        drafted = sprint_status.get_stories_by_status("drafted")
        if drafted:
            return f"Implement story {drafted[0]} with bmad-development-execution skill"

        return "All stories complete! ๐ŸŽ‰ Project done."

Complete Phase Flow

Level 2 Project Flow

1. workflow-init โ†’ Level 2 determined
2. workflow-status โ†’ "Start Planning"
   โ†’ bmad-product-planning: Create PRD + Epics
3. workflow-status โ†’ "Proceed to Solutioning"
   โ†’ bmad-architecture-design: Create Architecture
4. sprint-planning โ†’ Initialize sprint-status.yaml
5. workflow-status โ†’ "Create Stories"
   โ†’ bmad-story-planning: Create Story 1.1
   โ†’ bmad-story-planning: Create Story 1.2
   โ†’ ...
6. workflow-status โ†’ "Implement Stories"
   โ†’ bmad-development-execution: Implement Story 1.1
   โ†’ bmad-development-execution: Implement Story 1.2
   โ†’ ...
7. All done! ๐ŸŽ‰

Level 4 Project Flow

1. workflow-init โ†’ Level 4 determined
2. workflow-status โ†’ "Start Analysis"
   โ†’ bmad-discovery-research: Brainstorm + Product Brief + Research
3. workflow-status โ†’ "Proceed to Planning"
   โ†’ bmad-product-planning: Create PRD + Epics
   โ†’ bmad-ux-design: Create UX Design (if UI-heavy)
4. workflow-status โ†’ "Proceed to Solutioning"
   โ†’ bmad-architecture-design: Create comprehensive Architecture
   โ†’ bmad-test-strategy: Initialize Test Framework (optional)
5. sprint-planning โ†’ Initialize sprint-status.yaml
6. workflow-status โ†’ "Create Stories"
   โ†’ bmad-test-strategy: ATDD - Write tests first (optional)
   โ†’ bmad-story-planning: Create stories one by one
7. workflow-status โ†’ "Implement Stories"
   โ†’ bmad-development-execution: Implement stories iteratively
   โ†’ bmad-test-strategy: Test automation (ongoing)
8. All done! ๐ŸŽ‰

User Commands

User can ask orchestrator:

  • "Initialize workflow" โ†’ workflow-init
  • "What's my status?" / "Where am I?" โ†’ workflow-status
  • "What's next?" โ†’ workflow-status with recommendation
  • "What's the next story?" โ†’ sprint-status next-backlog
  • "List backlog stories" โ†’ sprint-status list-status backlog
  • "Mark Planning complete" โ†’ update-phase with validation
  • "Show all stories" โ†’ sprint-status list

Important Notes

  • State files are source of truth: Always read before giving recommendations
  • Validate phase gates: Don't advance without artifacts
  • Guide, don't execute: Orchestrator recommends skills, doesn't run them
  • Update state files: After each phase completion
  • Sprint status from epics: Always initialize after epics created

Attribution: Based on BMAD Method v6-alpha License: Internal use - BMAD Method is property of bmad-code-org Generated: This skill orchestrates complete BMAD workflow with proper state management

Source: SKILL.md on GitHub

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

1 alert8mo4 checks ยท Risk HIGH
  • Gen Agent Trust Hub9mo

    This orchestration skill routes projects based on user input and local file state. It is vulnerable to Indirect Prompt Injection and command injection because it processes untrusted project descriptions and status documents while possessing high-privilege Bash and Write capabilities.

  • Socket8mo

    No alerts

  • Snyk9mo

    Risk: LOW ยท No issues

  • Runlayer9mo

    7/7 files flagged

Signed by skilld at 58378b1. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 2 months ago.

Steadyupdated last year
What it can do
Reads files Edits files Runs commands
All 4 allowed tools
ReadWriteGrepBash
Other metadata
metadata
{
  "auto-invoke": true,
  "triggers": {
    "patterns": [
      "start project",
      "what's next",
      "where am I",
      "status",
      "what should I do"
    ],
    "keywords": [
      "status",
      "workflow",
      "next",
      "start",
      "guide",
      "phase",
      "initialize",
      "orchestrate"
    ]
  },
  "capabilities": [
    "workflow-routing",
    "status-tracking",
    "phase-coordination",
    "skill-activation"
  ],
  "prerequisites": [],
  "outputs": [
    "workflow-status",
    "next-actions",
    "phase-guidance"
  ]
}

README badge

README badge for bacoco/bmad-skills/main-workflow-router