6.8 KiB
6.8 KiB
CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Repository Overview
BMAD-METHOD (Breakthrough Method of Agile AI-Driven Development) is a natural language AI agent framework that orchestrates collaborative AI agents for software development and other domains. The entire framework is markdown-based with no code in the core framework.
Key Architecture
Multi-Agent System
- Location:
bmad-core/agents/- Individual AI personas with specific roles - Agent Teams:
bmad-core/agent-teams/- Bundled collections of agents - Workflows:
bmad-core/workflows/- Prescribed sequences for different project types - Templates:
bmad-core/templates/- Reusable document templates (PRD, Architecture, etc.) - Tasks:
bmad-core/tasks/- Specific repeatable actions - Data:
bmad-core/data/- Knowledge base, technical preferences, coding standards, and scaffolding preferences - Checklists:
bmad-core/checklists/- Quality assurance and validation checklists for agents
Two-Phase Development Approach
- Planning Phase (Web UI): Creates PRDs and Architecture documents
- Development Phase (IDE): Converts plans into hyper-detailed implementation stories
V4 Enhanced Features
- Memory Bank Pattern: Persistent AI context management across development sessions (
docs/memory-bank/) - Architecture Decision Records (ADRs): Comprehensive decision tracking system (
docs/adr/) - Development Journals: Session documentation and progress tracking (
docs/devJournal/) - Project Scaffolding Standards: Standardized directory structures and organizational patterns
- Enhanced Agent Capabilities: Session kickoff, comprehensive commit/PR workflows, sprint reviews
- Context Persistence: Eliminates context loss between development sessions
Important Files
bmad-web-build.js- Builds bundled text files for web UI consumptionbmad-installer.js- Installs BMAD into other projectsbmad-version.js- Version management utilitiessettings.yaml- Core framework configuration
Essential Commands
Development
# Install dependencies
npm install
# Build for web UI (creates bundled text files)
npm run build:web
# Build development version (for PR testing)
npm run build:dev
# Run installer locally
node ./tools/bmad-installer.js
# Format code
npm run format
# Check formatting
npm run format:check
# Run validation scripts
npm run validate
Version Management
# Show current version
node ./tools/bmad-version.js
# Sync version across all files
node ./tools/bmad-version.js --sync
Release Process
Releases are automated via semantic-release. Commits should follow conventional commit format:
feat:for new featuresfix:for bug fixesdocs:for documentation changeschore:for maintenance tasks
Working with Agents and Workflows
Adding/Modifying Agents
- Agents are in
bmad-core/agents/[agent-name]/ - Each agent has
agent.yaml(configuration) andagent-system-prompt.md(instructions) - Agents can reference templates, tasks, and tools
- When modifying agents, ensure consistency with their role in workflows
Working with Workflows
- Workflows are in
bmad-core/workflows/[workflow-name].yaml - They define sequences of agent interactions
- Reference agents by their IDs from the agent definitions
- Include handoff instructions between agents
Templates and Tasks
- Templates (
bmad-core/templates/) provide document structures using YAML format with embedded LLM instructions - Tasks (
bmad-core/tasks/) define specific repeatable actions including Memory Bank, ADR, and journal management - Checklists (
bmad-core/checklists/) provide quality assurance and validation workflows - Data files (
bmad-core/data/) include knowledge base, coding standards, technical preferences, and project scaffolding preferences - All components are referenced by agents and can be customized per project
Key Data Files
bmad-kb.md- Core knowledge base with BMad concepts and workflowstechnical-preferences.md- User's preferred technologies and patternscoding-standards.md- Code quality standards and security principlesproject-scaffolding-preference.md- Standardized project structure guidelinestwelve-factor-principles.md- Cloud-native application principlesmicroservice-patterns.md- Microservice architecture patterns
Testing and Validation
Since this is a natural language framework, there are no unit tests. Quality is ensured through:
- Agent checklists and validation prompts
- Workflow review cycles
- Validation scripts that check YAML and markdown formatting
Important Considerations
- Natural Language Focus: All core framework components are markdown/YAML - no code
- Installer Pattern: BMAD is designed to be installed into other projects, not run standalone
- Web UI Build: The
build:webcommand creates special bundled files for ChatGPT/Gemini consumption - Expansion Packs: The framework supports domain-specific extensions (game dev, DevOps, etc.)
- Document Sharding: Large documents are automatically broken down into manageable pieces
- Memory Bank Integration: Projects should initialize Memory Bank structure for context persistence
- ADR Documentation: Important architectural decisions should be documented using ADR templates
- Project Scaffolding: New projects should follow standardized directory structures from project-scaffolding-preference.md
- Agent Dependencies: Agents now include enhanced capabilities for session management, context persistence, and quality workflows
Working with V4 Features
Memory Bank Usage
- Use
*initialize-memory-banktask to set up persistent context structure - Agents reference Memory Bank during session kickoff for full project context
- Update Memory Bank throughout development to maintain current state
ADR Management
- Use
*create-adrtask for documenting architectural decisions - ADRs are stored in
docs/adr/and linked from Memory Bank system - Reference ADRs in development stories and architecture documentation
Development Journals
- Use
*create-dev-journaltask to document development sessions - Journals capture progress, decisions, and insights for future reference
- Stored in
docs/devJournal/organized by date/session
Session Management
- Use
*session-kickofffor proper session initialization with full context *comprehensive-commitand*comprehensive-prfor enhanced git workflows*sprint-reviewfor comprehensive retrospectives and progress assessment
GitHub Actions
The repository uses automated workflows for:
- CI/CD with semantic release
- Version syncing across documentation
- Changelog generation
- NPM publishing
When making changes, ensure they pass the format checks and validation scripts before committing.