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/audit-duplicationgit 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.00007 | $0.01405 |
| Opus 5 | $0.00003 | $0.00702 |
| Sonnet 5 | $0.00001 | $0.00281 |
| Haiku 4.5 | $0.00001 | $0.00140 |
Grade A, and why
audit-duplication 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 2d 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.
How it starts
The opening of the file, as written. The whole thing — 170 lines — stays where its author put it; the contents beside it link to each section on GitHub.
You are a senior developer analyzing the Detrix codebase for cross-crate and cross-language code duplication. Your goal is to find code that is duplicated or nearly-duplicated across different crates/clients and recommend consolidation.
Scope
"$ARGUMENTS" — if empty, analyze the entire project. If a scope like branch or uncommitted is given, focus on changed crates only.
Strategy: Fingerprint → Compare → Confirm
You CANNOT read all crates at once (context limit). Instead, use a 3-phase approach:
Phase 1: Automated Pattern Search
Use Grep to search across ALL crates simultaneously for duplication signals. Run these searches in parallel — each one is cheap and covers the whole codebase:
1a. Identical/similar function signatures:
Search for common function name prefixes that appear in multiple crates:
- "fn new(" across crates (constructor patterns)
- "fn from_" / "fn to_" / "fn into_" (conversion functions)
- "fn validate" / "fn parse" / "fn format" (utility patterns)
- "fn get_" / "fn find_" / "fn list_" (data access patterns)
1b. Similar struct/enum definitions:
Search for struct/enum names that appear in multiple crates.
Look for structs with similar field sets (e.g., same fields in different DTOs).
1c. Error type duplication:
Search for error enum variants across crates.
Look for similar error messages/patterns.
1d. Conversion boilerplate:
Search for From/TryFrom/Into implementations.
Look for similar .map() / .map_err() / conversion chains.
1e. Similar imports:
Search for identical multi-line use statements that suggest shared patterns.
1f. Copy-pasted blocks:
Search for distinctive string literals, magic numbers, or unique code patterns
that appear in multiple files across different crates.
Write raw search results to .agents/audit/_duplication_raw.md.
Phase 2: Catalog Extraction (via subagents)
Launch subagents in parallel — one per "cluster" of related crates. Each subagent:
- Reads the crate using get_symbols_overview (NOT full file reads)
- Extracts a structured catalog of public API surface
- Writes to
.agents/audit/_catalog_<cluster>.md
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.
- 2d ago First seen · 170 lines · 7 tokens per session scan A d3dd52fed450
audit-duplication is a command published in the GitHub repository flashus/detrix (23 stars, last pushed 9d ago), licensed MIT. It adds 7 tokens to every session and 1,405 once invoked, about $0.0000 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 第二步:确认实现范围.