|
| 1 | +# AGENTS.md |
| 2 | + |
| 3 | +## Project Overview |
| 4 | + |
| 5 | +**BMad Builder (BMB)** is a meta-module for the BMad Code Platform that helps users create custom AI agents, workflows, and domain-specific modules. It's a documentation-driven project with YAML-based agent/workflow definitions and some minimal Node.js tooling. |
| 6 | + |
| 7 | +## Key Commands |
| 8 | + |
| 9 | +### Development |
| 10 | +```bash |
| 11 | +npm run docs:dev # Start Astro dev server (http://localhost:4321) |
| 12 | +npm run docs:build # Build documentation site |
| 13 | +npm run docs:preview # Preview built site |
| 14 | +``` |
| 15 | + |
| 16 | +### Testing & Validation |
| 17 | +```bash |
| 18 | +npm test # Run full test suite (schemas, refs, lint, format, md) |
| 19 | +npm run test:schemas # Validate agent YAML schemas |
| 20 | +npm run test:refs # Validate internal file references |
| 21 | +npm run validate:schemas # Validate actual agent files against schema |
| 22 | +npm run validate:refs # Check file references (alias for above) |
| 23 | +``` |
| 24 | + |
| 25 | +### Code Quality |
| 26 | +```bash |
| 27 | +npm run lint # ESLint check |
| 28 | +npm run lint:fix # ESLint auto-fix |
| 29 | +npm run lint:md # Markdown lint |
| 30 | +npm run format:check # Prettier check |
| 31 | +npm run format:fix # Prettier format |
| 32 | +``` |
| 33 | + |
| 34 | +### Release |
| 35 | +```bash |
| 36 | +npm run release # Bump patch version and push tag |
| 37 | +npm run release:minor # Bump minor version |
| 38 | +npm run release:major # Bump major version |
| 39 | +``` |
| 40 | + |
| 41 | +## Architecture |
| 42 | + |
| 43 | +### Source Structure (`src/`) |
| 44 | +- **`agents/`** — Agent definitions (`*.agent.yaml`) with persona, menu, and metadata |
| 45 | +- **`workflows/`** — Multi-step guided processes organized by type (agent, workflow, module) |
| 46 | + - Each workflow has `steps-c/` (create), `steps-e/` (edit), `steps-v/` (validate) |
| 47 | + - Step-file architecture: JIT loading, sequential execution, state tracking |
| 48 | + - `data/` contains CSV knowledge bases for agents |
| 49 | + |
| 50 | +### Module Structure |
| 51 | +``` |
| 52 | +your-module/ |
| 53 | +├── src/ |
| 54 | +│ ├── module.yaml # Module metadata, install config, variables |
| 55 | +│ ├── agents/ # *.agent.yaml files |
| 56 | +│ ├── workflows/ # Workflow files with step subdirectories |
| 57 | +│ └── tools/ # Optional reusable tools |
| 58 | +└── package.json |
| 59 | +``` |
| 60 | + |
| 61 | +### Build Tools (`tools/`) |
| 62 | +- **`build-docs.mjs`** — Consolidates docs, generates LLM-friendly files (`llms.txt`), builds Astro site |
| 63 | +- **`validate-file-refs.mjs`** — Validates cross-file references in agents/workflows |
| 64 | + |
| 65 | +### Documentation (`docs/`) |
| 66 | +- Diataxis structure: tutorials, how-to, explanation, reference |
| 67 | +- Starlight-based site in `website/` |
| 68 | +- `_STYLE_GUIDE.md` — Project-specific writing conventions (Google style + Diataxis) |
| 69 | + |
| 70 | +### Skills (`.claude/skills/`) |
| 71 | +- BMad OS (Open Source) skills for maintainer workflows |
| 72 | +- `bmad-os-add-doc` — Diataxis documentation authoring |
| 73 | +- `bmad-os-release-module` — Module release process |
| 74 | +- `bmad-os-gh-triage` — GitHub issue triage |
| 75 | + |
| 76 | +## Important Concepts |
| 77 | + |
| 78 | +### Agent YAML Structure |
| 79 | +- `agent.metadata` — id, name, title, icon, module |
| 80 | +- `agent.persona` — role, identity, communication_style, principles |
| 81 | +- `agent.menu` — trigger commands that execute workflows |
| 82 | +- `conversational_knowledge` — CSV files loaded at runtime |
| 83 | + |
| 84 | +### Workflow Step Architecture |
| 85 | +- Micro-file design: each step is self-contained |
| 86 | +- Just-in-time loading: only current step in memory |
| 87 | +- Sequential enforcement with state tracking |
| 88 | +- Menus halt execution waiting for user input |
| 89 | +- Frontmatter defines: name, description, web_bundle, createWorkflow |
| 90 | + |
| 91 | +### Path Variables |
| 92 | +- `{project-root}/_bmad/bmb/` — Installation path (in repo, maps to `src/`) |
| 93 | +- `{bmb_creations_output_folder}` — User's custom content output |
| 94 | +- Runtime variables: `{output_folder}`, `{project-root}` from Core config |
| 95 | + |
| 96 | +## Development Notes |
| 97 | + |
| 98 | +- **Node.js 22+ required** (see `.nvmrc`) |
| 99 | +- Module is `default_selected: false` — not auto-installed |
| 100 | +- File references in src/ become `_bmad/bmb/` after installation |
| 101 | +- All YAML uses double quotes with `avoidEscape: true` |
| 102 | +- Website builds to `build/site/` for deployment |
| 103 | +- LLM docs have 600k char limit (~150k tokens) |
| 104 | + |
| 105 | +## Publishing |
| 106 | + |
| 107 | +BMad modules are published as npm packages. The module code (`src/`) is what gets installed into user projects via `npx bmad-method install`. The astro website is deployed separately (GitHub Pages via CNAME). |
0 commit comments