code-review-python

code-review-python is a skill for Claude Code from Jamie-BitFlight/claude_skills. It costs 68 tokens per session (1,170 once invoked), scanned A, original, MIT.

A set of review rules for Python projects, covering type annotations, error handling, formatting, and modern Python practices.

In plain words
What is it for?
Use it when reviewing Python files or projects that use pyproject.toml, especially to check types, Ruff rules, logging, imports, and Python 3.11 conventions.
Why use it?
It helps reviewers catch Python-specific mistakes and inconsistent code that a general review may miss.

Skill for Claude Code

Written for Claude Code: user-invocable in frontmatter.

Part of the dh plugin — 53 skills, 28 agents shipped together

Good fit Use it when reviewing Python files or projects that use pyproject.toml, especially…

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/jamie-bitflight/claude_skills/code-review-python
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add Jamie-BitFlight/claude_skills --skill code-review-python
Clone the repo
git clone --depth 1 https://github.com/Jamie-BitFlight/claude_skills

Made for: Claude Code.

Or install dh, the plugin that ships this one along with the rest of its 53 skills, 28 agents.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for code-review-python

README.md
[![agentmods](https://agentmods.dev/badge/skills/jamie-bitflight/claude_skills/code-review-python.svg)](https://agentmods.dev/skills/jamie-bitflight/claude_skills/code-review-python)
Your own site
<a href="https://agentmods.dev/skills/jamie-bitflight/claude_skills/code-review-python"><img src="https://agentmods.dev/badge/skills/jamie-bitflight/claude_skills/code-review-python.svg" alt="Measured on agentmods" height="20"></a>
Per session 68 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,170 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00068 $0.01170
Opus 5 $0.00034 $0.00585
Sonnet 5 $0.00014 $0.00234
Haiku 4.5 $0.00007 $0.00117

Measured 3d ago against content hash b7b32d1f8814, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

code-review-python scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugins/development-harness/skills/code-review-python/SKILL.md · 106 lines

How it starts

The opening of the file, as written. The whole thing — 106 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Python Code Review Patterns

Stack-specific rules loaded by dh:code-reviewer when pyproject.toml or *.py files are detected.

Type Annotations

  • All public function boundaries must have type annotations — parameters and return type
  • Any is only acceptable with an inline comment explaining why a specific type cannot be used
  • TypedDict is required for dicts that cross module boundaries; plain dict[str, ...] is only acceptable within a single function
  • Optional[X] is legacy — use X | None (Python 3.10+ union syntax)
  • Union[X, Y] is legacy — use X | Y
  • Return type None must be explicit on functions that have no return value but have side effects
  • Protocol classes are preferred over ABC for structural typing

Ruff Compliance

  • Bare except: is a blocking finding — must be except ExceptionType:
  • print() in library code (non-CLI, non-script) is a blocking finding (T201) — use logging instead
  • Magic numbers in comparisons are a blocking finding (PLR2004) — extract to named constants
  • Unused imports must be removed, not commented out
  • f-strings are required for string interpolation — % and .format() are legacy
  • __all__ must be defined in modules that have public API surface

ty Type Safety

  • Unresolved imports indicate a missing uv add — fix the import, not the type checker
  • # ty: ignore suppressions are prohibited — fix the code to satisfy ty
  • ty extra-paths in pyproject.toml must stay in sync with pytest pythonpath
  • TypedDict nominal incompatibility across modules means the TypedDict should be defined in a shared location, not duplicated

pytest Patterns

  • Test names follow behavioral naming: test_<what>_when_<condition>_returns_<result> or test_<what>_when_<condition>_raises_<exception>
  • Tests assert on observable behavior, not on implementation details (internal state, private methods)
  • Integration tests hit real dependencies — mocking the thing under test is not a test
  • Fixtures are preferred over test-class instance state
  • assert result is not None is not a meaningful assertion — assert the actual expected value
  • Tests are isolated — no shared mutable state between test functions
  • Parametrize repetitive test cases with @pytest.mark.parametrize
  • Each test file mirrors the module it tests: src/foo/bar.pytests/foo/test_bar.py

Read the full file on GitHub · 106 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3d ago First seen · 106 lines · 68 tokens per session scan A b7b32d1f8814

Subscribe to this mod's changes

code-review-python is a skill published in the GitHub repository Jamie-BitFlight/claude_skills (65 stars, last pushed today), licensed MIT. It adds 68 tokens to every session and 1,170 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.