← ClaudeAtlas

add-fuzz-targetlisted

Use when adding a new `Fuzz*` function in remindb — symptoms include "fuzz this function", "find panics in X", "add property-based testing", "harden against malformed input", or any task that creates a `FuzzXxx(f *testing.F)` in a `*_test.go`. Also use when extending an existing fuzz target's seed corpus with new shape coverage.
radimsem/remindb · ★ 114 · AI & Automation · score 83
Install: claude install-skill radimsem/remindb
# Add a fuzz target remindb fuzzes parser, query, transformer, compiler, and temperature code. The fuzz harness is whatever Go's `testing.F` gives you — there's no project-specific framework — but the *seed-corpus discipline* is project convention worth getting right. `scripts/fuzz.sh` auto-discovers any `Fuzz*` function via `go test -list='^Fuzz'`, so naming your function `FuzzXxx` is the only registration needed. ## Where it lands Two files at most. | File | What changes | |---|---| | `pkg/<package>/fuzz_test.go` | New file or extend existing — `FuzzXxx(f *testing.F)` | | `pkg/<package>/testdata/fuzz/<FuzzXxx>/` | Auto-managed by Go fuzz; commit any minimization corpus crashes find here | If `pkg/<package>/fuzz_test.go` already exists (it does for `parser`, `query`, `transformer`, `compiler`, `temperature`), append; don't make a second file. ## The function shape Mirror `pkg/parser/fuzz_test.go` and `pkg/temperature/fuzz_test.go`. The shape is uniform: ```go func FuzzExample(f *testing.F) { // Seed corpus — see "Seed selection" below. f.Add(input1, input2) // ... more f.Add lines, each one shape ... f.Fuzz(func(t *testing.T, input1 T1, input2 T2) { result, err := YourFunc(input1, input2) // Invariants — see "Invariant assertions" below. if err != nil { return // errors are fine; panics are not } if !invariantHolds(result) { t.Errorf("invariant violated: ...") } }) }