add-fuzz-targetlisted
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: ...")
}
})
}