trailmark-structural skill
✓ OfficialPerforms full structural analysis on a target directory to report hotspots, taint, blast radius, privilege boundaries, and attack surface data.
- GitHub stars
- 8,136
- Files
- 3
- Last commit
- Nov 11, 2026
- License
- CC-BY-SA-4.0
- Allowed tools
- 4
What does the trailmark-structural skill do?
trailmark-structural performs full structural analysis on a target directory to report hotspots, taint, blast radius, privilege boundaries, and attack surface data.
Summary generated from the skill's SKILL.md.
About the trailmark-structural skill
Performing deep structural analysis on a target directory is what this skill enables for security researchers and developers conducting code audits. It builds a comprehensive graph of a codebase to identify critical security and complexity metrics, such as taint, blast radius, and privilege boundaries. An agent should load this tool when a vivisect process requires detailed structural data rather than a simple summary or ad-hoc graph queries.
The process relies on the Trailmark engine to run four pre-analysis passes, producing a JSON payload that includes complexity hotspots, proxy nodes, and attack surface data. It utilizes Bash, Read, Grep, and Glob tools to interact with the environment and executes Python snippets to interface with the QueryEngine. The skill is designed to be version-aware, meaning it probes for specific capabilities like type references or external proxy nodes available in Trailmark 0.4.0 or 0.5.0+ while maintaining compatibility with older versions. It is not intended for single small files or quick overviews where the summary skill would suffice.
What an agent can do with it
- 1Prioritize security auditsGenerate complexity and taint data to determine which parts of a codebase require immediate attention during an audit.
- 2Map attack surfacesIdentify entrypoint attributes and attack surface entries to understand how an application can be accessed.
- 3Analyze codeblast radiusDetermine the potential impact of changes or vulnerabilities by calculating the blast radius and privilege boundaries.
- 4Inspect proxy nodesExamine unresolved call counts and proxy nodes to understand indirect execution paths.
Written from the skill's SKILL.md. Every use case is checked against a quote from it.
How to install the trailmark-structural skill
Each command copies the skill folder into the client's skills directory. Restart the client or start a new session to load it.Install the trailmark-structural skill in Plugin
/plugin marketplace add trailofbits/skills /plugin install trailmark@trailofbits
Install the trailmark-structural skill in Claude Code
~/.claude/skills/trailmark-structural/SKILL.md
$ npx degit trailofbits/skills/plugins/trailmark/skills/trailmark-structural ~/.claude/skills/trailmark-structuralInstall the trailmark-structural skill in Claude Code (project)
.claude/skills/trailmark-structural/SKILL.md
$ npx degit trailofbits/skills/plugins/trailmark/skills/trailmark-structural .claude/skills/trailmark-structuralInstall the trailmark-structural skill in Codex
~/.agents/skills/trailmark-structural/SKILL.md
$ npx degit trailofbits/skills/plugins/trailmark/skills/trailmark-structural ~/.agents/skills/trailmark-structuralInstall the trailmark-structural skill in Gemini CLI
~/.gemini/skills/trailmark-structural/SKILL.md
$ npx degit trailofbits/skills/plugins/trailmark/skills/trailmark-structural ~/.gemini/skills/trailmark-structuralInstall the trailmark-structural skill in Claude.ai
npx degit trailofbits/skills/plugins/trailmark/skills/trailmark-structural trailmark-structural && zip -r trailmark-structural.zip trailmark-structural # claude.ai → Customize → Skills → + → Create skill → Upload a skill → trailmark-structural.zip
Automated checks
Ran Nov 15, 2026Full report →Not verified yet. A skill needs a score of 80, no serious finding, and enough data for us to check. How checks work · What to fix for more points
- Source repository linked and reachabletrailofbits/skills/plugins/trailmark/skills/trailmark-structural is public and reachablegithub.com/trailofbits/skills/tree/HEAD/plugins/trailmark/sk ↗Pass
- Open source license (OSI)CC-BY-SA-4.0 is not OSI-approvedspdx.org/licenses/CC-BY-SA-4.0.html ↗Finding
- Commit or release in the last yearLast commit 2026-11-11github.com/trailofbits/skills/commits ↗Pass
- No download-and-run or credential theft in scriptsNo scripts in the skill folderPass
- No hidden instructions in SKILL.mdNo override phrases, safeguard switches, credential requests or hidden charactersgithub.com/trailofbits/skills/blob/HEAD/plugins/trailmark/sk ↗Pass
- Pre-approved tools are scopedBash lets the agent run any shell command without askinggithub.com/trailofbits/skills/blob/HEAD/plugins/trailmark/sk ↗Finding
- SKILL.md follows the Agent Skills formatValid name and description; says when to use it; 168 linesgithub.com/trailofbits/skills/blob/HEAD/plugins/trailmark/sk ↗Pass
SKILL.md
View on GitHubTrailmark Structural Analysis
Builds a Trailmark graph and runs engine.preanalysis() to compute all
four pre-analysis passes. The core workflow is v0.2-safe; v0.4-only details
are included only after checking method availability, and newer builds
enrich the same output (0.5.0+ adds an attributes key to attack-surface
entries and proxy.external:* nodes from .trailmark/links.toml) without
any workflow change.
When to Use
- Vivisect Phase 1 needs full structural data (hotspots, taint, blast radius, privilege boundaries)
- Detailed pre-analysis passes for a specific target scope
- Generating complexity and taint data for audit prioritization
- Inspecting proxy/unresolved-call counts, subgraph edges, or type-reference summaries when Trailmark 0.4.0+ is installed
When NOT to Use
- Quick overview only (use
trailmark-summaryinstead) - Ad-hoc code graph queries (use the main
trailmarkskill directly) - Target is a single small file where structural analysis adds no value
Rationalizations to Reject
| Rationalization | Why It's Wrong | Required Action |
|---|---|---|
| "Summary analysis is enough" | Summary skips taint, blast radius, and privilege boundary data | Run full structural analysis when detailed data is needed |
| "One pass is sufficient" | Passes cross-reference each other — taint without blast radius misses critical nodes | Run all four passes |
| "Tool isn't installed, I'll analyze manually" | Manual analysis misses what tooling catches | Report "trailmark is not installed" and return |
| "Empty pass output means the pass failed" | Some passes produce no data for some codebases (e.g., no privilege boundaries) | Return full output regardless |
| "A v0.4 field is always present" | Users may still have Trailmark 0.2.x installed | Probe with hasattr() before querying v0.4-only methods |
Usage
The target directory is passed via the args parameter.
Execution
Step 1: Check that trailmark is available.
trailmark analyze --help 2>/dev/null || \
uv run trailmark analyze --help 2>/dev/null
If neither command works, report "trailmark is not installed"
and return. Do NOT run pip install, uv pip install,
git clone, or any install command. The user must install
trailmark themselves.
Optionally record the version:
trailmark --version 2>/dev/null || uv run trailmark --version 2>/dev/null || true
Do not fail if this command is missing; use API feature probes below.
Step 2: Detect languages with Trailmark's parse API.
python3 - "{args}" <<'PY'
import json
import sys
try:
from trailmark.parse import detect_languages # canonical location since 0.3.x
except ModuleNotFoundError:
# v0.2.x predates trailmark.parse; the same function lives in query.api
from trailmark.query.api import detect_languages
print(json.dumps(detect_languages(sys.argv[1])))
PY
If the import fails, rerun the same snippet with uv run --with trailmark python - "{args}".
If the result is [], report "Trailmark found no supported languages under
target" and return.
Step 3: Run the full structural analysis via QueryEngine.
Run this snippet with python3. If the import fails, rerun the same snippet
under uv run --with trailmark python - "{args}".
python3 - "{args}" <<'PY'
import json
import sys
try:
from trailmark.parse import detect_languages # canonical location since 0.3.x
except ModuleNotFoundError:
# v0.2.x predates trailmark.parse; the same function lives in query.api
from trailmark.query.api import detect_languages
from trailmark.query.api import QueryEngine
target = sys.argv[1]
languages = detect_languages(target)
engine = QueryEngine.from_directory(target, language="auto")
preanalysis = engine.preanalysis()
def summarize_subgraph(name: str, limit: int = 25) -> dict[str, object]:
nodes = engine.subgraph(name)
summary = {
"count": len(nodes),
"sample_ids": [node["id"] for node in nodes[:limit]],
}
if hasattr(engine, "subgraph_edges"):
summary["edge_count"] = len(engine.subgraph_edges(name))
return summary
graph = json.loads(engine.to_json())
nodes = graph.get("nodes", {})
proxy_nodes = [
node_id for node_id, node in nodes.items()
if node.get("kind") == "proxy" or node.get("origin") == "proxy"
]
payload = {
"languages": languages,
"summary": engine.summary(),
"preanalysis": preanalysis,
"attack_surface": engine.attack_surface()[:25],
"hotspots": engine.complexity_hotspots(10)[:25],
"proxy_nodes": proxy_nodes[:25],
"subgraphs": {
name: summarize_subgraph(name)
for name in engine.subgraph_names()
},
}
if hasattr(engine, "type_references"):
payload["type_reference_samples"] = {
node_id: engine.type_references(node_id)[:10]
for node_id in list(nodes)[:25]
}
print(json.dumps(payload, indent=2))
PY
Step 4: Verify the output.
The output should include:
languagessummarypreanalysishotspots(possibly empty)proxy_nodes(empty on v0.2.x or when there are no unresolved calls; on 0.5.0+ may includeproxy.external:*entries declared in.trailmark/links.toml)subgraphswith counts and sample IDs
On Trailmark 0.5.0+, attack_surface entries may carry an attributes
object (e.g. solidity_visibility, solidity_overridden_by). Pass it
through unchanged — downstream consumers use it to rank entrypoints.
Some subgraphs may have zero nodes for some codebases (this is normal). Return the full JSON payload regardless.
Files in this skill
3trailmark-structural skill questions
How do I install the trailmark-structural skill in Claude Code?
Run npx degit trailofbits/skills/plugins/trailmark/skills/trailmark-structural ~/.claude/skills/trailmark-structural. Claude Code loads skills from ~/.claude/skills (all projects) or .claude/skills (one project) and uses a skill when its description matches the task.
Which clients can use the trailmark-structural skill?
Any client that reads the Agent Skills format: Claude Code, Codex, Gemini CLI and claude.ai (upload as a ZIP). Scripts in the skill run only where the client allows code execution.
When should I use trailmark-structural instead of trailmark-summary?
Use structural analysis when you need detailed data like taint, blast radius, and privilege boundaries, whereas summary is for quick overviews.
What happens if a specific analysis pass produces no data?
It is normal for some passes to produce no data for certain codebases; the tool will still return the full output.
Can I use this tool if I don't have Trailmark installed?
No, the user must install Trailmark themselves; the agent will report that it is not installed and return.