audit

audit is a command for coding agents from yacb2/domaintome. It costs 42 tokens per session (929 once invoked), scanned A, original, MIT.

A command that checks a DomainTome graph, which is a database of project items and their relationships, for structural problems.

In plain words
What is it for?
Auditing the active project or another project’s graph and reporting orphans, dangling edges, invalid IDs, and cycles.
Why use it?
It finds disconnected items, broken relationships, naming issues, and circular relationships that can make the graph unreliable.

Command

Part of the dt plugin — 1 skill, 9 commands, 1 agent, 2 hooks, 1 MCP server shipped together

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/yacb2/domaintome/audit
Clone the repo
git clone --depth 1 https://github.com/yacb2/domaintome

Or install dt, the plugin that ships this one along with the rest of its 1 skill, 9 commands, 1 agent, 2 hooks, 1 MCP server.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for audit

README.md
[![agentmods](https://agentmods.dev/badge/commands/yacb2/domaintome/audit.svg)](https://agentmods.dev/commands/yacb2/domaintome/audit)
Your own site
<a href="https://agentmods.dev/commands/yacb2/domaintome/audit"><img src="https://agentmods.dev/badge/commands/yacb2/domaintome/audit.svg" alt="Measured on agentmods" height="20"></a>
Per session 42 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 929 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00042 $0.00929
Opus 5 $0.00021 $0.00464
Sonnet 5 $0.00008 $0.00186
Haiku 4.5 $0.00004 $0.00093

Measured 3d ago against content hash 45b71febaf9f, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

audit scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugins/domaintome/commands/audit.md · 95 lines

How it starts

The opening of the file, as written. The whole thing — 95 lines — stays where its author put it; the contents beside it link to each section on GitHub.

/dt:audit runs structural checks on a DomainTome graph and surfaces findings. The target is chosen by $ARGUMENTS:

$ARGUMENTS Target Mechanism
empty Active project (the graph the MCP server is using) MCP dt_audit()
<path> Another project's graph at <path>/.dt/graph.db Subprocess dt audit + dt stats

/dt:probe <path> is a deprecated alias that always lands in the "with path" branch.

Mode A — active project (no args)

Call dt_audit() via MCP and summarize:

  • orphans: nodes with no edges. List them and suggest either linking or deleting each.
  • invalid_ids / generic_ids: flag id hygiene problems and propose renames.
  • cycles_supersedes / cycles_depends_on / cycles_triggers: any non-empty list is a real bug — explain what it breaks and suggest which edge to remove.

If everything is clean, just say so in one line.

Mode B — external project (path provided)

The MCP server is bound to the active project's graph; it cannot be re-aimed at a different DB mid-session. So this mode shells out to the dt CLI instead.

  1. Resolve the DB path: <path>/.dt/graph.db. If the path does not exist, stop and report it clearly — do not create anything. Relative paths resolve against the current working directory.

  2. Run two read-only CLI calls:

    dt audit --db <path>/.dt/graph.db --json
    dt stats --db <path>/.dt/graph.db
    

    The --json flag on audit gives you structured counts and findings in one shot: nodes_total, edges_total, nodes_by_type, nodes_by_status, edges_by_relation, last_mutation_at, plus the finding lists (orphans, dangling_edges, invalid_ids, generic_ids, unknown_types, cycles_*).

  3. Summarize as a single markdown block with this shape:

    ## DomainTome audit — <project-name>
    
    **Graph**
    - nodes: <nodes_total>   edges: <edges_total>
    - last mutation: <last_mutation_at>
    - by type:     <nodes_by_type as k=v, ...>
    - by status:   <nodes_by_status as k=v, ...>
    - by relation: <edges_by_relation as k=v, ...>
    
    **Health**
    - orphans: N
    - dangling_edges: N
    - invalid_ids / generic_ids / unknown_types: N / N / N
    - cycles: supersedes=N, depends_on=N, triggers=N
    
    **Usage (MCP)**
    - calls: N   errors: N
    - total bytes exchanged: X  (≈ X*0.3 tokens, honest proxy)
    - top tools: <tool> (N calls), ...
    

Read the full file on GitHub · 95 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3d ago First seen · 95 lines · 42 tokens per session scan A 45b71febaf9f

Subscribe to this mod's changes

audit is a command published in the GitHub repository yacb2/domaintome (0 stars, last pushed 3mo ago), licensed MIT. It adds 42 tokens to every session and 929 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.