A diagram-first documentation and architecture-planning module for the BMad Method.
diagram-based-workflow makes the diagram the primary medium of communication between engineers and AI coding agents. System understanding, feature planning, and codebase modifications happen visually through Mermaid diagrams organized by the C4 model, paired with concise text for rationale, trade-offs, and cost drivers.
DIAGRAM FIRST
│
┌──────────┴──────────┐
↓ ↓
DOCUMENTATION PLANNING-WORKFLOW
(Understand system) (Design new changes)
│ │
└──────────┬──────────┘
↓
ARCHITECT
(Map design ↔ code)
↓
CODING AGENT
(Implement code)
↓
Verify & Update Docs
To install this module directly into your BMad project from GitHub:
# In your project root
npx bmad install https://github.com/Glitch_guy0/diagram-based-workflowOr run the setup skill within your AI assistant / IDE:
/dbw-setup
- Diagram →
WHAT/WHERE/CONNECTIONS/FLOW - Text →
WHY/RULES/CONSTRAINTS/TRADE-OFFS/COST - Code →
ACTUAL IMPLEMENTATION
Every project documented with this module answers three questions:
- How does the system work? (System Context, Containers, Sequence, Flows, States)
- How is the code structured & integrated? (Components, Code, Integrations, Adapters)
- What decisions were made and why? (ADRs, trade-offs, cost drivers)
{planning_artifacts}/(default:_bmad-output/planning-artifacts/): Work-in-progress drafts, proposed diagrams, iterative plans.{project_knowledge}/(default:docs/): Authoritative, approved, and verified system documentation structured by C4 hierarchy.
| Skill | Menu Code | Description |
|---|---|---|
dbw-setup |
[SU] |
Configures module paths (docs/, _bmad-output/planning-artifacts/, docs/decisions/) and registers capabilities in BMad. |
dbw-documentation |
[DS] |
Work Sequence A: Maps existing systems into C4 diagrams, behavioral flows, and linked ADRs. |
dbw-documentation |
[VS] |
Verifies synchronization between Mermaid diagrams and active source code to detect drift. |
dbw-planning-workflow |
[PW] |
Work Sequence B: Guides diagram-first planning with Architect impact analysis, cost evaluations, and implementation plans in {planning_artifacts}/. |
dbw-planning-workflow |
[PD] |
Promotes verified planning diagrams and decisions from {planning_artifacts}/ into docs/. |
Approved project documentation follows the standard C4 hierarchy:
docs/
├── c4/
│ ├── system-context.mmd # Level 1: System Context (Actors, Systems, Boundaries)
│ ├── containers.mmd # Level 2: Containers (Deployable units, services, DBs, queues)
│ ├── components/ # Level 3: Components (Scoped per container)
│ │ └── <container>.mmd
│ └── code/ # Level 4: Code (Selective domain/module structures)
│ └── <subject>.mmd
│
├── flows/ # Behavioral diagrams
│ ├── sequence-<flow>.mmd # Chronological interactions
│ ├── flowchart-<flow>.mmd # Decision branching & process logic
│ └── state-<object>.mmd # Lifecycle state transitions
│
├── integrations/ # Third-party integrations & boundary adapters
│ └── <integration>.mmd
│
├── decisions/ # Architecture Decision Records (ADRs)
│ └── ADR-<number>-<title>.md # Linked to diagram nodes
│
└── indexes/
└── diagram-index.md # Master catalog & source-of-truth matrix
- Inspect codebase and existing documentation.
- Select diagram type using One Diagram = One Question rule.
- Author canonical
.mmddiagram indocs/. - Document significant decisions in
docs/decisions/ADR-xxx.md. - Update
docs/indexes/diagram-index.md.
- Create or edit diagram in
{planning_artifacts}/(e.g._bmad-output/planning-artifacts/). - Architect analyzes diagram diff against current codebase.
- Architect maps affected C4 levels, flows, and boundaries.
- Evaluate cost drivers (infrastructure, vendor, operations).
- Generate step-by-step Implementation Plan.
- User reviews and approves.
- Coding agent implements changes.
- Promote approved diagrams into
docs/([PD]).
The module coordinates two core BMad capabilities:
architect(Diana / Winston): Owns architectural reasoning, system decomposition, boundary rules, code mapping, impact analysis, and cost/trade-off identification.technical-writer: Maintains concise supporting documentation, ADRs, indexes, and source-of-truth references.
You can customize DBW behaviors and agents:
- Module & Agent Overrides: Edit
_bmad/custom/config.toml(e.g. under[modules.dbw]or[agents.dbw-agent-architect]). - Skill Overrides: Create
_bmad/custom/dbw-documentation.toml,_bmad/custom/dbw-planning-workflow.toml, or_bmad/custom/dbw-setup.toml(personal overrides use.user.toml).
Part of the BMad ecosystem. Open source and customizable via _bmad/custom/.