Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Trace codepaths in diffs, map against tests, auto-generate missing coverage — use before shipping PRs
.claude/skills/hashgraph-online-skill-coverage-audit/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-05 | ✗→✓ | ▲ Improved | 76% | 0% |
| case-06 | ✗→✓ | ▲ Improved | 91% | 0% |
| case-09 | ✗→✓ | ▲ Improved | 113% | 0% |
| case-13 | ✗→✓ | ▲ Improved | 46% | 0% |
| case-18 | ✗→✓ | ▲ Improved | 63% | 0% |
> Host: Codex CLI — This skill was designed for Claude Code and adapted for Codex. > Cross-reference commands use installed skill names in Codex rather than /octo:* slash commands. > Use the active Codex shell and subagent tools. Do not claim a provider, model, or host subagent is available until the current session exposes it. > For host tool equivalents, see skills/blocks/codex-host-adapter.md.
Trace every codepath in a diff, map each path against existing tests, visualize coverage gaps, and auto-generate tests for uncovered paths.
Core principle: Trace codepaths in changed files -> Map against existing tests -> Score coverage quality -> Generate tests for gaps -> Report before/after counts.
These hard limits prevent runaway analysis:
Determine the diff scope. Use the most relevant source:
bash# PR diff git diff --name-only main...HEAD # Staged changes git diff --name-only --cached # Last commit git diff --name-only HEAD~1..HEAD
Filter to source code files only (exclude configs, docs, generated files).
For each changed file, you MUST trace:
if/else, switch/case, ternary, and pattern match. Each branch is a separate codepath.catch, throw, error return, validation failure, and early return with error. WHY: Error paths are the most common source of untested bugs.Produce a structured inventory:
markdown## Codepath Inventory: [filename] | # | Path Description | Type | Risk | |---|-----------------|------|------| | 1 | validateUser() happy path | conditional | low | | 2 | validateUser() missing email | error | medium | | 3 | validateUser() invalid format | error | medium | | 4 | processOrder() empty cart guard | guard | high | | 5 | processOrder() payment timeout | error | high | | 6 | processOrder() success | conditional | low |
Type categories: conditional, error, guard, loop-boundary, integration, async
Risk assessment: high = user-facing failure or data loss, medium = degraded behavior, low = cosmetic or logging
For each file in the diff, search the test directory for related tests:
bash# Find test files that reference the changed file or its exports # Search by filename pattern find tests/ -name "*[changed_file_stem]*" -type f # Search by import/require of the changed module grep -rl "import.*from.*[module_name]" tests/ grep -rl "require.*[module_name]" tests/ # Search by function name references grep -rl "[function_name]" tests/
For each codepath, assess existing test coverage with this rubric:
| Rating | Meaning | Criteria | |--------|---------|----------| | ★★★ | Behavior + edge cases tested | Tests assert behavior AND cover boundary conditions, error cases, and edge inputs | | ★★ | Happy path tested | Tests cover the success path but miss error branches or edge cases | | ★ | Smoke test only | Test exists but only checks the function runs without error (no meaningful assertions) | | ☆ | No test found | No test references this codepath at all |
Map each codepath to its test coverage:
markdown## Coverage Map: [filename] | # | Codepath | Test File | Rating | Notes | |---|----------|-----------|--------|-------| | 1 | validateUser() happy path | test-user.sh:42 | ★★★ | Asserts valid + invalid inputs | | 2 | validateUser() missing email | test-user.sh:58 | ★★ | Tests missing, not malformed | | 3 | validateUser() invalid format | -- | ☆ | No test for format validation | | 4 | processOrder() empty cart guard | -- | ☆ | Guard clause untested | | 5 | processOrder() payment timeout | test-orders.sh:30 | ★ | Checks no crash, no assertions | | 6 | processOrder() success | test-orders.sh:15 | ★★★ | Full integration test |
After completing the map, produce an ASCII coverage summary. This is the primary output artifact.
COVERAGE: 5/12 paths tested (42%)
Code paths: 3/5 (60%)
User flows: 2/7 (29%)
GAPS: 7 paths need testsBreak down by category:
BY TYPE:
conditional: 3/4 tested (75%) ████████░░
error: 1/5 tested (20%) ██░░░░░░░░
guard: 0/2 tested (0%) ░░░░░░░░░░
integration: 1/1 tested (100%) ██████████
BY RISK:
high: 1/3 tested (33%) ███░░░░░░░
medium: 2/5 tested (40%) ████░░░░░░
low: 2/4 tested (50%) █████░░░░░Use full block for covered and light shade for uncovered. 10-character bar. Always show exact fractions and percentages.
Before generating any tests, you MUST detect the project's testing patterns:
markdown**Detected Test Conventions:** - Framework: [jest/vitest/pytest/bash/go test/etc.] - Location: [tests/ | __tests__/ | src/**/*.test.* | etc.] - Naming: [test-*.sh | *.test.ts | *_test.go | etc.] - Style: [BDD describe/it | xUnit | TAP | custom] - Helpers: [test-utils.ts | conftest.py | helpers/ | etc.] - Assertion library: [built-in | chai | assert | etc.]
For each no-test and smoke-only codepath, generate a test that:
For each generated test, show:
markdown### Generated: test for [codepath description] **Covers:** Codepath #N from [filename] **Raises coverage:** from no-test to full coverage [test code block]
After generating all tests, show the coverage change:
BEFORE: 5/12 paths tested (42%)
AFTER: 11/12 paths tested (92%)
New tests generated: 6
Remaining gaps: 1 (manual review needed)Coverage audit runs as a complement to code review. When invoked during deliver phase:
If coverage audit finds gaps in new code, recommend the user adopt TDD for the next iteration. Coverage audit fixes existing gaps; TDD prevents future ones.
After generating tests, use skill-verification-gate to run the test suite and confirm the new tests pass.
| Action | Why It Is Wrong | |--------|-----------------| | Count lines instead of paths | Line coverage misses branch coverage entirely | | Generate tests without checking conventions | Tests that do not match project style will be rejected | | Test implementation details | Brittle tests that break on refactoring | | Skip error paths | Error paths are where most bugs live | | Exceed the 30-path cap | Analysis becomes unfocused and slow | | Generate more than 20 tests | Diminishing returns; focus on highest impact | | Spend more than 2 min on one path | Mark as needs-manual-review and move on |
1. TRACE -> Identify all codepaths in the diff (max 30)
2. MAP -> Find existing tests for each path
3. SCORE -> Rate coverage quality (no-test / smoke / happy-path / full)
4. DIAGRAM -> ASCII coverage visualization
5. GENERATE -> Auto-create tests for gaps (max 20)
6. REPORT -> Before/after test counts| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | fail→fail | 29,232 | 11,122 | -62% | 1 | 1 | 0% | 5,661 | 2,796 | -51% | 0 | 0 | — |
case-02 | fail→fail | 19,062 | 12,304 | -35% | 1 | 1 | 0% | 3,942 | 2,813 | -29% | 0 | 0 | — |
case-22 | fail→fail | 12,366 | 13,938 | +13% | 1 | 1 | 0% | 1,721 | 3,420 | +99% | 0 | 0 | — |
case-23 | pass→pass | 14,835 | 13,794 | -7% | 1 | 1 | 0% | 2,969 | 4,926 | +66% | 0 | 0 | — |
case-03 | fail→fail | 26,302 | 16,126 | -39% | 1 | 1 | 0% | 4,122 | 2,737 | -34% | 0 | 0 | — |
case-04 | pass→pass | 13,735 | 11,045 | -20% | 1 | 1 | 0% | 2,194 | 3,404 | +55% | 0 | 0 | — |
case-05 | fail→pass | 17,841 | 6,339 | -64% | 1 | 1 | 0% | 1,981 | 3,490 | +76% | 0 | 0 | — |
case-06 | fail→pass | 17,149 | 4,561 | -73% | 1 | 1 | 0% | 1,623 | 3,099 | +91% | 0 | 0 | — |
case-07 | pass→pass | 9,436 | 8,643 | -8% | 1 | 1 | 0% | 706 | 2,829 | +301% | 0 | 0 | — |
case-08 | pass→pass | 4,759 | 8,823 | +85% | 1 | 1 | 0% | 784 | 2,735 | +249% | 0 | 0 | — |
case-09 | fail→pass | 6,957 | 3,097 | -55% | 1 | 1 | 0% | 1,343 | 2,860 | +113% | 0 | 0 | — |
case-10 | pass→pass | 16,157 | 10,615 | -34% | 1 | 1 | 0% | 1,878 | 3,280 | +75% | 0 | 0 | — |
case-11 | pass→pass | 17,494 | 8,389 | -52% | 1 | 1 | 0% | 2,008 | 2,948 | +47% | 0 | 0 | — |
case-12 | pass→pass | 11,077 | 9,026 | -19% | 1 | 1 | 0% | 1,906 | 2,986 | +57% | 0 | 0 | — |
case-13 | fail→pass | 15,766 | 3,047 | -81% | 1 | 1 | 0% | 1,949 | 2,848 | +46% | 0 | 0 | — |
case-14 | pass→pass | 7,639 | 1,847 | -76% | 1 | 1 | 0% | 1,361 | 2,656 | +95% | 0 | 0 | — |
case-15 | fail→fail | 3,753 | 11,724 | +212% | 1 | 1 | 0% | 583 | 2,653 | +355% | 0 | 0 | — |
case-16 | pass→pass | 16,169 | 4,741 | -71% | 1 | 1 | 0% | 1,807 | 3,134 | +73% | 0 | 0 | — |
case-17 | pass→pass | 13,102 | 7,163 | -45% | 1 | 1 | 0% | 2,106 | 3,429 | +63% | 0 | 0 | — |
case-18 | fail→pass | 13,571 | 6,364 | -53% | 1 | 1 | 0% | 2,122 | 3,457 | +63% | 0 | 0 | — |
case-19 | pass→pass | 13,961 | 9,229 | -34% | 1 | 1 | 0% | 2,281 | 3,852 | +69% | 0 | 0 | — |
case-20 | fail→fail | 4,079 | 4,340 | +6% | 1 | 1 | 0% | 698 | 3,007 | +331% | 0 | 0 | — |
case-21 | pass→fail | 21,988 | 4,957 | -77% | 1 | 1 | 0% | 3,444 | 2,588 | -25% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 23 cases were attempted, and 18 counted toward the lift figure. The other 5 produced results that are not comparable between the two arms, so they are excluded from the headline rather than averaged into it. The headline lift of +17 percentage points is the difference between those two pass rates over the 18 comparable cases. 2 cases got worse with the skill loaded, and they are included in that figure.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.