testing-handbook-generator by trailofbits/skills
npx skills add https://github.com/trailofbits/skills --skill testing-handbook-generator根据 Trail of Bits 测试手册生成和维护 Claude Code 技能。
在以下情况调用此技能:
请勿用于:
此技能需要测试手册仓库。完整详情请参阅 discovery.md。
快速参考: 检查 ./testing-handbook、../testing-handbook、~/testing-handbook → 询问用户 → 最后手段是克隆。
仓库地址: https://github.com/trailofbits/testing-handbook
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
Phase 0: 设置 Phase 1: 发现
┌─────────────────┐ ┌─────────────────┐
│ 定位手册 │ → │ 分析手册 │
│ - 查找或克隆 │ │ - 扫描章节 │
│ - 确认路径 │ │ - 分类类型 │
└─────────────────┘ └─────────────────┘
↓ ↓
Phase 3: 生成 Phase 2: 规划
┌─────────────────┐ ┌─────────────────┐
│ 双阶段生成 │ ← │ 生成计划 │
│ 阶段1: 内容 │ │ - 新技能 │
│ 阶段2: 交叉引用 │ │ - 更新 │
│ - 写入 gen/ │ │ - 呈现给用户 │
└─────────────────┘ └─────────────────┘
↓
Phase 4: 测试 Phase 5: 收尾
┌─────────────────┐ ┌─────────────────┐
│ 验证技能 │ → │ 生成后处理 │
│ - 运行验证器 │ │ - 更新 README │
│ - 测试激活 │ │ - 更新交叉引用 │
│ - 修复问题 │ │ - 自我改进 │
└─────────────────┘ └─────────────────┘
仅修改以下位置:
plugins/testing-handbook-skills/skills/[技能名称]/* - 生成的技能(作为 testing-handbook-generator 的同级目录)plugins/testing-handbook-skills/skills/testing-handbook-generator/* - 自我改进README.md - 将生成的技能添加到表格中切勿修改或分析:
plugins/property-based-testing/、plugins/static-analysis/ 等)请勿扫描或将 testing-handbook-skills/ 之外的任何技能拉入上下文。仅基于手册内容及其引用的资源生成技能。
| 手册章节 | 技能类型 | 模板 |
|---|---|---|
/static-analysis/[工具]/ | 工具技能 | tool-skill.md |
/fuzzing/[语言]/[模糊测试器]/ | 模糊测试器技能 | fuzzer-skill.md |
/fuzzing/techniques/ | 技术技能 | technique-skill.md |
/crypto/[工具]/ | 领域技能 | domain-skill.md |
/web/[工具]/ | 工具技能 | tool-skill.md |
| 信号 | 指示 |
|---|---|
带有 bookCollapseSection: true 的 _index.md | 主要工具/主题 |
| 编号文件(00-、10-、20-) | 结构化内容 |
techniques/ 子章节 | 方法论内容 |
99-resources.md 或 91-resources.md | 包含外部链接 |
| 信号 | 操作 |
|---|---|
前置元数据中的 draft: true | 跳过该章节 |
| 空目录 | 跳过该章节 |
| 模板/占位符文件 | 跳过该章节 |
仅 GUI 工具(例如 web/burp/) | 跳过该章节(Claude 无法操作 GUI 工具) |
开始生成技能?
├─ 需要分析手册并制定计划?
│ └─ 阅读:discovery.md
│ (手册分析方法论,计划格式)
│
├─ 生成技能生成代理?
│ └─ 阅读:agent-prompt.md
│ (完整提示模板,变量参考,验证清单)
│
├─ 生成特定技能类型?
│ └─ 阅读相应模板:
│ ├─ 工具(Semgrep, CodeQL) → templates/tool-skill.md
│ ├─ 模糊测试器(libFuzzer, AFL++) → templates/fuzzer-skill.md
│ ├─ 技术(测试工具编写,覆盖率) → templates/technique-skill.md
│ └─ 领域(加密,Web) → templates/domain-skill.md
│
├─ 验证生成的技能?
│ └─ 运行:scripts/validate-skills.py
│ 然后阅读:testing.md 进行激活测试
│
├─ 生成后收尾?
│ └─ 参见:下文“生成后任务”
│ (更新主 README,更新技能交叉引用,自我改进)
│
└─ 从特定章节快速生成?
└─ 使用上方的快速参考,直接应用模板
生成采用双阶段方法来解决前向引用问题(技能引用了尚不存在的其他技能)。
并行生成所有技能,不包含“相关技能”部分:
Pass 1 - 并行生成 5 个技能:
├─ 代理 1: libfuzzer (模糊测试器) → skills/libfuzzer/SKILL.md
├─ 代理 2: aflpp (模糊测试器) → skills/aflpp/SKILL.md
├─ 代理 3: semgrep (工具) → skills/semgrep/SKILL.md
├─ 代理 4: harness-writing (技术) → skills/harness-writing/SKILL.md
└─ 代理 5: wycheproof (领域) → skills/wycheproof/SKILL.md
每个代理使用:pass=1 (仅内容,相关技能留空)
阶段 1 代理:
## 相关技能\n\n<!-- PASS2: 在所有技能存在后填充 -->references: DEFERRED在所有阶段 1 代理完成后,运行阶段 2 以填充“相关技能”部分:
Pass 2 - 填充交叉引用:
├─ 从 skills/*/SKILL.md 读取所有生成的技能名称
├─ 对于每个技能,基于以下确定相关技能:
│ ├─ 来自发现的 related_sections(手册结构)
│ ├─ 技能类型关系(模糊测试器 → 技术)
│ └─ 内容中明确提及的部分
└─ 更新每个 SKILL.md 的“相关技能”部分
阶段 2 流程:
ls -d skills/*/SKILL.md完整的提示模板请参阅 agent-prompt.md,其中包含:
pass 变量)阶段 1 后:汇总输出报告,验证所有技能是否已生成。阶段 2 后:运行验证器检查交叉引用。
如果代理失败或产生无效输出:
| 失败类型 | 检测方式 | 恢复操作 |
|---|---|---|
| 代理崩溃 | 无输出报告 | 使用相同输入重新运行单个代理 |
| 验证失败 | 输出报告显示错误 | 检查差距/警告,手动修补或重新运行 |
| 错误的技能类型 | 内容与模板不匹配 | 使用修正后的 type 参数重新运行 |
| 内容缺失 | 输出报告列出差距 | 如果差距较小则接受,或提供额外的 related_sections |
| 阶段 2 引用损坏 | 验证器显示技能缺失 | 检查技能是否被跳过,更新引用 |
重要提示: 不要因为单个代理失败而重新运行整个并行批次。独立修复单个失败。
要在不重新运行整个批次的情况下重新生成单个技能:
# 重新生成单个技能(阶段 1 - 仅内容)
"使用 testing-handbook-generator 从章节 {section_path} 重新生成 {skill-name} 技能"
# 示例:
"使用 testing-handbook-generator 从章节 fuzzing/c-cpp/10-libfuzzer 重新生成 libfuzzer 技能"
重新生成工作流:
skills/{skill-name}/SKILL.md(覆盖现有文件)uv run scripts/validate-skills.py --skill {skill-name}生成的技能写入到:
skills/[技能名称]/SKILL.md
每个技能都有自己的目录,用于存放潜在的辅助文件(作为 testing-handbook-generator 的同级目录)。
在交付生成的技能之前:
uv run scripts/validate-skills.pyREADME.md 已更新,包含生成的技能表格README.md 技能交叉引用图已更新生成技能后,更新仓库的主 README.md 以列出它们。
格式: 将生成的技能添加到同一个“可用插件”表格中,直接放在 testing-handbook-skills 之后。使用纯文本 testing-handbook-generator 作为作者(无链接)。
示例:
| 插件 | 描述 | 作者 |
|--------|-------------|--------|
| ... 其他插件 ... |
| [testing-handbook-skills](plugins/testing-handbook-skills/) | 从测试手册生成技能的元技能 | Paweł Płatek |
| [libfuzzer](plugins/testing-handbook-skills/skills/libfuzzer/) | 使用 libFuzzer 对 C/C++ 进行覆盖率引导的模糊测试 | testing-handbook-generator |
| [aflpp](plugins/testing-handbook-skills/skills/aflpp/) | 使用 AFL++ 进行多核模糊测试 | testing-handbook-generator |
| [semgrep](plugins/testing-handbook-skills/skills/semgrep/) | 用于查找错误的快速静态分析 | testing-handbook-generator |
生成技能后,使用显示技能关系的 mermaid 图更新 README.md 的技能交叉引用部分。
流程:
SKILL.md 并提取其 ## 相关技能 部分-->)用于主要技术依赖-.->)用于替代工具建议边分类:
| 关系 | 箭头样式 | 示例 |
|---|---|---|
| 模糊测试器 → 技术 | --> | libfuzzer --> harness-writing |
| 工具 → 工具(替代) | -.-> | semgrep -.-> codeql |
| 模糊测试器 → 模糊测试器(替代) | -.-> | libfuzzer -.-> aflpp |
| 技术 → 技术 | --> | harness-writing --> coverage-analysis |
验证: 更新后,运行 validate-skills.py 以验证所有引用的技能都存在。
每次生成运行后,反思哪些方面可以改进未来的运行。
捕获对以下方面的改进:
更新流程:
SKILL.md - 工作流、决策树、快速参考更新templates/*.md - 模板改进discovery.md - 检测逻辑更新testing.md - 新的验证检查自我改进示例:
问题:libFuzzer 技能缺少 sanitizer 标志表
修复:更新 templates/fuzzer-skill.md 以包含 ## 编译器标志 部分
用户:"从测试手册生成技能"
1. 定位手册(检查常见位置,询问用户,或克隆)
2. 阅读 discovery.md 了解方法论
3. 扫描 {handbook_path}/content/docs/ 处的手册
4. 构建带类型的候选列表
5. 向用户呈现计划
6. 获得批准后,使用适当的模板生成每个技能
7. 验证生成的技能
8. 使用生成的技能表格更新主 README.md
9. 根据“相关技能”部分更新 README.md 技能交叉引用图
10. 自我改进:记录任何模板/发现问题以供未来运行参考
11. 报告结果
用户:"为 libFuzzer 章节创建一个技能"
1. 阅读 /testing-handbook/content/docs/fuzzing/c-cpp/10-libfuzzer/
2. 识别类型:模糊测试器技能
3. 阅读 templates/fuzzer-skill.md
4. 提取内容,应用模板
5. 写入 skills/libfuzzer/SKILL.md
6. 验证并报告
应做:
不应做:
首次使用: 从 discovery.md 开始,了解手册分析过程。
模板参考: 技能类型模板请参阅 templates/ 目录。
验证: 质量保证方法论请参阅 testing.md。
每周安装量
1.1K
仓库
GitHub 星标
3.9K
首次出现
2026年1月19日
安全审计
安装于
claude-code1.0K
opencode967
gemini-cli947
codex943
cursor919
github-copilot887
Generate and maintain Claude Code skills from the Trail of Bits Testing Handbook.
Invoke this skill when:
Do NOT use for:
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
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 │
└─────────────────┘ └─────────────────┘
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-improvementREADME.md - Add generated skills to tableNEVER modify or analyze:
plugins/property-based-testing/, plugins/static-analysis/, etc.)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.
| 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 |
| 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 |
| 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) |
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
Generation uses a two-pass approach to solve forward reference problems (skills referencing other skills that don't exist yet).
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:
## Related Skills\n\n<!-- PASS2: populate after all skills exist -->references: DEFERREDAfter 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:
ls -d skills/*/SKILL.mdSee agent-prompt.md for the full prompt template with:
pass variable)After Pass 1: Aggregate output reports, verify all skills generated. After Pass 2: Run validator to check cross-references.
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.
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:
skills/{skill-name}/SKILL.md (overwrites existing)uv run scripts/validate-skills.py --skill {skill-name}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).
Before delivering generated skills:
uv run scripts/validate-skills.pyREADME.md updated with generated skills tableREADME.md Skills Cross-Reference graph updatedAfter 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 |
After generating skills, update the README.md's Skills Cross-Reference section with the mermaid graph showing skill relationships.
Process:
SKILL.md and extract its ## Related Skills section-->) for primary technique dependencies-.->) for alternative tool suggestionsEdge classification:
| Relationship | Arrow Style | Example |
|---|---|---|
| Fuzzer → Technique | --> | libfuzzer --> harness-writing |
| Tool → Tool (alternative) | -.-> | semgrep -.-> codeql |
| Fuzzer → Fuzzer (alternative) | -.-> | libfuzzer -.-> aflpp |
| Technique → Technique |
Validation: After updating, run validate-skills.py to verify all referenced skills exist.
After each generation run, reflect on what could improve future runs.
Capture improvements to:
Update process:
SKILL.md - Workflow, decision tree, quick reference updatestemplates/*.md - Template improvementsdiscovery.md - Detection logic updatestesting.md - New validation checksExample self-improvement:
Issue: libFuzzer skill missing sanitizer flags table
Fix: Updated templates/fuzzer-skill.md to include ## Compiler Flags section
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
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
Do:
Don't:
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.
Weekly Installs
1.1K
Repository
GitHub Stars
3.9K
First Seen
Jan 19, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykWarn
Installed on
claude-code1.0K
opencode967
gemini-cli947
codex943
cursor919
github-copilot887
超能力技能使用指南:AI助手技能调用优先级与工作流程详解
37,500 周安装
| tool-skill.md |
-->harness-writing --> coverage-analysis |