agentleFS
Beskars-CodeBeskars-Code/Skills/skills/test-audit/SKILL.md

test-audit

Skill0 starsChanged 5 days agoMITView on GitHub

Use when the user asks to audit, prune, sweep, or clean up existing tests, or to find low-value ones. Prunes one evidenced batch without waiting for approval and reports how to restore it. Not for writing new tests.

80 other projects use a version of this, 1 of them edited.

Adopted by

Most recently taken up by

Used with

Projects with it also use chips, redo and 10 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.
  • udecodeSkill

    chips

    Run the project's suggested-task ledger, the chips. /chips alone brings this session's open tasks up to date: it applies what the ledger helper says, settles stale and split tasks, cards what can start and reports the board, and /chips all also takes the ship-list tasks and the ones no live session owns, and merges duplicate tasks across the board. Use for /chips, /chips offer, start or drop, \"what chips are open\", \"suggest a task for X\", \"update the chips\", \"clean up the chips\", \"which chips are stale\", \"is this chip still worth doing\", \"merge duplicate chips\", at the last hand-back of a run that offered a task, and whenever pstack would file a tracked issue, a follow-up, a reflect Backlog item or an out-of-band PR.

    Also in 3 projects that use this

  • Scylla23Skill

    redo

    Re-run the last routed task one model tier up (haiku → sonnet → opus → fable). User-invoked escalation when the previous result missed. Pass --dry-run to preview without running.

    Also in 3 projects that use this

  • Aetheria-Labs1Skill

    plan-page

    Plan one storefront page from strategy through final copy, section order, proof, offers, template direction, responsive layout, and production asset requirements. Stops at an approved execution-ready specification.

    Also in 3 projects that use this

  • SocialKit-APISkill

    video-transcripts

    Extract transcripts from social videos through SocialKit across YouTube, TikTok, Instagram, Facebook, X/Twitter, LinkedIn, and direct video file URLs. Use when the user asks to transcribe, get captions or subtitles, pull the spoken text, or read what a video says, including one video or many at once. Returns full text plus timestamped segments. Not for posting, private accounts, or unrelated website scraping.

    Also in 3 projects that use this

  • clawdbotSkill

    pr-simplify

    Simplify your own change to its smallest complete fix. Use before opening a PR, before pushing large repairs to one, or when asked to shrink a PR or clean up slop.

    Also in 3 projects that use this

  • spitoglouSkill

    technical-documentation

    Create and improve technical documentation including architecture designs, PRDs, API docs, code explanations, and visual diagrams. Use when asked to document systems, explain codebases, create design documents, write PRDs, generate Mermaid/PlantUML diagrams, review architecture, write user stories, or create pull request descriptions. Triggers include "document this", "create a design doc", "explain this code", "write a PRD", "create a diagram", "architecture overview", "user story for", "PR description".

    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, 7 are distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 76 edited versions we read keep these.

  • 7

    Distinctive

    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. Distinctive:

    Every run: code-quality.md, code-structure.md, and testing.md.

    line 20
  2. Distinctive:

    Before asking the user anything: Asking the user.

    line 22
  3. Distinctive:

    Delete obsolete test-only exports, globals, wrappers, and dead production paths outright, leaving no aliases.

    line 62
  4. Distinctive:

    Prefer a net-negative production line count.

    line 65
  5. Distinctive:

    Run the smallest owner and sibling tests with the repo's own runner and a path or filter.

    line 71
  6. Distinctive:

    Run targeted formatting, then git diff --check.

    line 73
  7. Very specific:

    Run /review on the local branch diff.

    line 75
  8. Distinctive:

    Before a push, run the CI mirror.

    line 76

“Common” is measured: kept by at least 6 in 10 of the 76 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

Test audit

Find existing tests that cost more than they protect, prove it with evidence, and remove or repair one coherent batch, then report it with a way to restore it. Optimize for confidence, not deletion count.

Two modes share one value bar:

  • Audit (default): a focused sweep for a few high-confidence candidates.
  • Campaign: prune every test one subsystem owns (one package, plugin, or core area) in one PR. Before starting one, read campaign.md.

Adapted from openclaw test-audit (MIT).

Read when

  • Every run: code-quality.md, code-structure.md, and testing.md. The mandatory No tautological tests rule, junk patterns, and retention bar live there, not here.
  • Throughout: keep judgment in the main context and hand large reads to a subagent (main-context.md). Discovery and ledgers are subagent work.
  • Before asking the user anything: Asking the user. Findings follow Plain language.
  • Running checks: tooling.md. Shipping: shipping.md.

Contract

  • Discovery is read-only. Change tests, fixtures, or source only for the batch whose evidence is complete, and keep that batch restorable on its own.
  • This skill does not add new coverage. Moving a retained regression to its owner or repairing a vacuous assertion is part of the batch. A new test follows testing.md and needs the user's acceptance.
  • A test that must change for a behavior-preserving reorganization is suspect, not automatically deletable.
  • User start only. /task does not nest this skill.

Value bar

A test earns its maintenance cost by protecting behavior, a credible regression, or an independently meaningful contract.

Before judging a candidate, read the complete test and its production owner: the entry point, callers, callees, sibling implementations, overlapping tests, CI routing, and relevant history. Read the root and scoped AGENTS.md files first. When the test claims dependency-backed behavior, read the dependency source or types directly.

Process

  1. Scope. Name the area and the mode. If the user named nothing, pick the area with the most likely candidates and list it under Decided for you.
  2. Discover. Hunt for the junk patterns. For a broad scope, give each production owner area to a parallel read-only subagent (for example core packages, plugins or integrations, UI and apps, scripts and tooling, plus one cross-cutting pattern sweep). Ask each for short candidate rows, not file dumps. Prefer a few high-confidence candidates over a large speculative list.
  3. Record evidence. Fill every candidate evidence field. A missing field means the candidate is not ready. Check each against the retention bar; a match is a retained false positive, not a candidate.
  4. Edit the batch in the edit shape, keeping it separate from other changes so it can be restored on its own.
  5. Validate with the validation steps.
  6. Hand off with the handoff. Offer the next high-confidence batch as a separate follow-up, not folded into this one.

Candidate evidence

FieldWhat to record
TestExact name and file
DetectsThe failure it can actually catch
CallersNon-test callers of the covered production or test-support hook
Remaining proofThe stronger owner-boundary test that stays, or why no proof is needed
HistoryWhy the test or hook exists (commit, PR, or issue)
UnlocksProduction or test-support code the deletion removes
RiskWhat could be lost, and the focused command that validates it

Edit shape

  • One coherent owner-boundary batch per change.
  • Delete obsolete test-only exports, globals, wrappers, and dead production paths outright, leaving no aliases.
  • Move retained regressions to their canonical owner.
  • Fold repeated package or dependency assertions into one generic contract.
  • Prefer a net-negative production line count. Add no replacement tests that restate the same implementation. Leave an uncertain candidate alone instead of cleaning it up to raise the deletion count.

Validation

Edit source or tests only when no test watcher is running in the checkout.

  1. Run the smallest owner and sibling tests with the repo's own runner and a path or filter.
  2. For a removed source grep or plan assertion, run the script or dry-run that owns the real contract.
  3. Run targeted formatting, then git diff --check.
  4. Inspect git diff --numstat. Report production and tooling lines apart from test and test-support lines.
  5. Run /review on the local branch diff.
  6. Before a push, run the CI mirror.

Handoff

## Test audit
- **Removed:** <categories, with test count>
- **Production simplified:** <hooks, exports, dead paths removed>
- **Kept on purpose:** <false positives and the contract each guards>
- **Proof run:** `<command>`: pass | fail
- **Lines:** production <+/->, tests and support <+/->
- **PR:** <link and state, or not shipped>
- **Restore:** <exact command that brings the batch back>
- **Next batch:** <named follow-up, or none>

Anti-patterns

  • Deleting a test because it is static, slow, or looks like implementation, without proving another test owns the contract
  • Deleting a test that fails on the current code instead of treating it as a possible bug
  • Pasting whole test files into chat instead of evidence rows

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.