/test
Run tests with coverage reporting and quality gates.
Usage
code
/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:
- •Run full quality suite, not just tests
- •Check
prd/00_technology.mdfor project-specific commands:bash{lint_command} # Linting {type_check_command} # Type checking {test_coverage_command} # Tests with coverage - •Report on all aspects: tests, coverage, linting, type checking
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.mdto find the correct test commands - •
Run tests with coverage (example patterns):
bash# See prd/00_technology.md for your specific command {test_runner} tests/ --coverage - •
Report results:
code==================== 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
bash
# Test a specific file /test tests/unit/test_config # Test a specific class/describe /test tests/unit/test_api::TestHealthCheck # Test a specific function/it /test tests/unit/test_api::test_health_check # Test a directory /test tests/integration/
Coverage Analysis
- •
If coverage < minimum:
code⚠️ 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
code
$ /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% ✅