nathan-gage avatar

Python Best Practices

This is a comprehensive Python style guide distilled from real PR review patterns, covering 70 rules across data modeling, error handling, type safety, and API design. It assumes Python 3.11+ and includes impact ratings so you know what matters (like fixing mutable defaults and catching specific exceptions) versus what's just preference (like naming conventions). The rules are pragmatic about when to apply them: new code gets the full treatment, but stable code shouldn't be churned for style points. Worth having on hand if you're doing code reviews or want to stop debating the same patterns repeatedly. The discriminated unions and timezone-aware datetime guidance alone will save you from common footguns.

skills.sh installs
868
GitHub stars
3
last updated
Aug 21, 2026

Install

$ npx -y skills add nathan-gage/python-skills --skill python-best-practices --agent claude-code

Installs into .claude/skills of the current project.

Files

Python Best Practices

Guidelines for writing and reviewing Python. 75 rules across 8 categories, prioritized by impact.

A rule match is a signal, not a verdict. Most rules are design preferences for new code, not bugs to fix across the repo — check the rule's impact level before flagging in review or refactoring stable code.

Quick-reference lines are triggers, not licenses: before applying a rule as a review finding or a transformation, open the rule file and check its counter-signal — the marker-opened paragraph (**When ...** / **Scope:** / **Preserve ...**) saying when NOT to apply it.

When to Apply

  • Writing new Python modules, functions, classes, or data models
  • Reviewing code for correctness or type safety
  • Refactoring patterns in code that's being edited anyway

Avoid applying these rules as a blanket sweep across stable code — the churn rarely pays off.

Impact Levels

Sponsors

Details

Repository
github.com/nathan-gage/python-skills
Categories
Backend & APIs, Git & Pull Requests, Documentation, Code Review & Quality, Debugging, Python, Design & UI/UX
First seen
Jun 3, 2026
1oracle avatarnetsuite-suitescript-upgradeoracle/netsuite-suitecloud-sdkSuiteScript 1.0, 2.0, and 2.x to 2.1 migration assistant. Analyzes, converts, explains, and validates script upgrades. Covers 125+ API mappings, 34 object conve867skills.sh installs
2alirezarezvani avatarsecurity-pen-testingalirezarezvani/claude-skillsUse when the user asks to perform security audits, penetration testing, vulnerability scanning, OWASP Top 10 checks, or offensive security assessments. Covers s862skills.sh installs
3mindrally avatarnuxtjs-vue-typescriptmindrally/skillsNuxtJS and Vue 3 development with TypeScript, Composition API, Shadcn Vue, and Tailwind CSS for modern web applications.862skills.sh installs
4hairyf avatarnexthairyf/skillsNext.js framework for building React applications with App Router, Server Components, and optimized performance. Use when working with Next.js apps, routing, da860skills.sh installs
5pproenca avatartanstack-querypproenca/dot-skillsTanStack Query v5 performance optimization for data fetching, caching, mutations, and query patterns. This skill should be used when using useQuery, useMutation858skills.sh installs
6oracle avatarnetsuite-uif-spa-referenceoracle/netsuite-suitecloud-sdkUse when building, modifying, or debugging NetSuite UIF SPA components. Provides API/type lookup for `@uif-js/core` and `@uif-js/component` (constructors, metho854skills.sh installs