agentleFS
troskatertroskater/flowdeck-claude/skills/test-gap-detector/SKILL.md

test-gap-detector

Skill0 starsChanged 23 days agoMITView on GitHub

Identify which areas of a proposed change are weakly covered by tests and suggest the minimum high-value tests to add first.

The file

We split this skill into the rules it gives an agent

2 rules. About 0 are common, 1 is distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Check <fd>/.codebase/FAILURES.json for prior failures on these paths — flag as regression gap if no regression test exists

    line 30
  2. Distinctive:

    Do not add tests just to hit a coverage number — add tests for real risk paths

    line 60

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

<fd> is this project's FlowDeck directory, the one fd-state path prints (~/.fd-plan/<project>/, or <project>/.fd-plan/ when the storage setting is project).

Test Gap Detector

Activate this skill before implementing a feature or fix. Get back a ranked list of coverage gaps and the minimum viable tests to close them.

Gap Categories

CategoryWhat It Means
missing test fileSource file changed but no *.test.* counterpart exists
untested error pathA catch, else, or error branch has no test
untested branchAn if/else or switch arm has no test exercising it
no integration testA service-to-service or API call has no integration test
no regression testA previously-failed path has no regression test guarding it

Workflow

  1. List all files to be changed
  2. For each file, check if a test file exists (*.test.ts, *.spec.ts, __tests__/)
  3. For files with tests, scan for untested branches:
    • Count if, else, catch, switch statements
    • Cross-reference with test file to see which paths are exercised
  4. Check <fd>/.codebase/FAILURES.json for prior failures on these paths — flag as regression gap if no regression test exists
  5. For external calls (fetch, db.query, sendEmail), check for integration test coverage
  6. Rank gaps by risk (auth > payment > data > logic > UI)
  7. Produce minimum viable test set (top 3–5 tests)

Output Format

## Test Gap Report

### Gap Summary
| File | Gap Type | Risk | Suggested Test |
|------|----------|------|----------------|

### Minimum Viable Test Set (top 5)
1. **[test name]** — [file.test.ts]
   Tests: [what it validates]
   ```typescript
   it('[test name]', async () => {
     // test skeleton
   })

Coverage Verdict: GOOD | GAPS FOUND | CRITICAL GAPS


## Guidance

- A test skeleton is always better than no test — write it even if incomplete
- Auth and payment paths with no regression test = CRITICAL GAP, block merge
- Do not add tests just to hit a coverage number — add tests for real risk paths

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.