/tslateman-skills:python-review [path or package to review, defaults to working-tree changes]from tslateman-skills
Review Python code for agent-typical anti-patterns: blind except and try/except/pass error swallowing, type-ignore and Any sprinkled to silence the checker, string-matched exception handling, .get() defaults hiding missing keys, noqa suppression. Runs Ruff with a targeted rule set, then judges each trigger with a design lens. Use when: reviewing agent-written Python, before committing Python changes, or on "python review", "review this python", "ruff pass", "check for except abuse". For generic bug hunts use /code-review; for generic judgment use /vibe-check.
Ships in tslateman-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Python's dynamism means the interpreter rarely pushes back, so the
agent-typical minimal edit is a silencer: wrap the failing call in
try/except: pass, add # type: ignore, default the missing key with
.get(k, ""). Each edit makes the traceback vanish; the bug moves
downstream and loses its stack trace on the way. This review hunts that
debt class specifically.
Changed files:
!git diff --name-only HEAD 2>/dev/null | grep '\.py$' || echo "(not a git repo or no changed .py files — review the given path instead)"
Review $ARGUMENTS if given; otherwise the changed .py files above;
otherwise ask which package. Read the scoped files fully before judging —
every finding needs the surrounding control flow, not just the line.
Run Ruff with the targeted rule set (project rules plus the ones that catch this debt class):
uvx ruff check --select E722,BLE,TRY,B,SIM,ARG,RET,RUF --output-format concise .
E722/BLE — bare and blind exceptsTRY — exception handling design (tryceratops)B — bugbear: mutable defaults, no-op assertionsSIM/RET — collapsible conditionals, dead branchesIf the project pins its own Ruff config (pyproject.toml, ruff.toml),
respect it and say so. If a type checker is configured (mypy, pyright,
ty), run it too — type errors that were silenced rather than fixed are
the core of this review.
Then grep the scoped files for triggers Ruff can't judge:
| Trigger | Suspicion |
|---|---|
except Exception: / except: pass | Error swallowing — which specific exception was expected? |
# type: ignore / # noqa / cast( | Who silenced the checker, and is the reason written down? |
Any in signatures | Typing given up at the boundary — callers inherit the fog |
.get(key, default) | Legitimate optional, or a KeyError hidden behind a default? |
str(e) comparison / in str(e) | Exception control flow by string match — wants exception types |
hasattr/getattr with defaults | Duck-typing check, or an AttributeError silencer? |
isinstance chains | Usually polymorphism or match in disguise |
| Mutable default args | Classic footgun (bugbear catches most) |
For each trigger hit, decide which of three buckets it belongs in — this is the review's actual work:
except KeyError around one dict access with a comment is not a
finding; dict.get for a genuinely optional field is not a finding.type: ignore with the actual type,
convert isinstance chain to match, raise instead of default.Any at a module boundary
(wants a Protocol or TypedDict), optionality smeared through every
caller (wants validation at the edge, e.g. pydantic). Name the
restructure and its blast radius. Do not apply it without asking —
this bucket is why the review exists.A repeated trigger is one finding, not many: five .get(k, "") on the
same payload point at one unvalidated boundary.
Findings ordered by severity, each with file:line, the bucket, why it
matters in one sentence, and the suggested fix. Then a one-paragraph
verdict: does this code fail loudly at the boundary, or quietly
downstream? End with the counts: N fine / N mechanical / N restructure.
If the user asks you to apply fixes, apply bucket 2 directly and run Ruff plus the test suite after; bucket 3 gets a plan first.
except Exception, # type: ignore, or a default
value as a fix..get() and getattr by whether absence is a valid state,
not by whether the code runs.What SKILL.md sets; muted values are Claude Code's defaults
tslateman-skills@tslateman is listed by tslateman/claude-plugins — review the source before installing
npx claudepluginhub tslateman/claude-plugins --plugin tslateman-skillsOther plugins' skills for the same job
61 skills in this plugin
/adrGenerate Architecture Decision Records that capture the reasoning behind technical decisions. Use when the user asks to "create an ADR", "document a decision", "record why we chose X", or discusses architectural trade-offs worth preserving./arenaSpawn N parallel candidates at the same task, pick a base, graft the strongest parts of the losers into it. Use for /arena, 'arena this', 'throw it in the arena', or when one attempt at a non-trivial artifact would lock in the wrong shape./automagic-problem-discoveryAudit a workspace for recurring friction, pick the highest-leverage one, and build the automation that removes it. Use when the user asks "what should I automate", "what's wasting my time", "find the friction in my workflow", wants a self-improvement pass over their own tooling, or runs this on a recurring loop.