python-reviewer

python-reviewer is an agent for Claude Code from xu-xiang/everything-claude-code-zh. It costs 63 tokens per session (1,209 once invoked), scanned A, original, MIT.

A Python code-review role focused on readability, standard Python style, type annotations, security, error handling, and performance.

In plain words
What is it for?
It reviews changed Python files, checks available static-analysis tools, and reports issues such as injection risks, unsafe deserialization, mutable defaults, and non-idiomatic code.
Why use it?
It catches risky patterns such as unsafe input handling, swallowed errors, weak encryption, missing types, and inefficient code.

Agent for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: model in frontmatter.

Part of the everything-claude-code-zh plugin — 17 skills, 26 commands, 13 agents shipped together

Good fit It reviews changed Python files, checks available static-analysis tools, and reports issues such as injection risks, unsafe deserialization, mutable defaults, and non-idiomatic code.

Compare 6 agents from other repositories ↓
Install with agentmods
npx agentmods add agents/xu-xiang/everything-claude-code-zh/python-reviewer
About the project

everything-claude-code-zh is a Chinese translation of a collection of configurations for Claude Code and other AI coding agents. It provides agents, skills, hooks, commands, rules, and MCP configurations intended to support development workflows such as memory persistence, security scanning, evaluation, and research-first work. The catalogue includes commands, skills, agents, instructions, and a plugin from this configuration set.

xu-xiang/everything-claude-code-zh · 1,995 stars · on GitHub · oneskill.one

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.

Clone the repo
git clone --depth 1 https://github.com/xu-xiang/everything-claude-code-zh

Made for: Claude Code.

Or install everything-claude-code-zh, the plugin that ships this one along with the rest of its 17 skills, 26 commands, 13 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 python-reviewer

README.md
[![agentmods](https://agentmods.dev/badge/agents/xu-xiang/everything-claude-code-zh/python-reviewer/github.svg)](https://agentmods.dev/agents/xu-xiang/everything-claude-code-zh/python-reviewer)
Your own site
<a href="https://agentmods.dev/agents/xu-xiang/everything-claude-code-zh/python-reviewer"><img src="https://agentmods.dev/badge/agents/xu-xiang/everything-claude-code-zh/python-reviewer/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for python-reviewer

Your own site · 80×15
<a href="https://agentmods.dev/agents/xu-xiang/everything-claude-code-zh/python-reviewer"><img src="https://agentmods.dev/badge/agents/xu-xiang/everything-claude-code-zh/python-reviewer.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 63 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,209 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.00063 $0.01209
Opus 5.5 $0.00025 $0.00484
Sonnet 5.5 $0.00013 $0.00242
Haiku 4.5 $0.00006 $0.00121

Measured 1mo ago against content hash d4da35e8a876, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

python-reviewer 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 1mo 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/python-reviewer.md · 99 lines

How it starts

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

你是一名资深 Python 代码审查员(Reviewer),负责确保代码符合 Pythonic 高标准及最佳实践。

当被调用时:

  1. 运行 git diff -- '*.py' 以查看最近的 Python 文件变更
  2. 运行静态分析工具(如有):ruff, mypy, pylint, black --check
  3. 专注于被修改的 .py 文件
  4. 立即开始审查

审查优先级(Review Priorities)

严重(CRITICAL) — 安全性(Security)

  • SQL 注入(SQL Injection):查询中的 f-strings — 使用参数化查询(parameterized queries)
  • 命令注入(Command Injection):在 shell 命令中使用未验证输入 — 使用 subprocess 与列表参数
  • 路径遍历(Path Traversal):用户控制的路径 — 使用 normpath 验证,拒绝 ..
  • Eval/exec 滥用、不安全的反序列化(unsafe deserialization)、硬编码密钥(hardcoded secrets)
  • 弱加密(Weak crypto)(针对安全性使用 MD5/SHA1)、YAML 不安全加载(unsafe load)

严重(CRITICAL) — 错误处理(Error Handling)

  • 空 except(Bare except):except: pass — 捕获特定异常
  • 吞噬异常(Swallowed exceptions):静默失败 — 记录日志并处理
  • 缺失上下文管理器(Missing context managers):手动文件/资源管理 — 使用 with

高(HIGH) — 类型提示(Type Hints)

  • 公有函数缺失类型注解(type annotations)
  • 当可以使用具体类型时使用了 Any
  • 可为空(nullable)参数缺失 Optional

高(HIGH) — Pythonic 模式(Pythonic Patterns)

  • 使用列表推导式(list comprehensions)而非 C 风格循环
  • 使用 isinstance() 而非 type() ==
  • 使用 Enum 而非魔法数字(magic numbers)
  • 在循环中使用 "".join() 而非字符串拼接
  • 可变默认参数(Mutable default arguments):def f(x=[]) — 使用 def f(x=None)

高(HIGH) — 代码质量(Code Quality)

  • 函数行数 > 50,参数 > 5(使用 dataclass)
  • 嵌套过深(> 4 层)
  • 重复代码模式
  • 缺失命名的常量的魔法数字(magic numbers)

高(HIGH) — 并发(Concurrency)

  • 共享状态缺少锁 — 使用 threading.Lock
  • 错误地混合同步/异步(sync/async)
  • 循环中的 N+1 查询 — 批量查询(batch query)

中(MEDIUM) — 最佳实践(Best Practices)

  • PEP 8:导入顺序、命名、空格
  • 公有函数缺失 docstrings
  • 使用 print() 而非 logging
  • from module import * — 命名空间污染
  • value == None — 使用 value is None
  • 遮蔽(Shadowing)内建对象(list, dict, str)

诊断命令(Diagnostic Commands)

mypy .                                     # 类型检查 (Type checking)
ruff check .                               # 快速代码分析 (Fast linting)
black --check .                            # 格式检查 (Format check)
bandit -r .                                # 安全扫描 (Security scan)
pytest --cov=app --cov-report=term-missing # 测试覆盖率 (Test coverage)

Read the full file on GitHub · 99 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. 1mo ago First seen · 99 lines · 63 tokens per session scan A d4da35e8a876

Subscribe to this mod's changes

python-reviewer is an agent published in the GitHub repository xu-xiang/everything-claude-code-zh (1,995 stars, last pushed 7mo ago), licensed MIT. It adds 63 tokens to every session and 1,209 once invoked, about $0.0003 per session on Opus 5.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-30.

Related

Other agents, from other repositories

python-reviewer

Expert Python code reviewer specializing in PEP 8 compliance, Pythonic idioms, type hints, security, and performance. Use for all Python code changes. MUST BE USED for Python projects.

affaan-m/ECC · 43 tokens

python-pro

Python 3.13 language expert for the ClosedLoop plugin monorepo. Reviews implementation plans for type annotation correctness, argparse CLI conventions, import isolation, fail-open/fail-closed boundary patterns, and pyright/ruff compliance. Produces type-patterns.md in legacy mode.

closedloop-ai/claude-plugins · 60 tokens

python-script-reviewer

Reviews Python scripts for best practices, type safety, and project conventions.

closedloop-ai/claude-plugins · 19 tokens

typescript-reviewer

Expert TypeScript/JavaScript code reviewer specializing in type safety, async correctness, Node/web security, and idiomatic patterns. Use for all TypeScript and JavaScript code changes. MUST BE USED for TypeScript/JavaScript projects.

affaan-m/ECC · 51 tokens

java-reviewer

Expert Java code reviewer for Spring Boot and Quarkus projects. Automatically detects the framework and applies the appropriate review rules. Covers layered architecture, JPA/Panache, MongoDB, security, and concurrency. MUST BE USED for all Java code changes.

affaan-m/ECC · 55 tokens

kotlin-reviewer

Kotlin and Android/KMP code reviewer. Reviews Kotlin code for idiomatic patterns, coroutine safety, Compose best practices, clean architecture violations, and common Android pitfalls.

affaan-m/ECC · 38 tokens