[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7CHH489KQWCPDRWJ6R8AMNV":3,"skill-same:01M7CHH489KQWCPDRWJ6R8AMNV":64},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":18,"linkOnly":19,"markdownContent":20,"markdownBody":21,"frontMatter":22,"refName":23,"commitSha":24,"skillDirectory":25,"forksCount":26,"repositoryHtmlUrl":27,"repositoryHomepageUrl":6,"ownerHtmlUrl":28,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":29,"install":30,"resources":43},"01M7CHH489KQWCPDRWJ6R8AMNV","trailmark",null,"Builds and queries multi-language source and binary code graphs for security analysis. Includes pre-analysis passes for blast radius, taint propagation, privilege boundaries, entry point enumeration, proxy\u002Funresolved-call tracking, type\u002Freference queries, structural traversal, graph diffs, audit augmentation, declared cross-language\u002FFFI\u002Fexternal links via `.trailmark\u002Flinks.toml`, and SQL schema graphs. Use when analyzing call paths, mapping attack surface, finding complexity hotspots, enumerating entry points, tracing taint propagation, measuring blast radius, importing SARIF\u002FweAudit\u002Fbinary findings, linking source graphs across language or RPC boundaries, or building a code graph for audit prioritization. Feature-gate version-specific Trailmark APIs before using them; prefer `trailmark.parse.detect_languages()` or `--language auto` when the target language is unknown or polyglot.","bongkage\u002Ftrailofbits-skills","bongkage","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F101378796?v=4","01M7CH419QTJ16DNJ33P0WCWBE","01M7CH41A9NWK8D2JBRK9F0M2C",1,"CC-BY-SA-4.0","https:\u002F\u002Fgithub.com\u002Fbongkage\u002Ftrailofbits-skills\u002Fblob\u002Fmain\u002Fplugins\u002Ftrailmark\u002Fskills\u002Ftrailmark\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: trailmark\ndescription: \"Builds and queries multi-language source and binary code graphs for security analysis. Includes pre-analysis passes for blast radius, taint propagation, privilege boundaries, entry point enumeration, proxy\u002Funresolved-call tracking, type\u002Freference queries, structural traversal, graph diffs, audit augmentation, declared cross-language\u002FFFI\u002Fexternal links via `.trailmark\u002Flinks.toml`, and SQL schema graphs. Use when analyzing call paths, mapping attack surface, finding complexity hotspots, enumerating entry points, tracing taint propagation, measuring blast radius, importing SARIF\u002FweAudit\u002Fbinary findings, linking source graphs across language or RPC boundaries, or building a code graph for audit prioritization. Feature-gate version-specific Trailmark APIs before using them; prefer `trailmark.parse.detect_languages()` or `--language auto` when the target language is unknown or polyglot.\"\n---\n\n# Trailmark\n\nParses source code into a directed graph of functions, classes, calls, and\nsemantic metadata for security analysis.\n\n## When to Use\n\n- Mapping call paths from user input to sensitive functions\n- Finding complexity hotspots for audit prioritization\n- Identifying attack surface and entrypoints\n- Understanding call relationships in unfamiliar codebases\n- Security review or audit preparation across polyglot projects\n- Adding LLM-inferred annotations (assumptions, preconditions) to code units\n- Importing external binary-analysis graphs to connect source and binary views\n- Querying transitive slices, entrypoint paths, subgraph edges, or type references\n- Producing graph evidence for one suspicious function or candidate finding\n- Pre-analysis before mutation testing (genotoxic skill) or diagramming\n\n## When NOT to Use\n\n- Single-file scripts where call graph adds no value (read the file directly)\n- Architecture diagrams not derived from code (use the `diagramming-code` skill or draw by hand)\n- Mutation testing triage (use the genotoxic skill, which calls trailmark internally)\n- Runtime behavior analysis (trailmark is static, not dynamic)\n\n## Rationalizations to Reject\n\n| Rationalization | Why It's Wrong | Required Action |\n|-----------------|----------------|-----------------|\n| \"I'll just read the source files manually\" | Manual reading misses call paths, blast radius, and taint data | Install trailmark and use the API |\n| \"Pre-analysis isn't needed for a quick query\" | Blast radius, taint, and privilege data are only available after `preanalysis()` | Always run `engine.preanalysis()` before handing off to other skills |\n| \"The graph is too large, I'll sample\" | Sampling misses cross-module attack paths | Build the full graph; use subgraph queries to focus |\n| \"Uncertain edges don't matter\" | Dynamic dispatch is where type confusion bugs hide | Account for `uncertain` edges in security claims |\n| \"Single-language analysis is enough\" | Polyglot repos have FFI boundaries where bugs cluster | Use the correct `--language` flag per component |\n| \"Complexity hotspots are the only thing worth checking\" | Low-complexity functions on tainted paths are high-value targets | Combine complexity with taint and blast radius data |\n| \"The docs mention a version-gated method, so I can call it anywhere\" | Many environments still have Trailmark 0.2.x installed | Check the installed version or probe feature availability before using v0.4+\u002Fv0.5+ features |\n\n---\n\n## Installation\n\n**MANDATORY:** If `trailmark` is not found, install the CLI before doing anything else:\n\n```bash\nuv tool install trailmark\n```\n\nA tool install provides the CLI only — it does not make `import trailmark` resolvable.\nRun the Python snippets in this skill with `uv run --with trailmark python -`; that, not\ninstallation, is the fix for an import error or ModuleNotFoundError in a snippet.\n\n**DO NOT** fall back to \"manual verification\", \"manual analysis\", or reading\nsource files by hand as a substitute for running trailmark. The tool must be\ninstalled and used programmatically. If installation fails, report the error\nto the user instead of silently switching to manual code reading.\n\n## Version Gate\n\nTrailmark 0.4.0 expands the graph model and query surface, and 0.5.0 adds a\nSQL parser, repository-link configuration, and richer entrypoint metadata.\nBefore using a feature listed as **v0.4+** or **v0.5+**, check the installed\nversion:\n\n```bash\ntrailmark --version 2>\u002Fdev\u002Fnull || uv run trailmark --version 2>\u002Fdev\u002Fnull\n```\n\nCompare the reported version numerically (not lexically). `0.4.0` or newer\nmeans the full v0.4 surface is available. The version command itself was added\nin 0.2.2, so a failure means either a pre-0.2.2 install or trailmark missing\nentirely — distinguish with `trailmark analyze --help`. When working\nprogrammatically, probe with `hasattr()` and fall back instead of assuming a\nv0.4-only method exists:\n\n```python\nif hasattr(engine, \"subgraph_edges\"):\n    edges = engine.subgraph_edges(\"tainted\")\nelse:\n    # v0.2 fallback: filter engine.to_json() edges whose endpoints\n    # are both in engine.subgraph(\"tainted\")\n    edges = []\n```\n\n**v0.2-safe baseline:** CLI `analyze`, `diff`, `entrypoints`, `augment`, and\n`--language auto`; `QueryEngine.from_directory()`, `callers_of()`,\n`callees_of()`, `paths_between()`, `ancestors_of()`, `reachable_from()`,\n`entrypoint_paths_to()`, `complexity_hotspots()`, `attack_surface()`,\n`summary()`, `to_json()`, `preanalysis()`, `annotate()`, `annotations_of()`,\n`nodes_with_annotation()`, `clear_annotations()`, `findings()`, `subgraph()`,\n`subgraph_names()`, `diff_against()`, `augment_sarif()`, and\n`augment_weaudit()`.\n\n**Added in 0.2.2:** CLI `--version` flag and `version` subcommand.\n\n**Added in 0.3.x:** the `trailmark.parse` module with module-level\n`detect_languages()` and `supported_languages()`. `detect_languages()` itself\nis v0.2-safe via `from trailmark.query.api import detect_languages` (kept as a\ndeprecated alias in 0.3+); `supported_languages()` has no 0.2.x equivalent.\n\n**v0.4+ features:** native `diagram` subcommand; expanded parser coverage;\nproxy nodes for unresolved calls; node origins; binary graph augmentation via\n`augment_binary()`; `connect_subgraphs()`; `subgraph_edges()`;\n`generic_parameters()`; and `type_references()`.\n\n**v0.5+ features:** `sql` parser (PostgreSQL-oriented schemas, tables, views,\nfunctions, procedures, dependencies); node kinds `schema`, `table`, `view`,\n`procedure`; `.trailmark\u002Flinks.toml` repository-link configuration (see\nRepository Links below), including `proxy.external:\u003Csymbol>` nodes for\ndeclared external endpoints; repository links, unresolved-call proxies, and\n`type_uses` edges now materialize for single-language directory parses (0.4\nemitted them only for polyglot parses); Solidity entrypoints detected from\nparser metadata (interfaces excluded; `solidity_visibility`,\n`solidity_mutability`, `solidity_override`, `solidity_container_kind`, and\n`solidity_overridden_by` node attributes); `attack_surface()` entries carry an\n`attributes` key when the node has attributes; TypeScript resolves receivers\nassigned with `new ConcreteClass()`; C# file-scoped namespaces.\n\nv0.5.0 adds no new `QueryEngine` methods, so `hasattr(engine, ...)` cannot\ndetect it. Gate v0.5 features on the reported version, or probe structurally:\n\n```python\nfrom trailmark.models.nodes import NodeKind\n\nhas_v05 = \"SCHEMA\" in NodeKind.__members__  # sql kinds are 0.5+\n```\n\n## Quick Start\n\n```bash\n# Auto-detect and merge every supported language under the tree\nuv run trailmark analyze --language auto --summary {targetDir}\n\n# Explicit languages (single language or comma-separated list)\nuv run trailmark analyze --language rust {targetDir}\nuv run trailmark analyze --language python,rust {targetDir}\n\n# Complexity hotspots\nuv run trailmark analyze --language auto --complexity 10 {targetDir}\n\n# Entrypoint inventory and structural diff (v0.2-safe)\nuv run trailmark entrypoints --language auto {targetDir}\nuv run trailmark diff --language auto --repo {repoDir} main HEAD --json\n\n# Version report (0.2.2+)\nuv run trailmark --version\n\n# v0.4+: native diagram command\nuv run trailmark diagram -t {targetDir} -T call-graph -f main --depth 2\n```\n\n### Programmatic API\n\n```python\n# trailmark.parse is a 0.3+ module; on 0.2.x import detect_languages from\n# trailmark.query.api instead (supported_languages has no 0.2.x equivalent)\nfrom trailmark.parse import detect_languages, supported_languages\nfrom trailmark.query.api import QueryEngine\n\n# Ask the installed Trailmark build what it supports\nsupported_languages()\ndetect_languages(\"{targetDir}\")\n\n# Prefer auto for unknown or polyglot trees; use explicit lists when needed\nengine = QueryEngine.from_directory(\"{targetDir}\", language=\"auto\")\nengine = QueryEngine.from_directory(\"{targetDir}\", language=\"python,rust\")\n\nengine.callers_of(\"function_name\")\nengine.callees_of(\"function_name\")\nengine.paths_between(\"entry_func\", \"db_query\")\nengine.complexity_hotspots(threshold=10)\nengine.attack_surface()\nengine.summary()\nengine.to_json()\n\n# Transitive slices and entrypoint path queries (v0.2-safe)\nengine.ancestors_of(\"sensitive_sink\")\nengine.reachable_from(\"entry_func\")\nengine.entrypoint_paths_to(\"sensitive_sink\")\n\n# v0.4+: connect named subgraphs\nif hasattr(engine, \"connect_subgraphs\"):\n    engine.connect_subgraphs(\"tainted\", \"privilege_boundary\")\n\n# Run pre-analysis (blast radius, entrypoints, privilege\n# boundaries, taint propagation)\nresult = engine.preanalysis()\n\n# Query subgraphs created by pre-analysis\nengine.subgraph_names()\nengine.subgraph(\"tainted\")\nengine.subgraph(\"high_blast_radius\")\nengine.subgraph(\"privilege_boundary\")\nengine.subgraph(\"entrypoint_reachable\")\nif hasattr(engine, \"subgraph_edges\"):\n    engine.subgraph_edges(\"tainted\")\n\n# Add LLM-inferred annotations\nfrom trailmark.models import AnnotationKind\n\nengine.annotate(\"function_name\", AnnotationKind.ASSUMPTION,\n                \"input is URL-encoded\", source=\"llm\")\n\n# Query annotations (including pre-analysis results)\nengine.annotations_of(\"function_name\")\nengine.annotations_of(\"function_name\",\n                       kind=AnnotationKind.BLAST_RADIUS)\nengine.annotations_of(\"function_name\",\n                       kind=AnnotationKind.TAINT_PROPAGATION)\nengine.nodes_with_annotation(AnnotationKind.FINDING)\nengine.clear_annotations(\"function_name\", kind=AnnotationKind.ASSUMPTION)\n\n# v0.4+: generic\u002Ftype-reference and binary augmentation APIs\nif hasattr(engine, \"generic_parameters\"):\n    engine.generic_parameters(\"GenericTypeOrFunction\")\nif hasattr(engine, \"type_references\"):\n    engine.type_references(\"function_name\")\nif hasattr(engine, \"augment_binary\"):\n    engine.augment_binary(\"binary_graph.json\")\n```\n\n## Pre-Analysis Passes\n\n**Always run `engine.preanalysis()` before handing off to genotoxic or\n`diagramming-code` skills.** Pre-analysis enriches the graph with four passes:\n\n1. **Blast radius estimation** — counts downstream and upstream nodes per\n   function, identifies critical high-complexity descendants\n2. **Entry point enumeration** — maps entrypoints by trust level, computes\n   reachable node sets\n3. **Privilege boundary detection** — finds call edges where trust levels\n   change (untrusted -> trusted)\n4. **Taint propagation** — marks all nodes reachable from untrusted\n   entrypoints\n\nResults are stored as annotations and named subgraphs on the graph.\n\nFor detailed documentation, see\n[references\u002Fpreanalysis-passes.md](references\u002Fpreanalysis-passes.md).\n\n## Language Selection\n\nDo not hardcode a stale language table in downstream workflows. Ask the\ninstalled Trailmark build what it supports:\n\n```python\nfrom trailmark.parse import detect_languages, supported_languages\n\nsupported_languages()\ndetect_languages(\"{targetDir}\")\n```\n\nCLI patterns:\n\n```bash\n# Auto-detect and merge\nuv run trailmark analyze --language auto {targetDir}\n\n# Explicit list for a known polyglot target\nuv run trailmark analyze --language python,rust {targetDir}\n```\n\nAs of Trailmark 0.5.0, parser names include: `python`, `javascript`,\n`typescript`, `php`, `ruby`, `c`, `cpp`, `c_sharp`, `java`, `go`, `rust`,\n`solidity`, `cairo`, `circom`, `haskell`, `erlang`, `masm`, `swift`, `objc`,\n`kotlin`, `dart`, `move`, `tact`, `func`, `sway`, `rego`, `proto`, `thrift`,\n`graphql`, and `sql` (added in 0.5.0; PostgreSQL-oriented, `.sql` files).\nTreat this list as documentation, not a source of truth; call\n`supported_languages()` on the installed build before relying on a parser.\n\n## Repository Links (v0.5+)\n\nParsers cannot see cross-language calls (FFI, RPC, IPC, contract invocation)\nor edges into external systems. Declare them in `.trailmark\u002Flinks.toml` at the\nanalysis root and Trailmark materializes the edges on every parse — this is a\nstable public configuration interface:\n\n```toml\n[[link]]\nsource = \"backend:submit\"\ntarget = \"contract:Verifier.verify\"\nkind = \"calls\"                 # any EdgeKind; defaults to calls\nconfidence = \"certain\"         # certain | inferred | uncertain; defaults to inferred\ndescription = \"JSON-RPC eth_call\"\n\n[[link]]\nsource = \"backend:notify\"\ntarget = \"payments-webhook\"\ntarget_external = true         # required because target is unresolved\n```\n\nEndpoint references may be exact node IDs or unique names\u002Fsuffixes. Validation\nfails closed: ambiguous references, unknown internal endpoints, invalid enum\nvalues, and malformed TOML raise `ValueError` rather than silently weakening\nthe graph. `source_external = true` \u002F `target_external = true` permit an\nunresolved endpoint by creating a `proxy.external:\u003Csymbol>` node. Configured\nedges carry a `configured_by = .trailmark\u002Flinks.toml` attribute so they are\ndistinguishable from parser-derived edges.\n\nUse this when the audit spans an FFI\u002FRPC boundary the rationalization table\nwarns about: declare the boundary edges first, then path and taint queries\ncross them like any other call edge.\n\n## Graph Model\n\n**Node kinds:** `function`, `method`, `class`, `module`, `struct`,\n`interface`, `trait`, `enum`, `namespace`, `contract`, `library`,\n`template`; **v0.4+** also materializes unresolved references as `proxy`\nnodes; **v0.5+** adds `schema`, `table`, `view`, and `procedure` for SQL\ngraphs.\n\n**Node origins:** **v0.4+** nodes may carry origin `source`, `proxy`,\n`binary`, or `synthetic`. v0.2 exports may omit origin.\n\n**Edge kinds:** `calls`, `inherits`, `implements`, `contains`, `imports`;\n**v0.4+** adds `resolves_to`, `type_uses`, `specializes`, and\n`corresponds_to`.\n\n**Edge confidence:** `certain` (direct call, `self.method()`), `inferred`\n(attribute access on non-self object), `uncertain` (dynamic dispatch)\n\n### Per Code Unit\n- Parameters with types, return types, exception types\n- Cyclomatic complexity and branch metadata\n- Docstrings\n- Annotations: `assumption`, `precondition`, `postcondition`, `invariant`,\n  `blast_radius`, `privilege_boundary`, `taint_propagation`, `finding`,\n  `audit_note` (last two set by `augment_sarif` \u002F `augment_weaudit`)\n\n### Per Edge\n- Source\u002Ftarget node IDs, edge kind, confidence level\n\n### Project Level\n- Dependencies (imported packages)\n- Entrypoints with trust levels and asset values\n- Named subgraphs (populated by pre-analysis)\n\n## Key Concepts\n\n**Declared contract vs. effective input domain:** Trailmark separates what a\nfunction *declares* it accepts from what can *actually reach* it via call\npaths. Mismatches are where vulnerabilities hide:\n- **Widening**: Unconstrained data reaches a function that assumes validation\n- **Safe by coincidence**: No validation, but only safe callers exist today\n\n**Edge confidence:** Dynamic dispatch produces `uncertain` edges. Account for\nconfidence when making security claims.\n\n**Proxy nodes (v0.4+):** Unresolved calls are preserved as nodes such as\n`proxy.unresolved:\u003Csymbol>`. Do not treat these as source code functions; use\nthem to identify resolution gaps, dynamic dispatch, external APIs, or binary\nlinkage candidates. **v0.5+** also emits `proxy.external:\u003Csymbol>` nodes for\nendpoints declared external in `.trailmark\u002Flinks.toml`.\n\n**Reachability is not taint:** `entrypoint_paths_to()` and the taint subgraph\nanswer different questions. Path queries report call-graph reachability;\npreanalysis taint marks nodes reachable from untrusted entrypoints as a coarse\nsignal. Trailmark does not perform interprocedural taint analysis — do not\npresent either as proof that attacker-controlled data reaches a sink.\n\n**Binary augmentation (v0.4+):** `engine.augment_binary()` imports an external\nbinary-analysis graph JSON file. Trailmark connects it to source nodes when\npossible; it does not disassemble binaries itself.\n\n**Subgraphs:** Named collections of node IDs produced by pre-analysis.\nQuery with `engine.subgraph(\"name\")`. Available after `engine.preanalysis()`.\n\n## Query Patterns\n\nSee [references\u002Fquery-patterns.md](references\u002Fquery-patterns.md) for common\nsecurity analysis patterns.\n\nSee [references\u002Fpreanalysis-passes.md](references\u002Fpreanalysis-passes.md) for\npre-analysis pass documentation.\n\nUse `trailmark-finding-triage` when the user has one concrete candidate\nfinding, SARIF result, weAudit annotation, suspicious function, or report\nexcerpt and needs a handoff-ready reachability and blast-radius evidence packet.\n\nUse `trailmark-variant-neighborhood` after one seed issue is known and the user\nneeds graph-derived variant candidates for `variant-analysis`, Semgrep, CodeQL,\nor manual review.\n","# Trailmark\n\nParses source code into a directed graph of functions, classes, calls, and\nsemantic metadata for security analysis.\n\n## When to Use\n\n- Mapping call paths from user input to sensitive functions\n- Finding complexity hotspots for audit prioritization\n- Identifying attack surface and entrypoints\n- Understanding call relationships in unfamiliar codebases\n- Security review or audit preparation across polyglot projects\n- Adding LLM-inferred annotations (assumptions, preconditions) to code units\n- Importing external binary-analysis graphs to connect source and binary views\n- Querying transitive slices, entrypoint paths, subgraph edges, or type references\n- Producing graph evidence for one suspicious function or candidate finding\n- Pre-analysis before mutation testing (genotoxic skill) or diagramming\n\n## When NOT to Use\n\n- Single-file scripts where call graph adds no value (read the file directly)\n- Architecture diagrams not derived from code (use the `diagramming-code` skill or draw by hand)\n- Mutation testing triage (use the genotoxic skill, which calls trailmark internally)\n- Runtime behavior analysis (trailmark is static, not dynamic)\n\n## Rationalizations to Reject\n\n| Rationalization | Why It's Wrong | Required Action |\n|-----------------|----------------|-----------------|\n| \"I'll just read the source files manually\" | Manual reading misses call paths, blast radius, and taint data | Install trailmark and use the API |\n| \"Pre-analysis isn't needed for a quick query\" | Blast radius, taint, and privilege data are only available after `preanalysis()` | Always run `engine.preanalysis()` before handing off to other skills |\n| \"The graph is too large, I'll sample\" | Sampling misses cross-module attack paths | Build the full graph; use subgraph queries to focus |\n| \"Uncertain edges don't matter\" | Dynamic dispatch is where type confusion bugs hide | Account for `uncertain` edges in security claims |\n| \"Single-language analysis is enough\" | Polyglot repos have FFI boundaries where bugs cluster | Use the correct `--language` flag per component |\n| \"Complexity hotspots are the only thing worth checking\" | Low-complexity functions on tainted paths are high-value targets | Combine complexity with taint and blast radius data |\n| \"The docs mention a version-gated method, so I can call it anywhere\" | Many environments still have Trailmark 0.2.x installed | Check the installed version or probe feature availability before using v0.4+\u002Fv0.5+ features |\n\n---\n\n## Installation\n\n**MANDATORY:** If `trailmark` is not found, install the CLI before doing anything else:\n\n```bash\nuv tool install trailmark\n```\n\nA tool install provides the CLI only — it does not make `import trailmark` resolvable.\nRun the Python snippets in this skill with `uv run --with trailmark python -`; that, not\ninstallation, is the fix for an import error or ModuleNotFoundError in a snippet.\n\n**DO NOT** fall back to \"manual verification\", \"manual analysis\", or reading\nsource files by hand as a substitute for running trailmark. The tool must be\ninstalled and used programmatically. If installation fails, report the error\nto the user instead of silently switching to manual code reading.\n\n## Version Gate\n\nTrailmark 0.4.0 expands the graph model and query surface, and 0.5.0 adds a\nSQL parser, repository-link configuration, and richer entrypoint metadata.\nBefore using a feature listed as **v0.4+** or **v0.5+**, check the installed\nversion:\n\n```bash\ntrailmark --version 2>\u002Fdev\u002Fnull || uv run trailmark --version 2>\u002Fdev\u002Fnull\n```\n\nCompare the reported version numerically (not lexically). `0.4.0` or newer\nmeans the full v0.4 surface is available. The version command itself was added\nin 0.2.2, so a failure means either a pre-0.2.2 install or trailmark missing\nentirely — distinguish with `trailmark analyze --help`. When working\nprogrammatically, probe with `hasattr()` and fall back instead of assuming a\nv0.4-only method exists:\n\n```python\nif hasattr(engine, \"subgraph_edges\"):\n    edges = engine.subgraph_edges(\"tainted\")\nelse:\n    # v0.2 fallback: filter engine.to_json() edges whose endpoints\n    # are both in engine.subgraph(\"tainted\")\n    edges = []\n```\n\n**v0.2-safe baseline:** CLI `analyze`, `diff`, `entrypoints`, `augment`, and\n`--language auto`; `QueryEngine.from_directory()`, `callers_of()`,\n`callees_of()`, `paths_between()`, `ancestors_of()`, `reachable_from()`,\n`entrypoint_paths_to()`, `complexity_hotspots()`, `attack_surface()`,\n`summary()`, `to_json()`, `preanalysis()`, `annotate()`, `annotations_of()`,\n`nodes_with_annotation()`, `clear_annotations()`, `findings()`, `subgraph()`,\n`subgraph_names()`, `diff_against()`, `augment_sarif()`, and\n`augment_weaudit()`.\n\n**Added in 0.2.2:** CLI `--version` flag and `version` subcommand.\n\n**Added in 0.3.x:** the `trailmark.parse` module with module-level\n`detect_languages()` and `supported_languages()`. `detect_languages()` itself\nis v0.2-safe via `from trailmark.query.api import detect_languages` (kept as a\ndeprecated alias in 0.3+); `supported_languages()` has no 0.2.x equivalent.\n\n**v0.4+ features:** native `diagram` subcommand; expanded parser coverage;\nproxy nodes for unresolved calls; node origins; binary graph augmentation via\n`augment_binary()`; `connect_subgraphs()`; `subgraph_edges()`;\n`generic_parameters()`; and `type_references()`.\n\n**v0.5+ features:** `sql` parser (PostgreSQL-oriented schemas, tables, views,\nfunctions, procedures, dependencies); node kinds `schema`, `table`, `view`,\n`procedure`; `.trailmark\u002Flinks.toml` repository-link configuration (see\nRepository Links below), including `proxy.external:\u003Csymbol>` nodes for\ndeclared external endpoints; repository links, unresolved-call proxies, and\n`type_uses` edges now materialize for single-language directory parses (0.4\nemitted them only for polyglot parses); Solidity entrypoints detected from\nparser metadata (interfaces excluded; `solidity_visibility`,\n`solidity_mutability`, `solidity_override`, `solidity_container_kind`, and\n`solidity_overridden_by` node attributes); `attack_surface()` entries carry an\n`attributes` key when the node has attributes; TypeScript resolves receivers\nassigned with `new ConcreteClass()`; C# file-scoped namespaces.\n\nv0.5.0 adds no new `QueryEngine` methods, so `hasattr(engine, ...)` cannot\ndetect it. Gate v0.5 features on the reported version, or probe structurally:\n\n```python\nfrom trailmark.models.nodes import NodeKind\n\nhas_v05 = \"SCHEMA\" in NodeKind.__members__  # sql kinds are 0.5+\n```\n\n## Quick Start\n\n```bash\n# Auto-detect and merge every supported language under the tree\nuv run trailmark analyze --language auto --summary {targetDir}\n\n# Explicit languages (single language or comma-separated list)\nuv run trailmark analyze --language rust {targetDir}\nuv run trailmark analyze --language python,rust {targetDir}\n\n# Complexity hotspots\nuv run trailmark analyze --language auto --complexity 10 {targetDir}\n\n# Entrypoint inventory and structural diff (v0.2-safe)\nuv run trailmark entrypoints --language auto {targetDir}\nuv run trailmark diff --language auto --repo {repoDir} main HEAD --json\n\n# Version report (0.2.2+)\nuv run trailmark --version\n\n# v0.4+: native diagram command\nuv run trailmark diagram -t {targetDir} -T call-graph -f main --depth 2\n```\n\n### Programmatic API\n\n```python\n# trailmark.parse is a 0.3+ module; on 0.2.x import detect_languages from\n# trailmark.query.api instead (supported_languages has no 0.2.x equivalent)\nfrom trailmark.parse import detect_languages, supported_languages\nfrom trailmark.query.api import QueryEngine\n\n# Ask the installed Trailmark build what it supports\nsupported_languages()\ndetect_languages(\"{targetDir}\")\n\n# Prefer auto for unknown or polyglot trees; use explicit lists when needed\nengine = QueryEngine.from_directory(\"{targetDir}\", language=\"auto\")\nengine = QueryEngine.from_directory(\"{targetDir}\", language=\"python,rust\")\n\nengine.callers_of(\"function_name\")\nengine.callees_of(\"function_name\")\nengine.paths_between(\"entry_func\", \"db_query\")\nengine.complexity_hotspots(threshold=10)\nengine.attack_surface()\nengine.summary()\nengine.to_json()\n\n# Transitive slices and entrypoint path queries (v0.2-safe)\nengine.ancestors_of(\"sensitive_sink\")\nengine.reachable_from(\"entry_func\")\nengine.entrypoint_paths_to(\"sensitive_sink\")\n\n# v0.4+: connect named subgraphs\nif hasattr(engine, \"connect_subgraphs\"):\n    engine.connect_subgraphs(\"tainted\", \"privilege_boundary\")\n\n# Run pre-analysis (blast radius, entrypoints, privilege\n# boundaries, taint propagation)\nresult = engine.preanalysis()\n\n# Query subgraphs created by pre-analysis\nengine.subgraph_names()\nengine.subgraph(\"tainted\")\nengine.subgraph(\"high_blast_radius\")\nengine.subgraph(\"privilege_boundary\")\nengine.subgraph(\"entrypoint_reachable\")\nif hasattr(engine, \"subgraph_edges\"):\n    engine.subgraph_edges(\"tainted\")\n\n# Add LLM-inferred annotations\nfrom trailmark.models import AnnotationKind\n\nengine.annotate(\"function_name\", AnnotationKind.ASSUMPTION,\n                \"input is URL-encoded\", source=\"llm\")\n\n# Query annotations (including pre-analysis results)\nengine.annotations_of(\"function_name\")\nengine.annotations_of(\"function_name\",\n                       kind=AnnotationKind.BLAST_RADIUS)\nengine.annotations_of(\"function_name\",\n                       kind=AnnotationKind.TAINT_PROPAGATION)\nengine.nodes_with_annotation(AnnotationKind.FINDING)\nengine.clear_annotations(\"function_name\", kind=AnnotationKind.ASSUMPTION)\n\n# v0.4+: generic\u002Ftype-reference and binary augmentation APIs\nif hasattr(engine, \"generic_parameters\"):\n    engine.generic_parameters(\"GenericTypeOrFunction\")\nif hasattr(engine, \"type_references\"):\n    engine.type_references(\"function_name\")\nif hasattr(engine, \"augment_binary\"):\n    engine.augment_binary(\"binary_graph.json\")\n```\n\n## Pre-Analysis Passes\n\n**Always run `engine.preanalysis()` before handing off to genotoxic or\n`diagramming-code` skills.** Pre-analysis enriches the graph with four passes:\n\n1. **Blast radius estimation** — counts downstream and upstream nodes per\n   function, identifies critical high-complexity descendants\n2. **Entry point enumeration** — maps entrypoints by trust level, computes\n   reachable node sets\n3. **Privilege boundary detection** — finds call edges where trust levels\n   change (untrusted -> trusted)\n4. **Taint propagation** — marks all nodes reachable from untrusted\n   entrypoints\n\nResults are stored as annotations and named subgraphs on the graph.\n\nFor detailed documentation, see\n[references\u002Fpreanalysis-passes.md](references\u002Fpreanalysis-passes.md).\n\n## Language Selection\n\nDo not hardcode a stale language table in downstream workflows. Ask the\ninstalled Trailmark build what it supports:\n\n```python\nfrom trailmark.parse import detect_languages, supported_languages\n\nsupported_languages()\ndetect_languages(\"{targetDir}\")\n```\n\nCLI patterns:\n\n```bash\n# Auto-detect and merge\nuv run trailmark analyze --language auto {targetDir}\n\n# Explicit list for a known polyglot target\nuv run trailmark analyze --language python,rust {targetDir}\n```\n\nAs of Trailmark 0.5.0, parser names include: `python`, `javascript`,\n`typescript`, `php`, `ruby`, `c`, `cpp`, `c_sharp`, `java`, `go`, `rust`,\n`solidity`, `cairo`, `circom`, `haskell`, `erlang`, `masm`, `swift`, `objc`,\n`kotlin`, `dart`, `move`, `tact`, `func`, `sway`, `rego`, `proto`, `thrift`,\n`graphql`, and `sql` (added in 0.5.0; PostgreSQL-oriented, `.sql` files).\nTreat this list as documentation, not a source of truth; call\n`supported_languages()` on the installed build before relying on a parser.\n\n## Repository Links (v0.5+)\n\nParsers cannot see cross-language calls (FFI, RPC, IPC, contract invocation)\nor edges into external systems. Declare them in `.trailmark\u002Flinks.toml` at the\nanalysis root and Trailmark materializes the edges on every parse — this is a\nstable public configuration interface:\n\n```toml\n[[link]]\nsource = \"backend:submit\"\ntarget = \"contract:Verifier.verify\"\nkind = \"calls\"                 # any EdgeKind; defaults to calls\nconfidence = \"certain\"         # certain | inferred | uncertain; defaults to inferred\ndescription = \"JSON-RPC eth_call\"\n\n[[link]]\nsource = \"backend:notify\"\ntarget = \"payments-webhook\"\ntarget_external = true         # required because target is unresolved\n```\n\nEndpoint references may be exact node IDs or unique names\u002Fsuffixes. Validation\nfails closed: ambiguous references, unknown internal endpoints, invalid enum\nvalues, and malformed TOML raise `ValueError` rather than silently weakening\nthe graph. `source_external = true` \u002F `target_external = true` permit an\nunresolved endpoint by creating a `proxy.external:\u003Csymbol>` node. Configured\nedges carry a `configured_by = .trailmark\u002Flinks.toml` attribute so they are\ndistinguishable from parser-derived edges.\n\nUse this when the audit spans an FFI\u002FRPC boundary the rationalization table\nwarns about: declare the boundary edges first, then path and taint queries\ncross them like any other call edge.\n\n## Graph Model\n\n**Node kinds:** `function`, `method`, `class`, `module`, `struct`,\n`interface`, `trait`, `enum`, `namespace`, `contract`, `library`,\n`template`; **v0.4+** also materializes unresolved references as `proxy`\nnodes; **v0.5+** adds `schema`, `table`, `view`, and `procedure` for SQL\ngraphs.\n\n**Node origins:** **v0.4+** nodes may carry origin `source`, `proxy`,\n`binary`, or `synthetic`. v0.2 exports may omit origin.\n\n**Edge kinds:** `calls`, `inherits`, `implements`, `contains`, `imports`;\n**v0.4+** adds `resolves_to`, `type_uses`, `specializes`, and\n`corresponds_to`.\n\n**Edge confidence:** `certain` (direct call, `self.method()`), `inferred`\n(attribute access on non-self object), `uncertain` (dynamic dispatch)\n\n### Per Code Unit\n- Parameters with types, return types, exception types\n- Cyclomatic complexity and branch metadata\n- Docstrings\n- Annotations: `assumption`, `precondition`, `postcondition`, `invariant`,\n  `blast_radius`, `privilege_boundary`, `taint_propagation`, `finding`,\n  `audit_note` (last two set by `augment_sarif` \u002F `augment_weaudit`)\n\n### Per Edge\n- Source\u002Ftarget node IDs, edge kind, confidence level\n\n### Project Level\n- Dependencies (imported packages)\n- Entrypoints with trust levels and asset values\n- Named subgraphs (populated by pre-analysis)\n\n## Key Concepts\n\n**Declared contract vs. effective input domain:** Trailmark separates what a\nfunction *declares* it accepts from what can *actually reach* it via call\npaths. Mismatches are where vulnerabilities hide:\n- **Widening**: Unconstrained data reaches a function that assumes validation\n- **Safe by coincidence**: No validation, but only safe callers exist today\n\n**Edge confidence:** Dynamic dispatch produces `uncertain` edges. Account for\nconfidence when making security claims.\n\n**Proxy nodes (v0.4+):** Unresolved calls are preserved as nodes such as\n`proxy.unresolved:\u003Csymbol>`. Do not treat these as source code functions; use\nthem to identify resolution gaps, dynamic dispatch, external APIs, or binary\nlinkage candidates. **v0.5+** also emits `proxy.external:\u003Csymbol>` nodes for\nendpoints declared external in `.trailmark\u002Flinks.toml`.\n\n**Reachability is not taint:** `entrypoint_paths_to()` and the taint subgraph\nanswer different questions. Path queries report call-graph reachability;\npreanalysis taint marks nodes reachable from untrusted entrypoints as a coarse\nsignal. Trailmark does not perform interprocedural taint analysis — do not\npresent either as proof that attacker-controlled data reaches a sink.\n\n**Binary augmentation (v0.4+):** `engine.augment_binary()` imports an external\nbinary-analysis graph JSON file. Trailmark connects it to source nodes when\npossible; it does not disassemble binaries itself.\n\n**Subgraphs:** Named collections of node IDs produced by pre-analysis.\nQuery with `engine.subgraph(\"name\")`. Available after `engine.preanalysis()`.\n\n## Query Patterns\n\nSee [references\u002Fquery-patterns.md](references\u002Fquery-patterns.md) for common\nsecurity analysis patterns.\n\nSee [references\u002Fpreanalysis-passes.md](references\u002Fpreanalysis-passes.md) for\npre-analysis pass documentation.\n\nUse `trailmark-finding-triage` when the user has one concrete candidate\nfinding, SARIF result, weAudit annotation, suspicious function, or report\nexcerpt and needs a handoff-ready reachability and blast-radius evidence packet.\n\nUse `trailmark-variant-neighborhood` after one seed issue is known and the user\nneeds graph-derived variant candidates for `variant-analysis`, Semgrep, CodeQL,\nor manual review.\n",{"name":5,"description":7},"main","321ccfe628eca0d314b0ee4eaffcdd8a05639aaf","plugins\u002Ftrailmark\u002Fskills\u002Ftrailmark",0,"https:\u002F\u002Fgithub.com\u002Fbongkage\u002Ftrailofbits-skills","https:\u002F\u002Fgithub.com\u002Fbongkage","2026-11-06 12:15:06",{"source":8,"skillName":5,"commands":31,"prompt":41,"zipAvailable":42},[32,35,38],{"tool":33,"command":34},"npx","npx skills add bongkage\u002Ftrailofbits-skills --skill trailmark",{"tool":36,"command":37},"bunx","bunx skills add bongkage\u002Ftrailofbits-skills --skill trailmark",{"tool":39,"command":40},"pnpm","pnpm dlx skills add bongkage\u002Ftrailofbits-skills --skill trailmark","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fbongkage\u002Ftrailofbits-skills\u002Fblob\u002Fmain\u002Fplugins\u002Ftrailmark\u002Fskills\u002Ftrailmark\u002FSKILL.md",true,[44,50,56,60],{"path":45,"resourceType":46,"resourceTypeDesc":47,"sizeBytes":48,"sourceHtmlUrl":49},"agents\u002Fopenai.yaml","REFERENCE","参考文档",128,"https:\u002F\u002Fgithub.com\u002Fbongkage\u002Ftrailofbits-skills\u002Fblob\u002Fmain\u002Fplugins\u002Ftrailmark\u002Fskills\u002Ftrailmark\u002Fagents\u002Fopenai.yaml",{"path":51,"resourceType":52,"resourceTypeDesc":53,"sizeBytes":54,"sourceHtmlUrl":55},"assets\u002Ftrail-of-bits-mark.svg","ASSET","资产文件",3084,"https:\u002F\u002Fgithub.com\u002Fbongkage\u002Ftrailofbits-skills\u002Fblob\u002Fmain\u002Fplugins\u002Ftrailmark\u002Fskills\u002Ftrailmark\u002Fassets\u002Ftrail-of-bits-mark.svg",{"path":57,"resourceType":46,"resourceTypeDesc":47,"sizeBytes":58,"sourceHtmlUrl":59},"references\u002Fpreanalysis-passes.md",5778,"https:\u002F\u002Fgithub.com\u002Fbongkage\u002Ftrailofbits-skills\u002Fblob\u002Fmain\u002Fplugins\u002Ftrailmark\u002Fskills\u002Ftrailmark\u002Freferences\u002Fpreanalysis-passes.md",{"path":61,"resourceType":46,"resourceTypeDesc":47,"sizeBytes":62,"sourceHtmlUrl":63},"references\u002Fquery-patterns.md",8934,"https:\u002F\u002Fgithub.com\u002Fbongkage\u002Ftrailofbits-skills\u002Fblob\u002Fmain\u002Fplugins\u002Ftrailmark\u002Fskills\u002Ftrailmark\u002Freferences\u002Fquery-patterns.md",[65,72,79,86,93,100],{"skillNo":66,"name":67,"nameZh":6,"description":68,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":69,"categories":70,"keywords":71,"publishedAt":18},"01M7CHJAESZRWKJXFQG55BMNAA","zeroize-audit","Detects missing zeroization of sensitive data in source code and identifies zeroization removed by compiler optimizations, with assembly-level analysis, and control-flow verification. Use for auditing C\u002FC++\u002FRust code handling secrets, keys, passwords, or other sensitive data.","https:\u002F\u002Fgithub.com\u002Fbongkage\u002Ftrailofbits-skills\u002Fblob\u002Fmain\u002Fplugins\u002Fzeroize-audit\u002Fskills\u002Fzeroize-audit\u002FSKILL.md",[],[],{"skillNo":73,"name":74,"nameZh":6,"description":75,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":76,"categories":77,"keywords":78,"publishedAt":18},"01M7CHJ543G42A9GQC3PJE4F4V","yara-rule-authoring","Guides authoring of high-quality YARA-X detection rules for malware identification. Use when writing, reviewing, or optimizing YARA rules. Covers naming conventions, string selection, performance optimization, migration from legacy YARA, and false positive reduction. Triggers on: YARA, YARA-X, malware detection, threat hunting, IOC, signature, crx module, dex module.","https:\u002F\u002Fgithub.com\u002Fbongkage\u002Ftrailofbits-skills\u002Fblob\u002Fmain\u002Fplugins\u002Fyara-authoring\u002Fskills\u002Fyara-rule-authoring\u002FSKILL.md",[],[],{"skillNo":80,"name":81,"nameZh":6,"description":82,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":83,"categories":84,"keywords":85,"publishedAt":18},"01M7CHHYVFS1AKDTH3YDS1Y4K4","writing-lean-proofs","Writes and reviews structured Lean 4 proofs and designs Lean libraries following Mathlib conventions. Use when proving theorems in Lean, formalizing mathematics or specifications in Lean 4, defining new types or definitions in a Lean library, reviewing Lean proofs for readability and maintainability, refactoring long tactic proofs into lemmas, filling in sorry placeholders in a Lean development, setting up CI or linters for a Lean project, diagnosing slow proofs or maxHeartbeats timeouts, or writing custom tactics, macros, or linters.","https:\u002F\u002Fgithub.com\u002Fbongkage\u002Ftrailofbits-skills\u002Fblob\u002Fmain\u002Fplugins\u002Fwriting-lean-proofs\u002Fskills\u002Fwriting-lean-proofs\u002FSKILL.md",[],[],{"skillNo":87,"name":88,"nameZh":6,"description":89,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":90,"categories":91,"keywords":92,"publishedAt":18},"01M7CHHQXA39M4965MV2RMM5YS","vulnerability-triage-brocards","This skill should be used when the user asks to \"triage a vulnerability report\", \"assess a CVE\", \"evaluate a bug bounty submission\", \"decide if a finding is valid\", \"review a security finding\", \"dismiss a vulnerability\", \"should we fix this CVE\", \"prioritize a vulnerability report\", or needs to determine whether an incoming vulnerability report warrants investigation. Applies 7 brocards (rules of thumb) to systematically accept, dismiss, or request more information on vulnerability reports, or needs to filter raw findings from agentic vulnerability discovery pipelines before human review.","https:\u002F\u002Fgithub.com\u002Fbongkage\u002Ftrailofbits-skills\u002Fblob\u002Fmain\u002Fplugins\u002Fvulnerability-triage-brocards\u002Fskills\u002Fvulnerability-triage-brocards\u002FSKILL.md",[],[],{"skillNo":94,"name":95,"nameZh":6,"description":96,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":97,"categories":98,"keywords":99,"publishedAt":18},"01M7CHHJVQC2ZG2M310GXT0T42","variant-analysis","Hunts for the other instances of a bug already found — the variants of one root cause across a codebase. Use immediately after a vulnerability, logic bug, or bad pattern turns up in a specific file and the question becomes where else it occurs, including the bare conversational form (\"are there others like this?\", \"is this the same bug?\"). Also for generalizing one known instance into a CodeQL or Semgrep query for its whole pattern family, and for triaging a set of look-alike candidates against a known root cause. Not for initial discovery with no bug in hand.","https:\u002F\u002Fgithub.com\u002Fbongkage\u002Ftrailofbits-skills\u002Fblob\u002Fmain\u002Fplugins\u002Fvariant-analysis\u002Fskills\u002Fvariant-analysis\u002FSKILL.md",[],[],{"skillNo":101,"name":102,"nameZh":6,"description":103,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":104,"categories":105,"keywords":106,"publishedAt":18},"01M7CHHC1GM5GH585ZWGP7D03P","vector-forge","Mutation-driven test vector generation. Finds implementations of a cryptographic algorithm or protocol, runs mutation testing to identify escaped mutants, then generates new test vectors that deliberately exercise the uncovered code paths. Compares before\u002Fafter mutation kill rates to prove vector effectiveness. Use when generating cryptographic test vectors, measuring Wycheproof coverage gaps, finding escaped mutants via mutation testing, creating cross-implementation test suites, or improving test vector coverage for crypto primitives.","https:\u002F\u002Fgithub.com\u002Fbongkage\u002Ftrailofbits-skills\u002Fblob\u002Fmain\u002Fplugins\u002Ftrailmark\u002Fskills\u002Fvector-forge\u002FSKILL.md",[],[]]