review-python-file

A checklist for reviewing one Python file in depth, covering its design, correctness, security, types, documentation, imports, logging, and tests.

In plain words
What is it for?
Use it when reviewing a single Python file; use a multi-file change review process instead for a broader set of changes.
Why use it?
It helps find defects and maintainability problems that a quick code check may miss.

Skill for Claude CodeCodex

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.

agentmods
npx agentmods add skills/deephaven/deephaven-mcp/review-python-file
Any agent
npx skills add deephaven/deephaven-mcp --skill review-python-file
Clone the repo
git clone --depth 1 https://github.com/deephaven/deephaven-mcp

Made for: Claude Code, Codex.

Per session 57 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,374 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00057 $0.01374
Opus 5 $0.00028 $0.00687
Sonnet 5 $0.00011 $0.00275
Haiku 4.5 $0.00006 $0.00137

Measured 2d ago against content hash d1035137e6ca, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

review-python-file 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 2d 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.

.agents/skills/review-python-file/SKILL.md · 34 lines

How it starts

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

Review like a senior engineer. Every finding must answer three questions in concrete terms: what is wrong, what is better, why the change is worth its cost. All topics are fair game — correctness, security, design, duplication, clarity, naming, structure, tests. Be conscious of suggestions that do not serve a purpose.

Perform a comprehensive review of the specified Python file as it currently exists.

  1. Design: Is the code well-structured and consistent with the project? Apply the ref-python-coding-practices and ref-mcp-module-organization skills as relevant.
  2. Correctness: Does the code do what it claims? Look for logic errors, incorrect assumptions, and edge cases.
  3. Simplification and DRY: Can the code be simplified? Flag duplicated logic that should be shared, unnecessary abstraction, and over-engineering.
  4. Code smells: Flag anything that makes a senior engineer pause and ask "why is it like that?" — long functions, deep nesting, magic numbers, complex conditions, oddly-shaped APIs (boolean-mode flags, stringly-typed parameters where a Literal or Enum belongs, long parameter lists), strange call syntax, dead or commented-out code, mixed abstraction levels within one function, mutable default arguments, broad except clauses, side effects in property getters or __init__, argument mutation, speculative generality, primitive obsession, feature envy, re-implementations of stdlib or library functionality, misleading names, inconsistent return types, sentinel returns where an exception belongs — or anything else that just looks off. This list is illustrative, not exhaustive; trust your judgment. Apply the general style rules in ref-python-coding-practices.
  5. Security: Check for credential mishandling, session isolation issues, injection risks, and information disclosure — or anything else security-relevant. This list is illustrative, not exhaustive; trust your judgment. Flag any default or fallback ids — fully qualified ids arrive as explicit tool parameters and are validated by QualifiedSessionId.from_str, which raises rather than substituting a default.
  6. Type safety: Flag any Any type hints, hasattr, or getattr usage without justification (per ref-python-coding-practices).
  7. Closed-set dispatch exhaustiveness: For every dispatch on a Literal, Enum, or tuple of accepted values, verify a match + typing.assert_never(value) exhaustive form is used (or per-member metadata via __new__ for enums). Flag any silent if/elif/elif fall-through default branch on a closed set. See ref-python-coding-practices rule #18.
  8. Suppression audit: Search the file for # pragma: no cover, # type: ignore, # noqa, # mypy: ignore-errors. For each occurrence, determine whether a design move would eliminate the need (factor a helper, narrow with cast, rewrite the API). Flag any suppression without an inline justification comment. Bare # type: ignore (no bracketed error code) is always a bug. See ref-python-coding-practices rule #19.
  9. Docstrings: Apply the pydocs-improve skill to all functions and classes in the file. For any Pydantic schemas (StrictSchema / RedactableSchema subclasses), verify every field carries a PEP 257 trailing docstring — the project enforces this with tests/test_field_docs_contract.py; flag any reliance on Attributes: blocks as a documentation bug.
    • CLI help surface. For files under cli/_commands/ or cli/_help.py, the surfaced strings — command help= (via build_help), every click.option(help=...), and group docstrings used as help — are governed by ref-cli-help-standards, not pydocs. Apply cli-help-improve to that surface: verify the section contract, single-sourced OutputSpec, and plain-text (no-RST) rule. Internal docstrings on the same file still go through pydocs-improve.
  10. Imports: Flag any unused imports. (run-precommit removes them via ruff; the reviewer flags them for awareness, does not edit.)
  11. Logging: Apply the ref-logging-standards skill to review logging coverage and consistency.
  12. Test coverage: Verify the file is covered by its corresponding test file at the project's 100% per-source-file target (see AGENTS.md and tests-improve). Flag any uncovered branch.
    • __init__.py files count. Every __init__.py — including ones that only define __all__ (even an empty __all__) or re-export from a sibling module — has its own dedicated test_init.py. The package surface is part of the project's API contract; an untested __init__.py is a silent-refactor hazard.
    • What the test_init.py must pin:
      • The exact set of names in __all__.
      • That every name in __all__ resolves on the package (hasattr(pkg, name)).
      • That each re-export is the same object as the internal definition (pkg.X is _module.X).
      • That no _-prefixed names leak into the public surface.
    • Canonical implementations: tests/config/schema/test_init.py, tests/config/test_init.py, tests/auth/middleware/test_init.py.
  13. Output serialization: For any user-facing payload built in this file (MCP tool return dict or CLI OutputSpec field), apply ref-output-serialization-conventions to every string field — value vocabulary, casing, and known carve-outs.
  14. Spelling: apply ref-python-coding-practices rule 8 to the whole file (identifiers and string literals included, not just docstrings); run uv run codespell <file> and flag what it reports.

Read the full file on GitHub · 34 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. 2d ago First seen · 34 lines · 57 tokens per session scan A d1035137e6ca

Subscribe to this mod's changes

review-python-file is a skill published in the GitHub repository deephaven/deephaven-mcp (5 stars, last pushed 4d ago), licensed Apache-2.0. It adds 57 tokens to every session and 1,374 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-08-31.

Related

Other skills, from other repositories

bump-dependency

Bumps a Python package dependency across Home Assistant Core integrations, regenerates core requirement files, runs verification tests and prek lint, and prepares a pull request with proper release/compare links.

home-assistant/core · 42 tokens

agent-framework-azure-ai-py

Build persistent agents on Azure AI Foundry using the Microsoft Agent Framework Python SDK.

sickn33/agentic-awesome-skills · 24 tokens

biopython

Comprehensive molecular biology toolkit. Use for sequence manipulation, file parsing (FASTA/GenBank/PDB), phylogenetics, and programmatic NCBI/PubMed access (Bio.Entrez). Best for batch processing, custom bioinformatics pipelines, BLAST automation. For quick lookups use gget; for multi-service integration use…

K-Dense-AI/scientific-agent-skills · 76 tokens

python-feature-lifecycle

Guidance for package and feature lifecycle in the Agent Framework Python codebase, including stage meanings, feature-stage decorators, feature enums, and how to move APIs from one stage to the next.

microsoft/agent-framework · 43 tokens

python-development

Coding standards, conventions, and patterns for developing Python code in the Agent Framework repository. Use this when writing or modifying Python source files in the python/ directory.

microsoft/agent-framework · 35 tokens

marimo-pair

Work inside the user's live marimo notebook from the code editor: run Python in the same kernel the user does, inspect live notebook state, and commit durable notebook changes through code mode. Use whenever you create, analyze, or improve the user's marimo notebook.

marimo-team/marimo · 57 tokens