docs: add CLAUDE.md for Claude Code guidance

Adds documentation to guide Claude Code instances working in this
repository, covering common commands, architecture overview, and
development notes.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Caleb 2026-01-01 11:21:57 -06:00
parent c748f0f6cc
commit 6573f27589
2 changed files with 87 additions and 1 deletions

1
.gitignore vendored
View File

@ -34,7 +34,6 @@ Thumbs.db
_bmad*/.cursor/
# AI assistant files
CLAUDE.md
.ai/*
cursor
.gemini

87
CLAUDE.md Normal file
View File

@ -0,0 +1,87 @@
# CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
## Project Overview
BMad Method is an AI-driven agile development framework built on BMad Core (Collaboration Optimized Reflection Engine). It provides specialized AI agents and guided workflows for software development lifecycle management.
**Key Modules:**
- **Core** (`src/core/`) - Universal framework with shared agents, tasks, and workflows
- **BMM** (`src/modules/bmm/`) - BMad Method for agile software development (flagship module)
- **BMB** (`src/modules/bmb/`) - BMad Builder for creating custom agents/workflows
- **BMGD** (`src/modules/bmgd/`) - Game development workflows
- **CIS** (`src/modules/cis/`) - Creative Intelligence Suite
## Common Commands
```bash
# Run all tests (schemas, installation, validation, lint, markdown lint, format check)
npm test
# Run specific test suites
npm run test:schemas # Agent YAML schema validation tests
npm run test:install # Installation component tests
npm run validate:schemas # Validate all *.agent.yaml files against schema
# Code quality
npm run lint # ESLint with YAML support
npm run lint:fix # Auto-fix linting issues
npm run lint:md # Markdown linting
npm run format:check # Check Prettier formatting
npm run format:fix # Auto-fix formatting
# Test coverage
npm run test:coverage # Generate coverage report with c8
# CLI integration tests
./test/test-cli-integration.sh
```
## Architecture
### Module Structure
Each module in `src/modules/` follows this pattern:
```
module/
├── module.yaml # Module configuration and installer prompts
├── agents/ # Agent definitions (*.agent.yaml)
├── workflows/ # Workflow definitions with workflow.yaml files
├── data/ # Data files used by workflows
├── teams/ # Team configurations (agent groupings)
└── _module-installer/ # Module-specific installation logic
```
### Agent YAML Schema
Agent files (`*.agent.yaml`) are validated by `tools/schema/agent.js` using Zod. Key rules:
- Required fields: `id`, `name`, `title`, `icon`, `persona`, `menu`
- Module agents must have `module` field matching their path (e.g., `bmm` for files in `src/modules/bmm/agents/`)
- Menu triggers must be kebab-case or compound format (`TS or fuzzy match on tech-spec`)
- Test fixtures in `test/fixtures/agent-schema/` demonstrate valid/invalid patterns
### CLI Tools
- `tools/cli/bmad-cli.js` - Main CLI entry point
- `tools/bmad-npx-wrapper.js` - NPX wrapper (`npx bmad-method install`)
- `tools/validate-agent-schema.js` - Schema validation CLI wrapper
### Workflow System
Workflows are YAML files that guide multi-step processes. Located in module `workflows/` directories with:
- `workflow.yaml` - Workflow definition and steps
- Supporting data files and templates
## Development Notes
### Adding New Agents
1. Create `*.agent.yaml` in appropriate `src/modules/*/agents/` directory
2. Follow schema in `tools/schema/agent.js`
3. Validate with `npm run validate:schemas`
4. Add test fixtures if introducing new validation patterns
### Modifying Validation
Schema changes go in `tools/schema/agent.js`. Test fixtures in `test/fixtures/agent-schema/` must cover all validation paths (100% coverage required).
### PR Guidelines
- Submit to `main` branch for critical fixes only
- Keep PRs under 800 lines; split larger changes
- Use conventional commits: `feat:`, `fix:`, `docs:`, `refactor:`, `test:`, `chore:`
- Validate YAML schemas before committing: `npm run validate:schemas`