ds-python-review
Skill20 starsChanged 46 days agoMITView on GitHub
Review Python code with Tiger Style constraints and Python idioms.
In this repository52 other files it gives its agents.
- ds-dev-skill-benchSkill
- ds-agent-reviewSkill
- ds-architecture-planSkill
- ds-arenaSkill
- ds-blast-radiusSkill
- ds-blueprintSkill
- ds-bug-reviewSkill
- ds-clarity-reviewSkill
- ds-code-quality-reviewSkill
- ds-comment-reviewSkill
- ds-data-modeSkill
- ds-data-reviewSkill
- ds-debugSkill
- ds-deslopSkill
- ds-doc-quality-reviewSkill
- ds-exploreSkill
- ds-git-modeSkill
- ds-go-reviewSkill
- ds-grill-meSkill
- ds-handoffSkill
- ds-howSkill
- ds-humanizeSkill
- ds-interaction-modeSkill
- ds-java-reviewSkill
- ds-notebook-reviewSkill
- ds-onboardingSkill
- ds-osvSkill
- ds-perf-planSkill
- ds-project-checkpointSkill
- ds-project-resumeSkill
- ds-quality-gateSkill
- ds-reflectSkill
- ds-retroSkill
- ds-roadmapSkill
- ds-rust-reviewSkill
- ds-security-reviewSkill
- ds-semgrepSkill
- ds-shell-reviewSkill
- dsSkill
- ds-specSkill
- ds-step-modeSkill
- ds-tdd-modeSkill
- ds-test-modeSkill
- ds-test-quality-reviewSkill
- ds-tiger-style-modeSkill
- ds-tldtSkill
- ds-ts-reviewSkill
- ds-ui-modeSkill
- ds-ui-quality-reviewSkill
- ds-verify-thisSkill
- ds-zig-reviewSkill
- ds-zoom-outSkill
The file
We split this skill into the rules it gives an agent
1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 22
Use the checklist as a lens, not a scorecard: reason about the actual change, report real violations anchored to file:line, and flag issues …
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Applies to: Python 3.12+. Backend services, APIs, CLIs, data pipelines.
Arguments
Scan the invocation for the --no-tiger, --fix, and --full flags. Treat every other argument as review scope (files or directories); if no scope is given, review the changed files on the current branch.
--no-tigerpresent → skip the Tiger Style section; run Python Idioms, Typing, Performance, Security, and Testing only.--no-tigerabsent → run all sections (default).--fix→ after reporting, apply only the violations whose fix is mechanical and unambiguous (a rename to the idiom, a missing error check the review is certain about). Anything that changes logic or rests on an unverified assumption — especially security and correctness findings — stays report-only. After applying, re-run any build/test/lint check already in the loop and revert any fix that breaks it — or that touched more than the intended mechanical edit. End with a summary of what was applied and what was left.--full→ review the entire codebase instead of just the branch's changes. Explicit positional scope still wins;--fullonly replaces the no-scope default.
Example: /ds-python-review --no-tiger pkg1/ pkg2/ reviews pkg1/ and pkg2/ without Tiger Style.
Review Checklist
Use the checklist as a lens, not a scorecard: reason about the actual change, report real violations anchored to file:line, and flag issues even when they aren't listed. Don't manufacture findings to fill a category. Report only violations — no praise, no summary.
Tiger Style
Skip this section entirely if --no-tiger was passed. Otherwise it is mandatory.
- Non-trivial functions assert their preconditions and key invariants — don't demand assertions in thin wrappers or trivial accessors
- All loops over external input have explicit bounds; no unbounded iteration
- No recursion without provable termination
- All exceptions handled or propagated deliberately — no bare
except:and no silently swallowed errors - No post-initialization allocation in paths actually identified as hot — don't flag ordinary allocation
- Functions under 70 lines
- Variable names include units/qualifiers where applicable
Python Idioms
- No mutable default arguments (
def f(x=[])) — useNoneand create inside - Resources acquired with context managers (
with), not manualtry/finallyor unclosed handles - Catch specific exceptions, never bare
except:; chain withraise ... from err - No signaling failure via
None/sentinel where an exception or typed result is clearer - Iterate with comprehensions / generators over manual index loops; lazy generators for large streams
- No
from module import *; no logic in__init__.py; entrypoints guarded byif __name__ == "__main__" pathliboveros.path; f-strings over%/.format()- No
return/break/continueinside afinallyblock — it silently swallows exceptions - Timezone-aware
datetime.now(UTC)over the deprecated naivedatetime.utcnow()/utcfromtimestamp() - No imports of stdlib modules removed in 3.13 (PEP 594) —
crypt→bcrypt/argon2-cffi,pipes→subprocess+shlex.quote,cgi/cgitb→urllib.parse/email; alsotelnetlib/nntplib/imghdr/uu/lib2to3
Typing
- Every public signature annotated; passes
mypy --strict(no implicitAny) - Modern syntax:
list[str],X | NoneoverOptional[X] - PEP 695 type parameters (
class C[T],def f[T],typealias statement) over explicitTypeVar/TypeAliason new generic code @overrideon methods overriding a base;typing.TypeIsoverTypeGuard;ReadOnlyfor immutableTypedDictitems (3.13+)- Forward references quoted, or the module opts into
from __future__ import annotations(needed on 3.12–3.13; superseded on 3.14+) @dataclass/Protocol/Enumused instead of loose dicts and magic strings where they fit- No
# type: ignorewithout a trailing reason comment
Performance
Idiom-level checks only — for a ranked, costed optimization plan, use /ds-perf-plan.
- No blocking calls (
time.sleep,requests, sync DB drivers) insideasync def— use async clients orasyncio.to_thread - Every external
await/ network / DB call has a timeout - Concurrent tasks managed with
asyncio.TaskGroup(scoped lifetime, sibling cancellation,ExceptionGroup) over bareasyncio.gather - CPU-bound work uses
ProcessPoolExecutor— the stock interpreter's GIL serializes threads, so threading won't parallelize it - Database queries not issued inside loops; N+1 patterns absent
- Generators/streaming for large data instead of building full lists in memory
Security
- No string-built SQL (f-string/
%/+) — use parameterized queries / the ORM - No
subprocesswithshell=Trueon user input; noeval/exec/pickleon untrusted data tarfileextraction passesfilter='data'(or stricter) — bareextractallis a path-traversal/overwrite hazardyaml.safe_load, notyaml.load; no untrusted deserialization- No hardcoded credentials or secrets; read from env/secret store
- All external input validated and bounded at the boundary (e.g.
pydantic); requests set timeouts
Testing
- Public surface and error paths have meaningful coverage — flag notable gaps, not every untested accessor
- Error paths tested with
pytest.raises, not just the happy path - Variants parametrized (
@pytest.mark.parametrize) rather than copy-pasted - No real network/filesystem in unit tests — fakes and
tmp_path; no realsleepor wall-clock dependence
Version-specific checks
Read the target version from requires-python in pyproject.toml (or the project's declared minimum). Run the checklist above for every project. If it targets Python 3.14 or newer, also read 3.14.md in this skill directory and apply its checks on top. If the version can't be determined, run the base and note that version-specific checks were skipped.
Output Format
<file>:<line>: <severity>: <problem>. <fix>.Severity levels: critical (correctness/security), major (reliability/performance), minor (idiom/style).
Skip formatting nits unless they affect correctness or readability significantly.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

