Atomic command primitives for BMAD operations. Provides type-safe, testable wrappers around file operations and test execution with structured JSON I/O and built-in telemetry. This skill should be used when BMAD workflows need deterministic, reliable primitive operations with observability.
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
A direct command skips the review prompt. Inspect the source before running it.
Atomic command primitives for BMAD operations. Provides type-safe, testable wrappers around file operations and test execution with structured JSON I/O and built-in telemetry. This skill should be used when BMAD workflows need deterministic, reliable primitive operations with observability.
allowed-tools
Bash, Read
acceptance
[{"commands_executed":"All requested commands executed successfully"},{"json_io_valid":"All inputs parsed and outputs generated as valid JSON"},{"telemetry_emitted":"Telemetry data emitted for all command executions"},{"errors_handled":"All errors caught and reported in structured format"},{"deterministic_behavior":"Same inputs produce same outputs (idempotent where applicable)"}]
inputs
{"command":{"type":"enum","values":["read_file","run_tests","generate_architecture_diagram","analyze_tech_stack","extract_adrs","validate_patterns"],"required":true,"description":"Command name to execute"},"command_args":{"type":"object","required":true,"description":"Command-specific arguments (varies by command)","examples":{"read_file":{"path":"workspace/tasks/task-001.md"},"run_tests":{"path":".","framework":"jest","timeout":120},"generate_architecture_diagram":{"architecture":"docs/architecture.md","type":"c4-context","output":"docs/diagrams"}}}}
outputs
{"success":{"type":"boolean","description":"Whether command executed successfully"},"outputs":{"type":"object","description":"Command-specific outputs (varies by command)"},"telemetry":{"type":"object","description":"Telemetry data with command, duration_ms, timestamp","required_fields":["command","duration_ms","timestamp"]},"errors":{"type":"array","description":"Array of error objects (empty if success=true)","item_schema":{"error_code":"string","message":"string","details":"object (optional)"}}}
BMAD Commands provide atomic, testable command primitives that BMAD skills compose into workflows. Each command follows a strict contract with typed inputs/outputs, structured error handling, and built-in telemetry.
Design Principles:
Deterministic: Same inputs always produce same outputs
Testable: Pure functions with JSON I/O
Observable: All commands emit telemetry data
Composable: Commands are building blocks for skills
{"success":true,"outputs":{"technologies":[{"name":"React","category":"frontend","version":"18+"},{"name":"Node.js","category":"backend","version":"20+"},{"name":"PostgreSQL","category":"database","version":"15+"}],"tech_count":3,"categories":["frontend","backend","database"],"compatibility":{"issues":[],"warnings":[],"recommendations":["Verify versions are compatible"]},"architecture_source":"docs/architecture.md"},"telemetry":{"command":"analyze_tech_stack","tech_count":3,"duration_ms":180,"timestamp":"2025-01-31T10:30:00Z"},"errors":[]}
extract_adrs
Extract Architecture Decision Records (ADRs) from architecture document into separate files.
Full command contracts (inputs, outputs, errors, telemetry) are documented in:
references/command-contracts.yaml
Reference this file when:
Creating new commands
Updating existing commands
Integrating commands into skills
Understanding command behavior
Testing Commands
Test commands independently before using in workflows:
# Test read_file
python .claude/skills/bmad-commands/scripts/read_file.py \
--path README.md \
--output json
# Test run_tests (if you have a test suite)
python .claude/skills/bmad-commands/scripts/run_tests.py \
--path . \
--framework auto \
--output json
Verify:
JSON output is valid
Exit code is 0 for success, 1 for failure
Telemetry data is present
Errors are structured
Extending Commands
To add new commands:
Create scripts/<command_name>.py
Follow the standard response format
Add command contract to references/command-contracts.yaml
Update this SKILL.md with usage documentation
Make script executable: chmod +x scripts/<command_name>.py
Test independently before integrating
Philosophy
Commands are the foundation layer of BMAD's 3-layer architecture: