Generated banner for Testing Handbook Generator
Generated logo for Testing Handbook Generator

Testing Handbook Generator

Trail of BitsOfficialPublished by Trail of Bits

  • Skill
  • Workflow
  • Agent tooling
  • CC-BY-SA-4.0
  • No issues found

From the author

Generates Claude Code skills from the Trail of Bits Testing Handbook (appsec.guide), analyzing handbook pages and emitting SKILL.md files with the structure each skill type requires. Use when creating or refreshing a skill from handbook content, or when the user names the testing handbook or appsec.guide. Not for answering security testing questions — the generated skills cover those.
— the description by Trail of Bits

AutoGineer summary

Written by AutoGineer from the skill’s own files, not by the author

The testing-handbook-generator is a workflow-based skill designed to transform content from the Trail of Bits Testing Handbook into structured Claude Code skills. It follows a multi-phase process that includes handbook discovery, planning, two-pass content generation, and validation. The skill ensures that generated documentation adheres to specific templates based on the handbook section type, such as tools, fuzzers, techniques, or domains. It also manages cross-references between generated skills and updates repository documentation to maintain consistency.

What it does

  • Analyzes the Trail of Bits Testing Handbook to identify potential skills.
  • Generates structured SKILL.md files using predefined templates.
  • Executes a two-pass generation process to handle cross-references between skills.
  • Validates generated skills and their cross-references using automated scripts.
  • Updates the repository README and cross-reference graphs.
  • Supports regeneration of individual skills from specific handbook sections.

When to use it

  • When you need to create new security testing skills derived from the appsec.guide handbook.
  • When you need to refresh existing skills based on updates to the handbook content.
  • When you are performing bulk skill generation or maintenance within the plugin structure.
  • When a user explicitly references the testing handbook or appsec.guide.

Advantages

  • Ensures consistent structure across all generated security skills.
  • Automates the complex task of managing inter-skill dependencies.
  • Provides a clear workflow for validating and integrating new skills into the repository.
  • Reduces manual effort in maintaining documentation and cross-references.

Usage examples

“Generate skills from the testing handbook”
The agent initiates the discovery phase, scans the handbook, presents a generation plan for approval, and proceeds to create the skills.
“Create a skill for the libFuzzer section”
The agent reads the specific libFuzzer handbook section, applies the fuzzer-skill template, and generates the corresponding SKILL.md file.
“Regenerate the semgrep skill from the handbook”
The agent re-reads the relevant handbook section, overwrites the existing semgrep SKILL.md, and updates cross-references.

Install

  1. Download the skill as a ZIP:

    https://autogineer.com/agent-skills/trailofbits/testing-handbook-generator/download
  2. Unzip it into the cross-client skills folder of your project:

    mkdir -p .agents/skills && unzip testing-handbook-generator.zip -d .agents/skills

Documentation by Trail of Bits

Testing Handbook Skill Generator

Generate and maintain Claude Code skills from the Trail of Bits Testing Handbook.

When to Use

Invoke this skill when:

  • Creating new security testing skills from handbook content

  • User mentions "testing handbook", "appsec.guide", or asks about generating skills

  • Bulk skill generation or refresh is needed

Do NOT use for:

  • General security testing questions (use the generated skills)

  • Non-handbook skill creation

Handbook Location

The skill needs the Testing Handbook repository. See discovery.md for full details.

Quick reference: Check ./testing-handbook, ../testing-handbook, ~/testing-handbook → ask user → clone as last resort.

Repository: https://github.com/trailofbits/testing-handbook

Workflow Overview

Phase 0: Setup              Phase 1: Discovery
┌─────────────────┐        ┌─────────────────┐
│ Locate handbook │   →    │ Analyze handbook│
│ - Find or clone │        │ - Scan sections │
│ - Confirm path  │        │ - Classify types│
└─────────────────┘        └─────────────────┘
         ↓                          ↓
Phase 3: Generation        Phase 2: Planning
┌─────────────────┐        ┌─────────────────┐
│ TWO-PASS GEN    │   ←    │ Generate plan   │
│ Pass 1: Content │        │ - New skills    │
│ Pass 2: X-refs  │        │ - Updates       │
│ - Write to gen/ │        │ - Present user  │
└─────────────────┘        └─────────────────┘
         ↓
Phase 4: Testing           Phase 5: Finalize
┌─────────────────┐        ┌─────────────────┐
│ Validate skills │   →    │ Post-generation │
│ - Run validator │        │ - Update README │
│ - Test activation│       │ - Update X-refs │
│ - Fix issues    │        │ - Self-improve  │
└─────────────────┘        └─────────────────┘

Scope Restrictions

ONLY modify these locations:

  • plugins/testing-handbook-skills/skills/[skill-name]/* - Generated skills (as siblings to testing-handbook-generator)

  • plugins/testing-handbook-skills/skills/testing-handbook-generator/* - Self-improvement

  • Repository root README.md - Add generated skills to table

NEVER modify or analyze:

  • Other plugins (plugins/property-based-testing/, plugins/static-analysis/, etc.)

  • Other skills outside this plugin

Do not scan or pull into context any skills outside of testing-handbook-skills/. Generate skills based solely on handbook content and resources referenced from it.

Quick Reference

Section → Skill Type Mapping
Handbook SectionSkill TypeTemplate
/static-analysis/[tool]/Tool Skilltool-skill.md
/fuzzing/[lang]/[fuzzer]/Fuzzer Skillfuzzer-skill.md
/fuzzing/techniques/Technique Skilltechnique-skill.md
/crypto/[tool]/Domain Skilldomain-skill.md
/web/[tool]/Tool Skilltool-skill.md
Skill Candidate Signals
SignalIndicates
_index.md with bookCollapseSection: trueMajor tool/topic
Numbered files (00-, 10-, 20-)Structured content
techniques/ subsectionMethodology content
99-resources.md or 91-resources.mdHas external links
Exclusion Signals
SignalAction
draft: true in frontmatterSkip section
Empty directorySkip section
Template/placeholder fileSkip section
GUI-only tool (e.g., web/burp/)Skip section (Claude cannot operate GUI tools)

Decision Tree

Starting skill generation?

├─ Need to analyze handbook and build plan?
│  └─ Read: discovery.md
│     (Handbook analysis methodology, plan format)
│
├─ Spawning skill generation agents?
│  └─ Read: agent-prompt.md
│     (Full prompt template, variable reference, validation checklist)
│
├─ Generating a specific skill type?
│  └─ Read appropriate template:
│     ├─ Tool (Semgrep, CodeQL) → templates/tool-skill.md
│     ├─ Fuzzer (libFuzzer, AFL++) → templates/fuzzer-skill.md
│     ├─ Technique (harness, coverage) → templates/technique-skill.md
│     └─ Domain (crypto, web) → templates/domain-skill.md
│
├─ Validating generated skills?
│  └─ Run: scripts/validate-skills.py
│     Then read: testing.md for activation testing
│
├─ Finalizing after generation?
│  └─ See: Post-Generation Tasks below
│     (Update main README, update Skills Cross-Reference, self-improvement)
│
└─ Quick generation from specific section?
   └─ Use Quick Reference above, apply template directly

Two-Pass Generation (Phase 3)

Generation uses a two-pass approach to solve forward reference problems (skills referencing other skills that don't exist yet).

Pass 1: Content Generation (Parallel)

Generate all skills in parallel without the Related Skills section:

Pass 1 - Generating 5 skills in parallel:
├─ Agent 1: libfuzzer (fuzzer) → skills/libfuzzer/SKILL.md
├─ Agent 2: aflpp (fuzzer) → skills/aflpp/SKILL.md
├─ Agent 3: semgrep (tool) → skills/semgrep/SKILL.md
├─ Agent 4: harness-writing (technique) → skills/harness-writing/SKILL.md
└─ Agent 5: wycheproof (domain) → skills/wycheproof/SKILL.md

Each agent uses: pass=1 (content only, Related Skills left empty)

Pass 1 agents:

  • Generate all sections EXCEPT Related Skills

  • Leave a placeholder: ## Related Skills\n\n<!-- PASS2: populate after all skills exist -->

  • Output report includes references: DEFERRED

Pass 2: Cross-Reference Population (Sequential)

After all Pass 1 agents complete, run Pass 2 to populate Related Skills:

Pass 2 - Populating cross-references:
├─ Read all generated skill names from skills/*/SKILL.md
├─ For each skill, determine related skills based on:
│   ├─ related_sections from discovery (handbook structure)
│   ├─ Skill type relationships (fuzzers → techniques)
│   └─ Explicit mentions in content
└─ Update each SKILL.md's Related Skills section

Pass 2 process:

  1. Collect all generated skill names: ls -d skills/*/SKILL.md

  2. For each skill, identify related skills using the mapping from discovery

  3. Edit each SKILL.md to replace the placeholder with actual links

  4. Validate cross-references exist (no broken links)

Agent Prompt Template

See agent-prompt.md for the full prompt template with:

  • Variable substitution reference (including pass variable)

  • Pre-write validation checklist

  • Hugo shortcode conversion rules

  • Line count splitting rules

  • Error handling guidance

  • Output report format

Collecting Results

After Pass 1: Aggregate output reports, verify all skills generated. After Pass 2: Run validator to check cross-references.

Handling Agent Failures

If an agent fails or produces invalid output:

Failure TypeDetectionRecovery Action
Agent crashedNo output reportRe-run single agent with same inputs
Validation failedOutput report shows errorsCheck gaps/warnings, manually patch or re-run
Wrong skill typeContent doesn't match templateRe-run with corrected type parameter
Missing contentOutput report lists gapsAccept if minor, or provide additional related_sections
Pass 2 broken refValidator shows missing skillCheck if skill was skipped, update reference

Important: Do NOT re-run the entire parallel batch for a single agent failure. Fix individual failures independently.

Single-Skill Regeneration

To regenerate a single skill without re-running the entire batch:

# Regenerate single skill (Pass 1 - content only)
"Use testing-handbook-generator to regenerate the {skill-name} skill from section {section_path}"

# Example:
"Use testing-handbook-generator to regenerate the libfuzzer skill from section fuzzing/c-cpp/10-libfuzzer"

Regeneration workflow:

  1. Re-read the handbook section for fresh content

  2. Apply the appropriate template

  3. Write to skills/{skill-name}/SKILL.md (overwrites existing)

  4. Re-run Pass 2 for that skill only to update cross-references

  5. Run validator on the single skill: uv run scripts/validate-skills.py --skill {skill-name}

Output Location

Generated skills are written to:

skills/[skill-name]/SKILL.md

Each skill gets its own directory for potential supporting files (as siblings to testing-handbook-generator).

Quality Checklist

Before delivering generated skills:

  • [ ] All handbook sections analyzed (Phase 1)

  • [ ] Plan presented to user before generation (Phase 2)

  • [ ] Parallel agents launched - one per skill (Phase 3)

  • [ ] Templates applied correctly per skill type

  • [ ] Validator passes: uv run scripts/validate-skills.py

  • [ ] Activation testing passed - see testing.md

  • [ ] Main README.md updated with generated skills table

  • [ ] README.md Skills Cross-Reference graph updated

  • [ ] Self-improvement notes captured

  • [ ] User notified with summary

Post-Generation Tasks

1. Update Main README

After generating skills, update the repository's main README.md to list them.

Format: Add generated skills to the same "Available Plugins" table, directly after testing-handbook-skills. Use plain text testing-handbook-generator as the author (no link).

Example:

| Plugin | Description | Author |
|--------|-------------|--------|
| ... other plugins ... |
| [testing-handbook-skills](plugins/testing-handbook-skills/) | Meta-skill that generates skills from the Testing Handbook | Paweł Płatek |
| [libfuzzer](plugins/testing-handbook-skills/skills/libfuzzer/) | Coverage-guided fuzzing with libFuzzer for C/C++ | testing-handbook-generator |
| [aflpp](plugins/testing-handbook-skills/skills/aflpp/) | Multi-core fuzzing with AFL++ | testing-handbook-generator |
| [semgrep](plugins/testing-handbook-skills/skills/semgrep/) | Fast static analysis for finding bugs | testing-handbook-generator |
2. Update Skills Cross-Reference

After generating skills, update the README.md's Skills Cross-Reference section with the mermaid graph showing skill relationships.

Process:

  1. Read each generated skill's SKILL.md and extract its ## Related Skills section

  2. Build the mermaid graph with nodes grouped by skill type (Fuzzers, Techniques, Tools, Domain)

  3. Add edges based on the Related Skills relationships:

    • Solid arrows (-->) for primary technique dependencies

    • Dashed arrows (-.->) for alternative tool suggestions

  4. Replace the existing mermaid code block in README.md

Edge classification:

RelationshipArrow StyleExample
Fuzzer → Technique-->libfuzzer --> harness-writing
Tool → Tool (alternative)-.->semgrep -.-> codeql
Fuzzer → Fuzzer (alternative)-.->libfuzzer -.-> aflpp
Technique → Technique-->harness-writing --> coverage-analysis

Validation: After updating, run validate-skills.py to verify all referenced skills exist.

3. Self-Improvement

After each generation run, reflect on what could improve future runs.

Capture improvements to:

  • Templates (missing sections, better structure)

  • Discovery logic (missed patterns, false positives)

  • Content extraction (shortcodes not handled, formatting issues)

Update process:

  1. Note issues encountered during generation

  2. Identify patterns that caused problems

  3. Update relevant files:

    • SKILL.md - Workflow, decision tree, quick reference updates

    • templates/*.md - Template improvements

    • discovery.md - Detection logic updates

    • testing.md - New validation checks

  4. Document the improvement in commit message

Example self-improvement:

Issue: libFuzzer skill missing sanitizer flags table
Fix: Updated templates/fuzzer-skill.md to include ## Compiler Flags section

Example Usage

Full Discovery and Generation
User: "Generate skills from the testing handbook"

1. Locate handbook (check common locations, ask user, or clone)
2. Read discovery.md for methodology
3. Scan handbook at {handbook_path}/content/docs/
4. Build candidate list with types
5. Present plan to user
6. On approval, generate each skill using appropriate template
7. Validate generated skills
8. Update main README.md with generated skills table
9. Update README.md Skills Cross-Reference graph from Related Skills sections
10. Self-improve: note any template/discovery issues for future runs
11. Report results
Single Section Generation
User: "Create a skill for the libFuzzer section"

1. Read /testing-handbook/content/docs/fuzzing/c-cpp/10-libfuzzer/
2. Identify type: Fuzzer Skill
3. Read templates/fuzzer-skill.md
4. Extract content, apply template
5. Write to skills/libfuzzer/SKILL.md
6. Validate and report

Tips

Do:

  • Always present plan before generating

  • Use appropriate template for skill type

  • Preserve code blocks exactly

  • Validate after generation

Don't:

  • Generate without user approval

  • Skip fetching non-video external resources (use WebFetch)

  • Fetch video URLs (YouTube, Vimeo - titles only)

  • Include handbook images directly

  • Skip validation step

  • Exceed 500 lines per SKILL.md


For first-time use: Start with discovery.md to understand the handbook analysis process.

For template reference: See templates/ directory for skill type templates.

For validation: See testing.md for quality assurance methodology.

Files

templates/technique-skill.md

Technique Skill Template

Use this template for cross-cutting techniques that apply to multiple tools (harness writing, coverage analysis, sanitizers, dictionaries, etc.).

Template Structure

---
name: {technique-name-lowercase}
type: technique
description: "{What applying this technique achieves, leading with the outcome rather than naming the technique}. Covers {the concrete steps, tools, and flags}. Use when {the situations a user describes, in the words they would type — the symptom, the stalled campaign, the error, the question}."
---

# {Technique Name}

{Brief introduction - what this technique is and why it matters}

## Overview

{High-level explanation of the technique}

### Key Concepts

| Concept | Description |
|---------|-------------|
| {Concept 1} | {Brief explanation} |
| {Concept 2} | {Brief explanation} |

## When to Apply

**Apply this technique when:**
- {Trigger 1}
- {Trigger 2}
- {Trigger 3}

**Skip this technique when:**
- {Skip condition 1}
- {Skip condition 2}

## Quick Reference

{Essential commands or patterns in one place}

| Task | Command/Pattern |
|------|-----------------|
| {Task 1} | `{command or pattern}` |
| {Task 2} | `{command or pattern}` |
| {Task 3} | `{command or pattern}` |

## Step-by-Step

{Detailed workflow for applying this technique}

### Step 1: {First Step}

{Instructions with code examples}

\```{language}
{Example code}
\```

### Step 2: {Second Step}

{Instructions}

### Step 3: {Third Step}

{Instructions}

## Common Patterns

{Code patterns that demonstrate this technique}

### Pattern: {Pattern Name 1}

**Use Case:** {When to use this pattern}

**Before:**
\```{language}
{Code before applying technique}
\```

**After:**
\```{language}
{Code after applying technique}
\```

### Pattern: {Pattern Name 2}

**Use Case:** {When to use this pattern}

**Before:**
\```{language}
{Code before}
\```

**After:**
\```{language}
{Code after}
\```

## Advanced Usage

### Tips and Tricks

{Practical tips from experienced practitioners}

| Tip | Why It Helps |
|-----|--------------|
| {Tip 1} | {Explanation} |
| {Tip 2} | {Explanation} |
| {Tip 3} | {Explanation} |

### {Advanced Topic 1}

{Details}

### {Advanced Topic 2}

{Details}

## Anti-Patterns

{What NOT to do}

| Anti-Pattern | Problem | Correct Approach |
|--------------|---------|------------------|
| {Bad practice 1} | {Why it's bad} | {What to do instead} |
| {Bad practice 2} | {Why it's bad} | {What to do instead} |
| {Bad practice 3} | {Why it's bad} | {What to do instead} |

## Tool-Specific Guidance

{How this technique applies to specific fuzzers/tools - this is KEY for discoverability}

### libFuzzer

{Specific guidance for libFuzzer}

\```bash
{libFuzzer-specific command}
\```

**Integration tips:**
- {Tip specific to libFuzzer}
- {Tip specific to libFuzzer}

### AFL++

{Specific guidance for AFL++}

\```bash
{AFL++-specific command}
\```

**Integration tips:**
- {Tip specific to AFL++}
- {Tip specific to AFL++}

### cargo-fuzz (Rust)

{Specific guidance for Rust fuzzing}

\```bash
{cargo-fuzz command}
\```

**Integration tips:**
- {Tip specific to cargo-fuzz}

### go-fuzz (Go)

{Specific guidance for Go fuzzing}

\```bash
{go-fuzz command}
\```

### {Other Tool}

{Add sections for other relevant tools from handbook}

## Troubleshooting

| Issue | Cause | Solution |
|-------|-------|----------|
| {Issue 1} | {Cause} | {Fix} |
| {Issue 2} | {Cause} | {Fix} |
| {Issue 3} | {Cause} | {Fix} |

## Related Skills

{Links to tools and other techniques - bidirectional references}

### Tools That Use This Technique

| Skill | How It Applies |
|-------|----------------|
| **{fuzzer-skill-1}** | {How this technique is used with this fuzzer} |
| **{fuzzer-skill-2}** | {How this technique is used with this fuzzer} |
| **{tool-skill-1}** | {How this technique applies to this tool} |

### Related Techniques

| Skill | Relationship |
|-------|--------------|
| **{technique-skill-1}** | {How they work together - e.g., "Use coverage to identify where harness improvements are needed"} |
| **{technique-skill-2}** | {Complementary relationship} |

## Resources

### Key External Resources

{For each non-video URL: fetch with WebFetch, summarize key insights}

**[{Title 1}]({URL})**
{Summarized insights from fetched content}

### Video Resources

{Videos - title and URL only, no fetching}

- [{Video Title}]({YouTube/Vimeo URL}) - {Brief description}

Field Extraction Guide

Template FieldHandbook Source
{technique-name-lowercase}Slugified from directory/title
{Summary}From _index.md frontmatter or intro
Key ConceptsExtract definitions from handbook
Step-by-StepMain workflow from handbook
Common PatternsCode examples from handbook
Tool IntegrationFrom tool-specific subsections
Related SkillsMap to fuzzer and tool skills

Tool-Specific Section Guide

Include tool-specific guidance for tools covered in the handbook:

LanguageTools to Include
C/C++libFuzzer, AFL++, honggfuzz
Rustcargo-fuzz, libFuzzer
Gogo-fuzz, native fuzzing
PythonAtheris, Hypothesis
JavaScriptjsfuzz

When generating a technique skill, create bidirectional links:

If Technique Is AboutLink To These Skills
Harness writingAll fuzzer skills that use harnesses
SanitizersAll fuzzer skills (they all use sanitizers)
CoverageFuzzer skills, static analysis tools
Corpus/dictionariesAll fuzzer skills

Example: Writing Fuzzing Harnesses

---
name: fuzz-harness-writing
type: technique
description: "Designs and improves fuzzing harnesses for C/C++ and Rust. Covers mapping raw bytes onto a target API, generating structured inputs, avoiding non-determinism and false crashes, and deciding what to fuzz together. Use when writing a first fuzz target, when a campaign finds nothing or reports crashes that will not reproduce, or when the target API needs structured rather than raw input."
---

# Writing Fuzzing Harnesses

A harness is the entrypoint for your fuzz test. The fuzzer calls this function
with random data, and the harness routes that data to your code under test.

## Overview

### Key Concepts

| Concept | Description |
|---------|-------------|
| Harness | Function that receives fuzzer input and calls target code |
| SUT | System Under Test - the code being fuzzed |
| Entry point | Function signature required by the fuzzer |

## When to Apply

**Apply this technique when:**
- Creating a new fuzz target
- Fuzz campaign has low coverage
- Crashes are not reproducible

**Skip this technique when:**
- Using existing well-tested harnesses
- Tool provides automatic harness generation

## Quick Reference

| Task | Pattern |
|------|---------|
| Minimal C++ harness | `extern "C" int LLVMFuzzerTestOneInput(const uint8_t*, size_t)` |
| Minimal Rust harness | `fuzz_target!(|data: &[u8]| { ... })` |
| Minimal Go harness | `func Fuzz(data []byte) int { ... }` |
| Size validation | `if (size < MIN) return 0;` |

## Step-by-Step

### Step 1: Identify Entry Points

Find functions that:
- Accept external input
- Parse data formats
- Perform validation

### Step 2: Write Minimal Harness

\```c++
extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
    target_function(data, size);
    return 0;
}
\```

### Step 3: Add Input Validation

\```c++
extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
    if (size < MIN_SIZE || size > MAX_SIZE) return 0;
    target_function(data, size);
    return 0;
}
\```

## Common Patterns

### Pattern: Size-Bounded Input

**Use Case:** When target expects minimum input size

**Before:**
\```c++
extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
    parse_message(data, size);  // May crash on tiny inputs
    return 0;
}
\```

**After:**
\```c++
extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
    if (size < sizeof(header_t)) return 0;  // Skip invalid sizes
    parse_message(data, size);
    return 0;
}
\```

## Advanced Usage

### Tips and Tricks

| Tip | Why It Helps |
|-----|--------------|
| Start with parsers | High bug density, clear entry points |
| Use FuzzedDataProvider | Structured data extraction from fuzz input |
| Mock I/O operations | Prevents hangs, enables determinism |

### Structure-Aware Fuzzing

{How to use proto definitions, grammars, etc.}

## Anti-Patterns

| Anti-Pattern | Problem | Correct Approach |
|--------------|---------|------------------|
| Global state | Non-deterministic | Reset state in harness |
| Blocking I/O | Hangs fuzzer | Mock or skip I/O |
| Memory leaks | Resource exhaustion | Free in harness |

## Tool-Specific Guidance

### libFuzzer

\```c++
extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
    // Your code here
    return 0;
}
\```

**Integration tips:**
- Use `FuzzedDataProvider` for structured extraction
- Compile with `-fsanitize=fuzzer`

### AFL++

\```c++
int main(int argc, char **argv) {
    #ifdef __AFL_HAVE_MANUAL_CONTROL
        __AFL_INIT();
    #endif

    unsigned char *buf = NULL;
    size_t len = 0;
    while (__AFL_LOOP(10000)) {
        // Read from stdin, call target
    }
    return 0;
}
\```

**Integration tips:**
- Use persistent mode for performance
- Consider deferred initialization

### cargo-fuzz (Rust)

\```rust
#![no_main]
use libfuzzer_sys::fuzz_target;

fuzz_target!(|data: &[u8]| {
    // Your code here
});
\```

## Related Skills

### Tools That Use This Technique

| Skill | How It Applies |
|-------|----------------|
| **libfuzzer** | Uses LLVMFuzzerTestOneInput harness signature |
| **aflpp** | Supports persistent mode harnesses |
| **cargo-fuzz** | Uses Rust-specific harness macros |
| **go-fuzz** | Uses Go-specific harness signature |

### Related Techniques

| Skill | Relationship |
|-------|--------------|
| **coverage-analysis** | Measure harness effectiveness |
| **address-sanitizer** | Detect bugs found by harness |
| **fuzzing-corpus** | Provide seed inputs to harness |

...

Example: AddressSanitizer

---
name: address-sanitizer
type: technique
description: "Builds and runs code under AddressSanitizer to catch buffer overflows, use-after-free, and other memory errors during fuzzing or tests. Covers -fsanitize=address builds, ASAN_OPTIONS, reading the crash report, LeakSanitizer, and the overhead and platform trade-offs. Use when fuzzing C/C++ or Rust that has unsafe blocks or FFI, when debugging a memory corruption crash, or when reading an ASan stack trace."
---

# AddressSanitizer (ASan)

AddressSanitizer is a fast memory error detector for C/C++. It finds buffer
overflows, use-after-free, and other memory bugs with ~2x slowdown.

## Quick Reference

| Task | Command |
|------|---------|
| Enable ASan (Clang) | `-fsanitize=address` |
| Enable ASan (GCC) | `-fsanitize=address` |
| Disable leak detection | `ASAN_OPTIONS=detect_leaks=0` |
| Increase stack size | `ASAN_OPTIONS=stack_size=...` |

## Tool-Specific Guidance

### libFuzzer

\```bash
clang++ -fsanitize=fuzzer,address -g harness.cc -o fuzz
\```

**Integration tips:**
- Always combine with fuzzer sanitizer
- Use `-g` for better stack traces

### AFL++

\```bash
AFL_USE_ASAN=1 afl-clang-fast++ -g harness.cc -o fuzz
\```

**Integration tips:**
- Use `AFL_USE_ASAN` environment variable
- Consider memory limits with `AFL_MAP_SIZE`

## Related Skills

### Tools That Use This Technique

| Skill | How It Applies |
|-------|----------------|
| **libfuzzer** | Compile with `-fsanitize=fuzzer,address` |
| **aflpp** | Use `AFL_USE_ASAN=1` |
| **honggfuzz** | Compile with `-fsanitize=address` |

### Related Techniques

| Skill | Relationship |
|-------|--------------|
| **undefined-behavior-sanitizer** | Often used together for comprehensive detection |
| **fuzz-harness-writing** | Harness must handle ASan-detected crashes |
| **coverage-analysis** | Coverage guides fuzzer to trigger ASan errors |

...

Notes

  • Technique skills should be tool-agnostic in overview, tool-specific in guidance

  • ALWAYS include Tool-Specific Guidance section for major tools

  • ALWAYS include Related Skills with bidirectional links

  • Include Tips and Tricks in Advanced Usage section

  • Link to related technique skills

  • Keep under 500 lines

  • Fetch non-video external resources with WebFetch, extract key insights

  • For videos (YouTube, Vimeo): include title/URL only, do not fetch

Requirements and compatibility

Written for: Claude Code

Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta

“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.

Needs: Names Claude Code tools, Needs Python

Security

No issues found by our static scan· No issues found

A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.

Attribution and licence

Published by
Trail of Bits
Publisher
Trail of Bits (Official)
Source
trailofbits/skills · plugins/testing-handbook-skills/skills/testing-handbook-generator · commit e4dd0bb
Licence
Creative Commons Attribution-ShareAlike 4.0 International (redistribution allowed)
  • LICENSE (added by AutoGineer from LICENSE)
  • ATTRIBUTION.md (written by AutoGineer)
Synced

AutoGineer is not affiliated with or endorsed by Trail of Bits or Trail of Bits.

Download ZIP

The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download testing-handbook-generator.zip