A template for creating BMad Method modules that can be published to npm and installed via the BMad installer.
After creating a new repo from this template:
npm installReplace the placeholder values:
name: Your package name (e.g.,@bmad-method/your-module)description: What your module doesauthor: Your namerepository.url: Your git repository URLkeywords: Add relevant search terms
Remove these template instructions and add:
- What your module does
- How to use it
- Any specific configuration needed
All module content goes under src/:
src/
├── module.yaml # Module metadata and install questions
├── agents/ # BMad agents
├── workflows/ # Agent workflows
└── tools/ # Small reusable tools
- module.yaml: Defines install questions and defaults
- agents/: All BMad agents go here
- workflows/: Agent workflows or direct-call workflows
- tools/: Small, single-purpose prompt files
- Use relative paths in all workflows/agents for portability
- Create an npm automation token at https://www.npmjs.com/settings/tokens
- Add it as a GitHub secret named
NPM_TOKENin your repo settings:gh secret set NPM_TOKEN --repo YOUR-ORG/YOUR-REPO
The module includes release scripts that handle versioning and publishing:
# Patch release (0.1.0 -> 0.1.1)
npm run release
# Minor release (0.1.0 -> 0.2.0)
npm run release:minor
# Major release (0.1.0 -> 1.0.0)
npm run release:major
# Prerelease (0.1.0 -> 0.1.1-0)
npm run release:prereleaseThese scripts:
- Update the version in package.json
- Create a git tag
- Push the tag to GitHub
- Trigger the publish workflow which publishes to npm
You can also create tags manually:
git tag v0.1.0
git push origin v0.1.0The module includes GitHub Actions workflows:
- publish.yaml: Automatically publishes to npm when a version tag is pushed
- quality.yaml: Runs linting and formatting checks
- docs.yaml: Builds documentation
- discord.yaml: Posts updates to Discord (configure if needed)
# Run linting
npm run lint
# Fix formatting
npm run format:fix
# Run tests
npm testOnce published, users can install your module via the BMad Method installer or npm:
# Via BMad installer
npx bmad-method install
# Via npm
npm install your-module-nameMIT License — see LICENSE for details.
Your Module Name — Part of the BMad Method ecosystem.
See CONTRIBUTORS.md for contributor information.