一键导入
review-tests
Test quality review skill. Evaluates test validity, coverage thresholds, BDD scenario matching, edge cases, test structure, and error path testing.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Test quality review skill. Evaluates test validity, coverage thresholds, BDD scenario matching, edge cases, test structure, and error path testing.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Test failure diagnosis, source code fixes, and regression detection
Environment verification, dependency installation, baseline test verification
Contract-first single-task implementation dispatched by Coder Coordinator
Integration test writing for component boundaries and external dependencies
Unit test writing and execution with coverage threshold enforcement
API reference documentation skill. Produces and updates API endpoint documentation from contract files in .sdd/docs/api-reference.md.
| name | review-tests |
| description | Test quality review skill. Evaluates test validity, coverage thresholds, BDD scenario matching, edge cases, test structure, and error path testing. |
| argument-hint | Invoked by Review Coordinator - do not call directly |
This skill is invoked by the Review Coordinator as a subagent. It evaluates all test files associated with a WP across 6 quality dimensions, checking that tests exercise real behavior and meet coverage thresholds.
Input contract (received via subagent prompt):
#tool:search/searchSubagent to find test files matching WP scope patterns. Use #tool:search/usages to verify test coverage of contract symbols.Constraint: Do NOT modify any test files, source code, WP file, or spec file. Only write to the specified output path (FR-028).
Before evaluating, identify all test files for this WP:
tests/, test/, __tests__/, or spec/ directoriesTest requirements fields to identify expected test types (unit, integration, BDD, E2E, none)assert True, assertTrue(True), or equivalent vacuous assertions?pass, ..., or a docstring)?assert, expect, should, or equivalent)?Detection patterns (adapt for the project's language):
assert True, self.assertTrue(True), def test_*(): pass, def test_*(): ...expect(true).toBe(true), it('...', () => {}), test('...', () => {})# pragma: no cover, /* istanbul ignore */, or equivalent exclusions?If coverage tooling is configured: read existing coverage reports (e.g., htmlcov/, coverage.xml, .coverage, lcov.info, coverage/lcov-report/) and report actual thresholds found in the reports. If no reports exist, check the coverage configuration (e.g., pytest-cov in pyproject.toml, .coveragerc, jest --coverage in package.json, .nycrc) and flag as WARN - "Coverage tooling is configured but no coverage reports found. Cannot verify thresholds." Do NOT execute test runners or coverage tools (NFR-004: static analysis only).
If coverage tooling is NOT configured: flag as WARN - "No coverage tooling configured. Cannot verify thresholds."
assert True, empty test bodies, no assertions, mocking entire subject under testUse N/A with justification when a checklist dimension does not apply to this WP. Example justifications:
Write findings to the specified output path using the format below. Finding IDs use the TEST- prefix.
---
skill: review-tests
wp: <WP-ID>
spec: <spec-path>
reviewed_at: <ISO-8601-timestamp>
status: completed
finding_counts:
pass: <count>
warn: <count>
fail: <count>
na: <count>
files_reviewed:
- <test-file-1>
- <test-file-2>
- <source-file-checked-for-coverage>
---
# review-tests Findings for <WP-ID>
## Summary
<Brief overview: number of test files reviewed, test count, overall test quality assessment.>
## Findings
### TEST-001 [FAIL]
- **Checklist item**: Test Validity - Vacuous test
- **Requirement**: FR-040 dimension 1
- **File**: tests/test_users.py#L25-L28
- **Description**: Test `test_user_creation` contains only `assert True`.
- **Expected**: Test should assert specific behavior of the user creation function.
- **Evidence**:
```python
def test_user_creation():
assert True
test_1 has a non-descriptive name.test_parse_config_returns_default_on_missing_key.def test_1():
---
## Quality Checklist
Before completing, verify:
- [ ] Test validity checked (tests actually assert meaningful behavior)
- [ ] Coverage thresholds evaluated against spec requirements
- [ ] BDD scenarios matched to acceptance criteria
- [ ] Edge cases from spec tested
- [ ] Error paths have dedicated test cases
- [ ] `finding_counts` match actual findings in the output
- [ ] `files_reviewed` lists every file read during this review