con un clic
ds-python-review
Review Python code with Tiger Style constraints and Python idioms.
Instalar con Codex o Claude Copia este prompt, pégalo en Codex, Claude u otro asistente, y deja que revise la página de la skill y la instale por ti.
Menú
Review Python code with Tiger Style constraints and Python idioms.
Instalar con Codex o Claude Copia este prompt, pégalo en Codex, Claude u otro asistente, y deja que revise la página de la skill y la instale por ti.
Basado en la clasificación ocupacional SOC
Design a target architecture for a new system — module boundaries, dependency rules, seams, and build order — from its requirements. Reports a blueprint; changes nothing.
Analyze an existing codebase's architecture and produce a sequenced refactoring plan — assess module boundaries, dependency structure, and layering, then lay out ordered, risk-tagged steps. Language-agnostic. Reports a plan; changes nothing.
Turn a goal or another command's output into an ordered task roadmap.
Find the root cause of a failure with the scientific method — reproduce, isolate, fix, then prove it.
Interview the user relentlessly about a plan or design until reaching shared understanding.
Run an extremely strict maintainability + single-source-of-truth review of code changes — abstraction quality, file sprawl, spaghetti-condition growth, and duplicate/competing implementations. Reports findings by default; `--fix` applies the mechanical, unambiguous ones — structural/code-judo restructurings rest on judgment and stay reported.
| name | ds-python-review |
| description | Review Python code with Tiger Style constraints and Python idioms. |
| disable-model-invocation | true |
Applies to: Python 3.12+. Backend services, APIs, CLIs, data pipelines.
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-tiger present → skip the Tiger Style section; run Python Idioms, Typing, Performance, Security, and Testing only.--no-tiger absent → 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; --full only replaces the no-scope default.Example: /ds-python-review --no-tiger pkg1/ pkg2/ reviews pkg1/ and pkg2/ without Tiger Style.
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.
Skip this section entirely if --no-tiger was passed. Otherwise it is mandatory.
except: and no silently swallowed errorsdef f(x=[])) — use None and create insidewith), not manual try/finally or unclosed handlesexcept:; chain with raise ... from errNone/sentinel where an exception or typed result is clearerfrom module import *; no logic in __init__.py; entrypoints guarded by if __name__ == "__main__"pathlib over os.path; f-strings over %/.format()return/break/continue inside a finally block — it silently swallows exceptionsdatetime.now(UTC) over the deprecated naive datetime.utcnow() / utcfromtimestamp()crypt→bcrypt/argon2-cffi, pipes→subprocess+shlex.quote, cgi/cgitb→urllib.parse/email; also telnetlib/nntplib/imghdr/uu/lib2to3mypy --strict (no implicit Any)list[str], X | None over Optional[X]class C[T], def f[T], type alias statement) over explicit TypeVar/TypeAlias on new generic code@override on methods overriding a base; typing.TypeIs over TypeGuard; ReadOnly for immutable TypedDict items (3.13+)from __future__ import annotations (needed on 3.12–3.13; superseded on 3.14+)@dataclass/Protocol/Enum used instead of loose dicts and magic strings where they fit# type: ignore without a trailing reason commentIdiom-level checks only — for a ranked, costed optimization plan, use /ds-perf-plan.
time.sleep, requests, sync DB drivers) inside async def — use async clients or asyncio.to_threadawait / network / DB call has a timeoutasyncio.TaskGroup (scoped lifetime, sibling cancellation, ExceptionGroup) over bare asyncio.gatherProcessPoolExecutor — the stock interpreter's GIL serializes threads, so threading won't parallelize it%/+) — use parameterized queries / the ORMsubprocess with shell=True on user input; no eval/exec/pickle on untrusted datatarfile extraction passes filter='data' (or stricter) — bare extractall is a path-traversal/overwrite hazardyaml.safe_load, not yaml.load; no untrusted deserializationpydantic); requests set timeoutspytest.raises, not just the happy path@pytest.mark.parametrize) rather than copy-pastedtmp_path; no real sleep or wall-clock dependenceRead 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.
<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.