[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7EDMNBGPK9N3BJ8ETA8Q7TS":3,"skill-same:01M7EDMNBGPK9N3BJ8ETA8Q7TS":60},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":24,"commitSha":25,"skillDirectory":26,"forksCount":27,"repositoryHtmlUrl":28,"repositoryHomepageUrl":6,"ownerHtmlUrl":29,"ownerBlogUrl":6,"ownerDescription":30,"updatedAt":31,"install":32,"resources":45},"01M7EDMNBGPK9N3BJ8ETA8Q7TS","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.","lza6\u002FArmor-piercing-system-prompts","lza6","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F128880206?v=4","01M7EB3K7WPX5T28EJ2NVHE6EG","Chinese-tingfeng","01M7EB3K97E1KQ16QWKJMFNGX8",11,"MIT","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F03-逆向工程\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","d69096e239f2a89aabc2cd078c47664a9d3b1e11","03-逆向工程\u002Ftrailmark",3,"https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts","https:\u002F\u002Fgithub.com\u002Flza6","个人vx：Tf00798\r\n个人✈：@TFGY999","2026-10-08 14:29:22",{"source":8,"skillName":5,"commands":33,"prompt":43,"zipAvailable":44},[34,37,40],{"tool":35,"command":36},"npx","npx skills add lza6\u002FArmor-piercing-system-prompts --skill trailmark",{"tool":38,"command":39},"bunx","bunx skills add lza6\u002FArmor-piercing-system-prompts --skill trailmark",{"tool":41,"command":42},"pnpm","pnpm dlx skills add lza6\u002FArmor-piercing-system-prompts --skill trailmark","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F03-逆向工程\u002Ftrailmark\u002FSKILL.md",true,[46,52,56],{"path":47,"resourceType":48,"resourceTypeDesc":49,"sizeBytes":50,"sourceHtmlUrl":51},"agents\u002Fopenai.yaml","REFERENCE","参考文档",242,"https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F03-逆向工程\u002Ftrailmark\u002Fagents\u002Fopenai.yaml",{"path":53,"resourceType":48,"resourceTypeDesc":49,"sizeBytes":54,"sourceHtmlUrl":55},"references\u002Fpreanalysis-passes.md",5778,"https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F03-逆向工程\u002Ftrailmark\u002Freferences\u002Fpreanalysis-passes.md",{"path":57,"resourceType":48,"resourceTypeDesc":49,"sizeBytes":58,"sourceHtmlUrl":59},"references\u002Fquery-patterns.md",8934,"https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F03-逆向工程\u002Ftrailmark\u002Freferences\u002Fquery-patterns.md",[61,69,74,81,88,95],{"skillNo":62,"name":63,"nameZh":6,"description":64,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":65,"categories":66,"keywords":67,"publishedAt":68},"01M7FFG485KY83TD6HSC4YPCMC","obsidian-clipper-template-creator","Guide for creating templates for the Obsidian Web Clipper. Use when you want to create a new clipping template, understand available variables, or format clipped content.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobsidian-clipper-template-creator\u002FSKILL.md",[],[],"2026-11-16 10:05:34",{"skillNo":70,"name":63,"nameZh":6,"description":64,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":71,"categories":72,"keywords":73,"publishedAt":68},"01M7FFG0T6AZ0STEJPSB3CX84K","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobsidian-clipper-template-creator-antigravity-awesome-skills-main\u002FSKILL.md",[],[],{"skillNo":75,"name":76,"nameZh":6,"description":77,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":78,"categories":79,"keywords":80,"publishedAt":68},"01M7FFFY0QEM14SKWPDYGMXM2P","python-api","Programmatic Object-Detection-Metrics API guidance for BoundingBox, BoundingBoxes, Evaluator, enums, coordinate conversion, AP\u002FmAP semantics, and source-style import diagnostics.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobject-detection-metrics\u002Fsub-skills\u002Fpython-api\u002FSKILL.md",[],[],{"skillNo":82,"name":83,"nameZh":6,"description":84,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":85,"categories":86,"keywords":87,"publishedAt":68},"01M7FFFVZQZ2GJ0C0TGP7JHD20","file-evaluation","Folder-based PASCAL VOC AP\u002FmAP evaluation from ground-truth and detection text files.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobject-detection-metrics\u002Fsub-skills\u002Ffile-evaluation\u002FSKILL.md",[],[],{"skillNo":89,"name":90,"nameZh":6,"description":91,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":92,"categories":93,"keywords":94,"publishedAt":68},"01M7FFFSFNYSE77SJ6PE1CK2DA","object-detection-metrics","Guides legacy Object-Detection-Metrics PASCAL VOC AP\u002FmAP evaluation from detection text folders and direct Python API classes.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobject-detection-metrics\u002FSKILL.md",[],[],{"skillNo":96,"name":97,"nameZh":6,"description":98,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":99,"categories":100,"keywords":101,"publishedAt":68},"01M7FFFP0GCK1RVXBCPQ8APBMT","nx-workspace-patterns","Configure and optimize Nx monorepo workspaces. Use when setting up Nx, configuring project boundaries, optimizing build caching, or implementing affected commands.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fnx-workspace-patterns\u002FSKILL.md",[],[]]