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.zip

Installs 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.
250 chars✓ has a “when” trigger
Intermediate

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

You give it
A package or function name for which to generate a fuzz test
You get back
A `_fuzz_test.go` file containing a fuzz test with a seed corpus and appropriate structure

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: 15s per test
  • CRITICAL: Function names MUST NOT be substrings of other fuzz function names — e.g. use FuzzHKDFAllVariants, NEVER FuzzHKDF if FuzzHKDFAllVariants exists in the same package
  • Omit //go:build fuzz by 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 !fuzz at top of _property_test.go file
  • 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.

SkillInstallsUpdatedSafetyDifficulty
test-fuzz-gen (this skill)03moNo flagsIntermediate
go06moNo flagsBeginner
codeql12moReviewAdvanced
go-dev-guidelines149moNo flagsIntermediate

Try saying

Example prompts that trigger this skill in your AI assistant.

You might also like

go

rcarmo

go — an agent skill by rcarmo.

00

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.

12

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.

1495

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.

112

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.

210

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.

15

Search skills

Search the agent skills registry