agentleFS
dip497dip497/hivemind/.claude/skills/test-audit/SKILL.md

test-audit

Skill17 starsChanged 12 days agoMITView on GitHub

Use whenever writing, changing or reviewing a test in hivemind. The authoring gate every new or changed test must pass, the junk patterns it rejects, what makes an existing test worth keeping, and how to prove a test can fail. Adapted from openclaw's test-audit skill at the maintainer's request.

83 other projects use a version of this, 3 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. /chips sync runs the same sweep but offers no card, and it moves the waits on plans idle for a week to a fresh verdict. Use for /chips, /chips sync, /chips offer, start or drop, \"update the chips without new cards\", \"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

3 rules. 0 are common, 3 are distinctive, and 0 are very specific to this project.

  • 0

    Common

    Most of the 80 edited versions we read keep these.

  • 3

    Distinctive

    This author's own choices. Worth a look.

  • 0

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Before adding or changing a test, answer four questions.

    line 15
  2. Distinctive:

    call-shape tests (call counts, "called with") of private helpers that real boundaries cover.

    line 37
  3. Distinctive:

    Keep a test that independently enforces a public API, protocol, config, migration, storage, security, platform, default, package or release …

    line 52

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

The maintainer's rule: every test written or changed here passes this gate. It is adapted from openclaw's test-audit skill (MIT, © 2026 OpenClaw Foundation): the gate, the junk patterns and the retention bar are theirs, and the commands and examples are ours.

Authoring gate

Before adding or changing a test, answer four questions. A missing answer means the test does not go in yet.

  1. What observable behaviour, invariant or independent contract does it protect?
  2. What credible regression makes it fail?
  3. Why does existing coverage not already catch that? Each contract has one owner test at the strongest boundary. Another layer needs its own distinct risk, such as a transport, lifecycle or wiring failure the owner cannot reach. Prefer a new row in a table-driven test, or a shared fixture, over a near-duplicate test.
  4. Does it need a production seam (an export, option, flag, clock, hook) that no production caller needs? Then test at the real boundary and do not add the seam.

A test that would break under a behaviour-preserving refactor is asserting implementation. Rewrite it at the owning boundary before it lands.

Junk patterns

A match fails the gate unless the retention bar below names the contract it guards.

  • assertion-free coverage probes; self-comparisons;
  • copied fixtures, inventories, manifests or export lists;
  • exact source, import or string greps;
  • call-shape tests (call counts, "called with") of private helpers that real boundaries cover;
  • the same contract asserted again in another test or at another layer;
  • tests that exist to keep a test-only export, global or wrapper alive, and production code whose only callers are tests;
  • expected values produced by the code under test (building the expected storage key with the key builder that the code also uses);
  • mocks that implement the asserted behaviour; one mock standing in for different APIs;
  • fixtures that supply what the code should produce; persistence asserted against a store the code never writes;
  • negative controls that pass for an unrelated reason ("a corrupt blob starts fresh" planted under a key the code never reads passes whatever the code does);
  • names that promise more than the test exercises.

Retention bar

Keep a test that independently enforces a public API, protocol, config, migration, storage, security, platform, default, package or release contract. Also keep call order when the order is observable, and a regression with a credible failure mode. Spelling out a literal is right when the literal is the contract: the localStorage keys earlier versions wrote, a file name on users' disks, a CLI flag. Static or slow is not a reason to delete a test.

Prove it can fail

A test that has never failed proves nothing. For each new test, make one small edit to the production code that breaks what the test guards, run the test, see it fail for the reason it names, then restore the code. A bug's regression test must fail on the code before the fix. Note the mutations that matter in the commit message or the tracker. scripts/mutate.sh <file> <exact text> <replacement> -- <test command> does the edit, the run and the restore; apps/desktop/scripts/e2e.sh <spec> -g <title> runs one e2e test.

Break code only in a tree nobody else is editing. An agent checking someone else's change works in its own copy (a worktree): a backup taken before another edit, copied back after it, puts the old file over the new one. mutate.sh will not restore over a file written during its run (it keeps the old code beside it and exits 2), and builds apps/desktop/out again when the run built the mutation into it, so nothing after it tests broken code.

Changing an existing test

Hold the lines you touch to the same gate. Deleting a test needs evidence: what it can detect, which stronger test still covers that, and why it was added (git log -S).

Checks

  • A package: pnpm -F <package> test, then pnpm typecheck from the root.
  • Desktop units: pnpm -F @hivemind/desktop test:unit (tsx --test).
  • e2e: apps/desktop/AGENTS.md. Rebuild with pnpm exec electron-vite build in apps/desktop before running a spec against changed source.
  • git diff --check before committing.

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.