test-fuzz-gen
Automates the generation of compliant Go fuzz tests for input parsing and cryptographic handling.
Install
mkdir -p .claude/skills/test-fuzz-gen && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/15041" && unzip -o skill.zip -d .claude/skills/test-fuzz-gen && rm skill.zipInstalls to .claude/skills/test-fuzz-gen
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
Generate _fuzz_test.go fuzz tests conforming to cryptoutil project standards. Use when adding fuzz coverage for parsers, decoders, or crypto input handling to ensure correct build tags, 15s minimum fuzz time, seed corpus, and safe assertion patterns.Key capabilities
- →Generate Go fuzz tests for parsers
- →Generate Go fuzz tests for decoders
- →Generate Go fuzz tests for crypto input handling
- →Ensure fuzz tests conform to cryptoutil project standards
- →Include seed corpus entries for edge cases
- →Apply correct build tags for fuzz-only helpers
How it works
The skill generates a Go fuzz test file (`_fuzz_test.go`) based on cryptoutil project standards, including a template for seeding the corpus and defining the fuzzing logic.
Inputs & outputs
When to use test-fuzz-gen
- →Generate new fuzz test
- →Add seed corpus for crypto
- →Setup fuzz coverage for parser
- →Apply fuzzing build tags
About this skill
Generate _fuzz_test.go fuzz tests conforming to cryptoutil project standards.
Purpose
Use when creating fuzz tests for functions that parse or process external input.
Fuzz tests go in a separate _fuzz_test.go file (ONLY fuzz functions). Use
test-table-driven for deterministic example coverage and this skill for
mutation-style input exploration.
Key Rules
- File suffix:
_fuzz_test.go(ONLY fuzz functions, never mixed with unit tests) - Minimum fuzz time:
15sper test - CRITICAL: Function names MUST NOT be substrings of other fuzz function names — e.g. use
FuzzHKDFAllVariants, NEVERFuzzHKDFifFuzzHKDFAllVariantsexists in the same package - Omit
//go:build fuzzby default; only add a fuzz build tag when the package has fuzz-only helpers that must stay out of normal test builds - Property tests that MUST NOT run during fuzzing: add
//go:build !fuzzat top of_property_test.gofile - Corpus: provide seed entries covering edge cases (empty, nil, boundary values)
- Run from project root:
go test -fuzz=FuzzXxx -fuzztime=15s ./path/to/pkg
Template
package mypkg_test
import (
"testing"
)
func FuzzParseInput(f *testing.F) {
// Seed corpus — cover edge cases
f.Add([]byte(""))
f.Add([]byte("valid-input"))
f.Add([]byte("{invalid json}"))
f.Add([]byte("\x00\xff"))
f.Fuzz(func(t *testing.T, data []byte) {
// Must not panic
result, _ := ParseInput(data)
if result != nil {
// Validate invariants
_ = result
}
})
}
References
Read ENG-HANDBOOK.md Section 10.7 Fuzz Testing Strategy for fuzz testing requirements — apply the 15s minimum fuzz time, _fuzz_test.go file suffix, unique function name rule, and seed corpus requirements from this section.
Read ENG-HANDBOOK.md Section 10.1 Testing Strategy Overview for test file type suffixes — ensure _fuzz_test.go files contain ONLY fuzz functions and cross-check that _property_test.go files use //go:build !fuzz if they must not run during fuzz corpus execution.
When not to use it
- →When creating deterministic example coverage with table-driven tests
- →When fuzz functions are mixed with unit tests in the same file
Limitations
- →Fuzz tests must be in a separate `_fuzz_test.go` file
- →Fuzz function names must not be substrings of other fuzz function names in the same package
- →The skill is specific to Go fuzz tests conforming to cryptoutil project standards
How it compares
This skill provides a standardized template and rules for Go fuzz test generation, ensuring consistency and adherence to project-specific requirements, unlike manual test creation.
Compared to similar skills
test-fuzz-gen side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| test-fuzz-gen (this skill) | 0 | 3mo | No flags | Intermediate |
| go | 0 | 6mo | No flags | Beginner |
| codeql | 1 | 2mo | Review | Advanced |
| go-dev-guidelines | 14 | 9mo | No flags | Intermediate |
Try saying
Example prompts that trigger this skill in your AI assistant.
You might also like
go
rcarmo
go — an agent skill by rcarmo.
codeql
trailofbits
Runs CodeQL static analysis for security vulnerability detection using interprocedural data flow and taint tracking. Applicable when finding vulnerabilities, running a security scan, performing a security audit, running CodeQL, building a CodeQL database, selecting query rulesets, creating data extension models, or processing CodeQL SARIF output. NOT for writing custom QL queries or CI/CD pipeline setup.
go-dev-guidelines
jumppad-labs
This skill should be used when writing, refactoring, or testing Go code. It provides idiomatic Go development patterns, TDD-based workflows, project structure conventions, and testing best practices using testify/require and mockery. Activate this skill when creating new Go features, services, packages, tests, or when setting up new Go projects.
code-formatting
openshift
MANDATORY: When writing Go tests, you MUST use 'When...it should...' format for ALL test names. When writing any Go code, you MUST remind user to run 'make lint-fix' and 'make verify'. These are non-negotiable HyperShift requirements.
tidb-test-guidelines
pingcap
Decide where to place TiDB tests and how to write them (basic structure, naming, testdata usage). Use when asked about test locations, writing conventions, shard_count limits, casetest categorization, or when reviewing test changes in code review.
go-table-driven-tests
Xe
Write Go table-driven tests following Go community best practices and this repository's conventions. Use when writing or refactoring Go tests, especially when you notice repeated test patterns or copy-pasted test code.