Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Runs full Trailmark structural analysis by building a graph, running `preanalysis()`, and reporting hotspots, taint, blast radius, privilege boundaries, attack surface, and version-gated Trailmark 0.4+/0.5+ data such as proxy counts, subgraph edges, type/reference summaries, and entrypoint attributes. Use when vivisect needs detailed structural data for a target. Triggers: structural analysis, blast radius, taint analysis, complexity hotspots, proxy nodes, type references.
.claude/skills/trailofbits-trailmark-structural/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-08 | ✗→✓ | ▲ Improved | 382% | 0% |
| case-09 | ✗→✓ | ▲ Improved | -42% | 0% |
| case-11 | ✗→✓ | ▲ Improved | -11% | 0% |
| case-12 | ✗→✓ | ▲ Improved | 7% | 0% |
| case-15 | ✗→✓ | ▲ Improved | -13% | 0% |
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.
summaries when Trailmark 0.4.0+ is installed
trailmark-summary instead)trailmark skill directly)| 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 |
The target directory is passed via the args parameter.
Step 1: Check that trailmark is available.
bashtrailmark 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:
bashtrailmark --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.
bashpython3 - "{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 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 python - "{args}".
bashpython3 - "{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; on0.5.0+ may include proxy.external:* entries declared in .trailmark/links.toml)
subgraphs with counts and sample IDsOn 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.
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | fail→fail | 16,442 | 9,925 | -40% | 1 | 1 | 0% | 1,755 | 2,907 | +66% | 0 | 0 | — |
case-02 | fail→fail | 6,383 | 4,265 | -33% | 1 | 1 | 0% | 249 | 1,782 | +616% | 0 | 0 | — |
case-03 | fail→fail | 12,047 | 3,930 | -67% | 1 | 1 | 0% | 2,662 | 1,730 | -35% | 0 | 0 | — |
case-04 | fail→fail | 5,637 | 5,401 | -4% | 1 | 1 | 0% | 244 | 1,864 | +664% | 0 | 0 | — |
case-05 | fail→fail | 19,774 | 4,560 | -77% | 1 | 1 | 0% | 3,490 | 1,739 | -50% | 0 | 0 | — |
case-06 | pass→pass | 7,880 | 9,718 | +23% | 1 | 1 | 0% | 1,346 | 2,646 | +97% | 0 | 0 | — |
case-07 | pass→pass | 9,941 | 5,239 | -47% | 1 | 1 | 0% | 1,613 | 2,685 | +66% | 0 | 0 | — |
case-08 | fail→pass | 3,543 | 5,315 | +50% | 1 | 1 | 0% | 506 | 2,437 | +382% | 0 | 0 | — |
case-09 | fail→pass | 17,838 | 3,219 | -82% | 1 | 1 | 0% | 3,666 | 2,133 | -42% | 0 | 0 | — |
case-10 | fail→fail | 28,484 | 5,931 | -79% | 1 | 1 | 0% | 2,886 | 1,818 | -37% | 0 | 0 | — |
case-11 | fail→pass | 15,087 | 5,176 | -66% | 1 | 1 | 0% | 2,759 | 2,458 | -11% | 0 | 0 | — |
case-12 | fail→pass | 11,879 | 4,066 | -66% | 1 | 1 | 0% | 2,154 | 2,312 | +7% | 0 | 0 | — |
case-13 | fail→fail | 12,746 | 5,241 | -59% | 1 | 1 | 0% | 2,932 | 1,846 | -37% | 0 | 0 | — |
case-14 | pass→pass | 8,564 | 1,795 | -79% | 1 | 1 | 0% | 1,320 | 1,856 | +41% | 0 | 0 | — |
case-15 | fail→pass | 11,395 | 2,494 | -78% | 1 | 1 | 0% | 2,159 | 1,884 | -13% | 0 | 0 | — |
case-16 | pass→pass | 10,042 | 2,607 | -74% | 1 | 1 | 0% | 1,705 | 2,029 | +19% | 0 | 0 | — |
case-17 | fail→pass | 9,598 | 1,881 | -80% | 1 | 1 | 0% | 1,521 | 1,846 | +21% | 0 | 0 | — |
case-18 | fail→pass | 6,167 | 2,606 | -58% | 1 | 1 | 0% | 1,223 | 1,962 | +60% | 0 | 0 | — |
case-19 | fail→pass | 7,104 | 4,029 | -43% | 1 | 1 | 0% | 1,178 | 2,209 | +88% | 0 | 0 | — |
case-20 | fail→pass | 5,814 | 3,931 | -32% | 1 | 1 | 0% | 1,009 | 2,272 | +125% | 0 | 0 | — |
case-21 | pass→pass | 5,394 | 2,065 | -62% | 1 | 1 | 0% | 917 | 1,916 | +109% | 0 | 0 | — |
case-22 | pass→pass | 10,859 | 2,677 | -75% | 1 | 1 | 0% | 1,755 | 1,981 | +13% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted, and 16 counted toward the lift figure. The other 6 produced results that are not comparable between the two arms, so they are excluded from the headline rather than averaged into it. The headline lift of +41 percentage points is the difference between those two pass rates over the 16 comparable cases. 1 case got worse with the skill loaded, and it is included in that figure.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.