Skip to content
Skills Library
Programming · Review & audit

python-codebase-review

/python-codebase-review

Deep, whole-codebase review of a Python project that writes a new REVIEW.md, a verified and prioritized list of fixes and improvements. Splits the code into slices and fans out parallel reviewer subagents, plus cross-cutting and security passes, on top of a ruff/type-checker/pytest baseline. Use this whenever the user wants to review, audit, assess, or find bugs and improvements across a Python repository, package, or service as a whole, even if they just say "review this codebase", "what should we fix in this project", or "audit the code quality". Do not use it for reviewing a diff, branch, c

Licence
Apache-2.0
Last repository change
26.10.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
4
Scripts
1
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 26.10.2026, without references to retired models or APIs.

Licence

Apache-2.0, otwarta: można używać i zmieniać, z zachowaniem licencji i informacji o zmianach.

What to check before installing
  • 1 scripts in this package. Review them before installing, as Claude may execute them.

Scripts: scripts/baseline.sh

What it does and when to use it

Deep, whole-codebase review of a Python project that writes a new REVIEW.md, a verified and prioritized list of fixes and improvements. Splits the code into slices and fans out parallel reviewer subagents, plus cross-cutting and security passes, on top of a ruff/type-checker/pytest baseline. Use this whenever the user wants to review, audit, assess, or find bugs and improvements across a Python repository, package, or service as a whole, even if they just say "review this codebase", "what should we fix in this project", or "audit the code quality". Do not use it for reviewing a diff, branch, c

Triggers from the description

review this codebasewhat should we fix in this projectaudit the code quality
Original author description

Deep, whole-codebase review of a Python project that writes a new REVIEW.md, a verified and prioritized list of fixes and improvements. Splits the code into slices and fans out parallel reviewer subagents, plus cross-cutting and security passes, on top of a ruff/type-checker/pytest baseline. Use this whenever the user wants to review, audit, assess, or find bugs and improvements across a Python repository, package, or service as a whole, even if they just say "review this codebase", "what should we fix in this project", or "audit the code quality". Do not use it for reviewing a diff, branch, c

How it works

  1. 1. Baseline
  2. 2. Map the project
  3. 3. Plan slices
  4. 4. Fan out
  5. 5. Verify and merge
  6. 6. Write REVIEW.md
  7. After the review
Original SKILL.md headings · 168 lines, 1,219 words
SKILL.md preview
---
name: python-codebase-review
description: Deep, whole-codebase review of a Python project that writes a new REVIEW.md, a verified and prioritized list of fixes and improvements. Splits the code into slices and fans out parallel reviewer subagents, plus cross-cutting and security passes, on top of a ruff/type-checker/pytest baseline. Use this whenever the user wants to review, audit, assess, or find bugs and improvements across a Python repository, package, or service as a whole, even if they just say "review this codebase", "what should we fix in this project", or "audit the code quality". Do not use it for reviewing a diff, branch, commit, or PR (use /review), for a single file, or for checking the findings of an existing REVIEW.md (use review-verification).
compatibility: Written for omp, whose task tool fans out the reviewers with its reviewer and security-reviewer agents and an outputSchema. The baseline script needs bash, and uses uv and uvx when available.
---

# Python Codebase Review

Review an entire Python codebase and write `REVIEW.md`: bugs to fix and improvements to
make, each with location, impact, and a concrete fix. `REVIEW.md` is a scratch file:
put it in the scratch directory the agent instruction files name (such as `.scratch/`),
otherwise in `.scratch/` at the repository root, and add that directory to
`.git/info/exclude` when git does not already ignore it. Never put it at the repository
root, and never commit it. The value of this review is that every reported item is real
and actionable, so verification matters more than volume.

The review is read-only. Do not edit, format, or commit source files; the only file you
write in the repository is `REVIEW.md`. Running tools is fine, and so are throwaway
probes in a `probes/` subdirectory of that scratch directory, which you remove at the
end. If the user passed arguments (a path to limit scope, or a focus such as
"performance"), apply them to every phase.

## 1. Baseline

Run the bundled script from the repository root:

```sh
bash <skill-dir>/scripts/baseline.sh
```

It prints a summary and, on the last line, the output directory containing
`inventory.txt` (Python lines per directory), `ruff.txt`, `types.txt`, and `tests.txt`
(results plus coverage). It uses the project's uv environment or `.venv` when present
and the project's configured type checker, falling back to basedpyright.

Read the summary, the inventory, the test result tail, and enough of the ruff and type
output to know its shape. A failing or uncollectable test suite is itself a finding.
Reviewers get these paths so they do not re-report mechanical diagnostics; they should
cite one only when it points at a real behavioral bug.

If `git status` shows uncommitted changes, mention it in the final report, since
findings may refer to code that is not committed yet.

## 2. Map the project

Read `README`, `pyproject.toml` (or `setup.cfg`/`setup.py`), `AGENTS.md`/`CLAUDE.md` if
present, the entry points (console scripts, `__main__`, app factories, CLI modules), and
the test layout. Write a project brief of about 15 lines: purpose, runtime (CLI, web
service, library, data pipeline), Python version, key dependencies, packages and their
roles, entry points, conventions, and what the baseline showed. Every reviewer receives
this brief, so it is worth getting right.

## 3. Plan slices

Split the code into review slices of roughly 3-8k lines each, along package or module
boundaries so each reviewer sees code that belongs together. Size the plan to the
codebase: a 2k-line project needs one or two reviewers, not ten. Keep generated code,
vendored code, and migrations out of slices unless the user asks for them.

Under about 15k lines, keep the total to six reviewers or fewer: merge Architecture
with Dead code, and Errors with Concurrency. Overlapping lenses mostly re-find the same
defect. That overlap is a useful confidence signal, but each extra reviewer costs as
much as a slice.

Add cross-cutting reviewers, each covering the whole codebase through its own lens:

- **Architecture**: module boundaries, dependency direction, import cycles, global
  state, layering leaks, abstractions that do not pay for themselves.
- **Errors and resources**: exception handling and propagation, swallowed errors,
  retries, cleanup of files, connections, subprocesses, and temporary state.
- **Concurrency**: async correctness, blocking calls in async code, threads, shared
  mutable state, locks, task cancellation. Skip it if the project has none.
- **Tests**: what is untested (use the coverage report), weak assertions, tests coupled
  to implementation details, flaky patterns, missing edge cases on critical paths.
- **Dead code and simplification**: unused modules, functions, parameters, settings, and
  dependencies; duplicated logic; needless indirection.

Add one `security-reviewer` for the whole repository when the code handles untrusted
input, network, files, auth, secrets, subprocesses, deserialization, or SQL.

## 4. Fan out

Launch every reviewer in a single `task` call so they run in parallel. Use the
`reviewer` agent for slice and cross-cutting reviews. Give every task the contents of
`references/finding-schema.json` as its `outputSchema`, so the findings can be merged
mechanically.

Put in the shared `context`: the project brief, the baseline output paths, the read-only
rule, the output contract (below), and the checklist from
`references/python-checklist.md`. Each task names its slice (exact paths) or its lens,
and anything specific you noticed during mapping.

Output contract for reviewers:

- Report a finding only after tracing the code path that makes it real. Name the
  triggering input or state and the consequence. A plausible-sounding guess costs the
  user time to disprove.
- `kind: fix` means behavior is wrong today; `kind: improvement` means it works but
  should change.
- Do not report formatting or naming nits, issues already present in the baseline
  output, or "consider adding" suggestions with no concrete defect or payoff.
- When the same problem repeats across files, report it once and list the other
  locations in `problem`.
- Prefer a short snippet in `fix` over a description of a snippet.

## 5. Verify and merge

When all reviewers return:

1. Merge findings and remove duplicates: same root cause in overlapping lines is one
   finding; keep the clearest write-up and the highest justified priority.
2. Verify every P0 and P1 yourself by reading the code. Where it is cheap, prove it with
   a throwaway script or test in the scratch `probes/` directory. Drop findings you
   cannot confirm, and downgrade ones whose impact was overstated.
3. Drop findings with confidence below 0.5 unless they are P0. Spot-check a sample of
   P2/P3 findings; if a reviewer's samples are often wrong, re-check the rest of that
   reviewer's findings.
4. Group systemic issues (the same pattern in many places) into one finding with a list
   of locations.

## 6. Write REVIEW.md

Use this structure:

```markdown
# Code review: <project>

<date> · <commit sha> · <lines of Python reviewed>
Baseline: ruff <n> issues, <checker> <n> errors, tests <pass/fail>, coverage <n>%

## Summary
3-6 sentences: overall health, the most important risks, and where to start.

## Quick wins
Up to 10 high-value fixes with effort S, one line each, linking to their entries below.

## Fixes
### P0
#### F1. <title>
`path/to/file.py:12-20` · category · effort S/M/L
**Problem:** what is wrong, what triggers it, and the impact.
**Evidence:** how it was confirmed.
**Fix:** concrete change, with a snippet when useful.

### P1 / P2 / P3 (same format)

## Improvements
Same format, numbered I1, I2, ..., ordered by priority then effort.

## Baseline diagnostics
Counts by rule or error code for ruff and the type checker, with a one-line
recommendation for each large group (for example, "enable rule X", "fix with ruff
--fix"). Do not list every diagnostic.

## Not reviewed
Paths excluded and why, and any reviewer that failed.
```

Omit empty sections. Then reply in chat with the path to `REVIEW.md`, the count of
findings by priority, and the top five items.

## After the review

Recommend a verification pass in a fresh session before acting on REVIEW.md (the
`review-verification` skill). Then file the confirmed items as issues, as the
`github-workflow` skill describes: self-contained, with no references to REVIEW.md or
its finding IDs. Delete REVIEW.md once its items are filed or fixed.

Suggest fixing in batches by priority in a new session ("fix the P0 items in REVIEW.md,
one commit each, with a regression test for each"), then running `/review` on the
resulting diff. For a second opinion, ask a model from another family to check REVIEW.md
for false positives and misses.
Files in this package (4)
  • SKILL.md 9 KB
  • references/finding-schema.json 2 KB
  • references/python-checklist.md 3 KB
  • scripts/baseline.sh 4 KB

Versions

The database has no other skills named python-codebase-review.

Database snapshot: 13.11.2026 · package version c9b04cbaa107 (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 90modern-python
    Use when creating or migrating a Python project or script to uv, Ruff, ty, and pytest. Not for pushing to a remote or publishing: use new-branch-and-pr for that.
  • 100code-review
    Review code for quality, bugs, security issues, and suggest improvements. Use when asked to review, audit, or improve code.
  • 100python-audit-method
    Run ruff, mypy/pyright, vulture, complexipy/radon and pytest, then report prioritized fixes. TRIGGER WHEN: `/daodan:check-health` runs on a Python project, the user asks to audit a Python codebase across lint, types, complexity, dead code and coverage, or a codebase is prepared…
  • 100python-audit-method
    Run ruff, mypy/pyright, vulture, complexipy/radon and pytest, then report prioritized fixes. TRIGGER WHEN: `/daodan:check-health` runs on a Python project, the user asks to audit a Python codebase across lint, types, complexity, dead code and coverage, or a codebase is prepared…
  • 100python-code-quality
    Python code quality with ruff and ty. Use when the user mentions ruff, ty, linting, formatting, type checking, or Python code style.
  • 100arn-assessing
    This skill should be used when the user says "assessing", "arness assessing", "assess", "assess codebase", "technical review", "codebase assessment", "find improvements", "what should I improve", "tech debt review", "pattern compliance check", "codebase health check",…

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.