AGENT SKILL

test-audit

Find tests that do not earn their upkeep and silent regressions nothing guards, then apply the chosen changes.

License 许可
MIT
所属仓库
lithammer/ai
最近更新
2026-11-13
Stars
★ 0
Forks
0

01 前言 Front Matter

name
test-audit
description
Find tests that do not earn their upkeep and silent regressions nothing guards, then apply the chosen changes.
argument-hint
[scope or concern]
disable-model-invocation
true

02 资源文件 1

03 SKILL.md 正文

Test Audit

Audit existing tests with one question: if the behavior a test guards broke, what would notice first? A test earns its upkeep only when nothing else would: the regression is silent, and an incidental edit, made while changing nearby code for another reason, could cause it. No diff is needed.

1. Scope

Read the repository's instructions and the requested scope or concern: a path, subsystem, or kind of test. With no target, map the repository's major subsystems and choose promising areas to inspect.

Run the in-scope tests and static checks. A test that is already red may guard a product bug; report it and leave its value unjudged. The proofs in step 3 need a green baseline.

2. Discover

Use a single agent by default. Split a large scope only along genuinely independent subsystems.

Read each test beside the production code it guards. For each guarded behavior, ask what would notice a regression first: types, another test, a crash, a visible failure in normal use, or nothing. Collect candidates in both directions:

  • Removal: a test whose regression something else would catch, or that goes red when behavior stays the same.
  • Addition: behavior whose regression nothing would catch, where a incidental edit could cause it.

3. Prove

Record git status --short and git diff before the first mutation. Prove each candidate with a mutation of the production code, then run the owner's tests, static checks, and, where the claim is normal use, a real run. Undo each mutation before the next.

  • Break the guarded behavior and something other than the test goes red: the test is redundant.
  • Change the code without changing behavior and the test goes red: the test is a change detector.
  • Break the behavior and nothing goes red: propose a test.

Record each mutation and what caught it. A claim the environment cannot run stays unproven; drop it with the candidates the proof does not support.

Done when every remaining candidate has a mutation record and the working tree matches the record taken before the first mutation.

4. Present and wait

Rank candidates by upkeep removed or risk guarded. For each, give:

  • The test or production location and the behavior it concerns.
  • The mutation, and what caught it or that nothing did.
  • For a removal, the lines it removes, including production code that only the test uses.
  • For an addition, the contract and the edit that would break it.

State what you explored and what remains unread. Return no candidates when none hold.

Wait for the user to select candidates before editing.

5. Implement

Use the develop skill for the selected candidates. Pass each candidate's mutation record as its requirements; a selected addition is the user asking for that test.

04 同仓库更多 Skills

lithammer
lithammer/ai

shape

Review a working change for its shape (cause, ownership, states, names, size, reuse, cost), then apply what you accept.

★ 0
lithammer
lithammer/ai

correctness

Review a working change for defects (logic, state, lifecycle, concurrency, regression) and for drift from its ticket, docs, and rules, then apply what you accept.

★ 0
lithammer
lithammer/ai

zero-tech-debt

Rework a change as if the intended UX and architecture existed from day one, deleting compatibility cruft and accidental complexity.

★ 0
lithammer
lithammer/ai

waterfall-review

Review a code change by dispatching specialized review subagents in parallel — each focused on a single dimension (correctness, security, architecture, etc.) — then triaging their findings into a unified report. Works standalone on a branch or as part of the waterfall flow after implementation. Invoke when the user explicitly asks to review a branch or diff, or as a step inside waterfall-implement; avoid auto-triggering on casual mentions of "review".

★ 0
lithammer
lithammer/ai

waterfall-refactor

Identify refactoring opportunities in code that a feature will touch. Runs at strategic level during design (looking for structural moves that could change which approach is chosen) or tactical level before implementation (looking for pre-work that gives the feature a better foundation). Primarily invoked by waterfall-design or waterfall-implement; avoid auto-triggering on casual mentions of "refactor".

★ 0
lithammer
lithammer/ai

waterfall-plan

Detail a chosen design approach into an implementation plan (objective, file manifest, execution order, test strategy), then auto-proceed to waterfall-challenge. Convergent phase of the waterfall flow.

★ 0