codebase-audit

Partitions large diffs into functional clusters and dispatches parallel subagents for adversarial code review.

9|Updated Jul 8, 2026
One-click install
npx skills add https://github.com/jerrylin96/dotgemini --skill codebase-audit-jerrylin96
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: codebase-audit
Source: https://github.com/jerrylin96/dotgemini/tree/main/skills/codebase-audit
Command: npx skills add https://github.com/jerrylin96/dotgemini --skill codebase-audit-jerrylin96

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve? Reviewing large pull requests or entire codebases with a single agent causes context degradation and missed defects. This Skill splits the work into orthogonal functional clusters, audits each with an isolated subagent, and synthesizes findings into a prioritized blast-radius scorecard. ## Core Features & Use Cases - Automated Cluster Discovery: A deterministic Python engine partitions git diffs or whole repositories into domain-based clusters with associated test targets and volume metrics. - Parallel Subagent Audits: Each cluster is reviewed by an isolated subagent that runs its test suite first and reports only empirically grounded findings with exact file:line citations. - Cross-Boundary Contract Verification: The orchestrator validates exported symbols, signatures, and shared schemas across cluster boundaries, then produces a P0/P1/P2 scorecard with blast-radius assessment. - Use Case: Before merging a 2,000-line feature branch touching physics, IO, and transforms modules, run the audit to get per-cluster verdicts, a contract matrix, and a merge action plan. ## Quick Start Ask the agent to run a codebase audit on the current branch diff against main and produce a prioritized findings scorecard.

Frequently Asked Questions about codebase-audit

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I audit a large pull request with multiple review agents?

Run the cluster discovery script against your diff base ref, confirm the proposed clusters, then dispatch one subagent per cluster. Each subagent runs its cluster's tests and reports empirically grounded findings, which the orchestrator merges into a single scorecard.

How does the clustering engine partition a codebase for review?

The cluster_files.py script groups files by top-level domain directory, isolates files exceeding 3000 lines into monolithic clusters, and merges small domains into a shared utilities cluster. It caps output at five clusters and attaches discovered test files to each.

When should I use single-agent review instead of multi-agent audit?

Use single-agent adversarial review when the diff is under 300 lines and touches three or fewer files. The clustering engine signals this with an is_small_diff flag and recommends the fast-path fallback automatically.

Does the clustering script work with shallow git clones?

Yes. When the three-dot merge-base diff fails due to shallow history, the script falls back to a two-dot tree diff and attaches a warning field to the JSON payload. If both diffs fail, it exits with an error payload on stderr.

What are the limitations of multi-agent codebase audits?

Subagents are limited to ten prioritized findings each and must cite exact file:line evidence, so subtle cross-cluster issues rely on the orchestrator's contract verification pass. The workflow also requires a POSIX environment and subagent support in the host CLI.