templates
The templates skill provides a standardized markdown structure for documenting static analysis tools and similar command-line utilities. Use this template when creating documentation for tools like Semgrep, CodeQL, or other standalone CLI analyzers that need consistent formatting including installation steps, usage workflows, customization options, and configuration guidance.
git clone --depth 1 https://github.com/trailofbits/skills /tmp/templates && cp -r /tmp/templates/plugins/testing-handbook-skills/skills/testing-handbook-generator/templates/tool- ~/.claude/skills/templatestool-skill.md
# Tool Skill Template
Use this template for static analysis tools (Semgrep, CodeQL) and similar standalone CLI tools.
## Template Structure
```markdown
---
name: {tool-name-lowercase}
type: tool
description: >
{Summary from handbook}. Use when {trigger conditions based on tool purpose}.
---
# {Tool Name}
{Brief introduction from handbook _index.md - 1-2 paragraphs max}
## When to Use
{Decision criteria from handbook "Ideal use case" or similar section}
**Use {Tool Name} when:**
- {Criterion 1}
- {Criterion 2}
- {Criterion 3}
**Consider alternatives when:**
- {Limitation 1} → Consider {Alternative Tool}
- {Limitation 2} → Consider {Alternative Tool}
## Quick Reference
| Task | Command |
|------|---------|
| {Task 1} | `{command 1}` |
| {Task 2} | `{command 2}` |
| {Task 3} | `{command 3}` |
## Installation
{Content from 00-installation.md or installation section}
### Prerequisites
{System requirements}
### Install Steps
{Step-by-step installation - preserve code blocks exactly}
### Verification
\```bash
{Command to verify installation}
\```
## Core Workflow
{Main usage patterns from handbook - the typical workflow}
### Step 1: {First Step}
{Instructions}
### Step 2: {Second Step}
{Instructions}
### Step 3: {Third Step}
{Instructions}
## How to Customize
{Include this section for tools that support custom rules/queries like Semgrep, CodeQL, etc.
Skip this section for simple CLI tools like golint that don't support user-defined rules.}
### Writing Custom {Rules/Queries}
{Basic structure and syntax}
\```{language}
{Template for custom rule/query with comments}
\```
### Key Syntax Reference
| Syntax/Operator | Description | Example |
|-----------------|-------------|---------|
| {Syntax 1} | {What it does} | `{example}` |
| {Syntax 2} | {What it does} | `{example}` |
### Example: {Common Use Case}
{Complete example of a custom rule/query for a realistic use case}
\```{language}
{Full working custom rule/query}
\```
### Testing Custom {Rules/Queries}
{How to validate that custom rules/queries work correctly}
\```bash
{Test command}
\```
## Configuration
{Settings, config files, ignore files}
### Configuration File
{Location and format of main config file}
\```{format}
{Example config file content}
\```
### Ignore Patterns
{How to exclude files/paths - .semgrepignore, .codeqlignore, etc.}
\```
{Example ignore patterns}
\```
### Suppressing False Positives
{How to suppress specific findings inline}
\```{language}
{Example suppression comment}
\```
## Advanced Usage
{Content from 10-advanced.md or advanced section}
### Tips and Tricks
{Practical tips from experienced users - extract from handbook hints/warnings}
| Tip | Why It Helps |
|-----|--------------|
| {Tip 1} | {Explanation} |
| {Tip 2} | {Explanation} |
### {Advanced Topic 1}
{Details}
### {Advanced Topic 2}
{Details}
### Performance Optimization
{How to speed up analysis for large codebases}
\```bash
{Performance-related flags or commands}
\```
## CI/CD Integration
{Content from 20-ci.md if available}
### GitHub Actions
\```yaml
{Example workflow - preserve exactly from handbook}
\```
### Other CI Systems
{General guidance for Jenkins, GitLab CI, etc.}
## Common Mistakes
{Extracted from handbook tips, hints, and warnings}
| Mistake | Why It's Wrong | Correct Approach |
|---------|----------------|------------------|
| {Mistake 1} | {Reason} | {Fix} |
| {Mistake 2} | {Reason} | {Fix} |
## Limitations
{What the tool cannot do - important for setting expectations}
- **{Limitation 1}:** {Explanation and when this matters}
- **{Limitation 2}:** {Explanation and when this matters}
- **{Limitation 3}:** {Explanation and when this matters}
## Related Skills
{Link to complementary skills - helps discoverability}
| Skill | When to Use Together |
|-------|---------------------|
| **{skill-name-1}** | {Integration scenario - e.g., "For advanced taint tracking beyond intraprocedural"} |
| **{skill-name-2}** | {Integration scenario} |
## Resources
{From 99-resources.md - fetch non-video URLs with WebFetch, extract insights}
### Key External Resources
{For each non-video URL: fetch with WebFetch, summarize key techniques/insights}
**[{Title 1}]({URL})**
{Summarized insights: key techniques, patterns, examples extracted from the page}
**[{Title 2}]({URL})**
{Summarized insights from fetched content}
### Video Resources
{Videos - title and URL only, no fetching}
- [{Video Title}]({YouTube/Vimeo URL}) - {Brief description from handbook}
```
## Field Extraction Guide
| Template Field | Handbook Source |
|----------------|-----------------|
| `{tool-name-lowercase}` | Slugified title from `_index.md` |
| `{Summary from handbook}` | `summary` field from frontmatter |
| `{Tool Name}` | `title` field from frontmatter |
| `{trigger conditions}` | Derive from "Ideal use case" or benefits |
| Quick Reference commands | Extract from code blocks in main content |
| Installation | `00-installation.md` or installation section |
| How to Customize | From custom rules/queries section (if tool supports it) |
| Configuration | From config file documentation |
| Advanced Usage | `10-advanced.md` or advanced section |
| CI/CD Integration | `20-ci.md` if exists |
| Limitations | Extract from "when not to use" or caveats |
| Resources | `99-resources.md` or `91-resources.md` |
## Section Applicability Guide
Not all sections apply to every tool. Use this guide:
| Section | When to Include |
|---------|-----------------|
| How to Customize | Tool supports custom rules/queries (Semgrep, CodeQL, Bandit) |
| Configuration | Tool has config files or significant options |
| CI/CD Integration | Tool is commonly used in CI pipelines |
| Related Skills | Complementary skills exist in the handbook |
## Example: Semgrep
```markdown
---
name: semgrep
type: tool
description: >
Fast static analysis for finding bugs, detecting vulnerabilities, and enforcing code standards.
Use when scanningAudits GitHub Actions workflows for security vulnerabilities in AI agent integrations including Claude Code Action, Gemini CLI, OpenAI Codex, and GitHub AI Inference. Detects attack vectors where attacker-controlled input reaches AI agents running in CI/CD pipelines, including env var intermediary patterns, direct expression injection, dangerous sandbox configurations, and wildcard user allowlists. Use when reviewing workflow files that invoke AI coding agents, auditing CI/CD pipeline security for prompt injection risks, or evaluating agentic action configurations.
Clarify requirements before implementing. Use when serious doubts arise.
Enables ultra-granular, line-by-line code analysis to build deep architectural context before vulnerability or bug finding.
Scans Algorand smart contracts for 11 common vulnerabilities including rekeying attacks, unchecked transaction fees, missing field validations, and access control issues. Use when auditing Algorand projects (TEAL/PyTeal).
Prepares codebases for security review using Trail of Bits' checklist. Helps set review goals, runs static analysis tools, increases test coverage, removes dead code, ensures accessibility, and generates documentation (flowcharts, user stories, inline comments).
Scans Cairo/StarkNet smart contracts for 6 critical vulnerabilities including felt252 arithmetic overflow, L1-L2 messaging issues, address conversion problems, and signature replay. Use when auditing StarkNet projects.
Systematic code maturity assessment using Trail of Bits' 9-category framework. Analyzes codebase for arithmetic safety, auditing practices, access controls, complexity, decentralization, documentation, MEV risks, low-level code, and testing. Produces professional scorecard with evidence-based ratings and actionable recommendations.
Scans Cosmos SDK blockchain modules and CosmWasm contracts for consensus-critical vulnerabilities — chain halts, fund loss, state divergence. 25 core + 16 IBC + 10 EVM + 3 CosmWasm patterns. Use when auditing custom x/ modules, reviewing IBC integrations, or assessing pre-launch chain security. Updated for SDK v0.53.x.