| name | test |
| description | Run tests with coverage reporting and quality gates. |
/test
Run tests with coverage reporting and quality gates.
Usage
/test [target] [--coverage] [--watch] [--failed] [--verbose]
Arguments
target: Specific test file, directory, or test name (optional)
--coverage: Generate coverage report (default: true)
--watch: Watch mode for continuous testing
--failed: Re-run only failed tests
--verbose: Verbose output
Instructions
When this skill is invoked:
Agent Behavior (Codex-Max Pattern)
Autonomy:
- Complete test execution and analysis end-to-end
- If tests fail, analyze failures and suggest specific fixes
- If coverage is low, identify missing test cases and offer to implement them
- Don't just report results - provide actionable next steps
Thoroughness:
Problem-Solving:
- If tests fail:
- Show the failure details with file:line references
- Analyze the root cause
- Suggest or implement the fix
- Re-run tests to verify
- If coverage is low:
- Identify uncovered lines (show file:line references)
- Suggest test cases to add
- Offer to implement the missing tests
Presentation:
- Lead with overall status (pass/fail, coverage %)
- Group results logically (by test file or category)
- Use file:line references for failures and missing coverage
- Provide clear next steps
Default Run (All Tests)
-
Read prd/00_technology.md to find the correct test commands
-
Run tests with coverage (example patterns):
{test_runner} tests/ --coverage
-
Report results:
==================== Test Results ====================
✅ Passed: 42
❌ Failed: 0
⏭️ Skipped: 2
⏱️ Duration: 3.45s
==================== Coverage ====================
Name Stmts Miss Cover
-----------------------------------------------------
src/{project}/__init__ 2 0 100%
src/{project}/main 45 0 100%
...
-----------------------------------------------------
TOTAL 523 0 100%
✅ Coverage requirement met
Specific Target
/test tests/unit/test_config
/test tests/unit/test_api::TestHealthCheck
/test tests/unit/test_api::test_health_check
/test tests/integration/
Coverage Analysis
-
If coverage < minimum:
⚠️ Coverage below requirement: 95% (required: {min_coverage}%)
Missing coverage in:
- src/{project}/services/user:45-52 (error handling)
- src/{project}/api/auth:78-85 (edge case)
Suggested tests to add:
1. Test error handling in UserService.create()
2. Test authentication timeout scenario
-
Generate detailed report if available in your stack
Integration Tests
When running integration tests:
- Check dependencies are running (Docker services, etc.)
- Run with integration marker from your test framework
- Verify cleanup after tests
Quality Gates
The test skill enforces these quality gates (see prd/00_technology.md for specific values):
| Gate | Requirement | Action on Failure |
|---|
| Coverage | Minimum % | Block merge |
| All tests pass | 0 failures | Block merge |
| No skipped (without reason) | Documented skips only | Warn |
| Performance | No test > configured limit | Warn |
Example Output
$ /test
🧪 Running tests...
tests/unit/test_config::TestSettings::test_default_values PASSED
tests/unit/test_config::TestSettings::test_is_development PASSED
tests/unit/test_api::test_health_check PASSED
tests/unit/test_api::test_root_endpoint PASSED
==================== 4 passed in 0.45s ====================
📊 Coverage: 100% ✅