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.
npx agentmods add commands/flashus/detrix/auditgit clone --depth 1 https://github.com/flashus/detrixWhat 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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00012 | $0.01890 |
| Opus 5 | $0.00006 | $0.00945 |
| Sonnet 5 | $0.00002 | $0.00378 |
| Haiku 4.5 | $0.00001 | $0.00189 |
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 yesterday.
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.
How it starts
The opening of the file, as written. The whole thing — 215 lines — stays where its author put it; the contents beside it link to each section on GitHub.
You are a PROJECT MANAGER coordinating a comprehensive code audit. You do NOT read source code yourself. You dispatch subagents and compile their reports.
Scope
The argument provided is: "$ARGUMENTS"
If the argument is empty or blank, you MUST use AskUserQuestion to ask the user BEFORE doing anything else:
Question: "What scope should the audit cover?"
Options:
- "Current branch" — "Audit changes on current branch vs main"
- "Uncommitted changes" — "Audit only uncommitted/staged changes"
- "Full project" — "Audit all 13 crates + clients (takes a while)"
- "Single crate" — "I'll specify which crate to audit"
If the user picks "Single crate", follow up: "Which crate? (e.g. detrix-core, detrix-api)" Then use their answer as the scope.
If the argument IS provided, map it:
branch— audit changes on current branch vs mainuncommitted— audit uncommitted changes onlyproject— audit entire project- A crate name (e.g.
detrix-core) — audit just that crate
CRITICAL: Context Window Management
You MUST NOT read source code files yourself. Your job is to:
- Set up the audit directory
- Run automated tooling (clippy, etc.)
- Dispatch one subagent per crate (they each get a fresh context window)
- Read only the subagent OUTPUT FILES to compile the final report
This architecture lets us audit 13 crates without exhausting the context.
Phase 1: Setup & Automated Checks
mkdir -p .agents/audit
Check which crates were already audited (for resumability):
ls .agents/audit/*.md 2>/dev/null
If audit files already exist, ask the user: "Found existing audit files for [crates]. Skip already-audited crates, or start fresh?"
Run automated checks and save output:
cargo clippy --all -- -D warnings 2>&1 | head -200 > .agents/audit/_clippy.txt
Phase 2: Determine Crates to Audit
For scope branch: identify which crates have changes:
git diff main...HEAD --name-only | grep "^crates/" | cut -d/ -f2 | sort -u
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.
- yesterday First seen · 215 lines · 12 tokens per session scan A 4efd279fe0b8
audit is a command published in the GitHub repository flashus/detrix (23 stars, last pushed 8d ago), licensed MIT. It adds 12 tokens to every session and 1,890 once invoked, about $0.0001 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-30.
Other commands, from other repositories
freview
Prepare PR with CI checks and Devin AI review loop.
debug-task
Debug Frontman task interactions from the database.
work
Set up a containerized worktree for a GitHub issue or PR.
auto-work
给一个需求,AI自动完成调研→方案→方案Review→开发→开发Review全流程.
develop-review
Review feature-developing 生成的代码,检查遗漏和宪法违规.
developing
Command "developing" from chaohong-ai/ai-auto-work, covering 参数解析, 你的角色, 工作流程, 第一步:建立完整上下文 and 第二步:确认实现范围.