python-expert

Write and review PEP 8-compliant, type-annotated Python code.

Updated Apr 15, 2025
One-click install
npx skills add https://github.com/khrore/nix-config --skill python-expert-khrore
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: python-expert
Source: https://github.com/khrore/nix-config/tree/main/dotfiles/common/.config/opencode/skills/python-expert
Command: npx skills add https://github.com/khrore/nix-config --skill python-expert-khrore

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Many Python projects suffer from subtle correctness bugs, inconsistent style, missing type information, weak error handling, and avoidable performance issues; this skill supplies senior-level guidance to fix those problems and raise code quality to production standards.

Core Features & Use Cases

  • Code authoring: Produce PEP 8-compliant, type-annotated functions and classes with clear docstrings and sensible defaults.
  • Code review & audits: Identify mutable default arguments, improper exception handling, missing type hints, and performance anti-patterns and provide concrete fixes.
  • Optimization & debugging: Recommend list comprehensions, context managers, profiling-first optimizations, and safer resource handling for real-world scripts and libraries.

Quick Start

Review the attached Python file for correctness, add missing type hints and docstrings, flag security and performance issues, and suggest concrete fixes.

Frequently Asked Questions about python-expert

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

FAQPage Schema
How do I add type hints and docstrings to an existing Python codebase?

To add type hints and docstrings to a Python codebase, review your scripts and libraries function by function, applying PEP 8-compliant type annotations and explicit error handling to raise code quality to production standards.

What is the best way to find and fix Python performance anti-patterns?

Finding Python performance anti-patterns involves a profiling-first approach to identify bottlenecks, allowing you to apply concrete fixes like list comprehensions and context managers for optimized real-world scripts.

How do I fix mutable default arguments and improper exception handling in Python?

Fixing mutable default arguments and improper exception handling requires a senior-level code review that identifies these subtle correctness bugs and provides concrete, PEP 8-compliant fixes with explicit error handling for your Python code.

Can I get a Python code review for small to medium projects?

Yes, you can get a Python code review for small to medium projects that identifies missing type information, weak error handling, and inconsistent style, supplying actionable recommendations to achieve production-grade reliability.

Why does my Python script have subtle correctness bugs despite passing tests?

Your Python script may have subtle correctness bugs due to mutable default arguments, missing type annotations, or weak error handling that basic tests miss, requiring a senior-level audit to supply concrete fixes.