From test-case-reduction
Guide the user through setting up and running test-case reduction with shrinkray. Use when the user has a file that triggers a bug and wants to minimize it.
How this skill is triggered — by the user, by Claude, or both
Slash command
/test-case-reduction:reduceThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
You are helping the user set up and run a test-case reduction. They have a file that triggers some bug or exhibits some property, and they want to minimize it to a small, understandable example.
You are helping the user set up and run a test-case reduction. They have a file that triggers some bug or exhibits some property, and they want to minimize it to a small, understandable example.
Ask about:
write-interestingness-test skill).Preprocessing eliminates header dependencies and gives the reducer much more freedom:
gcc -E -P file.c > file.i
# or
clang -E -P file.c > file.i
Then reduce file.i instead of file.c.
Use -P to suppress #line directives (they bloat the file and confuse some reducer passes).
If possible, consolidate into a single file. For C/C++, preprocessing handles this. For other languages, manually inline imports if feasible.
For truly multi-file cases, shrinkray's directory mode works:
shrinkray test.sh ./test-directory/
Consider manual pre-reduction: remove sections that are obviously irrelevant (dead code, unrelated functions, unused imports) before starting the reducer.
If the user doesn't have one, help them write one. The test must:
See the write-interestingness-test skill for detailed guidance.
Always verify the test before running the reducer:
# Should exit 0
./test.sh original_file; echo "Exit: $?"
# Should exit non-zero (test with empty/trivial input)
echo "" | ./test.sh /dev/stdin; echo "Exit: $?"
shrinkray ./test.sh file_to_reduce
Key options to consider:
--timeout N — Override auto-calibrated timeout (useful if the bug is timing-sensitive)--parallelism N — Limit parallelism (useful if the test has side effects)--input-type {stdin,arg,basename,all} — How the test receives input (default: all)--formatter none — Disable auto-formatting (if the formatter interferes)--volume debug — Verbose output for troubleshooting--seed N — Set random seed for reproducibilitydebug-reduction skill.After reduction completes:
npx claudepluginhub drmaciver/test-case-reduction-skillGuides active bug investigation using Code Complete's scientific debugging method: STABILIZE → LOCATE → HYPOTHESIZE → EXPERIMENT → FIX → TEST → SEARCH. Runs the failing test first, then forms testable hypotheses before editing.
Creates minimal working examples (MWEs) from Lean 4 errors for bug reports using lake minimizers, with setup for lean4 and mathlib4 repositories.
Writes property-based tests using Hegel across Rust, Go, C++, and TypeScript projects. Generates random inputs and shrinks failures to minimal counterexamples.