codebase-audit

Audits AI-generated codebases through a three-pass inventory, comprehension quiz, and test-guarded trimming workflow.

Updated Mar 21, 2026
One-click install
npx skills add https://github.com/pulak999/ai-tooling --skill codebase-audit-pulak999
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: codebase-audit
Source: https://github.com/pulak999/ai-tooling/tree/main/ai-assistant-kit/cursor-skills/codebase-trimmer
Command: npx skills add https://github.com/pulak999/ai-tooling --skill codebase-audit-pulak999

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Developers who inherit or generate code with AI often cannot explain what their own codebase does, leaving dead code, undocumented functions, and blind spots that erode confidence. This Skill enforces comprehension-driven trimming: every function you keep, you can defend. ## Core Features & Use Cases - Function Inventory Mapping: Walks the source tree, extracts every function with LOC, docstrings, and callgraph data, and flags DEAD, LARGE, and UNDOCUMENTED candidates in an AUDIT.md report. - Comprehension Quiz: Interactively quizzes you on each function, classifying answers as OWNED, FUZZY, or BLIND, with shortcuts like skip, blind, show, and done. - Test-Guarded Trimming: Attempts deletion of BLIND and DEAD functions first, runs your test suite after every change, and falls back to guided rewrites when functions turn out to be load-bearing. - Use Case: After an AI assistant scaffolds a Python project, run this audit to discover that 6 of 47 functions are dead, delete them with tests confirming safety, and rewrite the 4 functions you could not explain. ## Quick Start Audit my codebase with root ./src and test command pytest tests/ -x -q, then quiz me on every function and trim what I cannot explain.

Frequently Asked Questions about codebase-audit

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

FAQPage Schema
How do I audit an AI-generated codebase I don't fully understand?

Run a three-pass audit: first map every function into an inventory with callgraph data, then quiz yourself on each function's purpose, then delete or rewrite anything you cannot explain. Each deletion is verified by running your test suite.

How to safely remove dead code from a Python project?

Identify functions with no callers that are not entry points or tests, comment out the body, and run your test command. If tests pass, delete permanently; if they fail, the function is load-bearing and must be understood or rewritten instead.

Does this code audit workflow support CUDA files?

Yes, .cu and .cuh files are included in the function inventory. During the comprehension quiz, CUDA kernels are evaluated on whether you can explain what the kernel computes and why the grid, block, and shared memory configuration was chosen.

What happens if deleting a function breaks my tests?

The function is restored and treated as load-bearing but not understood. You then choose to rewrite it yourself, get a line-by-line walkthrough before rewriting, or keep it as a documented known gap in the audit report.

What are the limitations of comprehension-based code trimming?

The approach depends entirely on a working test suite to validate deletions, so code without test coverage cannot be safely trimmed. It also requires interactive time investment, since every function must be individually assessed.