codebase-audit
Skill20 starsChanged 34 days agoMITView on GitHub
Long-running, resumable adversarial audit of a whole codebase. Splits the repo into partitions, runs /adversarial-reviewer --codebase on each, then synthesizes a cross-partition risk register and a written remediation report. Use for onboarding audits of an inherited codebase, pre-acquisition due diligence, periodic tech-debt health checks, or when the user asks for a comprehensive, thorough, exhaustive or deep review of the whole codebase ("full codebase audit", "code due diligence", "tech debt audit", "what am I inheriting"). Differs from /adversarial-reviewer --codebase, which samples the repo in one pass, and from /code-quality-audit, which measures coverage, complexity, cycles and mutation scores.
28 other projects use a version of this.
Adopted by
Most recently taken up by
- lothlorienblade/agent-skillstheir own version, first seen Nov 8, 2026
- TidalPaladin/skillstheir own version, first seen Nov 8, 2026
- kekzl/imptheir own version, first seen Nov 7, 2026
- velonx/agent-skillstheir own version, first seen Nov 1, 2026
- TencentCloudBase/CloudBase-AI-Toolkittheir own version, first seen Oct 30, 2026
- frostney/pascal-mcp-sdktheir own version, first seen Oct 21, 2026
Used with
Projects with it also use cloud-api-recipe-authoring, codebuddy-ide-mcp-upgrade and 10 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
TencentCloudBaseSkillcloud-api-recipe-authoring
Author or revise a cloud-api-operations recipe (config/source/skills/cloud-api-operations/references/recipes/). Encodes why the long tail of control-plane capabilities is deliberately NOT wrapped as MCP/CLI tools, the API-first admission test for whether a capability deserves a recipe, the negative and positive lists, the fixed recipe structure, the writing rules distilled from writing-for-agents, the user-facing copy red lines, and the product regeneration/verification pipeline. Also routes contributors (and their agents) to the contribution flow and the pre-PR self-test protocol in references/contributing.md. Use when adding a recipe, judging whether a scenario belongs in the recipe set, updating the recipes index, re-checking existing recipes against the admission test, or onboarding someone who wants to submit one.
Also in 3 projects that use this
TencentCloudBaseSkillcodebuddy-ide-mcp-upgrade
升级 CodeBuddy IDE(genie 扩展)内置的 CloudBase MCP,以及 MCP 发版时同步 IDE 侧白名单。当用户提到「更新 IDE 里的 MCP」「内置 MCP 版本太老」「IDE 集成的 CloudBase 功能不足」「改工具白名单 toolWhiteList」「把新 bundle 打进 CodeBuddy」「白名单漂移」「MCP 发版要同步什么」时使用。覆盖:解包定位内置 bundle 与内嵌配置、重新构建 mcp bundle、生成新的工具白名单与系统提示词、安全注入 IDE 并备份、用 MCP 协议验证工具清单、人工端到端验收、一键回滚。
Also in 3 projects that use this
frostneySkillnative-nostalgia-stack
Applies the user's FreePascal toolchain and its build, formatting, hook, and test contracts while leaving project-specific mechanics local. Use when scaffolding or working in a FreePascal project that follows this toolchain.
Also in 3 projects that use this
frostneySkillsoftware-engineering-excellence
Applies the user's engineering standards during substantial technical work: preserve scope, use current evidence, delegate independent parts, and complete authorized outcomes. Use during substantial implementation, debugging, refactoring, or multi-part delivery work.
Also in 3 projects that use this
withpiperSkillroadmap-review
Audit roadmap health — issues, dependency order, spec coverage, doc freshness. Use when speccing a new initiative. Use when /phase-plan output looks suspicious. Use before /roadmap-create reruns.
Also in 3 projects that use this
zaxbysauceSkillpr-review-fix
Codex adapter for addressing pull request review feedback in opencode-swarm. Use when the user asks to fix PR review comments, requested changes, reviewer findings, CI-review notes, or a pasted review summary with low false-positive tolerance.
Also in 3 projects that use this
- +6 more from TencentCloudBase
Other versions28 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 28
- TencentCloudBase/CloudBase-AI-ToolKit★ 1.2ksame name
- TencentCloudBase/CloudBase-MCP★ 1.2ksame name
- TencentCloudBase/CloudBase-AI-Toolkit★ 1.2ksame name
- kekzl/imp★ 77same name
- myatminlu/vector-skills★ 18same name
- sohei56/maul-team★ 17same name
- GoldenWing-360/claude-security-skills★ 16same name
- rommelporras/kiro-config★ 13same name
- frostney/pascal-mcp-sdk★ 2same name
- NitorCreations/nitor-agent-skills★ 2same name
18 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository34 other files it gives its agents.
- adrSkill
- adversarial-reviewerSkill
- agent-creatorSkill
- brainstormSkill
- codebase-researchSkill
- code-quality-auditSkill
- code-reviewSkill
- context-saverSkill
- continuous-learningSkill
- create-planSkill
- design-languageSkill
- e2e-testingSkill
- eval-harnessSkill
- grumpy-reviewerSkill
- implement-phaseSkill
- implement-planSkill
- iterate-planSkill
- prompt-generatorSkill
- security-reviewSkill
- ship-issueSkill
- skill-visualizerSkill
- strategic-compactSkill
- tt-create-build-loopSkill
- tt-create-planSkill
- tt-implement-phaseSkill
- tt-implement-planSkill
- tt-workflow-auditSkill
- tt-workflow-buildSkill
- tt-workflow-runSkill
- user-storySkill
- verification-loopSkill
- video-explainerSkill
- visual-explainerSkill
- workflow-guideSkill
The file
We split this skill into the rules it gives an agent
11 rules. 0 are common, 5 are distinctive, and 6 are very specific to this project.
0
Common
Most of the 28 edited versions we read keep these.
5
Distinctive
This author's own choices. Worth a look.
6
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 72
Read: README.md, CLAUDE.md, package.json / pyproject.toml / Cargo.toml / go.mod, top-level *.config.*.
- Distinctive: line 77
Write a one-page codebase map summarizing what you learned.
- Distinctive: line 81
Create the audit workspace:
- Distinctive: line 95
By concern: when the repo is flat — group files by feature / module using directory names and import graphs.
- Distinctive: line 109
Do not proceed to Step 3 without explicit user approval.
- Very specific: line 111
Use TaskCreate to register one task per partition.
- Distinctive: line 131
If a partition invocation fails (timeout, tool error), mark the task failed, write an error stub to the partition file, and continue with …
- Very specific: line 137
After all partitions are complete, read every partitions/*.md file and look for patterns that no single partition could see:
- Very specific: line 145
Write a synthesis.md with the findings grouped by the patterns above.
- Very specific: line 221
If the user passes --force, ignore existing partition reports and re-review everything.
- Very specific: line 223
If the user passes --only <partition-name>, re-review just that partition (useful after fixes, or if a partition's first review was flaky).
“Common” is measured: kept by at least 6 in 10 of the 28 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Codebase Audit
<!-- contents: generated by tests/skill_structure.py --write; edit headings, not this block -->Contents
- Positioning
- Usage
- Workflow
- Step 1: Scope and map
- Step 2: Partition plan — STOP for user approval
- Step 3: Per-partition adversarial review
- Step 4: Cross-partition synthesis
- Step 5: The report
- Step 6: Hand off
- Overall Health Ratings
- Resume Behavior
- Anti-Patterns
- Relationship to Other Skills
- Design Note: Why This Is a Separate Skill
<!-- /contents -->Long-running comprehensive adversarial audit. Orchestrates per-partition reviews through /adversarial-reviewer --codebase, then synthesizes findings into a written report. Designed for methodical full coverage, not strategic sampling — use when the user wants the whole thing reviewed and is willing to spend the tokens and time.
Positioning
| Skill | What it does | Coverage | Output | When |
/devflow:code-review | Per-phase quality gate | Changed files | Verdict + notes | During implementation |
/adversarial-reviewer (diff) | Hostile pre-merge review | Changed files | BLOCK/CONCERNS/CLEAN | Before a merge |
/adversarial-reviewer --codebase | Adversarial sample of repo | 5-10 files per persona | HIGH/MEDIUM/LOW-RISK + most-concerning area | Quick whole-repo sanity check |
/codebase-audit | Methodical full audit | Every partition | Written report + risk register | Onboarding / due diligence / tech-debt review |
/code-quality-audit | Metrics: coverage, complexity, cycles, mutation | Whole repo (metric-based) | Numeric gate | Quantitative health |
Pair codebase-audit with code-quality-audit for a complete picture: this skill gives you the qualitative adversarial read; code-quality-audit gives you the quantitative one.
Usage
/codebase-audit # Audit CWD
/codebase-audit src/ # Scope to a subtree
/codebase-audit --resume # Pick up from last checkpoint
/codebase-audit --only api # Re-run a specific partition
/codebase-audit --force # Ignore existing partition reports (re-review everything)Expect 200K-500K tokens and 30-60 minutes of wall clock for a typical ~500-file repo. This is a deliberate investment. Confirm with the user before kicking off if the cost would surprise them.
Workflow
Step 1: Scope and map
Determine the scope root (path argument, or CWD). Build the map:
git ls-files | wc -l— total file count (orfind . -type fif not a git repo).git ls-files | head -500+tree -L 3— structural overview.- Read:
README.md,CLAUDE.md,package.json/pyproject.toml/Cargo.toml/go.mod, top-level*.config.*. git log --pretty=format: --name-only --since=180.days | sort | uniq -c | sort -rn | head -50— recent churn.- Locate test directories; compute rough test-to-source ratio.
- Detect monorepo structure (
packages/,apps/, workspace configs) — these are natural partition boundaries.
Write a one-page codebase map summarizing what you learned. This goes into the audit directory so future steps and the user can reference it.
Step 2: Partition plan — STOP for user approval
Create the audit workspace:
docs/audits/YYYY-MM-DD-<repo-name>/
├── map.md # from Step 1
├── plan.md # from Step 2 (this step)
├── partitions/ # per-partition reports (populated in Step 3)
└── REPORT.md # final synthesis (produced in Step 5)Propose a partition plan in plan.md. Partition strategy, in priority order:
- Monorepo workspaces (
packages/*,apps/*) — each workspace is one partition. - Top-level src directories (
src/api,src/domain,src/ui, etc.) — each is one partition. - By concern when the repo is flat — group files by feature / module using directory names and import graphs.
Each partition should be 50-150 files. Too small = wasted orchestration overhead. Too large = exceeds /adversarial-reviewer --codebase's sampling sweet spot (which expects ~300-500 files max).
Record each partition with:
- Name (short, kebab-case)
- Path(s) (glob-compatible)
- File count
- Rationale (why this is a coherent chunk)
Then stop and show the plan to the user. This is the token-commitment checkpoint. Ask:
"Here's the partition plan: N partitions, estimated cost ~XYZ tokens. Approve, modify, or narrow scope?"
Do not proceed to Step 3 without explicit user approval. A user who sees 15 partitions and wanted 3 should catch it here, not after the audit is half-done.
Use TaskCreate to register one task per partition. This makes progress visible and resumable.
Step 3: Per-partition adversarial review
For each partition (honor TaskList ordering):
- Check for existing report at
docs/audits/.../partitions/<partition-name>.md. If it exists and--forcewas not passed, skip this partition (resume behavior) — mark task complete, move on. - Mark task in_progress via
TaskUpdate. Invoke the adversarial-reviewer skill on the partition path:
/adversarial-reviewer --codebase <partition-path>Capture the full output (three persona sections + synthesis + verdict + most-concerning area).
- Write the partition report to
docs/audits/.../partitions/<partition-name>.md. The file should contain:- Partition metadata (path, file count, date reviewed)
- The verbatim adversarial-reviewer output
- Mark task completed.
If a partition invocation fails (timeout, tool error), mark the task failed, write an error stub to the partition file, and continue with the next partition. Don't let one partition kill the whole audit.
Do not batch the reviews in parallel. Sequential is safer here — adversarial-reviewer itself spawns three persona subagents, so parallelism is already happening at that level. Stacking parallelism on top can exhaust rate limits and causes contention on subagent dispatch.
Step 4: Cross-partition synthesis
After all partitions are complete, read every partitions/*.md file and look for patterns that no single partition could see:
- Systemic findings. A finding flagged in 2+ partitions — for example, "missing input validation at module boundaries" showing up across
api,webhook, andcli. Systemic = highest severity. - Architectural anti-patterns. Cross-cutting concerns (logging, error handling, auth, config) implemented inconsistently across partitions. Not visible from inside a single partition.
- Dependency risk concentration. A fragile module that many other partitions depend on. Use
grep/ import analysis to find these. - Security posture across layers. Are trust boundaries consistently enforced? Does internal-only data leak to public-facing modules?
- Test coverage dead zones. Which partitions are notably less tested than others?
Write a synthesis.md with the findings grouped by the patterns above.
Step 5: The report
Produce REPORT.md. This is the deliverable — assume the reader won't read the per-partition files. Structure:
# Codebase Audit Report: <repo-name>
**Date:** YYYY-MM-DD
**Scope:** <path> (N files across K partitions)
**Overall health:** HEALTHY / CONCERNING / AT-RISK / DEGRADED
## Executive Summary
3-5 sentences. Single most important thing to fix. Single biggest risk. Overall shape.
## Risk Register
Prioritized table. One row per distinct finding:
| # | Severity | Area | Finding | Detected in | Recommended action |
|---|----------|------|---------|-------------|-------------------|
| 1 | CRITICAL | auth | SQL injection in session middleware | api, admin | Parameterize queries |
| 2 | HIGH | data | No migration rollback procedure | data, worker | Add reversible migrations |
...
Order by severity, then by breadth (systemic issues above single-partition).
## Systemic Issues
Findings that appeared in multiple partitions, with the list of partitions they appeared in.
## Architectural Themes
Cross-cutting concerns reviewed at the whole-repo level.
## Per-partition Index
| Partition | Verdict | Critical | Warnings | Report |
|-----------|---------|----------|----------|--------|
| api | HIGH-RISK | 3 | 7 | partitions/api.md |
...
## Remediation Roadmap
Prioritized, with rough effort estimates:
1. **Immediate (this week):** items that block safe operation
2. **Short-term (this quarter):** items that degrade the codebase if ignored
3. **Medium-term (this year):** tech-debt paydown
4. **Defer or accept:** items that aren't worth fixing given current priorities
## Methodology Note
One paragraph explaining how the audit was conducted (partitions, `/adversarial-reviewer --codebase` per partition, synthesis pass) so the reader can judge the evidence.Step 6: Hand off
Tell the user:
- The report is at
docs/audits/.../REPORT.md - Per-partition evidence is in
partitions/ - Estimated total token spend (read from the session if available)
- Suggest running
/code-quality-auditif they want the quantitative complement
Overall Health Ratings
| Rating | Criteria |
| HEALTHY | No critical findings, few warnings, tests present, no systemic issues |
| CONCERNING | No criticals but clear warnings clusters, inconsistencies, or thin tests |
| AT-RISK | 1-2 CRITICALs, or cross-partition systemic issues, or significant test gaps |
| DEGRADED | Multiple CRITICALs, clear decay patterns, broken architectural boundaries |
Resume Behavior
The audit is resumable by default. A re-run of /codebase-audit (or explicit --resume) will:
- Detect existing
docs/audits/.../plan.md→ skip Step 1 and Step 2. - For each partition in the plan, check
partitions/<name>.md— skip if exists. - Continue from the first incomplete partition.
If the user passes --force, ignore existing partition reports and re-review everything. This is for when the codebase has changed significantly since the last audit.
If the user passes --only <partition-name>, re-review just that partition (useful after fixes, or if a partition's first review was flaky).
The audit directory name includes the date, so re-runs the next day create a fresh audit rather than muddying yesterday's. Users who specifically want to continue yesterday's audit should pass --resume <audit-dir-name> (e.g., --resume 2026-04-23-myapp).
Anti-Patterns
| Anti-pattern | Why it's wrong |
| Kicking off a 20-partition audit without user approval | Hundreds of K tokens is not a "background task." The user must opt in after seeing the plan. |
| Running partitions in parallel | adversarial-reviewer already spawns three subagents per call. Layering parallelism causes rate-limit pressure and concurrency bugs in subagent dispatch. |
| Skipping the synthesis step and shipping the per-partition files as the report | The systemic findings are the whole point. A stack of per-partition reports is evidence, not a deliverable. |
| Reusing persona logic inline instead of delegating | Two copies of the persona briefs drift. Always invoke /adversarial-reviewer --codebase <partition>. |
| Dumping the map into the partition-level briefs | /adversarial-reviewer --codebase builds its own map for its scope. Don't pre-feed it; keep partitions clean. |
| Treating the final report as a merge decision | This is a health assessment for a codebase, not a gate on a change. Use HEALTHY/CONCERNING/AT-RISK/DEGRADED, not BLOCK/CLEAN. |
| Letting one failed partition abort the audit | Mark the partition failed, move on. The report's methodology note should disclose any skipped partitions. |
Relationship to Other Skills
- Delegates to:
adversarial-reviewer(one call per partition,--codebasemode) - Complements:
code-quality-audit— qualitative (this skill) + quantitative (that skill) gives you the complete picture - Different from:
codebase-research— that skill explains how the code works; this skill assesses what's wrong with it - Not a replacement for:
devflow:code-reviewordevflow:security-review— per-change quality gates still belong in their own skills
Design Note: Why This Is a Separate Skill
adversarial-reviewer --codebase does strategic sampling — 5-10 files per persona, one parallel pass, done in minutes. That's the right shape for a quick "is this repo okay?" answer.
Comprehensive audit is a different shape: multi-stage (scope → partition → per-partition → synthesis → report), long-running (tens of minutes), resumable (checkpoints on disk), and produces a written document rather than a verdict paragraph. Stuffing this into adversarial-reviewer would have bloated that skill past usefulness and confused its single-unit-of-review purpose.
This skill is an orchestrator — it does nothing the delegated skill can't do; it arranges the work so that full coverage becomes feasible, which no single adversarial-reviewer invocation can achieve.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

