Agent skill · writing content · wshobson

python-anti-patterns

Use this skill when reviewing Python code for common anti-patterns to avoid. Use as a checklist when reviewing code, before finalizing implementations, or when debugging issues that might stem from known bad practices.

Why this skill is useful

Codifies a checklist of common Python anti-patterns that the AI could infer but now doesn't have to guess.

What it needs

About 4k tokens when loaded. Last updated 2026-08-05. 38,570 stars on the source repository.

What this skill does

Python Anti-Patterns Checklist A reference checklist of common mistakes and anti-patterns in Python code. Review this before finalizing implementations to catch issues early. When to Use This Skill Reviewing code before merge Debugging mysterious issues Teaching or learning Python best practices Establishing team coding standards Refactoring legacy code Note: This skill focuses on what to avoid. For guidance on positive patterns and architecture, see the python-design-patterns skill. Infrastructure Anti-Patterns Scattered Timeout/Retry Logic Fix: Centralize in decorators or client wrappers. Double Retry Fix: Retry at one layer only. Know your infrastructure's retry behavior. Hard-Coded Configuration Fix: Use environment variables with typed settings. Architecture Anti-Patterns Exposed Internal Types Fix: Use DTOs/response models. Mixed I/O and Business Logic Fix: Repository pattern. Keep business logic pure. Error Handling Anti-Patterns Bare Exception Handling Fix: Catch specific exceptions. Log or handle appropriately. Ignored Partial Failures Fix: Capture both successes and failures. Missing Input Validation Fix: Validate early at API boundaries. Resource Anti-Patterns Unclosed Resources Fix: Use context managers. Blocking in Async Fix: Use async-native libraries. Type Safety Anti-Patterns Missing Type Hints Fix: Annotate all public functions. Untyped Collections Fix: Use type parameters. Testing Anti-Patterns Only Testing Happy Paths Fix: Test error conditions and edge cases. Over-Mocking Fix: Use integration tests for critical paths. Mock only external services. …

How to use it

Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:

@skills wshobson/python-anti-patterns

View the source on GitHub

Browse the @skills marketplace