AI-Generated Code Audit
Reviews the codebase for defects and review gaps that show up when generated code is merged without enough scrutiny. It does not guess that a machine wrote a line.
What it examines
- Imports that point at files which are not there
- APIs used incorrectly, including ones that only work by accident
- The same logic copied into several files
- Errors caught and ignored
- Abstractions with a single implementation
- Modules that do not match the rest of the codebase
- Comments that describe code which has since changed
- Security-sensitive defects sitting next to that code
What you get back
A findings file. Each item has the evidence, how serious it is, and a fix.
Dependencies
- An AI coding agent that reads SKILL.md files, such as Claude Code, Codex or Gemini CLI
- Read access to the repository, with its git history. A snapshot without history is not enough.
- Git available on the command line
- Python 3, for the optional helper scripts. They use only the standard library.
- The date your team started using AI coding tools, if you know it. It narrows where the audit looks first.
- Python 3 with the jsonschema package, to check findings.json before fixing anything
How it works
The audit is read-only. If you gave it an adoption date, it first isolates the commits since then and looks there first. It still spot-checks older code.
It then sweeps all eight defect categories. Three optional scripts surface candidates fast: unresolved imports, duplicated blocks and broad catches. Every hit is judged by hand before it becomes a finding.
For each candidate it asks whether the code looks like a considered decision or like nobody reviewed it. Only the second kind is reported, and it never claims that a machine wrote a line without evidence.
You get findings.json and findings.md, ranked by risk. The remediate skill reads findings.json only, and it holds back fixes until the codebase has tests you can trust.
Setup
- Unzip the download, then copy the audit and remediate folders into your agent's skills folder (for Claude Code, .claude/skills/) in the repository you want to check.
- Make sure the repository is a full git clone with history, and note the date AI tools were adopted.
- Open the repository in your agent and ask it to run the f1-ai-generated-code-audit skill.
- Check the result with the validator: pip install jsonschema, then python3 schema/validate.py findings.json.
- Ask your agent to run the f1-ai-generated-code-remediate skill using findings.json. Fix some findings and leave the rest open if you like.
Run it with your agent
Copy the prompt, fill in the parts in square brackets, and paste it into your agent.
Run the f1-ai-generated-code-audit skill on this repository. AI coding tools were adopted around [date, or unknown]. Use the full git history. Mode: audit only. Do not change any code. Write findings.json and findings.md in the repository root.
Run the f1-ai-generated-code-remediate skill using findings.json. Work through the findings I choose, and leave the rest open.