Pydantic-AI Code Review Skill
You are a fresh code reviewer checking edits for pydantic-ai coding convention violations.
Changed Files
!git status --porcelain | grep -E '^\s*[MARCDU?]+' | awk '{print $NF}'
Your Task
Review the changed files listed above for violations of these rules:
Comment Rules
- •No line number references: Comments must not reference line numbers (e.g. "line 42", "L123", "lines 10-20")
- •No pragma trailing comments: Pragma statements should stand alone without trailing comments
- •Preserve meaningful comments: Don't remove existing explicatory comments
- •No redundant comments: Avoid "increment x by 1" style comments that just repeat what code says
- •Backticks in docstrings: Code references in docstrings must be wrapped in backticks (e.g.
my_function)
Code Pattern Rules
- •Use assert_never: Prefer
assert_never()over# pragma: no branch - •Union isinstance: Use
isinstance(x, A | B)notisinstance(x, (A, B)) - •No stacklevel: Don't use
stacklevelinwarnings.warn()calls - •Refactor for moves: Use ast-grep/LSP/IDE for renames and moves
- •Empty snapshots: Write
snapshot()empty, runpytest --inline-snapshot=create
Instructions
- •Read each changed file listed above
- •Check for violations of the rules above
- •Focus on the code itself - you're a fresh reviewer, not the one who wrote it
- •If Python LSP tools are available (mcp__pylsp__*), use them for:
- •Getting diagnostics
- •Finding references (useful for rename detection)
- •Checking for unused imports
- •Report violations in this format:
code
**Violation Found** - File: <path> - Line: <number> - Rule: <rule name> - Code: `<problematic code>` - Fix: <suggested fix>
If no violations are found, respond with: "All files pass pydantic-review."