python-anti-patterns

Scan Python code for common anti-patterns affecting reliability, security, and maintainability.

Updated Jul 2, 2025
One-click install
npx skills add https://github.com/janpeterd/dotfiles --skill python-anti-patterns-janpeterd
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: python-anti-patterns
Source: https://github.com/janpeterd/dotfiles/tree/main/dot_agents/skills/python-anti-patterns
Command: npx skills add https://github.com/janpeterd/dotfiles --skill python-anti-patterns-janpeterd

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

It helps you prevent production bugs and maintainability failures by identifying common Python anti-patterns early in the development lifecycle.

Core Features & Use Cases

  • Code review checklist: Validate retry/timeout strategy, configuration handling, and exception behavior during PR reviews.
  • Debugging guidance: Diagnose issues caused by patterns like bare exceptions, ignored partial failures, and blocking calls in async code.
  • Refactoring support: Improve architecture by removing mixed I/O and business logic, exposed internal types, and untyped public APIs.

Quick Start

Ask the AI to review the function or module you are about to merge against the python-anti-patterns checklist and explain each finding with a concrete fix.

Frequently Asked Questions about python-anti-patterns

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

FAQPage Schema
How do I catch Python anti-patterns before merging code?

To catch Python anti-patterns before merging, scan your function or module against a code review checklist identifying risky patterns like bare exception swallowing, blocking in async code, and untyped public APIs to prevent production bugs.

What are common Python error handling anti-patterns to avoid?

Common Python error handling anti-patterns to avoid include bare exception swallowing, ignored partial failures, scattered retry logic, and inadequate error-path testing, all of which severely degrade application reliability and maintainability.

How do I diagnose blocking calls in Python async code?

Diagnose blocking calls in Python async code by applying debugging guidance that scans for risky patterns where mixed I/O and business logic block the event loop, explaining each finding with a concrete fix to restore async performance.

Can I use a Python code review checklist for refactoring untyped public APIs?

Yes, you can use a Python code review checklist for refactoring untyped public APIs by removing exposed internal types, ORM type leakage, and missing type hints to significantly improve your architecture and maintainability.

What is the best way to find hard-coded secrets and unclosed resources in Python?

The best way to find hard-coded secrets and unclosed resources in Python is scanning for specific risky patterns during development, validating configuration handling and resource management to prevent security and infrastructure failures.