agentleFS
cirnecirne/agent-skills/skills/coverage/SKILL.md

coverage

Skill2 starsChanged 5 months agoMITView on GitHub

Measures, assesses, and improves test coverage with risk/feasibility triage — and flags coverage theater (shallow string/source mirrors). Use when the user invokes /coverage, asks which areas need tests, wants to add coverage for a specific area, or asks about coverage gaps, priorities, or weak/theater tests.

15 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use adr, plan and 5 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • asterkinSkill

    adr

    Create Architecture Decision Records (ADRs) following project standards. Guides template usage, process, and best practices for documenting architecturally significant decisions.

    Also in 3 projects that use this

  • BlockSkill

    plan

    Draft a TDD, PRD, or lightweight plan in the conversation without committing it.

    Also in 4 projects that use this

  • GitHubSkill

    refactor

    Surgical code refactoring to improve maintainability without changing behavior. Covers extracting functions, renaming variables, breaking down god functions, improving type safety, eliminating code smells, and applying design patterns. Less drastic than repo-rebuilder; use for gradual improvements.

    Also in 3 projects that use this

  • OpenAISkill

    audit

    Audit or critique a product flow, journey, workflow, funnel, onboarding path, checkout path, settings path, screen, or multi-step product experience by capturing screenshots first, then reporting UX, design, and accessibility findings inline from that evidence. Use Figma only when the user explicitly asks for a board. Use when the user asks to audit, review, critique, inspect, assess, analyze, evaluate, or give feedback on a product experience.

    Also in 3 projects that use this

  • SentrySkill

    review

    Fixture review skill.

    Also in 3 projects that use this

  • MicrosoftSkill

    release

    Use ONLY when the user explicitly asks to cut/publish a Huabu desktop release or tag a version. Performs an outward action — bumps the version in apps/desktop/package.json, commits + annotated-tags vX.Y.Z, and pushes the branch + tag. That tag push auto-builds the macOS/Windows installers and publishes a GitHub Release. Provides `status`, `bump`, `tag-push`, and a one-command `run` (bump → tag-push).

    Also in 3 projects that use this

The file

We split this skill into the rules it gives an agent

8 rules. 0 are common, 6 are distinctive, and 2 are very specific to this project.

  • 0

    Common

    Most of the 13 edited versions we read keep these.

  • 6

    Distinctive

    This author's own choices. Worth a look.

  • 2

    Very specific

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

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

    Run via /tests logging rules (full logs, no pipe).

    line 19
  2. Very specific:

    Refuse / skip: when the only win is covering another if in an already well-tested file with no distinct product stake.

    line 38
  3. Distinctive:

    Prefer ≤3 distinct cases per pass (one behavior per case.

    line 43
  4. Distinctive:

    One or two anchor phrases max: when copy *is* the contract (e.g.

    line 75
  5. Distinctive:

    Run the project coverage command.

    line 84
  6. Distinctive:

    Prefer (in order): (1) named missing behaviors in the gap tracker, (2) rewrite/delete theater, (3) residual % only when the case is a …

    line 95
  7. Distinctive:

    When an area already has tests, ask: do they lock behavior, or just wording/markup?

    line 97
  8. Distinctive:

    Add meaningful tests that pass the quality gate.

    line 105

“Common” is measured: kept by at least 6 in 10 of the 13 edited versions of this file we could read. “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

Coverage

Goal: improve real confidence and testability within reason — know gaps, prioritize by behaviors, reject theater that only mirrors implementation, accept documented blind spots where automation is poor ROI. Line/branch % is evidence, not the objective; high % with shallow assertions is a false green.

Discover repo conventions

NeedLook for
Coverage commandtest:coverage, coverage, vitest/jest/nyc config
Gap trackerdocs/coverage.md or equivalent
Test patternscomponent-testing docs, fixtures, e2e vs unit
Project overlay<repo>/.cursor/skills/coverage.local/ when present

Run via /tests logging rules (full logs, no pipe). When a project overlay exists, follow this skill first, then the overlay.

Commands

User saysDo
/coverageRefresh metrics, summarize gaps, scan for theater, recommend next targets
/coverage … need testsRank by risk × gap (behaviors, not residual %; discount theater-inflated areas)
/coverage theaterAudit for shallow mirrors; do not chase line %
/coverage add … for <area>Admission plan → behavioral tests → scoped coverage → update gap doc

Quality gate (before writing tests)

Admission criteria — for each proposed case, write (chat or PR body):

  1. Behavior — one sentence, user-visible or data-integrity
  2. Failure mode — if this regresses, user/system sees X
  3. Test shape — mount+event, HTTP route contract, pure helper, or eval — not “hit uncovered lines”

Refuse / skip when the only win is covering another if in an already well-tested file with no distinct product stake. Prefer documenting an accepted blind spot or rewriting theater over packing residual branches.

Definition of done

  • A deliberate break of the named behavior would fail the new test
  • Prefer ≤3 distinct cases per pass (one behavior per case; no mega-tests)
  • Scoped coverage % may rise as secondary evidence — never the sole success metric
  • Gap tracker updated with the behavior closed, not only a new line %

Theater (do not ship)

Coverage theater = tests that mostly assert “the code we wrote is still the code we wrote” — no logic, branches, failure modes, or user-visible outcomes exercised. Brittle under copy/CSS refactors, and false confidence.

Red flagWhy it’s weak
readFileSync / source greps on .svelte, .css, implementation textNever mounts or runs the unit; locks implementation text
Long prompt/copy toContain slogan listsMirrors wording; no branch or failure coverage
Exact Tailwind/CSS class strings or layout tokensStyle churn ≠ behavior
“Source contract” / “implements OPP-NNN” tests that only grep sourceDocuments intent in the wrong layer
Snapshot-of-prose with no inputs variedSame as string laundry lists
Mock-only route-shape spam with no product-stakes failure modeAsserts the mock, not the contract
Packing unrelated branches into one test to lift %Optimizes the metric, not the risk
Usually not theater — keepWhy it’s real
Fixture values appear / wrong values do notData plumbing
Flag on → section present; flag off → absentConditional logic
Invariants: secrets omitted, dangerous tools absent, schema shapeSafety contracts
User action → callback / navigation / persistence / error stateBehavior
Parser/transform goldens with varied inputs and edge casesLogic
Evals / judge harnesses for agent qualityOutcome-level (different layer)

Replacement heuristics — prefer tests that stay meaningful if someone rewrote the copy, renamed a CSS class, or rephrased a prompt without changing behavior:

  1. Vary inputs — empty, boundary, conflicting flags, bad data
  2. Assert outcomes — return shape, side effects, DOM roles/state, HTTP status, DB rows
  3. Assert semantic contracts — “must instruct X before Y,” “must not include secrets” — not the full slogan list
  4. One or two anchor phrases max when copy is the contract (e.g. a user-facing error code) — never a laundry list
  5. Delete or rewrite source-readFileSync tests; if line % was the only win, replace with a mount/behavior test or accept a documented blind spot

Refuse pure theater even when it would move the % needle. Project overlays may name concrete theater clusters; apply those filters too.

Workflow

1. Measure

Run the project coverage command. Prefer scoped coverage on new test files after adding them; full suite only for audits / snapshot metrics.

2. Prioritize (risk × feasibility)

Score High / Medium / Low on each axis — for behaviors, not files alone.

  • Risk: user/data harm if untested (auth, payments, sync, agent tools = high; chrome/dev-only = low)
  • Feasibility: pure functions/routes = high; full OAuth / pixel-perfect / credential e2e = low

Tackle high risk + high/medium feasibility first. High risk + low feasibility → document accepted gap + lighter substitute.

Prefer (in order): (1) named missing behaviors in the gap tracker, (2) rewrite/delete theater, (3) residual % only when the case is a distinct regression class.

When an area already has tests, ask: do they lock behavior, or just wording/markup? Theater does not reduce residual risk.

3. Choose test type

Match project norms: unit, component, integration, eval, e2e.

4. Improve and record

Add meaningful tests that pass the quality gate. Update the gap tracker when closing a tracked gap or when demoting an area from “covered” to “theater / weak.” Re-measure scoped coverage for the target.

Output

Top recommended targets (3–5) with risk, feasibility, behavior under test, suggested test shape, and theater notes (none / mild / heavy) — plus what changed in the gap doc if anything. Mark theater/weak so those gaps are not “closed.”

For /coverage add, include the admission criteria answers in the closing summary (and PR body when opening one).

Automation

Overnight / cloud coverage agents: ship ≤3 high-value cases or open no PR. If only theater-feasible work remains, update accepted blind spots / suggested next actions and exit without a test PR.

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.