BMAD-METHOD for Elixir/Phoenix - Bring the power of Agentic Agile Development to your Elixir projects!
Inspired by BMAD-METHODβ’, this package brings the proven Agentic Agile Development framework to Elixir and Phoenix projects with specialized AI agents, workflows, and quality gates tailored for the BEAM ecosystem.
BMAD (Breakthrough Method of Agile AI-Driven Development) provides:
- π€ Specialized AI Agents - Expert agents for Elixir/Phoenix development (Dev, QA, Architect, SM)
- π Development Workflows - Proven workflows for Phoenix features, contexts, and LiveViews
- β Quality Checklists - Best practices for Elixir, Phoenix, Ecto, and LiveView
- π£ Git Hooks - Automated quality enforcement with pre-commit, commit-msg, and post-merge hooks
- π Story Management - Structured approach to feature development with backlog, in-progress, and completed stories
Add bmad_elixir to your mix.exs dependencies:
def deps do
[
{:bmad_elixir, "~> 0.1.0", only: :dev, runtime: false}
]
endThen run:
mix deps.get# Basic initialization
mix bmad.init
# Initialize with git hooks
mix bmad.init --hooksThis creates:
your_phoenix_app/
βββ .bmad/
β βββ agents/ # AI agent definitions
β βββ workflows/ # Development workflows
β βββ tasks/ # Executable task guides
β βββ checklists/ # Quality gate checklists
β βββ config.yaml # Project configuration
βββ stories/
βββ backlog/ # Upcoming stories
βββ in-progress/ # Active development
βββ completed/ # Done stories
- elixir-dev π» - Senior Elixir/Phoenix Engineer for feature implementation
- elixir-qa β - Quality Assurance specialist for testing and validation
- elixir-architect ποΈ - System architect for OTP design and supervision trees
- elixir-sm π - Scrum Master for story creation and workflow management
- phoenix-expert π₯ - Phoenix framework specialist (Controllers, LiveView, Channels)
- ecto-specialist ποΈ - Database expert for schemas, migrations, and queries
- elixir-release-manager π - Release preparation and deployment
- elixir-documentation-specialist π - Documentation and ExDoc expert
Copy and customize the story template:
cp .bmad/templates/story-template.yaml stories/STORY-001.yamlThen edit stories/STORY-001.yaml with your story details.
Agents are markdown files that can be loaded into AI coding tools like Claude Code or GitHub Copilot. Each agent in .bmad/agents/ contains:
- Role definition and responsibilities
- Commands and best practices
- Examples and patterns specific to that role
Workflows provide step-by-step guides for complex tasks. See .bmad/workflows/ for available workflows:
greenfield-phoenix.yaml- New Phoenix project setupadd-phoenix-context.yaml- Create new bounded contextadd-liveview-feature.yaml- Implement LiveView feature
BMAD includes production-ready git hooks for quality enforcement:
- pre-commit - Runs
mix precommit(format, credo, dialyzer, test) - commit-msg - Blocks Claude Code attributions, enforces message format
- prepare-commit-msg - Shows commit message guidelines
- post-checkout - Reminds about migrations when switching branches
- post-merge - Reminds about migrations after merges
Install with:
mix bmad.init --hooksBMAD includes Claude Code Skills - executable workflows that Claude Code automatically discovers and uses when appropriate.
Skills are specialized capabilities that Claude Code loads on-demand based on your task. Unlike agents (which are comprehensive reference docs), skills are focused, executable workflows with specific triggers.
Key Differences:
- Agents (
.bmad/agents/) - Comprehensive expertise you manually reference - Skills (
.claude/skills/) - Auto-invoked workflows Claude Code discovers
elixir-quality-gate
- Runs comprehensive quality checks (format, credo, dialyzer, tests)
- Auto-triggers when validating code quality or before commits
phoenix-generator
- Guides using
mix phx.gen.*commands with best practices - Auto-triggers when creating Phoenix resources or schemas
ecto-migration-helper
- Creates and manages Ecto migrations safely
- Auto-triggers when working with database schema changes
elixir-test-runner
- Runs ExUnit tests with smart filtering and debugging
- Auto-triggers when running or debugging tests
phoenix-context-creator
- Creates well-designed Phoenix contexts following best practices
- Auto-triggers when designing new features or contexts
# Install skills to .claude/skills/
mix bmad.init --skills
# Install both hooks and skills
mix bmad.init --hooks --skillsSkills use YAML frontmatter to declare when they should activate:
---
name: elixir-quality-gate
description: Run comprehensive Elixir quality checks (format, credo, dialyzer, tests). Use when validating code quality or before commits.
---When you ask Claude Code to "run quality checks," it automatically:
- Reads skill descriptions
- Identifies relevant skills
- Loads and executes the appropriate workflow
Project Skills (.claude/skills/) - Shared with team via git:
mix bmad.init --skills # Installs to .claude/skills/
git add .claude/skills/Personal Skills (~/.claude/skills/) - Your personal toolkit:
cp -r .claude/skills/* ~/.claude/skills/See the installed skills as examples. Each skill is a directory containing:
SKILL.md(required) - YAML frontmatter + instructionsscripts/(optional) - Helper scriptstemplates/(optional) - Code templates
Run all quality checks locally before committing:
mix precommitThis runs:
- Format check -
mix format --check-formatted - Compilation -
mix compile --warnings-as-errors - Credo -
mix credo --strict - Dialyzer -
mix dialyzer(type checking) - Tests -
mix test
If you have git hooks installed, these checks run automatically on every commit.
Run checks individually during development:
# Format code
mix format
# Static analysis
mix credo --strict
# Type checking (first run builds PLT - takes 1-2 minutes)
mix dialyzer
# Run tests
mix testThis package includes a production-ready GitHub Actions workflow in .github/workflows/ci.yml that runs on every push and pull request.
-
Quality Check (runs once)
- Code formatting validation
- Compilation with warnings as errors
- Credo static analysis (strict mode)
-
Tests (matrix: Elixir 1.14-1.16, OTP 25-26)
- Runs test suite on multiple Elixir/OTP versions
- Ensures compatibility across versions
-
Dialyzer (runs once)
- Type checking with Dialyzer
- PLT files cached for faster builds
The workflow includes intelligent caching:
- Dependencies (
deps/,_build/) - PLT files (
priv/plts/) for faster Dialyzer runs
Tests run on:
- Elixir 1.16.0 + OTP 26.2
- Elixir 1.15.7 + OTP 25.3
- Elixir 1.14.5 + OTP 25.3
The workflow is installed when you run mix bmad.init. To use it in your Phoenix project:
- Ensure
.github/workflows/ci.ymlexists - Ensure you have
mix.exswith precommit alias configured - Push to GitHub - the workflow runs automatically
Add CI status badges to your README:
[](https://github.com/yourusername/your_repo/actions/workflows/ci.yml)Edit .bmad/config.yaml to customize:
project:
name: MyPhoenixApp
type: elixir_phoenix
agents:
default: elixir-dev
available:
- elixir-architect
- elixir-dev
- elixir-qa
quality:
pre_commit:
- mix format --check-formatted
- mix credo --strict
- mix dialyzer
- mix test-
Create a story: Copy template and fill in details
cp .bmad/templates/story-template.yaml stories/STORY-042-oauth-login.yaml
-
Review workflow: Check
.bmad/workflows/for relevant workflow guide -
Activate agent: Load appropriate agent from
.bmad/agents/(e.g.,elixir-dev.md) -
Implement: Follow story tasks, workflow steps, and established patterns
-
Use task guides: Reference
.bmad/tasks/for detailed implementation help -
Test: Write comprehensive ExUnit tests following TDD principles
-
Quality check: Pre-commit hook validates everything automatically
-
Review checklists: Verify against relevant checklists in
.bmad/checklists/ -
Complete: Move story to completed folder when all criteria met
Located in .bmad/agents/:
-
elixir-dev.md - Senior Elixir/Phoenix Engineer
- Feature implementation with TDD
- Bug fixes and refactoring
- Follows established patterns religiously
-
elixir-qa.md - Quality Assurance Specialist
- Comprehensive test coverage
- Quality gate validation (tests, credo, dialyzer)
- Edge case discovery
-
elixir-architect.md - System Design Architect
- OTP supervision trees
- GenServer patterns
- Phoenix context boundaries
- Fault tolerance design
-
elixir-sm.md - Scrum Master
- User story creation
- Task breakdown
- Agent coordination
- Sprint planning
Located in .bmad/workflows/:
-
greenfield-phoenix.yaml - Complete new Phoenix project setup
- Planning & Architecture (4-8 hours)
- Project setup and configuration
- Core infrastructure (auth, contexts, deployment)
- Quality gates and best practices
-
add-phoenix-context.yaml - Systematic context creation (4-8 hours)
- Context boundary definition
- Schema and migration design
- Context API implementation
- Comprehensive testing
-
add-liveview-feature.yaml - LiveView implementation (4-8 hours)
- LiveView structure planning
- Mount, events, and PubSub handlers
- Streams and forms (following AGENTS.md rules)
- Performance optimization
Located in .bmad/checklists/:
-
phoenix-checklist.md - Phoenix best practices
- Context design and controllers
- Security and performance
- Error handling and testing
- Deployment readiness
-
ecto-checklist.md - Database best practices
- Schema design and associations
- Migrations and indices
- Query optimization
- Multi-tenancy patterns
-
liveview-checklist.md - LiveView best practices
- Lifecycle implementation
- Streams and socket assigns
- Forms and events
- PubSub and real-time updates
- Common pitfalls to avoid
Located in .bmad/tasks/:
- create-story.md - User story creation with acceptance criteria
- qa-gate.md - Quality validation (tests, credo, dialyzer, format)
- write-tests.md - Comprehensive testing strategies
- create-context.md - Phoenix context with Ecto patterns
- create-liveview.md - LiveView following best practices
- debugging.md - Debug workflows and tools (IEx, Observer, Recon)
Located in priv/hooks/:
- pre-commit.sh - Quality checks and auto-restage
- commit-msg.sh - Block AI attributions
- prepare-commit-msg.sh - Show guidelines in editor
- post-checkout.sh - Migration reminders
- post-merge.sh - Dependency/migration alerts
Located in .bmad/templates/:
- story-template.yaml - Comprehensive user story structure
- config-template.yaml - BMAD configuration with all options
Stories provide structure and context using the YAML template:
story:
id: STORY-001
title: "Add User Authentication"
status: in_progress
assigned_agent: elixir-dev
acceptance_criteria:
- scenario: "User can register"
given: "I am on the registration page"
when: "I submit valid credentials"
then:
- "My account is created"
- "I am logged in automatically"
technical_tasks:
context:
- "Create User schema with password hashing"
- "Implement Accounts.create_user/1"
- "Write comprehensive tests"Checklists ensure best practices:
- Phoenix controller patterns
- Ecto schema validations
- LiveView lifecycle hooks
- GenServer supervision
- Security considerations
Guided workflows for common tasks:
- Creating new Phoenix contexts
- Implementing LiveView features
- Refactoring bounded contexts
- Adding Ecto migrations
- Security audits
This package is inspired by and compatible with BMAD-METHODβ’, adapting its proven Agentic Agile Development approach for the Elixir/Phoenix ecosystem.
Contributions welcome! Please read CONTRIBUTING.md first.
MIT License - see LICENSE for details.
- v0.1.0 - Initial release with core agents and workflows
- v0.2.0 - Advanced workflows for umbrella apps
- v0.3.0 - Integration with CI/CD pipelines
- v0.4.0 - Brownfield project support
- v0.5.0 - LiveView-specific workflows and agents
Built with β€οΈ for the Elixir community