x-code-audit

x-code-audit is a skill for Claude Code from KtKID/x-dev-pipeline. It costs 387 tokens per session (2,241 once invoked), scanned A, original, MIT.

A six-stage code-audit workflow for finding gradual problems across a project or within a named module. It checks tooling, unused code, documentation accuracy, module design, architecture, and performance.

In plain words
What is it for?
Use it for scheduled audits or focused checks of a module, including stale docs, dead code, weak error handling, architecture drift, and slow operations.
Why use it?
It separates cheap automated checks from deeper review, so agents do not spend time reading code when a tool can find the issue. Findings are prioritised and explained in plain language.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the x-dev-pipeline plugin — 20 skills shipped together

Good fit Use it for scheduled audits or focused checks of a module, including stale docs, dead code, weak error handling, architecture drift, and slow operations.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/ktkid/x-dev-pipeline/x-code-audit
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.

Any agent
npx skills add KtKID/x-dev-pipeline --skill x-code-audit
Clone the repo
git clone --depth 1 https://github.com/KtKID/x-dev-pipeline

Made for: Claude Code.

Or install x-dev-pipeline, the plugin that ships this one along with the rest of its 20 skills.

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 x-code-audit

README.md
[![agentmods](https://agentmods.dev/badge/skills/ktkid/x-dev-pipeline/x-code-audit/github.svg)](https://agentmods.dev/skills/ktkid/x-dev-pipeline/x-code-audit)
Your own site
<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.

agentmods 80×15 button for x-code-audit

Your own site · 80×15
<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>
Per session 387 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,241 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.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

Measured 6d ago against content hash ba31f69a1965, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

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.

The scan reads SKILL.md. This mod also ships 1 executable file (scripts/audit.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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.

skills/x-code-audit/SKILL.md · 126 lines

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,不改代码、不改报告。

Read the full file on GitHub · 126 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. 6d ago First seen · 126 lines · 387 tokens per session scan A ba31f69a1965

Subscribe to this mod's changes

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.

Related

x-code-audit compared with skills from other repositories

x-code-audit next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
x-code-auditKtKID/x-dev-pipelineSkill127d agoMITA387Claude Code
evidence-based-developmentsynaptiai/synapti-marketplaceSkill9todayApache-2.0A80Claude Code
bug-huntingrfxlamia/pockettoSkill81mo agoMITA46Claude Code
codex-agentmajiayu000/spellbookSkill3017d agoMITA45Claude Code
project-health-auditormajiayu000/spellbookSkill3017d agoMITA31Claude Code
skeptical-triageavelikiy/great_ctoSkill11714d agoMITA49Claude Code
anti-patternsavelikiy/great_ctoSkill11714d agoMITA59Claude Code