| name | run-tests |
| description | Execute tests with coverage analysis using bmad-commands, identify coverage gaps, and suggest missing tests. This skill should be used for test execution and quality validation. |
| acceptance | [{"tests_executed":"All matching tests successfully executed"},{"coverage_generated":"Coverage report generated successfully"},{"gaps_identified":"Coverage gaps analyzed and categorized"},{"suggestions_provided":"Missing test suggestions provided (if gaps exist)"}] |
| inputs | {"scope":{"type":"string","required":true,"description":"Test scope: task_id, file_path, or '--all'","validation":"Must be valid task ID, file path, or '--all'"},"coverage":{"type":"boolean","required":false,"description":"Generate coverage report","default":true},"framework":{"type":"string","required":false,"description":"Test framework (auto-detect or explicit: jest, pytest, junit, gtest, cargo, go)","default":"auto"}} |
| outputs | {"tests_passed":{"type":"boolean","description":"Whether all tests passed"},"total_tests":{"type":"number","description":"Total number of tests executed"},"passed_tests":{"type":"number","description":"Number of tests that passed"},"failed_tests":{"type":"number","description":"Number of tests that failed"},"coverage_percent":{"type":"number","description":"Overall test coverage percentage"},"coverage_gaps":{"type":"array","description":"List of identified coverage gaps with criticality"}} |
| telemetry | {"emit":"skill.run-tests.completed","track":["scope","framework","total_tests","passed_tests","failed_tests","coverage_percent","duration_ms","gaps_count"]} |
Run Tests Skill
Purpose
Execute tests, generate coverage reports, analyze coverage gaps, and suggest missing tests to improve code quality and test completeness.
Core Capabilities:
- Test execution via bmad-commands
- Coverage report generation and analysis
- Gap identification with criticality assessment
- Missing test suggestions with concrete examples
Prerequisites
- Test framework configured (Jest, Pytest, JUnit, Google Test, Cargo, Go Test, or any custom framework)
- Tests written for the code being tested
- bmad-commands skill available at
.claude/skills/bmad-commands/
- Project dependencies installed
Framework Support:
- Auto-detection: Automatically detects Jest, Pytest, JUnit, GTest, Cargo, Go Test
- Explicit: Specify framework with
--framework <name>
- Custom: Add custom frameworks via
.claude/config.yaml (see bmad-commands/FRAMEWORK-EXTENSION-GUIDE.md)
Workflow
Step 0: Determine Test Scope
Action: Parse input and identify which tests to run.
Scope Types: Task-based (extract keywords → pattern → find tests), File-based (find corresponding test file), All tests (run all **/.test.)
See: references/templates.md#step-0-scope-determination-templates for complete examples
Step 1: Execute Tests
Action: Use bmad-commands to run tests.
Execute: python .claude/skills/bmad-commands/scripts/run_tests.py --path . --framework auto --output json
Parse Response: Extract success, outputs (passed, total_tests, coverage_percent, failures), telemetry, errors
If tests fail: Report failed tests with details, suggest fixes, do not proceed with coverage analysis
See: references/templates.md#step-1-test-execution-templates for complete response formats and error handling
Step 2: Generate Coverage Report
Action: Parse coverage data and generate reports.
Coverage Metrics: Statements, Branches, Functions, Lines (each with covered/total/percent)