python-anti-patterns

Flag common Python anti-patterns in source code during reviews and debugging.

Updated Mar 3, 2026
One-click install
npx skills add https://github.com/jacexh/skills --skill python-anti-patterns-jacexh
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: python-anti-patterns
Source: https://github.com/jacexh/skills/tree/main/skills/python-anti-patterns
Command: npx skills add https://github.com/jacexh/skills --skill python-anti-patterns-jacexh

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Provides a focused checklist to identify and avoid common Python anti-patterns that cause bugs, performance regressions, and maintenance headaches during development, code review, and debugging.

Core Features & Use Cases

  • Review checklist: A compact set of anti-patterns to run through before merging code.
  • Debugging aid: Helps pinpoint likely sources of mysterious failures by highlighting risky patterns.
  • Refactoring and standards: Suggests idiomatic replacements and architectural fixes for legacy code and team guidelines. Use this checklist during pre-merge reviews, refactoring of legacy services, debugging sessions, or when establishing team coding standards.

Quick Start

Run a pre-merge code review and list any instances of scattered retry logic, hard-coded configuration, unclosed resources, blocking async calls, missing type hints, and insufficient tests.

Frequently Asked Questions about python-anti-patterns

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I find common Python anti-patterns during a code review?

To find common Python anti-patterns during a code review, use a focused checklist to detect issues like scattered retry logic, hard-coded configuration, and blocking calls in async code. This prevents bugs and maintenance headaches before merging.

What are frequent Python anti-patterns that cause resource leaks and runtime bugs?

Frequent Python anti-patterns causing resource leaks and runtime bugs include unclosed resources, duplicated retry logic, and blocking operations within async code. Identifying these risky patterns helps pinpoint sources of mysterious failures during debugging.

How do I refactor legacy Python code to use more idiomatic best practices?

To refactor legacy Python code into idiomatic best practices, identify hard-coded configurations and missing type hints, then apply suggested architectural fixes. This establishes better team coding standards and improves overall maintainability.

Does this anti-pattern checklist apply to pre-merge checks for Python projects?

Yes, this anti-pattern checklist applies directly to Python projects for pre-merge checks. It flags insufficient testing and missing type hints, serving as a compact review tool to ensure code quality and prevent performance regressions.

Why does blocking code in async Python cause performance issues and how to fix it?

Blocking code in async Python causes performance issues by stalling the event loop during runtime troubleshooting. Fix this anti-pattern by replacing blocking calls with idiomatic asynchronous alternatives recommended during a dedicated code review.