codebase-audit
БесплатноБез исполняемых скриптовНе проверен全面代码库审计 — 自适应并行深度分析(前后端契约、数据完整性、异常处理/安全、架构/技术债、配置/缓存),结构化 findings + 对抗验证 + 基线对比,输出按严重程度排序的统一报告和修复路线图。支持 quick 快速体检模式。Use when user asks to audit, analyze, or…
от majiayu000★ 301 звезда на GitHubОб этом скилле
Codebase Audit — Adaptive Deep Analysis
Comprehensive codebase audit that adapts its agent configuration to the project's tech stack, forces structured findings, adversarially verifies Critical/High findings before they enter the report, diffs against the previous audit's ledger (resolved / still-open / new), and outputs a severity-sorted report plus a phased repair roadmap.
Core Principles
- READ-ONLY — Audit agents must never create, modify, or delete files in the target. Every agent prompt starts with the read-only preamble in
references/agent-prompts.md. - Inherit the session model — Omit the
modelparam on all agents so they inherit the session model (usually the strongest available). Only override upward if the session model is clearly weak for cross-file reasoning. Never hardcode a specific model name in this skill. - Depth over breadth — Fewer agents with broader merged scopes beat many shallow agents. Each agent traces issues across file boundaries.
- Adaptive — Agent count and dimensions vary by stack and mode.
- Verified findings — Critical/High findings must survive an adversarial verify pass. Medium findings pass through but are labeled
unverifiedin the report.
Operating Contract
- Direct actions: read-only inspection, local dependency audits, report writing under the target, and ledger updates under
<target>/.audit/after the user invokes this skill. - Escalate before: editing audited project source files, dependency manifests,
.gitignore, CI config, remote issues, PR state, or anything outside the requested audit/report scope. - Secret evidence: retain file:line and the surrounding code, but replace credential values with
[REDACTED]in findings, reports, and ledger entries; never reproduce the literal. This redacted snippet satisfies the code-evidence requirement. - Evidence-backed pushback: challenge "all clear" or "resolved" only with file evidence, dependency-audit output, verifier results, or ledger spot-checks.
- Feedback loop: promote repeated misses into prompt updates, ledger matching rules, or fixture eval cases rather than leaving them as session-only notes.
Gotchas
- Dependency-audit commands must run from
{TARGET_DIR}, not the assistant's incidental cwd. - Finder agents must not read
evals/expected-findings.jsonor eval README files when auditing the planted-bug fixture. - A previous ledger miss is not proof that a finding was resolved; spot-check the file before marking an old finding
resolved.
Modes
| Mode | Trigger | Agents | Verify pass | Ledger |
|---|---|---|---|---|
| full (default) | plain invocation, "全面审查" | 3–5 by stack (+ optional dims) | yes | yes |
| quick | "quick" in args, "快速体检" | 2 (Silent Degradation & Security; Data Integrity & Registry) | no — all findings labeled unverified |
yes |
Optional dimensions (full mode only, enable when user asks or the repo obviously needs them):
tests— test quality: assertion strength, skip markers, coverage of critical paths (Agent 6)concurrency— races, blocking calls in async, leaked tasks/goroutines (Agent 7)
Workflow
Phase 0: Detect & Prepare
- Stack detection:
package.json/tsconfig.json→ TS/JS;pyproject.toml/requirements.txt→ Python;Cargo.toml→ Rust;go.mod→ Go; multiple → full-stack. - Size estimate:
tokei <target>(fallback:find <target> -name '*.<ext>' | xargs wc -l), excluding vendored/generated code. If effective size ≥ 400K LOC, split each agent's scope by top-level directory and note the split in the report. - Exclusions (always, in every agent prompt):
node_modules/,vendor/,target/,dist/,build/,.git/, lockfiles, generated code. - Ledger: read
<target>/.audit/findings.jsonif it exists — this is the previous audit baseline (format:references/ledger-format.md). - Deterministic dependency audit: from
{TARGET_DIR}(never the assistant's incidental cwd), run each matching tool and feed raw output to the Error Handling & Security prompt:- Rust:
cargo audit - Node:
npm audit - Python metadata (
pyproject.toml/setup.py):pip-audit . - Python requirements (
requirements.txt):pip-audit -r requirements.txt - Python fallback with no project files:
pip-audit . - Go:
govulncheck ./...If a required tool is unavailable, the report must state依赖审计降级跳过: <tool>; never omit the degradation silently.
- Rust:
Phase 1: Assemble Dimensions
Pick the configuration by detected stack. Full prompt templates in references/agent-prompts.md; prepend the read-only preamble and inject {TARGET_DIR} / {STACK_INFO} into each.
Full-Stack (5 agents) — frontend + backend both present:
| # | Dimension | Scope (merged) |
|---|---|---|
| 1 | Frontend-Backend Contract | Type consistency + rendering pipeline + serialization boundaries. Reads BOTH sides. |
| 2 | Data Integrity & Flow | E |
Установить codebase-audit в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл codebase-audit?
全面代码库审计 — 自适应并行深度分析(前后端契约、数据完整性、异常处理/安全、架构/技术债、配置/缓存),结构化 findings + 对抗验证 + 基线对比,输出按严重程度排序的统一报告和修复路线图。支持 quick 快速体检模式。Use when user asks to audit, analyze, or review an entire codebase for design issues, find hidden bugs, check architecture health, or asks '全面审查', '代码库审计', '分析设计问题', 'audit codebase', 'health check', '有哪些问题', '快速体检'. Also trigger when user asks to find silent degradation, data flow breakpoints, type mismatches between frontend and backend, or wants to understand technical debt across a project.
Как установить скилл codebase-audit?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл codebase-audit запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
skill-creator
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an…
от Anthropicdiscernment-nudge
After you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
от Anthropicdata-consolidate
Joins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
от Anthropicinspection-to-capa
Runs the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…
от Anthropic