@iceinvein/agent-skills 0.23.13 → 0.24.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -1
- package/package.json +1 -1
- package/skills/index.json +7 -1
- package/skills/sluice/SKILL.md +7 -7
- package/skills/sluice/references/deep-channel.md +40 -51
- package/skills/sluice/skill.json +1 -1
- package/skills/test-redundancy-auditor/SKILL.md +117 -0
- package/skills/test-redundancy-auditor/evals/README.md +35 -0
- package/skills/test-redundancy-auditor/evals/boundary-tests-stay-unique/case.yaml +4 -0
- package/skills/test-redundancy-auditor/evals/boundary-tests-stay-unique/fixture.sh +76 -0
- package/skills/test-redundancy-auditor/evals/boundary-tests-stay-unique/graders/auditor-fired.md +5 -0
- package/skills/test-redundancy-auditor/evals/boundary-tests-stay-unique/graders/nothing-deleted.md +26 -0
- package/skills/test-redundancy-auditor/evals/boundary-tests-stay-unique/prompt.md +11 -0
- package/skills/test-redundancy-auditor/evals/callers-tree-unchanged/case.yaml +4 -0
- package/skills/test-redundancy-auditor/evals/callers-tree-unchanged/fixture.sh +60 -0
- package/skills/test-redundancy-auditor/evals/callers-tree-unchanged/graders/auditor-fired.md +5 -0
- package/skills/test-redundancy-auditor/evals/callers-tree-unchanged/graders/output-ignores-itself.md +11 -0
- package/skills/test-redundancy-auditor/evals/callers-tree-unchanged/graders/source-unchanged.md +10 -0
- package/skills/test-redundancy-auditor/evals/callers-tree-unchanged/graders/tests-unchanged.md +10 -0
- package/skills/test-redundancy-auditor/evals/callers-tree-unchanged/graders/tree-unchanged.md +13 -0
- package/skills/test-redundancy-auditor/evals/callers-tree-unchanged/prompt.md +11 -0
- package/skills/test-redundancy-auditor/evals/duplicate-is-flagged/case.yaml +4 -0
- package/skills/test-redundancy-auditor/evals/duplicate-is-flagged/fixture.sh +60 -0
- package/skills/test-redundancy-auditor/evals/duplicate-is-flagged/graders/auditor-fired.md +5 -0
- package/skills/test-redundancy-auditor/evals/duplicate-is-flagged/graders/one-of-the-pair-deleted.md +34 -0
- package/skills/test-redundancy-auditor/evals/duplicate-is-flagged/prompt.md +11 -0
- package/skills/test-redundancy-auditor/evals/guard-test-is-kept/case.yaml +4 -0
- package/skills/test-redundancy-auditor/evals/guard-test-is-kept/fixture.sh +58 -0
- package/skills/test-redundancy-auditor/evals/guard-test-is-kept/graders/auditor-fired.md +5 -0
- package/skills/test-redundancy-auditor/evals/guard-test-is-kept/graders/guard-kept.md +32 -0
- package/skills/test-redundancy-auditor/evals/guard-test-is-kept/prompt.md +11 -0
- package/skills/test-redundancy-auditor/evals/mock-assertion-is-vacuous/case.yaml +4 -0
- package/skills/test-redundancy-auditor/evals/mock-assertion-is-vacuous/fixture.sh +73 -0
- package/skills/test-redundancy-auditor/evals/mock-assertion-is-vacuous/graders/auditor-fired.md +5 -0
- package/skills/test-redundancy-auditor/evals/mock-assertion-is-vacuous/graders/mock-test-is-vacuous.md +33 -0
- package/skills/test-redundancy-auditor/evals/mock-assertion-is-vacuous/prompt.md +11 -0
- package/skills/test-redundancy-auditor/evals/mutate-without-tool-stops/case.yaml +4 -0
- package/skills/test-redundancy-auditor/evals/mutate-without-tool-stops/fixture.sh +60 -0
- package/skills/test-redundancy-auditor/evals/mutate-without-tool-stops/graders/auditor-fired.md +5 -0
- package/skills/test-redundancy-auditor/evals/mutate-without-tool-stops/graders/labelled-rubric-only.md +26 -0
- package/skills/test-redundancy-auditor/evals/mutate-without-tool-stops/graders/nothing-installed.md +12 -0
- package/skills/test-redundancy-auditor/evals/mutate-without-tool-stops/prompt.md +11 -0
- package/skills/test-redundancy-auditor/evals/rules.json +193 -0
- package/skills/test-redundancy-auditor/evals/subsumed-by-broader-test/case.yaml +4 -0
- package/skills/test-redundancy-auditor/evals/subsumed-by-broader-test/fixture.sh +62 -0
- package/skills/test-redundancy-auditor/evals/subsumed-by-broader-test/graders/auditor-fired.md +5 -0
- package/skills/test-redundancy-auditor/evals/subsumed-by-broader-test/graders/narrow-test-subsumed.md +35 -0
- package/skills/test-redundancy-auditor/evals/subsumed-by-broader-test/prompt.md +11 -0
- package/skills/test-redundancy-auditor/references/findings-format.md +71 -0
- package/skills/test-redundancy-auditor/references/mutation-mode.md +100 -0
- package/skills/test-redundancy-auditor/references/rubric.md +144 -0
- package/skills/test-redundancy-auditor/skill.json +24 -0
package/README.md
CHANGED
|
@@ -101,6 +101,7 @@ Skills that check code does what it was meant to do, with evidence rather than o
|
|
|
101
101
|
| Skill | Based on | What it does |
|
|
102
102
|
|-------|----------|--------------|
|
|
103
103
|
| **bug-hunter** | QA scenario testing; intent-first reproduction | Proves logic bugs with failing repros checked against stated intent. Writes scenarios before reading the code, and reports bugs, ambiguities, and covered scenarios. Claude Code only. |
|
|
104
|
+
| **test-redundancy-auditor** | Mutation testing; test subsumption | Measures how much of a suite is redundant. Gives each test a verdict (unique, duplicate, subsumed, vacuous, layer echo) with evidence, and writes a cost-weighted deletion list. Optional mutation mode verifies verdicts with a per-test kill matrix. Report only. Claude Code only. |
|
|
104
105
|
|
|
105
106
|
### Communication
|
|
106
107
|
|
|
@@ -195,7 +196,7 @@ If a skill declares activation support and you're installing for Claude Code int
|
|
|
195
196
|
|
|
196
197
|
## Supported Tools
|
|
197
198
|
|
|
198
|
-
Claude Code, Cursor, Codex and Gemini CLI. Most skills install into all four; bug-hunter, magpie, migrate, scope-estimate and
|
|
199
|
+
Claude Code, Cursor, Codex and Gemini CLI. Most skills install into all four; bug-hunter, magpie, migrate, scope-estimate, sluice and test-redundancy-auditor are Claude Code only, and the CLI skips the other tools for them.
|
|
199
200
|
|
|
200
201
|
## How It Works
|
|
201
202
|
|
package/package.json
CHANGED
package/skills/index.json
CHANGED
|
@@ -295,7 +295,7 @@
|
|
|
295
295
|
"name": "sluice",
|
|
296
296
|
"description": "Routes work by change shape into four channels (bypass, fast, main, deep) and applies only the rules each channel needs, so a one-line fix does not pay the cost of a multi-subsystem build. Carries nine rules as one-liners in the router and the full treatment in references read only on friction. Deep runs read the repo before designing, map the spec's intent to its decisions, and check spec against intent and plan against spec with a fresh reader, with plan.sh validate enforcing that every decision is covered. Checks the finished plan with plan.sh validate rather than trusting it to memory, seeds the run state from it, keeps a deep run's task breakdown in .sluice/run.json so a statusline segment, one status command and a SessionStart hook can answer where the run is (the hook prints a live run at every session start, compaction included), lists every live deep run and routed fast or main session on the machine in one board.sh view (drawn once, watched, or as JSON), and closes each run with a ledger read out of the session transcript: elapsed, tools, tokens, and what each dispatched agent cost where the transcript recorded it. Two Stop hooks hold a handback: one refuses a tree that moved since its last recorded check, the other refuses a changed existing test not proven to fail on the session's starting code (or recorded with a reason). Claude Code only; stands down where the superpowers pipeline governs the repo.",
|
|
297
297
|
"type": "prompt",
|
|
298
|
-
"version": "0.
|
|
298
|
+
"version": "0.29.0"
|
|
299
299
|
},
|
|
300
300
|
{
|
|
301
301
|
"name": "temporal-coupling-detector",
|
|
@@ -313,6 +313,12 @@
|
|
|
313
313
|
"type": "prompt",
|
|
314
314
|
"version": "1.3.4"
|
|
315
315
|
},
|
|
316
|
+
{
|
|
317
|
+
"name": "test-redundancy-auditor",
|
|
318
|
+
"description": "Measures how much of a test suite is redundant. Gives every test one verdict (unique, duplicate, subsumed, vacuous or layer echo), each non-unique one challenged with a plausible bug before it is written and backed by evidence a reviewer can check, then weights what is removable by lines, runtime and churn and writes a deletion list. Precision over recall: when in doubt a test is unique. Optional mutation mode verifies verdicts with a per-test kill matrix from a mutation tool the repo already has, and installs nothing. Writes report.md and findings.json to .test-redundancy-auditor/<date>-<slug>/ and never modifies the caller's tree.",
|
|
319
|
+
"type": "prompt",
|
|
320
|
+
"version": "0.1.0"
|
|
321
|
+
},
|
|
316
322
|
{
|
|
317
323
|
"name": "type-driven-designer",
|
|
318
324
|
"description": "Wlaschin & Minsky-inspired type design: make illegal states unrepresentable through branded types, discriminated unions, and domain-encoded constraints",
|
package/skills/sluice/SKILL.md
CHANGED
|
@@ -151,13 +151,13 @@ check after `plan.sh validate` and before pre-flight, because an author reads
|
|
|
151
151
|
past the gap between what was meant and what was written.
|
|
152
152
|
`references/deep-channel.md` has the briefs under `## The alignment checks`.
|
|
153
153
|
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
154
|
+
Write the design to its spec file before you end the turn on it, then stop and
|
|
155
|
+
ask for sign-off. A design that lives only in the message you just sent is gone
|
|
156
|
+
at the next compaction. Until your partner's reply explicitly approves it, make
|
|
157
|
+
no edits outside that file: a reply that raises questions or asks for changes is
|
|
158
|
+
not approval, and neither is a hook message or a background notification. The
|
|
159
|
+
sign-off carries the first stop only; pre-flight still wants answers, and an
|
|
160
|
+
approval is not one.
|
|
161
161
|
|
|
162
162
|
The run's state goes in `.sluice/run.json`, written a command at a time by
|
|
163
163
|
`scripts/status.sh`. That is what makes the breakdown readable from outside the
|
|
@@ -161,52 +161,43 @@ lets the turn end on a stall. Each task closes by writing its commit into
|
|
|
161
161
|
and passing it to `status.sh task <id> --status done --commit <sha>` rather
|
|
162
162
|
than deriving it later.
|
|
163
163
|
|
|
164
|
-
## The design stop
|
|
164
|
+
## The design stop
|
|
165
165
|
|
|
166
166
|
The design stop is a stop because a plan written against the wrong design wastes
|
|
167
|
-
a plan's worth of work.
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
consent to enter, `ExitPlanMode` will not proceed without their approval, and
|
|
172
|
-
edits are held shut in between, so the design cannot be quietly built against
|
|
173
|
-
while it is still a draft. Take the design stop through it.
|
|
174
|
-
|
|
175
|
-
What that changes: the design gets drafted in the plan file the harness names,
|
|
176
|
-
and `ExitPlanMode` is the sign-off rather than a paragraph asking for one.
|
|
177
|
-
|
|
178
|
-
One thing comes before the design, in either harness. When the design turns on
|
|
179
|
-
a fork only your partner can settle, one whose answer changes the design's
|
|
180
|
-
shape (where state lives, what shares it, which process owns it) rather than a
|
|
181
|
-
value the design can leave as config, ask it as one question with your
|
|
182
|
-
recommendation before the design is written, and write the design on the
|
|
183
|
-
answer. Ask it with `AskUserQuestion` where there is one, which returns the
|
|
184
|
-
answer without ending the turn; without one, the question is a stop of its
|
|
185
|
-
own, and the design is written, to its file, on the next turn. A design drafted
|
|
186
|
-
across both branches of a fork doubles the reading and still has to be
|
|
187
|
-
rewritten. Anything you can settle from the repo is not that fork: settle it,
|
|
188
|
-
and write the design first.
|
|
189
|
-
|
|
190
|
-
What it does not replace is pre-flight. That stop wants three answers, and an
|
|
191
|
-
approval is not an answer to any of them, so it stays where it is, after plan
|
|
192
|
-
mode has exited and the plan is written. One enforced gate does not collapse two
|
|
193
|
-
stops into one; it only makes the first of them hold.
|
|
194
|
-
|
|
195
|
-
**The harness's plan file is not the artifact.** It belongs to the mode and not
|
|
196
|
-
to the run. On approval, write the design to `docs/specs/YYYY-MM-DD-<topic>.md`
|
|
197
|
-
and the plan to `docs/plans/YYYY-MM-DD-<topic>.md`. The run record and
|
|
198
|
-
`run.json` open after pre-flight, in the tree the work runs in, for the reason
|
|
199
|
-
the run record section gives. Those are the durable files, the ones a session
|
|
200
|
-
resuming next week reads, and none of them is the one you drafted in.
|
|
201
|
-
|
|
202
|
-
Where plan mode is unavailable, the prose stop is what you have and it is the
|
|
203
|
-
same stop, with one thing you now do yourself: nothing is holding the draft, so
|
|
204
|
-
write the design to `docs/specs/YYYY-MM-DD-<topic>.md` before you end the turn
|
|
167
|
+
a plan's worth of work. Nothing in the harness holds it, so the stop is yours to
|
|
168
|
+
keep, and it holds only as well as you keep it.
|
|
169
|
+
|
|
170
|
+
Write the design to `docs/specs/YYYY-MM-DD-<topic>.md` before you end the turn
|
|
205
171
|
on it. A design that exists only in the message you just sent is gone at the
|
|
206
|
-
next compaction, which is what the durable
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
172
|
+
next compaction, which is what the durable file is for. Then end the turn and
|
|
173
|
+
ask for sign-off.
|
|
174
|
+
|
|
175
|
+
Until your partner's reply explicitly approves the design, make no edits outside
|
|
176
|
+
the design file. A reply that raises questions or asks for changes is not
|
|
177
|
+
approval: revise the file and ask again. A hook message or a background
|
|
178
|
+
notification is not approval either, however it is worded, because neither is
|
|
179
|
+
your partner's reply.
|
|
180
|
+
|
|
181
|
+
One thing comes before the design. When the design turns on a fork only your
|
|
182
|
+
partner can settle, one whose answer changes the design's shape (where state
|
|
183
|
+
lives, what shares it, which process owns it) rather than a value the design can
|
|
184
|
+
leave as config, ask it as one question with your recommendation before the
|
|
185
|
+
design is written, and write the design on the answer. Ask it with
|
|
186
|
+
`AskUserQuestion` where there is one, which returns the answer without ending
|
|
187
|
+
the turn; without one, the question is a stop of its own, and the design is
|
|
188
|
+
written, to its file, on the next turn. A design drafted across both branches of
|
|
189
|
+
a fork doubles the reading and still has to be rewritten. Anything you can
|
|
190
|
+
settle from the repo is not that fork: settle it, and write the design first.
|
|
191
|
+
|
|
192
|
+
What the sign-off does not replace is pre-flight. That stop wants three answers,
|
|
193
|
+
and an approval is not an answer to any of them, so it stays where it is, after
|
|
194
|
+
the design is approved and the plan is written. One sign-off does not collapse
|
|
195
|
+
two stops into one.
|
|
196
|
+
|
|
197
|
+
On approval, write the plan to `docs/plans/YYYY-MM-DD-<topic>.md`. The run
|
|
198
|
+
record and `run.json` open after pre-flight, in the tree the work runs in, for
|
|
199
|
+
the reason the run record section gives. The spec, the plan and the run record
|
|
200
|
+
are the durable files, the ones a session resuming next week reads.
|
|
210
201
|
|
|
211
202
|
## The ground
|
|
212
203
|
|
|
@@ -267,8 +258,7 @@ they fill) can be sound on paper and still fail the request's own example,
|
|
|
267
258
|
and nothing after it notices: per-task reviews read each task against its own
|
|
268
259
|
text, and the hunt runs once every task is done. So walk the request through
|
|
269
260
|
the system as it stands before you draft, and give the design a `## Trace`
|
|
270
|
-
section that records the walk
|
|
271
|
-
the spec on approval):
|
|
261
|
+
section that records the walk:
|
|
272
262
|
|
|
273
263
|
1. **The example, verbatim.** Quote the sentence, command or scenario the
|
|
274
264
|
request gives. Where it gives none, write the acceptance criterion as one
|
|
@@ -290,8 +280,8 @@ the spec on approval):
|
|
|
290
280
|
step.
|
|
291
281
|
|
|
292
282
|
The order is the ground, the walk, the fork, the draft. Walking after the
|
|
293
|
-
ground and before the fork is what puts a fork where **The design stop
|
|
294
|
-
|
|
283
|
+
ground and before the fork is what puts a fork where **The design stop**
|
|
284
|
+
wants it: one the walk turns up only your partner can settle is
|
|
295
285
|
asked before the design is written, and the trace goes into the design with
|
|
296
286
|
the answer.
|
|
297
287
|
|
|
@@ -310,10 +300,9 @@ never downshifted, as with the final review, since a cheaper reader is the one
|
|
|
310
300
|
that misses a gap in meaning.
|
|
311
301
|
|
|
312
302
|
**The intent check runs before sign-off**, once the draft and its trace are
|
|
313
|
-
written and before
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
name, then:
|
|
303
|
+
written to the spec file and before you ask for sign-off. Send it the spec
|
|
304
|
+
file's path, and ask it to read the design's `## Intent` section by that name,
|
|
305
|
+
then:
|
|
317
306
|
|
|
318
307
|
- Does each ask in `## Intent` reach a decision that actually delivers it, not
|
|
319
308
|
one that merely mentions it?
|
package/skills/sluice/skill.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sluice",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.29.0",
|
|
4
4
|
"description": "Routes work by change shape into four channels (bypass, fast, main, deep) and applies only the rules each channel needs, so a one-line fix does not pay the cost of a multi-subsystem build. Carries nine rules as one-liners in the router and the full treatment in references read only on friction. Deep runs read the repo before designing, map the spec's intent to its decisions, and check spec against intent and plan against spec with a fresh reader, with plan.sh validate enforcing that every decision is covered. Checks the finished plan with plan.sh validate rather than trusting it to memory, seeds the run state from it, keeps a deep run's task breakdown in .sluice/run.json so a statusline segment, one status command and a SessionStart hook can answer where the run is (the hook prints a live run at every session start, compaction included), lists every live deep run and routed fast or main session on the machine in one board.sh view (drawn once, watched, or as JSON), and closes each run with a ledger read out of the session transcript: elapsed, tools, tokens, and what each dispatched agent cost where the transcript recorded it. Two Stop hooks hold a handback: one refuses a tree that moved since its last recorded check, the other refuses a changed existing test not proven to fail on the session's starting code (or recorded with a reason). Claude Code only; stands down where the superpowers pipeline governs the repo.",
|
|
5
5
|
"author": "iceinvein",
|
|
6
6
|
"type": "prompt",
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: test-redundancy-auditor
|
|
3
|
+
description: Use when asked how much of a test suite is redundant, which tests can be dropped or merged, whether tests pull their weight, or to trim a slow or repetitive suite. Classifies each test as unique, duplicate, subsumed, vacuous or layer echo with cited evidence, weights what is removable by lines, runtime and churn, and writes a deletion list. Optional mutation mode (--mutate) verifies verdicts with a per-test kill matrix from the repo's own mutation tool. Report only; never edits a test.
|
|
4
|
+
argument-hint: "[<path>...] [--mutate]"
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Test redundancy auditor
|
|
8
|
+
|
|
9
|
+
A suite grows by copying the nearest test and changing one value. Some copies
|
|
10
|
+
cover a new case; many pin a behaviour another test already pins, or pin
|
|
11
|
+
nothing at all. This skill sorts one from the other, with evidence a reviewer
|
|
12
|
+
can check, so the suite can shrink without losing a single caught bug.
|
|
13
|
+
|
|
14
|
+
## Verdicts
|
|
15
|
+
|
|
16
|
+
Every test in the target gets exactly one. `references/rubric.md` has the
|
|
17
|
+
questions that decide it and the precision rules.
|
|
18
|
+
|
|
19
|
+
| Verdict | Meaning | On the deletion list |
|
|
20
|
+
|---|---|---|
|
|
21
|
+
| `unique` | Catches some plausible bug no other test catches | no |
|
|
22
|
+
| `duplicate` | Same behaviour, same input partition, same strength as another test | all but one of the group |
|
|
23
|
+
| `subsumed` | Every bug it catches, another test (or a named set of tests) catches too, but not the reverse | yes |
|
|
24
|
+
| `vacuous` | No plausible change to the code under test can make it fail | yes |
|
|
25
|
+
| `layer-echo` | The same rule on the same partition, asserted again through another entry point (unit, component, integration, e2e) | never; the report says which layer to keep |
|
|
26
|
+
|
|
27
|
+
The deletion list is built one test at a time, so two tests that each cover
|
|
28
|
+
the other never both go (`references/rubric.md`, "Building the deletion
|
|
29
|
+
list").
|
|
30
|
+
|
|
31
|
+
**Precision over recall.** A wrong "delete this" costs a caught bug; a missed
|
|
32
|
+
duplicate costs a few lines. When in doubt the verdict is `unique`.
|
|
33
|
+
|
|
34
|
+
## Method
|
|
35
|
+
|
|
36
|
+
1. **Name the target** in one line: the paths from the arguments, or the
|
|
37
|
+
whole suite when none are given. Find the runner from the repo's manifests
|
|
38
|
+
and `CLAUDE.md`/`AGENTS.md`, and follow any rule there on how tests must be
|
|
39
|
+
run. Record the runner and language versions and the time zone it runs in:
|
|
40
|
+
some verdicts depend on them.
|
|
41
|
+
2. **Map each test** to the unit it exercises, the behaviour it pins (one
|
|
42
|
+
sentence) and the input partition it covers. A suite whose test names
|
|
43
|
+
follow a consistent scenario/unit/outcome convention may supply these from
|
|
44
|
+
the names; say so in the report. A test whose behaviour you cannot state
|
|
45
|
+
in a sentence is a `vacuous` candidate. Each parametrised row counts as
|
|
46
|
+
one test, and so does each instance of a shared body (a `describe.each`
|
|
47
|
+
block, a helper that registers tests once per configuration).
|
|
48
|
+
3. **Compare within a unit.** Group tests by the code under test, then apply
|
|
49
|
+
the rubric to each group.
|
|
50
|
+
4. **Challenge every non-unique verdict** before writing it: name a plausible
|
|
51
|
+
bug, a one-line change to the code under test, that fails this test and
|
|
52
|
+
passes the one it is said to duplicate or be subsumed by (or, for
|
|
53
|
+
`vacuous`, that fails it at all). If you can name one, the verdict is
|
|
54
|
+
`unique`. When the answer is unclear, check it with a probe: apply the bug
|
|
55
|
+
in the scratch worktree and run the tests. A probe that fails neither test
|
|
56
|
+
was an equivalent change and settled nothing; try another.
|
|
57
|
+
5. **Cost each test**: lines in its body, its runtime, and churn (commits
|
|
58
|
+
touching its lines, `git log -L`). Take runtime as the median of three runs
|
|
59
|
+
of the runner's own reporter: the first test in a file absorbs warm-up, and
|
|
60
|
+
one run lets that decide which duplicate is kept. A cost you could not
|
|
61
|
+
measure is `null` with the reason in the report, never a guess.
|
|
62
|
+
6. **Mutation mode**, only with `--mutate` or when the request asks for
|
|
63
|
+
mutation testing: follow `references/mutation-mode.md`. Without a mutation
|
|
64
|
+
tool already in the repo, install nothing: name the tool to add, finish in
|
|
65
|
+
rubric mode, and say so.
|
|
66
|
+
7. **Write the output.**
|
|
67
|
+
|
|
68
|
+
Run anything that writes files (a probe, a mutation run) in a scratch `git
|
|
69
|
+
worktree` outside the repo, in a directory of this run's own. Link the
|
|
70
|
+
repo's installed dependencies into it rather than installing, and keep the
|
|
71
|
+
runner from writing caches through those links (for Vitest: `--no-cache`,
|
|
72
|
+
and `--configLoader runner` so Vite writes no `.vite-temp` into a linked
|
|
73
|
+
`node_modules`). Never modify the caller's tree: no test is edited, deleted or
|
|
74
|
+
added, and no install or build artefact lands there. Acting on the deletion
|
|
75
|
+
list is the caller's call.
|
|
76
|
+
|
|
77
|
+
**Large targets.** Past a few hundred tests, classification may be split
|
|
78
|
+
across subagents by file, each returning verdicts and evidence for its files.
|
|
79
|
+
The run itself keeps the cross-file comparisons, every probe, and the
|
|
80
|
+
deletion list, because a verdict split across two readers is where
|
|
81
|
+
duplicates hide and where two halves of a pair both get deleted.
|
|
82
|
+
|
|
83
|
+
## Output
|
|
84
|
+
|
|
85
|
+
Write to `.test-redundancy-auditor/<YYYY-MM-DD>-<slug>/` at the repo root:
|
|
86
|
+
`report.md` for a human and `findings.json` for a grader or calling skill, in
|
|
87
|
+
the shape `references/findings-format.md` gives. Mutation mode adds
|
|
88
|
+
`kill-matrix.json`. Write `findings.json` and `report.md` with the Write tool,
|
|
89
|
+
never from a shell command. The one exception is size: a `findings.json` for
|
|
90
|
+
more than about 100 tests is too large for one Write call, so write the
|
|
91
|
+
verdicts as a table with the Write tool and build `findings.json` from it
|
|
92
|
+
with a script saved beside it as `build-findings.*`.
|
|
93
|
+
|
|
94
|
+
`report.md` leads with the headline: how many tests, and what share of the
|
|
95
|
+
suite's lines and runtime, the deletion list removes. Then the deletion list,
|
|
96
|
+
each entry with its verdict and evidence, marking any that needs a
|
|
97
|
+
restructure rather than a deletion; layer echoes with the layer to keep;
|
|
98
|
+
guards (tests that pin another test's premise); behaviours a vacuous test
|
|
99
|
+
names but no test pins (gaps to fill, not to delete); the environment; and
|
|
100
|
+
every cost that could not be measured.
|
|
101
|
+
|
|
102
|
+
Run as a dispatched agent, the Write tool may refuse `report.md` and
|
|
103
|
+
`findings.json` as report files. Then put each refused file in a scratch path
|
|
104
|
+
and give the path in the hand-back (or, if small, its full content), for the
|
|
105
|
+
caller to write unchanged with the Write tool; never fall back to a shell
|
|
106
|
+
write into the caller's tree.
|
|
107
|
+
|
|
108
|
+
The directory ignores itself: if `.test-redundancy-auditor/.gitignore` is
|
|
109
|
+
absent, write it holding `*` before anything else in the run. Leave an
|
|
110
|
+
existing one alone.
|
|
111
|
+
|
|
112
|
+
## Hand-back
|
|
113
|
+
|
|
114
|
+
The run directory, the mode (rubric or mutation), the counts per verdict,
|
|
115
|
+
the share removable by tests, lines and runtime, then each deletion in one
|
|
116
|
+
line: test, verdict, evidence. Name anything not done: an unmeasured cost,
|
|
117
|
+
an unprobed verdict, mutation mode skipped and why.
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# test-redundancy-auditor evals
|
|
2
|
+
|
|
3
|
+
Seven cases for `claude plugin eval`. Each scaffolds a small Node repo with one
|
|
4
|
+
module and a `node --test` suite whose redundancy is known in advance. The
|
|
5
|
+
prompt asks about the tests the way a user would and never names the skill.
|
|
6
|
+
|
|
7
|
+
| Case | Fixture | What it pins |
|
|
8
|
+
|---|---|---|
|
|
9
|
+
| `duplicate-is-flagged` | Two tests each lowercase one capitalised word | One is a `duplicate` citing the other, exactly one of the pair is deleted, the three other tests stay `unique` |
|
|
10
|
+
| `mock-assertion-is-vacuous` | A test calls its own mock and asserts what the mock returns | That test is `vacuous` and deleted; the two that drive `notifyOverdue` stay `unique` |
|
|
11
|
+
| `boundary-tests-stay-unique` | Seven look-alike tests, each on a different edge | Every test `unique`, `deletions` empty |
|
|
12
|
+
| `subsumed-by-broader-test` | A one-field assertion on the input another test asserts in full | The narrow test is `subsumed` by the broad one (not `duplicate`), and only it is deleted |
|
|
13
|
+
| `callers-tree-unchanged` | The duplicate fixture | The test file keeps its five tests, nothing is created outside `.test-redundancy-auditor/`, which ignores itself |
|
|
14
|
+
| `mutate-without-tool-stops` | The duplicate fixture, mutation testing asked for, no tool installed | Nothing installed; `mode` is `rubric` and `mutation` names the tool to add |
|
|
15
|
+
| `guard-test-is-kept` | A test that never calls the code but checks the TZ stub took effect for the next test | It is `unique` as a guard naming the test it guards, and nothing is deleted |
|
|
16
|
+
|
|
17
|
+
Every case also has `auditor-fired`, a `tool_used: Skill` grader, so a score
|
|
18
|
+
can be told apart from the model's own habits. `callers-tree-unchanged` is in
|
|
19
|
+
`vacuousWithout`: a run that writes nothing passes its tree graders.
|
|
20
|
+
|
|
21
|
+
Mutation mode with a tool present is not pinned (see `rules.json`): it would
|
|
22
|
+
need StrykerJS installed inside the sandbox.
|
|
23
|
+
|
|
24
|
+
## Running
|
|
25
|
+
|
|
26
|
+
From the repo root:
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
claude plugin eval skills/test-redundancy-auditor --scaffold --allow-tools Bash Write Edit \
|
|
30
|
+
--model claude-opus-5-5 --judge-model claude-opus-5-5 --runs 1 --ablation none -j 7
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
The content graders are `llm` judges over the trace, since `findings.json`
|
|
34
|
+
sits under a slug the skill picks. They judge only the last write of it, and
|
|
35
|
+
see a head-and-tail window of a long trace.
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# A pagination helper whose tests look alike but each sit on a different edge:
|
|
3
|
+
# perPage 1 and 50 are the two inside edges, 0 and 51 the two outside ones,
|
|
4
|
+
# page 0 is the page floor, and the past-the-end and short-last-page tests
|
|
5
|
+
# cover the slice. For every test there is a plausible one-line bug that fails it
|
|
6
|
+
# and passes all the others, so nothing here is redundant. Any non-unique
|
|
7
|
+
# verdict is a false positive.
|
|
8
|
+
set -euo pipefail
|
|
9
|
+
|
|
10
|
+
mkdir -p src tests
|
|
11
|
+
|
|
12
|
+
cat > package.json <<'JSON'
|
|
13
|
+
{
|
|
14
|
+
"name": "listing",
|
|
15
|
+
"version": "2.0.1",
|
|
16
|
+
"type": "module",
|
|
17
|
+
"scripts": {
|
|
18
|
+
"test": "node --test \"tests/*.test.js\""
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
JSON
|
|
22
|
+
|
|
23
|
+
cat > src/paginate.js <<'JS'
|
|
24
|
+
const MAX_PER_PAGE = 50;
|
|
25
|
+
|
|
26
|
+
export function paginate(items, page, perPage) {
|
|
27
|
+
if (!Number.isInteger(perPage) || perPage < 1 || perPage > MAX_PER_PAGE) {
|
|
28
|
+
throw new RangeError(`perPage must be a whole number from 1 to ${MAX_PER_PAGE}, got ${perPage}`);
|
|
29
|
+
}
|
|
30
|
+
if (!Number.isInteger(page) || page < 1) {
|
|
31
|
+
throw new RangeError(`page must be a whole number of 1 or more, got ${page}`);
|
|
32
|
+
}
|
|
33
|
+
const start = (page - 1) * perPage;
|
|
34
|
+
return items.slice(start, start + perPage);
|
|
35
|
+
}
|
|
36
|
+
JS
|
|
37
|
+
|
|
38
|
+
cat > tests/paginate.test.js <<'JS'
|
|
39
|
+
import assert from "node:assert/strict";
|
|
40
|
+
import { test } from "node:test";
|
|
41
|
+
import { paginate } from "../src/paginate.js";
|
|
42
|
+
|
|
43
|
+
const letters = ["a", "b", "c", "d", "e", "f", "g"];
|
|
44
|
+
|
|
45
|
+
test("accepts a perPage of 1", () => {
|
|
46
|
+
assert.deepEqual(paginate(letters, 2, 1), ["b"]);
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
test("accepts a perPage of 50", () => {
|
|
50
|
+
assert.deepEqual(paginate(letters, 1, 50), letters);
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
test("rejects a perPage of 0", () => {
|
|
54
|
+
assert.throws(() => paginate(letters, 1, 0), RangeError);
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
test("rejects a perPage of 51", () => {
|
|
58
|
+
assert.throws(() => paginate(letters, 1, 51), RangeError);
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
test("rejects a page of 0", () => {
|
|
62
|
+
assert.throws(() => paginate(letters, 0, 3), RangeError);
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
test("the last page holds what is left", () => {
|
|
66
|
+
assert.deepEqual(paginate(letters, 3, 3), ["g"]);
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
test("a page past the last one is empty", () => {
|
|
70
|
+
assert.deepEqual(paginate(letters, 4, 3), []);
|
|
71
|
+
});
|
|
72
|
+
JS
|
|
73
|
+
|
|
74
|
+
git init --quiet
|
|
75
|
+
git add -A
|
|
76
|
+
git -c user.email=fixture@example.com -c user.name=fixture commit --quiet -m "feat: paginate listings"
|
package/skills/test-redundancy-auditor/evals/boundary-tests-stay-unique/graders/nothing-deleted.md
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: llm
|
|
3
|
+
# findings.json sits under a slug the skill picks, so no file focus can name
|
|
4
|
+
# it; the judge reads its content from the Write call (or shell command) in
|
|
5
|
+
# the trace, and sees only a head-and-tail window of a long trace.
|
|
6
|
+
focus: trace
|
|
7
|
+
weight: 3
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
The agent was asked which tests in `tests/paginate.test.js` can be dropped.
|
|
11
|
+
The file has seven tests, and each sits on its own edge: perPage 1 and 50
|
|
12
|
+
accepted, perPage 0 and 51 rejected, page 0 rejected, a short last page, and
|
|
13
|
+
a page past the end. For each one there is a plausible one-line bug in
|
|
14
|
+
`src/paginate.js` that fails it and passes the other six (for example
|
|
15
|
+
`perPage > 49` fails only the perPage-50 test, `perPage < 2` fails only the
|
|
16
|
+
perPage-1 test). None is redundant.
|
|
17
|
+
|
|
18
|
+
Find the `findings.json` the agent wrote under `.test-redundancy-auditor/`. If
|
|
19
|
+
it was written more than once, judge only the last write, with any later Edit
|
|
20
|
+
applied.
|
|
21
|
+
|
|
22
|
+
PASS if every one of the seven tests has verdict `unique` and `deletions` is
|
|
23
|
+
an empty array.
|
|
24
|
+
|
|
25
|
+
FAIL if no findings.json content is visible in the trace, if any test has a
|
|
26
|
+
verdict other than `unique`, or if `deletions` names any test.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: boundary-tests-stay-unique
|
|
3
|
+
description: Seven look-alike tests, each on a different edge of the same ranges. Pins the skill calling every one unique with an empty deletion list, rather than reading similar shape as redundancy.
|
|
4
|
+
tags: [false-positive, boundary, precision, scaffold, write]
|
|
5
|
+
max_turns: 60
|
|
6
|
+
timeout_seconds: 1800
|
|
7
|
+
allowed_tools: [Read, Glob, Grep, Skill, Write, Edit, Bash, Agent]
|
|
8
|
+
expected_outcome: findings.json under .test-redundancy-auditor/ gives all seven tests verdict unique and an empty deletions array.
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
`tests/paginate.test.js` feels repetitive. Which of these tests can we drop?
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# A slugify module and five tests. Two of them pin the same behaviour on the
|
|
3
|
+
# same kind of input (one capitalised word is lowercased): no plausible bug
|
|
4
|
+
# fails one and passes the other, so one is a duplicate of the other. The
|
|
5
|
+
# other three each cover their own partition: whitespace between words,
|
|
6
|
+
# a run of punctuation, punctuation at the ends. Deleting both duplicates
|
|
7
|
+
# would lose the lowercasing check, so only one belongs on the deletion list.
|
|
8
|
+
set -euo pipefail
|
|
9
|
+
|
|
10
|
+
mkdir -p src tests
|
|
11
|
+
|
|
12
|
+
cat > package.json <<'JSON'
|
|
13
|
+
{
|
|
14
|
+
"name": "slugs",
|
|
15
|
+
"version": "1.0.0",
|
|
16
|
+
"type": "module",
|
|
17
|
+
"scripts": {
|
|
18
|
+
"test": "node --test \"tests/*.test.js\""
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
JSON
|
|
22
|
+
|
|
23
|
+
cat > src/slugify.js <<'JS'
|
|
24
|
+
export function slugify(title) {
|
|
25
|
+
return title
|
|
26
|
+
.toLowerCase()
|
|
27
|
+
.replace(/[^a-z0-9]+/g, "-")
|
|
28
|
+
.replace(/^-+|-+$/g, "");
|
|
29
|
+
}
|
|
30
|
+
JS
|
|
31
|
+
|
|
32
|
+
cat > tests/slugify.test.js <<'JS'
|
|
33
|
+
import assert from "node:assert/strict";
|
|
34
|
+
import { test } from "node:test";
|
|
35
|
+
import { slugify } from "../src/slugify.js";
|
|
36
|
+
|
|
37
|
+
test("lowercases a capitalised word", () => {
|
|
38
|
+
assert.equal(slugify("Hello"), "hello");
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
test("joins words with a dash", () => {
|
|
42
|
+
assert.equal(slugify("hello world"), "hello-world");
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
test("lowercases another capitalised word", () => {
|
|
46
|
+
assert.equal(slugify("World"), "world");
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
test("collapses a run of punctuation into one dash", () => {
|
|
50
|
+
assert.equal(slugify("a--b"), "a-b");
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
test("trims punctuation from both ends", () => {
|
|
54
|
+
assert.equal(slugify("!hi!"), "hi");
|
|
55
|
+
});
|
|
56
|
+
JS
|
|
57
|
+
|
|
58
|
+
git init --quiet
|
|
59
|
+
git add -A
|
|
60
|
+
git -c user.email=fixture@example.com -c user.name=fixture commit --quiet -m "feat: slugify titles"
|
package/skills/test-redundancy-auditor/evals/callers-tree-unchanged/graders/output-ignores-itself.md
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: regex
|
|
3
|
+
# SKILL.md has the run drop a .gitignore holding `*` into
|
|
4
|
+
# .test-redundancy-auditor/ when none is there. The files target would show
|
|
5
|
+
# the path but not what it holds, and an empty .gitignore ignores nothing, so
|
|
6
|
+
# this reads the trace: a Write call whose content is `*`, or a shell command
|
|
7
|
+
# that writes a `*` into it.
|
|
8
|
+
pattern: '\.test-redundancy-auditor/\.gitignore"\s*,\s*"content"\s*:\s*"\*(?:\\n)?"|"command":"(?:\\.|[^"\\])*?\*(?:\\.|[^"\\])*?>\s*[^"\s]*\.test-redundancy-auditor/\.gitignore'
|
|
9
|
+
target: trace
|
|
10
|
+
weight: 2
|
|
11
|
+
---
|
package/skills/test-redundancy-auditor/evals/callers-tree-unchanged/graders/source-unchanged.md
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: regex
|
|
3
|
+
# SKILL.md has the run apply a suspected bug to the code under test to settle
|
|
4
|
+
# a verdict, in a scratch worktree. A probe applied in the caller's tree and
|
|
5
|
+
# never reverted would leave src/slugify.js changed, and the files target
|
|
6
|
+
# never lists an edited file, so this checks the module's body survives whole.
|
|
7
|
+
pattern: '\.toLowerCase\(\)\s*\n\s*\.replace\(/\[\^a-z0-9\]\+/g, "-"\)\s*\n\s*\.replace\(/\^-\+\|-\+\$/g, ""\);'
|
|
8
|
+
target: { source: file, path: src/slugify.js }
|
|
9
|
+
weight: 3
|
|
10
|
+
---
|
package/skills/test-redundancy-auditor/evals/callers-tree-unchanged/graders/tests-unchanged.md
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: regex
|
|
3
|
+
# The files target lists only paths the run created, so an edit to the
|
|
4
|
+
# scaffold's test file never reaches it. The scaffold has five tests; any
|
|
5
|
+
# other count means the audit deleted or added one.
|
|
6
|
+
pattern: '\btest\('
|
|
7
|
+
match: 'count:5'
|
|
8
|
+
target: { source: file, path: tests/slugify.test.js }
|
|
9
|
+
weight: 3
|
|
10
|
+
---
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: regex
|
|
3
|
+
# A grader cannot run `git status --porcelain`, so this reads the harness's own
|
|
4
|
+
# list of files the run created in the working directory, one path per line.
|
|
5
|
+
# .git/ is excluded because git keeps worktree bookkeeping there. Fails on any
|
|
6
|
+
# line naming a path outside .test-redundancy-auditor/. Edits to existing
|
|
7
|
+
# files never appear here; tests-unchanged covers the test file.
|
|
8
|
+
pattern: '^(?!\.test-redundancy-auditor/|\.git/).+'
|
|
9
|
+
flags: m
|
|
10
|
+
match: not_contains
|
|
11
|
+
target: files
|
|
12
|
+
weight: 3
|
|
13
|
+
---
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: callers-tree-unchanged
|
|
3
|
+
description: "The duplicate fixture again. Pins the audit as report-only: no test or source file edited, nothing created outside .test-redundancy-auditor/, and that directory ignoring itself."
|
|
4
|
+
tags: [report-only, tree, scaffold, write]
|
|
5
|
+
max_turns: 60
|
|
6
|
+
timeout_seconds: 1800
|
|
7
|
+
allowed_tools: [Read, Glob, Grep, Skill, Write, Edit, Bash, Agent]
|
|
8
|
+
expected_outcome: tests/slugify.test.js still holds its five tests, every created path is under .test-redundancy-auditor/, and .test-redundancy-auditor/.gitignore holds `*`.
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
Which tests in `tests/slugify.test.js` are redundant?
|