.claude/skills/test-dedup/SKILL.md
Use when test suites feel bloated, when unit tests duplicate coverage already provided by property-based or simulation tests, or during periodic test hygiene. Identifies and removes redundant tests while keeping signal.
npx skillsauth add ahrav/gossip-rs test-dedupInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Audit test modules to eliminate duplicate and redundant tests, favoring property-based tests over hand-rolled unit tests when coverage overlaps.
Every test must earn its place. A test exists to:
Default to property-based tests. A single proptest! that verifies an invariant over thousands of inputs is strictly more valuable than five hand-picked unit tests checking the same invariant at specific points. The unit tests are subsumed.
Keep unit tests only when they add unique value:
For each file or module under review:
#[test] function with a one-line summary of what it checksproptest! block with the properties it asserts#[kani::proof] with what it verifiesMap each test to the behavior it exercises:
| Behavior / Invariant | Unit Tests | Property Tests | Kani Proofs | Sim Coverage |
|---|---|---|---|---|
| Roundtrip encode/decode | test_encode_basic, test_encode_empty | prop_roundtrip | — | — |
| Bounds never exceeded | test_within_bounds | prop_bounds_hold | verify_bounds | — |
| Monotonic ordering | test_sorted_output | — | — | coordination_sim |
A unit test is redundant if ALL of the following are true:
A unit test is NOT redundant if ANY of the following are true:
// Regression: GH-123)test-support) and the unit test provides baseline ungated coverageFor every test, assign one label:
For each SUBSUME test:
For each MERGE group:
proptest! that generalizes all merged testsprop_assume! guardsFor each UPGRADE test:
proptest! with appropriate generators#[cfg(test)] (proptest is a direct dev-dependency, no feature gate needed)#[cfg(test)] mod tests { ... } at bottom of source file*_tests.rs files under crates/*/src/#[cfg(test)] module (proptest is a direct dev-dependency)#[cfg(kani)] mod kani_proofs { ... } in gossip-stdxcrates/gossip-coordination/src/sim/ (CoordinationSim)test-support featurekani featuretiger-harness (scanner-engine), scheduler-sim (scanner-scheduler)bench feature in scanner-engine, scanner-schedulerlib.rsShardSpec, ClaimTicket, coordination protocol types in gossip-contractsgossip-stdx (InlineVec, RingBuffer, ByteSlab)pub(crate) within a crate)Engine trait, RuleSpec, RuleCompiled in scanner-enginescanner-scheduler## Test Dedup Report: [module/file]
### Inventory
| # | Test | Type | Behavior Tested |
|---|------|------|-----------------|
| 1 | `test_foo_basic` | unit | Foo returns correct value for simple input |
| 2 | `test_foo_empty` | unit | Foo handles empty input |
| 3 | `prop_foo_roundtrip` | property | Foo roundtrips for all valid inputs |
| 4 | `verify_foo_bounds` | kani | Foo never exceeds buffer bounds |
### Coverage Matrix
| Behavior | Tests Covering It | Redundancy |
|---|---|---|
| Basic correctness | #1, #3 | #1 subsumed by #3 |
| Empty input | #2, #3 | #2 subsumed IF generator includes empty |
| Bounds safety | #4 | unique (Kani proof) |
### Verdicts
| Test | Verdict | Reason |
|------|---------|--------|
| `test_foo_basic` | SUBSUME | `prop_foo_roundtrip` covers all valid inputs including simple ones |
| `test_foo_empty` | KEEP (anchor) | Only readable example of empty-input behavior; property generator may skip empty |
| `prop_foo_roundtrip` | KEEP | Covers the broadest input space |
| `verify_foo_bounds` | KEEP | Unique formal verification value |
### Actions
1. **Delete** `test_foo_basic` — subsumed by `prop_foo_roundtrip`
2. **Keep** `test_foo_empty` — add comment: `// Anchor: documents empty-input edge case`
3. No changes to property/Kani tests
### Net Result
- Tests before: 4
- Tests after: 3
- Removed: 1 (25% reduction)
- Coverage impact: None (all removed tests fully subsumed)
Use your best judgment on borderline cases. Some guidelines:
test-support), keep at least one basic unit test ungated so cargo test (no features) still exercises the code./test-strategy — Decide what kind of test to write for new code/security-reviewer — Audit unsafe code (may affect test removal decisions)development
Deep first-principles code explanation that builds real understanding through phased walkthroughs with diagrams. Covers algorithms, data structures, memory layout, concurrency patterns, and performance tricks — especially for systems code in Rust. Use whenever the user asks to explain, walk through, break down, deep dive into, or understand code. Trigger on "how does this work", "what's happening here", "teach me about this", "why is it done this way", or when the user references a file with @ and wants to understand it. Proactively use when examining code involving lock-free algorithms, atomics/CAS, memory ordering,
development
Use when creating implementation-ready beads tasks that need testing strategy, optimal implementation approach, and documentation requirements baked in — composes /create-task with parallel enrichment agents that analyze the codebase and produce concrete test specifications, algorithm/data-structure guidance, and doc quality standards so implementing agents don't need to re-research
development
--- name: autoresearch description: Autonomous Goal-directed Iteration. Apply Karpathy's autoresearch principles to ANY task. Loops autonomously — modify, verify, keep/discard, repeat. Supports bounded iteration via Iterations: N inline config. version: 1.9.11 --- # Claude Autoresearch — Autonomous Goal-directed Iteration Inspired by [Karpathy's autoresearch](https://github.com/karpathy/autoresearch). Applies constraint-driven autonomous iteration to ANY work — not just ML research. **Core id
development
Use when implementing a new feature and assessing coverage gaps, during periodic test hygiene, when test suites feel bloated, or before merging code that changes coordination or hot paths. Two-phase assess-then-improve testing pipeline.