Skill

test-review

Install
1
Install the plugin
$
npx claudepluginhub sd0xdev/sd0x-dev-flow --plugin sd0x-dev-flow

Want just this skill?

Add to a custom plugin, then install with one command.

Description

Test coverage review via Codex MCP. Use when: reviewing test sufficiency, identifying coverage gaps, test quality audit. Not for: generating tests (use codex-test-gen), code review (use codex-code-review). Output: coverage analysis + gap report.

Tool Access

This skill is limited to using the following tools:

mcp__codex__codexmcp__codex__codex-replyBash(git:*)ReadGrepGlobWrite
Supporting Assets
View in Repository
references/codex-prompt-ac-trace.md
references/codex-prompt-test-gen.md
references/codex-prompt-test-review.md
Skill Content

Test Review Skill

Trigger

  • Keywords: test coverage, test review, are tests sufficient, generate tests, test gen, coverage

When NOT to Use

  • Code review (use codex-code-review)
  • Document review (use doc-review)
  • Just want to run tests (use /verify)

Commands

CommandDescriptionUse Case
/codex-test-reviewReview test sufficiencyRequired
/codex-test-genGenerate unit testsAdd missing tests
/check-coverageTest coverage analysisAfter feature dev

Workflow: /codex-test-review

Smart detect target → Read test + source → Codex review (5 dimensions) → Coverage assessment + Gate → Loop if Needs additions

Step 1: Smart Detection

InputBehavior
File pathReview that file directly
DirectoryReview all tests in directory
DescriptionAuto-find related test files
Module nameSearch related test files
No parameterAuto-detect from git diff

Step 2: Read Test and Source

  • Read test file (TEST_FILE)
  • Read corresponding source (SOURCE_FILE, inferred from test path)

Step 3: Codex Review

First review: mcp__codex__codex with test review prompt. See references/codex-prompt-test-review.md.

Loop review: mcp__codex__codex-reply with re-review template. See references/codex-prompt-test-review.md.

Config: sandbox: 'read-only', approval-policy: 'never'

Save the returned threadId.

Workflow: /codex-test-review --ac-trace

AC traceability mode — maps Acceptance Criteria from request docs to test evidence.

--ac-trace input → Read request doc → Parse ACs → Filter quality-gate → Search evidence → Codex verify → Matrix + Gate

Step 1: Input Resolution

InputBehavior
--ac-trace <request-path>Read specified request doc
--ac-trace (no path)Auto-detect from docs/features/*/requests/*.md via git diff context
No --ac-traceExisting behavior (5-dimension coverage review)

Step 2: Parse & Filter ACs

  1. Locate ## Acceptance Criteria section in request doc
  2. Parse - [ ] / - [x] items
  3. Filter out quality-gate ACs matching: /codex-review-fast, /codex-review-doc, /codex-review, /precommit, /precommit-fast, /pr-review

Step 3: Search Evidence

For each non-quality-gate AC:

Evidence TypePriorityHow to Find
Automated test1 (preferred)Search Related Files test paths; match AC text → test assertions
Runtime verification2Search /feature-verify results at L3+ confidence
Manual exception3 (verified only)Check AC annotation <!-- exception: REASON, expires: DATE -->

Step 4: Codex Verify (independent)

Fresh thread (mcp__codex__codex). See references/codex-prompt-ac-trace.md.

RuleDetail
Cacherequest-path + git diff hash key; same session reuse
Timeout30s → fallback to Claude-only + ⚠️ Inconclusive
UnavailableAll items ⚠️ Inconclusive; advisory → ⚠️ Adequate with exceptions; strict → ⚠️ Need Human

Config: sandbox: 'read-only', approval-policy: 'never'

Save the returned threadId.

Step 5: Exception Validation (3-gate)

GateCheck
Reason classClosed enum: ENV_UNAVAILABLE / UNSAFE_TO_AUTOMATE / ONE_TIME_MIGRATION
Codex verificationMust emit VALID_EXCEPTION
ExpiryISO 8601; expired = ⛔ (strict) or ⚠️ (advisory)

Exception caps (from @rules/testing.md): 1-8 AC = max 1; 9-12 = max 2; 13+ = hard cap 2. Prohibited domains: Security AC, Data-integrity AC, Regression AC = no exceptions allowed.

Step 6: Output + Gate

Gate sentinels (from @rules/testing.md):

SentinelMeaning
✅ AdequateAll ACs covered by evidence
⚠️ Adequate with exceptionsValidated exceptions within cap
⚠️ Need HumanCodex unavailable or inconclusive
⛔ InadequateUnverified exception, cap breach, or prohibited domain

Workflow: /codex-test-gen

Read source → Derive test path → Codex generate → Save test file → Suggest review

Steps

  1. Read source file
  2. Derive test path: src/service/xxx.tstest/unit/service/xxx.test.ts
  3. Codex generates tests. See references/codex-prompt-test-gen.md.
  4. Save to target path
  5. Suggest: run tests then /codex-test-review

Review Dimensions

DimensionScoring CriteriaWeight
Happy pathAll public methods, main flowsHigh
Error handlingtry/catch, error callbacksHigh
Edge casesnull/undefined, extremes, empty setsMedium
Mock qualityNot excessive, not insufficientMedium

Three-Layer Tests

TypeDirectoryMockFocus
Unittest/unit/FullSingle function
Integrationtest/integration/Only externalInter-module
E2Etest/e2e/ProhibitedComplete flow

Common Boundaries

TypeCases
String"", " ", null, undefined, very long
Number0, -1, NaN, Infinity, MAX_SAFE_INTEGER
Array[], [null], very large, nested
Object{}, null, circular reference

Review Loop

⚠️ @CLAUDE.md auto-loop: fix → re-review → ... → ✅ PASS ⚠️

⛔ Needs additions → add tests → /codex-test-review --continue <threadId> → repeat until ✅ Sufficient.

Max 3 rounds. Still failing → report blocker.

Output

## Test Coverage Review
| Dimension | Coverage | Rating |
|-----------|----------|--------|
| ...       | ...      | ⭐1-5  |

### Gate: ✅ Tests sufficient / ⛔ Needs additions

Verification

  • Coverage assessment includes all dimensions
  • Gate is clear (✅ Tests sufficient / ⛔ Needs additions)
  • Missing tests have specific code suggestions
  • Codex independently researched source code branches

References

  • Test review prompt: references/codex-prompt-test-review.md
  • Test gen prompt: references/codex-prompt-test-gen.md
  • AC trace prompt: references/codex-prompt-ac-trace.md
  • Standards: @rules/testing.md

Examples

Input: /codex-test-review test/unit/service/xxx.test.ts
Action: Read test + source → Codex review → Coverage assessment + Gate

Input: /codex-test-gen src/service/xxx.ts
Action: Read source → Codex generate → Save test → Suggest review

Input: Are this service's tests sufficient?
Action: /codex-test-review → Assess coverage → Output gaps + Gate

Input: /codex-test-review --ac-trace docs/features/auth/requests/2026-03-01-login.md
Action: Parse AC → Filter quality-gate → Search evidence → Codex verify → Matrix + Gate
Stats
Stars90
Forks12
Last CommitMar 18, 2026
Actions

Similar Skills