/skillry-backend-and-api:python-project-reviewfrom skillry-backend-and-api
Reviews Python projects across uv environments, packaging/PyPI, code style, anti-patterns, asyncio, background jobs, config, error handling, resilience, and FastAPI.
Ships in skillry-backend-and-api. 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.
Read when SKILL.md points to them.
Conduct a structured review of a Python project — covering virtual environment and dependency management (venv/uv/poetry), requirements pinning and lockfile hygiene, test structure (pytest fixtures, coverage targets), static analysis (ruff, mypy), common security anti-patterns, and packaging/entry-point correctness. Applies directly to Python-based projects such as ExampleApp and any adjacent Python tooling in the monorepo. Surface concrete findings from actual files, never from assumptions.
Skillry 3.0.0 merged the skills below into this one. A request that names a former skill routes here; open only the reference that matches the task. Paths are relative to this skill's directory.
| Former skill | Reference | Covers |
|---|---|---|
python-anti-patterns | references/python-anti-patterns.md | Anti-pattern checklist for Python code review: infrastructure, architecture, errors, resources, typing, tests |
python-code-style | references/python-code-style.md | Ruff and formatter configuration, naming, imports, docstrings, documentation standards |
python-design-patterns | references/python-design-patterns.md | KISS, separation of concerns, single responsibility, composition over inheritance, when to abstract |
python-resource-management | references/python-resource-management.md | Context managers, cleanup, connection and file lifecycles, streaming with accumulated state |
python-packaging | references/python-packaging.md | pyproject.toml, src layout, CLI entry points, building and publishing to PyPI |
python-pypi-package-builder | references/python-pypi-package-builder.md | End-to-end PyPI library: build backend choice, versioning, typing, CI, Trusted Publishing; scaffold script scripts/python-pypi-package-builder/scaffold.py |
uv-package-manager | references/uv-package-manager.md | uv projects, virtual environments, lockfiles, Python versions, Docker and CI workflows |
async-python-patterns | references/async-python-patterns.md | asyncio: tasks, gather, semaphores, timeouts, async context managers, event-loop pitfalls |
python-background-jobs | references/python-background-jobs.md | Task queues and workers (Celery and alternatives): retries, idempotency, job state, chains and chords |
python-error-handling | references/python-error-handling.md | Input validation, exception hierarchies, partial-failure handling in batches |
python-resilience | references/python-resilience.md | Retries with exponential backoff, timeouts, fault-tolerant decorators |
python-observability | references/python-observability.md | Structured logging, correlation IDs, metrics and OpenTelemetry tracing in Python |
python-configuration | references/python-configuration.md | pydantic-settings, environment variables, secrets, per-environment configuration |
fastapi-templates | references/fastapi-templates.md | FastAPI project scaffold: layered structure, repositories, services, auth, tests |
fastapi | references/fastapi.md | Official FastAPI conventions: fastapi CLI, Annotated parameters and dependencies, return types, routers, streaming and SSE, serving frontends, related tooling |
pyproject.toml, requirements*.txt, or uv.lock / poetry.lock.pip-audit has not been run recently and CVE exposure is unknown..md, .rst) with no code changes.# Identify project root and tooling
ls pyproject.toml setup.py setup.cfg requirements*.txt uv.lock poetry.lock Pipfile.lock 2>/dev/null
# Show Python version constraint and build backend
python3 - <<'EOF'
import tomllib
from pathlib import Path
try:
data = tomllib.loads(Path("pyproject.toml").read_text())
proj = data.get("project", data.get("tool", {}).get("poetry", {}))
print("name:", proj.get("name"))
print("python:", proj.get("requires-python"))
build = data.get("build-system", {}).get("build-backend", "not set")
print("build-backend:", build)
except Exception as e:
print("pyproject.toml error:", e)
EOF
# Check active venv / uv / poetry
which python3 && python3 --version
which uv && uv --version 2>/dev/null || echo "uv not found"
which poetry && poetry --version 2>/dev/null || echo "poetry not found"
# Check requirements files for unpinned dependencies
grep -n "^[a-zA-Z]" requirements*.txt 2>/dev/null | grep -v "==" | head -30
# List direct dependencies from pyproject.toml
python3 -c "
import tomllib; from pathlib import Path
d = tomllib.loads(Path('pyproject.toml').read_text())
deps = d.get('project',{}).get('dependencies', d.get('tool',{}).get('poetry',{}).get('dependencies',{}))
print(deps)
" 2>/dev/null
# Confirm lockfile exists and is not gitignored
git ls-files uv.lock poetry.lock requirements.txt requirements-lock.txt 2>/dev/null || echo "WARNING: lockfile may not be tracked"
# Check for packages pinned with >= only (no upper bound — unpredictable upgrades)
grep -n ">=[0-9]\|~=" requirements*.txt pyproject.toml 2>/dev/null | head -20
# pip-audit against current environment
pip-audit --desc --fix-dry-run 2>/dev/null || \
pip install pip-audit -q && pip-audit --desc 2>/dev/null
# uv audit (if using uv)
uv pip audit 2>/dev/null
# Safety (alternative)
safety check --full-report 2>/dev/null
Triage each CVE by severity (Critical/High/Medium/Low). Flag any Critical or High CVEs affecting direct dependencies for immediate patching.
# Show ruff config
grep -A 20 "\[tool\.ruff\]" pyproject.toml 2>/dev/null || cat .ruff.toml 2>/dev/null
# Run ruff — count violations by category
ruff check . --statistics 2>/dev/null | head -30
# Run ruff with auto-fix (dry-run) to see what can be auto-fixed
ruff check . --diff 2>/dev/null | head -60
# Check if ruff is in dev dependencies
grep "ruff" pyproject.toml requirements*.txt 2>/dev/null
Key rule categories to enable if missing: E, W (pycodestyle), F (pyflakes), I (isort), S (bandit security), B (bugbear), UP (pyupgrade).
# Show mypy config
grep -A 20 "\[tool\.mypy\]" pyproject.toml 2>/dev/null || cat mypy.ini .mypy.ini setup.cfg 2>/dev/null | grep -A 20 "\[mypy\]"
# Run mypy
mypy . --ignore-missing-imports 2>/dev/null | tail -20
# Count Any usage (too many → type coverage is low)
grep -rn ": Any\|-> Any\|cast(Any" src/ --include="*.py" | wc -l
# Check strict mode is enabled
grep -n "strict\|disallow_untyped" pyproject.toml mypy.ini 2>/dev/null
# subprocess shell=True (command injection risk)
grep -rn "subprocess\.\(run\|call\|Popen\|check_output\).*shell=True" \
. --include="*.py" | grep -v "test_\|#.*shell=True"
# eval / exec with non-literal arguments
grep -rn "\beval(\|\bexec(" . --include="*.py" | grep -v "^.*#\|test_\|evaluat"
# pickle load/loads (arbitrary code execution on untrusted data)
grep -rn "pickle\.load\|pickle\.loads\|cPickle\.load" . --include="*.py"
# SQL string concatenation (SQLi risk)
grep -rn 'execute.*%\s*\|execute.*\.format(\|execute.*f".*{' . --include="*.py" | head -20
# requests without timeout (hangs / DoS)
grep -rn "requests\.\(get\|post\|put\|delete\|patch\)(" . --include="*.py" \
| grep -v "timeout=" | head -20
# requests with verify=False (TLS disabled)
grep -rn "verify=False" . --include="*.py"
# yaml.load without Loader (arbitrary code execution)
grep -rn "yaml\.load(" . --include="*.py" | grep -v "Loader="
# tempfile.mktemp (race condition — use mkstemp/NamedTemporaryFile)
grep -rn "tempfile\.mktemp(" . --include="*.py"
# Hardcoded credentials in source
grep -rn "password\s*=\s*['\"][^${\.\(]" . --include="*.py" | grep -v "test_\|example\|#" | head -20
# Test discovery
find . -type f -name "test_*.py" -o -name "*_test.py" | grep -v __pycache__ | head -30
# pytest config
grep -A 15 "\[tool\.pytest\|pytest\.ini_options\]" pyproject.toml 2>/dev/null \
|| cat pytest.ini setup.cfg 2>/dev/null | grep -A 15 "\[pytest\]"
# Run tests with coverage
pytest --tb=short -q 2>/dev/null | tail -20
pytest --cov=. --cov-report=term-missing --tb=no -q 2>/dev/null | tail -30
# Check for missing test files for key modules
for f in $(find src/ . -maxdepth 2 -name "*.py" | grep -v test | grep -v __); do
base=$(basename "$f" .py)
find . -name "test_${base}.py" -o -name "${base}_test.py" 2>/dev/null | grep -q . \
|| echo "NO TEST: $f"
done
# Confirm __main__.py or entry_points are defined
find . -name "__main__.py" | grep -v node_modules | head -10
python3 - <<'EOF'
import tomllib; from pathlib import Path
try:
d = tomllib.loads(Path("pyproject.toml").read_text())
scripts = d.get("project", {}).get("scripts", d.get("tool", {}).get("poetry", {}).get("scripts", {}))
print("entry points:", scripts or "NONE DEFINED")
except: pass
EOF
# Check import structure (relative vs absolute)
grep -rn "^from \.\|^import \." . --include="*.py" | head -20
# Check for circular imports (run import in clean env)
python3 -c "import src" 2>&1 | head -10
pyproject.toml exists and defines requires-python with a specific version constraint.uv.lock, poetry.lock, or requirements.txt with pinned == versions) is committed and up to date.>= only without upper bound in requirements files).pip-audit / uv pip audit reports no Critical or High CVEs.ruff is in dev dependencies and runs clean (zero errors) in CI.mypy is in dev dependencies with disallow_untyped_defs = true or strict = true.subprocess.run(..., shell=True) with user-controlled input.eval( or exec( on non-literal strings.pickle.loads on data from untrusted sources (network, user upload).execute() DB calls use parameterised queries (? / %s placeholders), not string formatting.requests.* call has an explicit timeout= argument.requests calls never use verify=False in production paths.yaml.safe_load is used instead of yaml.load without an explicit Loader.tempfile.mkstemp or NamedTemporaryFile is used instead of mktemp..py files.--cov-fail-under=80) in CI.__main__.py or [project.scripts] entry point is defined for CLI tools.# Full security scan (bandit)
pip install bandit -q && bandit -r . -f txt -ll 2>/dev/null | head -50
# Dependency vulnerability scan
pip install pip-audit -q && pip-audit 2>/dev/null
# Lint + type check in one pass
ruff check . && mypy . --ignore-missing-imports
# Coverage report
pytest --cov=. --cov-report=term-missing -q 2>/dev/null | tail -30
# List all subprocess shell=True usages
grep -rn "shell=True" . --include="*.py" | grep "subprocess"
# List all eval/exec usages
grep -rn "\beval(\|\bexec(" . --include="*.py" | grep -v "^.*#"
# Check uv lockfile is up to date
uv lock --check 2>/dev/null && echo "lockfile up to date" || echo "lockfile OUTDATED"
Produce a structured report with:
Any overuse; strict mode status.file:line | pattern | risk | concrete fix. Each of the 8 anti-patterns above confirmed absent or listed.eval found in the codebase as part of the review.pip install of unvetted packages to test them.pyproject.toml or requirements.txt without explicit user approval.****; flag for rotation and removal.Done means: dependency pinning and CVE status are documented, ruff and mypy have been run (or their absence is flagged), all 8 security anti-pattern categories have been checked and reported, pytest coverage is measured and compared against the threshold, packaging is verified, and every finding has file:line + severity + concrete fix. The project is safe to ship when CVE audit is clean, ruff/mypy pass, security patterns are absent, and coverage meets the threshold.
references/async-python-patterns.md (opens in a new tab)references/async-python-patterns/LICENSE (opens in a new tab)references/fastapi-templates.md (opens in a new tab)references/fastapi-templates/LICENSE (opens in a new tab)references/fastapi.md (opens in a new tab)references/fastapi/LICENSE (opens in a new tab)references/fastapi/references/dependencies.md (opens in a new tab)references/fastapi/references/other-tools.md (opens in a new tab)references/fastapi/references/path-operations.md (opens in a new tab)references/fastapi/references/pydantic.md (opens in a new tab)references/fastapi/references/responses.md (opens in a new tab)references/fastapi/references/streaming.md (opens in a new tab)references/python-anti-patterns.md (opens in a new tab)references/python-anti-patterns/LICENSE (opens in a new tab)references/python-background-jobs.md (opens in a new tab)references/python-background-jobs/LICENSE (opens in a new tab)references/python-code-style.md (opens in a new tab)references/python-code-style/LICENSE (opens in a new tab)references/python-configuration.md (opens in a new tab)references/python-configuration/LICENSE (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
6 skills in this plugin
/transactional-emailSend transactional email and threaded replies via modern mail APIs, author React Email templates, enforce deliverability and release gates./api-and-interface-designDesign APIs and interfaces: REST/GraphQL principles, OpenAPI 3.1 specs, contracts, spec-to-code generation./backend-implementation-reviewReview server-side code: correctness, validation, maintainability, third-party, webhook and queue boundaries.npx claudepluginhub fluxonlab/skillry --plugin skillry-backend-and-apiOther plugins' skills for the same job