Back to Security & Vulnerability Analysis

testing-handbook-generator

skill generationsecurity testingappsectrail of bitshandbookautomationagent developmentcode security
โญ 5.7k๐Ÿ“„ CC-BY-SA-4.0๐Ÿ•’ 2026-06-15Source โ†—

Install this skill

npx skills add trailofbits/skills

Works across Claude Code, Cursor, Codex, Copilot & Antigravity

The testing-handbook-generator is an automated agent skill that parses the Trail of Bits Testing Handbook to produce structured, standardized Claude Code skills. It streamlines the conversion of raw security documentation into actionable, developer-ready formats by mapping handbook sectionsโ€”such as static analysis tools, fuzzing techniques, and cryptographic domain guidesโ€”to specific, version-controlled skill templates. The process follows a strict two-pass generation workflow, ensuring initial content creation remains isolated from inter-skill references before finalizing cross-links and project-level documentation. This tool maintains consistency across the security plugin ecosystem by adhering to defined path limitations and skipping non-CLI or draft-status content, ensuring only high-quality, executable security guidance is added to the agent directory.

When to Use This Skill

  • โ€ขSyncing the agent skill directory with the latest handbook repository updates
  • โ€ขGenerating a new tool-specific skill from a handbook section folder
  • โ€ขStandardizing documentation across multiple security plugin modules
  • โ€ขRefreshing internal skill documentation based on structural changes in source files

How to Invoke This Skill

Example prompts that trigger this skill in Claude Code, Cursor, or Antigravity:

  • โ€œGenerate new skills from the testing handbook
  • โ€œUpdate my agent skills using the appsec.guide content
  • โ€œScan the testing-handbook repository for new tools
  • โ€œBuild out the security handbook skill set
  • โ€œRefresh skills based on the latest handbook changes

Pro Tips

  • ๐Ÿ’กEnsure the `trailofbits/testing-handbook` repository is locally accessible to the agent for optimal performance and accurate skill generation.
  • ๐Ÿ’กAfter generating new skills, remember to test them thoroughly to confirm they address specific security testing scenarios as intended.
  • ๐Ÿ’กLeverage this skill for bulk generation to quickly populate your agent with a comprehensive suite of specialized security testing capabilities from the handbook.
  • ๐Ÿ’กKeep the local handbook repository updated to ensure the generated skills incorporate the latest security testing methodologies.

What this skill does

  • โ€ขParses handbook repository structures to identify new skill candidates
  • โ€ขApplies specific templates for tools, fuzzers, domains, and security techniques
  • โ€ขExecutes two-pass generation to resolve cross-skill dependencies
  • โ€ขValidates generated output against internal security plugin standards
  • โ€ขAutomates updates to project README and cross-reference indices

When not to use it

  • โœ•Answering high-level theoretical security questions about the handbook
  • โœ•Modifying plugins outside of the designated testing-handbook-skills directory
  • โœ•Creating skills for GUI-based tools that cannot be automated via CLI

Example workflow

  1. Verify existence of the handbook at the target local path
  2. Run the discovery scan to classify handbook sections
  3. Generate draft files using the two-pass content and cross-ref approach
  4. Execute validation scripts to check for formatting or linking errors
  5. Commit updated README and metadata to the repository

Prerequisites

  • โ€“A local clone or accessible path to the Trail of Bits Testing Handbook repository
  • โ€“Proper write permissions within the plugins/testing-handbook-skills/ directory

Pitfalls & limitations

  • !Overwriting manually modified files if the generator is triggered without proper filtering
  • !Failing to skip GUI-only sections which may lead to unusable agent skills
  • !Dependency circularity if cross-references are not handled by the two-pass system

FAQ

Does this skill work with any security repository?
No, it is specifically configured to process the Trail of Bits Testing Handbook structure and templates.
Why does the generation process take two passes?
The first pass generates content independently, while the second pass resolves cross-references between new and existing skills to ensure links are valid.
How does it handle GUI-based tools?
It intentionally skips sections identified as GUI-only tools because Claude Code cannot operate them directly.
What happens if a section is marked as a draft?
The generator detects 'draft: true' in the frontmatter and skips those files to avoid creating incomplete or unverified skills.

How it compares

Unlike manual creation which is prone to format drift, this generator enforces strict schema adherence via pre-defined templates and automated validation.

Source & trust

โญ 5.7k stars๐Ÿ“„ CC-BY-SA-4.0๐Ÿ•’ Updated 2026-06-15
๐Ÿ“„ Full skill instructions โ€” original source: trailofbits/skills
# 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](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 Section | Skill Type | Template |
|------------------|------------|----------|
| /static-analysis/[tool]/ | Tool Skill | tool-skill.md |
| /fuzzing/[lang]/[fuzzer]/ | Fuzzer Skill | fuzzer-skill.md |
| /fuzzing/techniques/ | Technique Skill | technique-skill.md |
| /crypto/[tool]/ | Domain Skill | domain-skill.md |
| /web/[tool]/ | Tool Skill | tool-skill.md |

### Skill Candidate Signals

| Signal | Indicates |
|--------|-----------|
| _index.md with bookCollapseSection: true | Major tool/topic |
| Numbered files (00-, 10-, 20-) | Structured content |
| techniques/ subsection | Methodology content |
| 99-resources.md or 91-resources.md | Has external links |

### Exclusion Signals

| Signal | Action |
|--------|--------|
| draft: true in frontmatter | Skip section |
| Empty directory | Skip section |
| Template/placeholder file | Skip 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](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 Type | Detection | Recovery Action |
|--------------|-----------|-----------------|
| Agent crashed | No output report | Re-run single agent with same inputs |
| Validation failed | Output report shows errors | Check gaps/warnings, manually patch or re-run |
| Wrong skill type | Content doesn't match template | Re-run with corrected type parameter |
| Missing content | Output report lists gaps | Accept if minor, or provide additional related_sections |
| Pass 2 broken ref | Validator shows missing skill | Check 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](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:**
| Relationship | Arrow Style | Example |
|--------------|-------------|---------|
| 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](discovery.md) to understand the handbook analysis process.

**For template reference:** See [templates/](templates/) directory for skill type templates.

**For validation:** See [testing.md](testing.md) for quality assurance methodology.

How to Use This Skill Unit

Option A: Project-Specific (Recommended)

  1. Click "Download" above
  2. In your project, create the directory: .agent/skills/testing-handbook-generator/
  3. Save the file as SKILL.md
  4. The agent will automatically discover the skill based on its description.

Option B: Global Installation (All Agents)

Save the file to these locations to make it available across all projects:

  • Claude Code: ~/.claude/skills/trailofbits/skills/testing-handbook-generator/SKILL.md
  • Cursor: ~/.cursor/skills/trailofbits/skills/testing-handbook-generator/SKILL.md
  • Antigravity: ~/.gemini/antigravity/skills/trailofbits/skills/testing-handbook-generator/SKILL.md

๐Ÿš€ Install with CLI:
npx skills add trailofbits/skills

Read the Master Guide: Mastering Agent Skills โ†’

Recommended Rules

View more rules โ†’

Recommended Workflows

View more workflows โ†’

Recommended MCP Servers

View more MCP servers โ†’

Take It Further

Maximize your productivity with these powerful resources

๐Ÿ“‹

Define Your Standards

Set up coding standards to ensure this workflow produces consistent, high-quality results.

Browse Rules Library
๐Ÿ“–

Master Workflows

Learn how to create custom workflows, use Turbo Mode, and build your automation library.

Complete Guide

How to use this Skill in Claude Code & Cursor

For Claude Code (CLI)

To use this skill in Claude Code, copy the rule content into your project's custom instructions or follow our Add-Skill CLI guide. This ensures Claude follows your standards during every code generation.

For Cursor & Windsurf

For Cursor or Windsurf, individual skills are best used in the "Rules for AI" section. This specific unit helps the agent avoid security & vulnerability analysis issues, leading to cleaner, more efficient code.

Why the skill format matters: the standardized Agent Skills format lets your AI agent load detailed instructions only when they are relevant, keeping your prompt clean while improving results.

Source & attribution

This skill is categorized under Security & Vulnerability Analysis and is published by Trail of Bits, maintained in trailofbits/skills.

โ† Browse All Agent Skills
Sponsored AI assistant. Recommendations may be paid.