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 skills add KtKID/x-dev-pipeline --skill x-code-auditgit clone --depth 1 https://github.com/KtKID/x-dev-pipelineWrote 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.
[](https://agentmods.dev/skills/ktkid/x-dev-pipeline/x-code-audit)<a href="https://agentmods.dev/skills/ktkid/x-dev-pipeline/x-code-audit"><img src="https://agentmods.dev/badge/skills/ktkid/x-dev-pipeline/x-code-audit/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/ktkid/x-dev-pipeline/x-code-audit"><img src="https://agentmods.dev/badge/skills/ktkid/x-dev-pipeline/x-code-audit.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00387 | $0.02241 |
| Opus 5.5 | $0.00155 | $0.00896 |
| Sonnet 5.5 | $0.00077 | $0.00448 |
| Haiku 4.5 | $0.00039 | $0.00224 |
Grade A, and why
x-code-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 6d 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 — 126 lines — stays where its author put it; the contents beside it link to each section on GitHub.
x-code-audit · 代码巡检
每个任务的验收只查本轮的任务文档和设计。全项目会慢慢变坏的地方,比如规范没人管、死代码越积越多、说明文档过期、模块越写越乱、架构跑偏、越来越慢,靠这里查。
两种用法走同一条路:
- 定时巡检:每晚跑,只查上次巡检以来变了的地方。
- 查一个模块:用户点名模块或目录(“审查一下 src/library/loan”),六层都只在这个模块里跑。
六层
前一层能查出来的,后一层不再查;能用脚本或工具判断的,不让 AI 读代码去猜。 AI 只做脚本做不了的那一小块,而且一次只看一个模块。
| 层 | 查什么 | 谁来查 | 细则 |
|---|---|---|---|
| L1 机器检查 | lint、类型检查、格式化:配没配、规则全不全、CI 跑没跑、现在跑一遍过不过 | 脚本,不读业务代码 | l1-tooling.md |
| L2 死代码 | 0 引用的函数、类、文件、导出 | 工具找(Python 用脚本自带的引用扫描,JS/TS 用 knip,Go 用 staticcheck);子 agent 只确认工具拿不准的 | l2-dead-code.md |
| L3 文档对代码 | 模块说明里的函数名、链接、文件名、配置项、默认值,和描述的行为 | 名字、链接、默认值由脚本逐条核对;子 agent 只核对描述行为的句子 | l3-docs.md |
| L4 模块审查 | 一个模块内部:职责、对外接口、错误处理、测试是否真在测 | 子 agent,一个模块一个 | l4-module.md |
| L5 架构审查 | 循环依赖、下层依赖上层、同一信息多处定义、绕过既有抽象、以前定的约束 | 依赖图和重复定义由脚本找;子 agent 只看脚本报的点和固定检查项 | l5-architecture.md |
| L6 性能 | 循环里查库或调接口、重复计算、数据结构不合适、阻塞等待、资源不释放 | 子 agent,一个模块一个 | l6-perf.md |
流程
下面的命令都在项目根目录运行,audit.py 指 <本 skill 目录>/scripts/audit.py。
1. 开一次巡检
python3 audit.py start # 定时巡检:上次巡检以来变了的;第一次跑就是全量
python3 audit.py start --module src/library/loan # 只查一个模块,可以给多个 --module
python3 audit.py start --layers L2 # 只跑某几层,比如“查查死代码”
python3 audit.py start --full # 全量
它会生成一个 8 位随机的检查 ID,并在项目的 reports/audit/ 下写好报告骨架 audit-<检查 ID>.md:开头是检查 ID、代码版本、范围(哪些模块、哪些文件)、要跑的层,下面是「检查进度」表,列出这次要做的每个单位(一层 × 一个范围)。整次巡检只有这一份报告,后面所有结果都写进它。
2. 先跑脚本部分
python3 audit.py scripts <检查 ID>
它跑完 L1、L2、L3、L5 的脚本部分,结果和问题直接写进报告。工具拿不准的死代码、要核对行为的说明,会被登记成新的子 agent 单位。
3. 并行派子 agent
python3 audit.py units <检查 ID> # 列出所有还没做的子 agent 单位
这些单位互不依赖,一次全派出去并行跑,不要一个做完再派下一个。每个单位派一个便宜的子 agent(sonnet),派工单照抄 dispatch.md 的模板,只填范围和路径,不另加规矩。子 agent 只读代码,把回执写到 reports/audit/audit-<检查 ID>.parts/<单位>.md,不改代码、不改报告。
What ships with it
10 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
- references/dispatch.md 3.6 KB
- references/l1-tooling.md 2.2 KB
- references/l2-dead-code.md 1.6 KB
- references/l3-docs.md 1.5 KB
- references/l4-module.md 1.2 KB
- references/l5-architecture.md 2.1 KB
- references/l6-perf.md 1.2 KB
- references/report-template.md 1.9 KB
- references/severity.md 3.2 KB
- scripts/audit.py 57 KB runs code
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.
- 6d ago First seen · 126 lines · 387 tokens per session scan A ba31f69a1965
x-code-audit is a skill published in the GitHub repository KtKID/x-dev-pipeline (12 stars, last pushed 7d ago), licensed MIT. It adds 387 tokens to every session and 2,241 once invoked, about $0.0015 per session on Opus 5.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-11-24.
x-code-audit compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| x-code-auditKtKID/x-dev-pipeline | Skill | 12 | 7d ago | MIT | A | 387 | Claude Code |
| evidence-based-developmentsynaptiai/synapti-marketplace | Skill | 9 | today | Apache-2.0 | A | 80 | Claude Code |
| bug-huntingrfxlamia/pocketto | Skill | 8 | 1mo ago | MIT | A | 46 | Claude Code |
| codex-agentmajiayu000/spellbook | Skill | 301 | 7d ago | MIT | A | 45 | Claude Code |
| project-health-auditormajiayu000/spellbook | Skill | 301 | 7d ago | MIT | A | 31 | Claude Code |
| skeptical-triageavelikiy/great_cto | Skill | 117 | 14d ago | MIT | A | 49 | Claude Code |
| anti-patternsavelikiy/great_cto | Skill | 117 | 14d ago | MIT | A | 59 | Claude Code |