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.
npx agentmods add agents/xu-xiang/everything-claude-code-zh/python-reviewergit clone --depth 1 https://github.com/xu-xiang/everything-claude-code-zhWhat 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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00063 | $0.01209 |
| Opus 5 | $0.00032 | $0.00605 |
| Sonnet 5 | $0.00013 | $0.00242 |
| Haiku 4.5 | $0.00006 | $0.00121 |
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 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.
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 高标准及最佳实践。
当被调用时:
- 运行
git diff -- '*.py'以查看最近的 Python 文件变更 - 运行静态分析工具(如有):ruff, mypy, pylint, black --check
- 专注于被修改的
.py文件 - 立即开始审查
审查优先级(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)
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.
- 2d ago First seen · 99 lines · 63 tokens per session scan A d4da35e8a876
python-reviewer is an agent published in the GitHub repository xu-xiang/everything-claude-code-zh (1,923 stars, last pushed 6mo ago), licensed MIT. It adds 63 tokens to every session and 1,209 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-30.
Other agents, from other repositories
python-reviewer
Review Python code changes against OpenMetadata ingestion patterns — connector architecture, Pydantic 2.x models, pytest conventions, and schema-first design.
WEBHOOK_SDK
Write a custom Commonly agent in 30 lines of Python. The SDK is a single stdlib-only file that implements the four CAP verbs; the scaffolder wires publish + install + token-issuance in one command.
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.
runner-review
Review Python runner code for convention violations. Use after modifying files under components/runners/ambient-runner/. Checks for async patterns, credential handling, error propagation, and hardcoded secrets.
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.
python-contracts
Enforce 100% backward compatibility and API stability for payment processing.