Agent Skills: review-python-code

Review Python code for bugs, edge cases, and pitfalls specific to ML, data, API, and deployment contexts (data leakage, tensor shapes, device placement, missing timeouts, hardcoded secrets, resource leaks). Reports findings in chat without editing files.

UncategorizedID: garg-aayush/tutorials/review-python-code

Install this agent skill to your local

pnpm dlx add-skill https://github.com/garg-aayush/handbook/tree/HEAD/.claude/skills/review-python-code

Skill Files

Browse the full folder contents for review-python-code.

Download Skill

Loading file tree…

.claude/skills/review-python-code/SKILL.md

Skill Metadata

Name
review-python-code
Description
Review Python code for bugs, edge cases, and pitfalls specific to ML, data, API, and deployment contexts (data leakage, tensor shapes, device placement, missing timeouts, hardcoded secrets, resource leaks). Reports findings in chat without editing files.

Review Python code for bugs, edge cases, and pitfalls in ML/API/deployment contexts.

Rules

  • Input Required: If no files provided, ask user to reference specific files.
  • Correctness > Style: Skip PEP8 nitpicks. Focus on bugs and logic errors.
  • No Edits: Report issues in chat only; do not modify files.

Focus Areas

ML & Data

  • Data leakage (train/test contamination), incorrect tensor shapes, wrong device (CPU/GPU)
  • Model state issues (missing eval(), gradient accumulation), incorrect loss/metric usage
  • NumPy/Pandas pitfalls: chained indexing, dtype mismatches, broadcasting errors

APIs & Requests

  • Missing error handling, timeouts, retries for network calls
  • Auth token exposure, missing validation on inputs/responses
  • Rate limiting, connection pooling, async misuse

Deployment

  • Hardcoded secrets/paths, missing env var checks
  • Resource leaks (unclosed files/connections), memory issues
  • Missing dependency version pins, incompatible package versions

Output Format

  1. Critical: Bugs causing crashes or wrong results
  2. Edge Cases: Unhandled scenarios
  3. Fixes: Brief code snippets for corrections