More screenshots

    Works with the AI Agents you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIMuseMuseDotsDots+21 more

    Python Best Practice Checker

    1

    Audit Python code against PEP 8, PEP 484 type hints, modern Python idioms, security vulnerabilities, and performance pitfalls.

    Free

    4 usesSecurity scanned
    python-best-practice-checker

    python-best-practice-checker

    Example session with this skill installed

    "Audit this Python module for quality" (pastes 150-line module)

    • Read your context and instructions
    • Compiled the python-best-practice-checker

    "Python Audit Report — payment_handler.py — Score: C (42 issues found)

    CRITICAL (1):

    • Line 89: Deserializes untrusted input with unsafe deserialization. Use json.loads() or msgspec instead.

    ERROR (3):

    • Line 23: Mutable default arguments (empty list, empty dict) shared across calls. Replace with None sentinel + in-function initialization.
    • Line 67: Bare except with pass — swallows all exceptions including interrupts. Use specific exception types with logging.
    • Line 112: File open not inside a context manager — handle leaks if reading raises.

    WARNING (8):

    • Line 34: for-range with len() — use enumerate() instead
    • Line 56: Regex compiled inside loop — move to module-level constant
    • Line 78: String concatenation in loop — use join()
    • Line 91: Using typing.List/Dict imports — use builtin generics (Python 3.10+)

    INFO (30): [style, naming, documentation findings]

    Top 3 highest-impac

    Connects securely to your tools. The creator never sees your data.

    About this skill

    The Problem

    Your Python module passes ruff, passes mypy, passes tests — and still has a mutable default argument that silently corrupts state between calls, a bare except clause that swallows interrupts, a regex recompiled inside a loop running 10K times per request, and unvalidated deserialization of user-supplied data. Linters check syntax and style. This skill checks the semantic patterns that cause production incidents.

    What You Get

    • PEP 8 style audit — naming conventions, import organization, line length, blank line rules, trailing whitespace, and file structure validation with exact line numbers and corrections
    • Type annotation completeness — checks all function signatures for parameter types and return types, enforces modern Python 3.10+ syntax (union pipe instead of Union generics, builtin list/dict instead of typing imports), and flags overly broad Any usage
    • Anti-pattern detection — mutable default arguments, bare except clauses, string concatenation in loops, for-range-when-enumerate-would-work, comprehension side effects, and module-level executable code
    • Security vulnerability scan — dynamic code evaluation on user input, SQL string concatenation, hardcoded credentials, unsafe deserialization of untrusted data, and insecure temp file usage
    • Performance pitfall identification — repeated attribute lookup in loops, unnecessary list materialization where generators suffice, re-compiling regex per call, and using list.pop(0) where deque is appropriate
    • Severity-scored report — findings categorized as CRITICAL (security), ERROR (runtime failure), WARNING (anti-patterns), INFO (style), with corrected code examples for each finding

    Why This Beats Prompting It Yourself

    Ruff catches style violations. MyPy catches type mismatches. Neither catches that your function with a mutable default argument silently shares state across calls, that a bare except hides user interrupts, or that a file open call leaks the handle if reading raises. This skill performs a semantic audit that goes beyond what static analysis tools detect — checking the behavioral patterns that cause silent bugs, not just the syntactic rules that prevent them.

    Example Session

    You: "Audit this Python module for quality" (pastes 150-line module)

    Agent: "Python Audit Report — payment_handler.py — Score: C (42 issues found)

    CRITICAL (1):

    • Line 89: Deserializes untrusted input with unsafe deserialization. Use json.loads() or msgspec instead.

    ERROR (3):

    • Line 23: Mutable default arguments (empty list, empty dict) shared across calls. Replace with None sentinel + in-function initialization.
    • Line 67: Bare except with pass — swallows all exceptions including interrupts. Use specific exception types with logging.
    • Line 112: File open not inside a context manager — handle leaks if reading raises.

    WARNING (8):

    • Line 34: for-range with len() — use enumerate() instead
    • Line 56: Regex compiled inside loop — move to module-level constant
    • Line 78: String concatenation in loop — use join()
    • Line 91: Using typing.List/Dict imports — use builtin generics (Python 3.10+)

    INFO (30): [style, naming, documentation findings]

    Top 3 highest-impact fixes:

    1. Replace unsafe deserialization with json (CRITICAL security)
    2. Fix mutable default arguments (silent state corruption)
    3. Wrap file I/O in context managers (resource leak)"

    Use Cases

    • Pre-commit quality gate to catch semantic issues that linters miss
    • Code review for Python PRs where type hints and style are correct but behavior is subtly wrong
    • Onboarding audit to establish a quality baseline on a new Python codebase
    • Post-refactoring verification to ensure changes didn't introduce anti-patterns
    • Security audit of Python code that handles user input or external data

    Known Limitations

    This skill is a heuristic audit — it complements but does not replace mypy, ruff, or pyright. Some findings may be false positives if the code uses patterns the skill doesn't recognize (dynamic metaclasses, clever init_subclass usage). Always check the project's pyproject.toml before recommending Python 3.10+ syntax — don't suggest modern syntax for a codebase targeting Python 3.9.

    This skill is a heuristic audit — it complements but does not replace mypy, ruff, or pyright. Some findings may be false positives if the code uses patterns the skill doesn't recognize (dynamic metaclasses, clever init_subclass usage). Always check the project's pyproject.toml before recommending Python 3.10+ syntax — don't suggest modern syntax for a codebase targeting Python 3.9.

    How to use

    1. 1

      Connect your agent to the Agensi MCP

      Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup

    2. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 3

      Ask for what you need

      Your agent loads this skill and uses it on your task. It always asks before any payment.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill goes through the trust checks below.

    Security scanned

    Checked by our 8-point scan before listing

    4 uses

    Times used to date

    Free forever

    No account required to browse

    Trust & safety

    Security scan

    Security scan passed 4 months ago

    • Free with an Agensi account

    Permissions

    Terminal / Shell
    Read Files

    File Scopes

    python-best-practice-checker/**
    Listed4 months ago

    What's inside

    Frequently Asked Questions

    Unlike basic syntax checkers, this skill conducts a deep-tissue audit focusing on senior-level logic, security vulnerabilities, and modern Python 3.10+ idioms that standard LLMs often overlook. It identifies complex issues like O(n²) performance bottlenecks and mutable default argument anti-patterns.

    This skill is compatible with any AI agent platform that supports custom skill integration, including GPT-based agents, Claude-powered assistants, and autonomous developer frameworks. It works as a plug-and-play logic layer for any agent tasked with writing or reviewing Python code.

    Every audit includes a structured report categorizing findings by severity (Critical to Info), detailed explanations of risks, and "Modern Python" code blocks showing exactly how to refactor the problematic code. You also receive an overall quality grade from A-F and a prioritized action list.

    The skill is specifically optimized for modern Python (3.10 and newer), including support for PEP 604 union types and PEP 585 generics. While it can audit older code, its primary focus is modernizing legacy syntax into secure, performant, and type-safe Python.

    You receive the full skill logic ready for immediate deployment into your agent's environment, along with documentation on how to trigger the various audit phases. Your purchase also includes access to future updates as Python standards and PEP guidelines evolve.