BMAD-METHOD/tools
cx-noam-brendel 6dc292c850 fix(bmb): add module.yaml schema validation and fix #1288
- Add Zod schema validation for module.yaml files
- Create test suite for module schema with 17 test fixtures
- Fix create-module workflow to make 'code' field requirements clearer

Fixes #1288 - The create-module workflow could produce module.yaml files
without the required 'code' field or with placeholder text like '{module_code}'.

1. Created tools/schema/module.js with Zod validation for:
   - Required fields: code, name, header, subheader
   - Code format: kebab-case, 2-20 chars, starts with letter
   - Variable definitions with prompt/inherit patterns

2. Created tools/validate-module-schema.js CLI validator

3. Added npm scripts:
   - validate:modules - validates all module.yaml files
   - test:modules - runs module schema test suite

4. Updated BMB workflow instructions with explicit warnings about
   required fields in step-03-config.md and step-03-module-yaml.md

5. Added 17 test fixtures covering:
   - Missing required fields (code, name, header, subheader)
   - Invalid code formats (placeholder, uppercase, underscore, etc.)
   - Variable definitions (prompt, inherit, single-select, multi-select)

- npm run test:modules - 17/17 tests pass
- npm run validate:modules - All 5 existing modules pass
- npm test - Full test suite passes
2026-01-26 15:41:22 +02:00
..
cli feat(installer): update install messages for Beta.0 release 2026-01-26 00:15:22 -06:00
docs docs: radical reduction of documentation scope for v6 beta (#1406) 2026-01-25 14:00:26 -06:00
flattener feat: add documentation website with Docusaurus build pipeline (#1177) 2025-12-23 23:01:36 +08:00
lib feat: add documentation website with Docusaurus build pipeline (#1177) 2025-12-23 23:01:36 +08:00
maintainer feat: add Raven's Verdict PR review tool (#1054) 2025-12-07 14:13:33 -06:00
schema fix(bmb): add module.yaml schema validation and fix #1288 2026-01-26 15:41:22 +02:00
bmad-npx-wrapper.js fix: preserve user's cwd when running via npx 2025-10-29 09:31:38 -05:00
build-docs.js docs: named TEA links consistently (#1337) 2026-01-15 18:01:37 -06:00
fix-doc-links.js Add link auditor, reorganize documentation, and README update (#1277) 2026-01-10 02:55:33 +08:00
format-workflow-md.js check alignment 2025-10-22 12:36:39 -05:00
migrate-custom-module-paths.js _cfg -> _config 2025-12-13 19:41:09 +08:00
platform-codes.yaml docs: radical reduction of documentation scope for v6 beta (#1406) 2026-01-25 14:00:26 -06:00
validate-agent-schema.js we only need one yaml lib 2025-12-13 18:35:07 +08:00
validate-doc-links.js docs: radical reduction of documentation scope for v6 beta (#1406) 2026-01-25 14:00:26 -06:00
validate-module-schema.js fix(bmb): add module.yaml schema validation and fix #1288 2026-01-26 15:41:22 +02:00
validate-svg-changes.sh Project Cleanup of Agents Menus, BMB module removal to other repo 2026-01-19 02:04:14 -06:00