BMAD-FOUNDRY: The Modular Architecture for Deterministic AI Agents

Moving beyond the everything-app prompt to a registry of specialized micro-agents and verified workflows.

• View on GitHub • More from bmad-code-org

A Victorian-style foundry where tiny mechanical owls are being assembled and filed into drawers by brass hands, representing the orchestration of specialized micro-agents.
BMAD-FOUNDRY shifts AI development from a single conversational interface to a structured assembly line of specialized agents.

Key Takeaways

The Party Mode Paradigm

Most developers treat AI agents like a single, all-knowing intern. You open a chat window, paste some code, and hope the model context window holds up. BMAD-FOUNDRY argues that high-stakes engineering requires the exact opposite approach. It introduces a modular registry of hyper-specialized, swappable micro-agents that only speak when spoken to and operate within rigid workflows.

This orchestration is what the BMAD community calls "Party Mode." Instead of one monolithic AI, you install a room of specialists. A Skill Architect plans the structure, a QA Lead writes the tests, and a Security Auditor reviews the output. They collaborate but remain strictly partitioned.

Running AI agents in a real codebase means solving three intertwined problems at once: planning and quality gates (so agents don't drift), observability (so you know what's working), and orchestration (so multiple agents divide work without clobbering each other).

Inside the Module: The Registry Pattern

The core abstraction of the Foundry is the module.yaml file. This manifest defines a module's identity, its dependencies, and its entry points. The bmad-builder validates these units before they ever touch your IDE. This ensures that every downloaded persona adheres to a strict schema.

The AST verification loop prevents agent drift by grounding all AI instructions in the actual abstract syntax tree of the repository.

Curing Context Rot with AST Verification

Long-running AI sessions inevitably suffer from context rot. The model forgets constraints, invents non-existent functions, and drifts from the original architecture. The Foundry solves this through AST (Abstract Syntax Tree) verification.

By utilizing modules like skill-forge, the framework grounds AI instructions in the actual parsed structure of your codebase. The AI is not allowed to guess the shape of a function. It must verify it against the AST before proceeding to the next step in the workflow.

BMAD is not a “start coding in 20 minutes” setup. It’s closer to “do the work up front so the coding part stops being the hardest part.”

The Workflow: Software Engineering as a Science

BMAD enforces discipline through declarative step-files. The AI is not permitted to wing it. It must follow a rigid path from Source Analysis to Architecture Planning before a single line of feature code is written. This documentation-first approach ensures predictability.

FeatureTraditional AI ChatBMAD-FOUNDRY
InputNatural LanguageDeclarative YAML & Step-files
MemoryShort-term BufferContext-Managed Workflows
VerificationProbabilistic TrustAST-Grounded Truth
PersonaStatic Gen-AISwappable Registry Agents