python-engineer

Expert Python engineering for code review, quality improvement, and debugging. Use when reviewing Python code for best practices, refactoring for cleaner code, debugging errors, improving type safety with type hints, writing tests with pytest, or developing Web APIs with FastAPI. Focuses on Pythonic patterns, SOLID principles, and production-ready code quality.

16 stars

Best use case

python-engineer is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Expert Python engineering for code review, quality improvement, and debugging. Use when reviewing Python code for best practices, refactoring for cleaner code, debugging errors, improving type safety with type hints, writing tests with pytest, or developing Web APIs with FastAPI. Focuses on Pythonic patterns, SOLID principles, and production-ready code quality.

Teams using python-engineer should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/python-engineer/SKILL.md --create-dirs "https://raw.githubusercontent.com/diegosouzapw/awesome-omni-skill/main/skills/development/python-engineer/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/python-engineer/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How python-engineer Compares

Feature / Agentpython-engineerStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Expert Python engineering for code review, quality improvement, and debugging. Use when reviewing Python code for best practices, refactoring for cleaner code, debugging errors, improving type safety with type hints, writing tests with pytest, or developing Web APIs with FastAPI. Focuses on Pythonic patterns, SOLID principles, and production-ready code quality.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

Related Guides

SKILL.md Source

# Python Engineer

Expert guidance for Python code review, quality improvement, and debugging with focus on Web API development.

## Core Workflow

1. **Understand** - Analyze current code structure and identify issues
2. **Diagnose** - Apply relevant best practices from references
3. **Improve** - Implement changes with proper typing and tests
4. **Validate** - Verify improvements through testing

## Code Review

When reviewing Python code, check:

1. **Type Safety** - All functions have type hints, mypy passes
2. **Testing** - pytest coverage for critical paths
3. **Clean Code** - Pythonic patterns, no code smells
4. **Error Handling** - Proper exception handling
5. **Documentation** - Docstrings for public APIs

For detailed checklist: [references/code-review.md](references/code-review.md)

## Debugging

Debug workflow:
1. Reproduce the issue with minimal test case
2. Identify error type and stack trace
3. Apply targeted debugging technique
4. Verify fix with test

For debugging techniques: [references/debugging.md](references/debugging.md)

## Quality Improvement

### Type Hints

Add comprehensive type annotations:
```python
from typing import TypeVar, Generic
from collections.abc import Callable, Sequence

T = TypeVar("T")

def process_items(
    items: Sequence[T],
    transformer: Callable[[T], T],
) -> list[T]:
    return [transformer(item) for item in items]
```

For complete guide: [references/type-hints.md](references/type-hints.md)

### Testing with pytest

Write meaningful tests:
```python
import pytest

class TestUserService:
    def test_create_user_with_valid_email_returns_user(
        self, user_service: UserService
    ) -> None:
        result = user_service.create("test@example.com")
        assert result.email == "test@example.com"
        assert result.id is not None

    def test_create_user_with_invalid_email_raises_validation_error(
        self, user_service: UserService
    ) -> None:
        with pytest.raises(ValidationError, match="Invalid email"):
            user_service.create("invalid-email")
```

For testing patterns: [references/testing.md](references/testing.md)

### Clean Code

Prefer:
- Composition over inheritance
- Small, focused functions (< 20 lines)
- Descriptive names over comments
- Early returns to reduce nesting
- Dataclasses/Pydantic over raw dicts

For patterns: [references/clean-code.md](references/clean-code.md)

## Web API Development

FastAPI best practices:
```python
from fastapi import FastAPI, HTTPException, status
from pydantic import BaseModel

class UserCreate(BaseModel):
    email: str
    name: str

@app.post("/users", status_code=status.HTTP_201_CREATED)
async def create_user(user: UserCreate) -> User:
    if await user_exists(user.email):
        raise HTTPException(
            status_code=status.HTTP_409_CONFLICT,
            detail="User already exists"
        )
    return await create_user_in_db(user)
```

For FastAPI patterns: [references/fastapi.md](references/fastapi.md)

## References

- [references/code-review.md](references/code-review.md) - Code review checklist
- [references/clean-code.md](references/clean-code.md) - Pythonic patterns
- [references/testing.md](references/testing.md) - pytest best practices
- [references/type-hints.md](references/type-hints.md) - Type annotation guide
- [references/fastapi.md](references/fastapi.md) - FastAPI development
- [references/debugging.md](references/debugging.md) - Debugging techniques

Related Skills

python-workflow

16
from diegosouzapw/awesome-omni-skill

Python project workflow guidelines. Triggers: .py, pyproject.toml, uv, pip, pytest, Python. Covers package management, virtual environments, code style, type safety, testing, configuration, CQRS patterns, and Python-specific development tasks.

python-workflow-development

16
from diegosouzapw/awesome-omni-skill

Develop Python scripts and modules for building AI workflows and integrations. Use when coding data ingestion, transformation, analysis, and automation pipelines in pilot projects requiring Python automation.

python-typing

16
from diegosouzapw/awesome-omni-skill

Migrate Python codebases to strict type checking with pyright. Use when user wants to add types, fix type errors, set up strict mode, or run a typing migration. Provides setup automation, fix patterns, discipline enforcement, and optional iteration loop support.

python-testing

16
from diegosouzapw/awesome-omni-skill

Use when implementing new Python code (follow TDD), designing test suites, reviewing test coverage, setting up pytest infrastructure, writing fixtures, mocking dependencies, or performing parametrized testing

python-testing-patterns

16
from diegosouzapw/awesome-omni-skill

Implement comprehensive testing strategies with pytest, fixtures, mocking, and test-driven development. Use when writing Python tests, setting up test suites, or implementing testing best practices.

python-specialist

16
from diegosouzapw/awesome-omni-skill

Deliver production-quality Python solutions with framework-aware patterns and tests.

python-setup-dev-environment

16
from diegosouzapw/awesome-omni-skill

Set up and run a reproducible Python dev environment with uv, ruff, mypy, and VSCode.

Python Security Scan

16
from diegosouzapw/awesome-omni-skill

Comprehensive security vulnerability scanner for Python projects including Flask, Django, and FastAPI applications. Detects OWASP Top 10 vulnerabilities, injection flaws, insecure deserialization, authentication issues, hardcoded secrets, and framework-specific security problems. Audits dependencies for known CVEs and generates actionable security reports.

python-project

16
from diegosouzapw/awesome-omni-skill

Scaffold and harden Python projects using vpngw-aligned defaults (pyproject/setuptools-scm, src layout, Ruff, pytest, Typer, Pydantic) plus best practices for CLI tools, systemd services, APIs/UI apps, IaC/automation, security/networking, and AI/ML workflows.

python-programmer

16
from diegosouzapw/awesome-omni-skill

Python programmer specialising in functional programming, clean code, documentation, and code quality using ruff and uv.

python-pro

16
from diegosouzapw/awesome-omni-skill

Master Python 3.12+ with modern features, async programming,

python

16
from diegosouzapw/awesome-omni-skill

Python coding conventions and guidelines Triggers on: **/*.py