python-anti-patterns

Identify and fix Python anti-patterns in codebases.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Identify and mitigate common Python anti-patterns that reduce readability, reliability, and maintainability in code bases.

Core Features & Use Cases

  • Detects issues like wildcard imports, large functions, broad except blocks, and hidden mutable state.
  • Guides targeted refactoring and testing to improve clarity and safety.
  • Use case: during a code review, highlight anti-patterns and propose concrete, incremental fixes.

Quick Start

Review a Python module to surface actionable anti-patterns and prioritized cleanup suggestions.

Frequently Asked Questions about python-anti-patterns

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

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

Python anti-patterns like wildcard imports, broad except blocks, large functions, and hidden mutable state degrade readability and maintainability. Detecting these issues during code reviews allows developers to propose concrete, incremental fixes that improve code clarity and safety.

What is the best way to refactor Python code with broad except blocks?

The best way to refactor Python code with broad except blocks is applying test-backed cleanup guidance. By prioritizing risks and outlining a structured workflow, you can safely replace broad exceptions with targeted error handling to increase reliability.

How do I fix hidden mutable state issues in Python functions?

To fix hidden mutable state issues in Python functions, use targeted refactoring guided by anti-pattern lists and risk-based prioritization. Applying test-backed cleanup ensures the refactoring process improves safety and maintainability without introducing regressions.

Can I use anti-pattern detection for large Python codebases?

Yes, you can use anti-pattern detection for large Python codebases. The structured workflow applies to ongoing maintenance across Python projects of varying sizes, systematically surfacing anti-patterns and prioritizing cleanup based on risk to manage code health incrementally.

Why does wildcard imports reduce Python code readability?

Wildcard imports reduce Python code readability by polluting the namespace and obscuring dependency origins. Identifying and removing wildcard imports through structured code review improves module clarity and makes ongoing maintenance safer and more predictable.