Engineering
Python Code Review with Modern Typing avatar

Python Code Review with Modern Typing

Enforce strict Python 3.12+ type safety and modern annotation standards for high-quality, maintainable codebases.

Introduction

This skill acts as a specialized code review agent focused on enforcing strict Python type safety. It is designed for developers, software engineers, and automated CI pipelines aiming to modernize their Python codebases by adopting Python 3.12+ typing conventions. The primary objective is to eliminate ambiguity in function signatures, class attributes, and variable declarations, reducing runtime errors caused by type mismatches and improving IDE autocompletion and static analysis performance.

  • Systematic audit of function signatures, ensuring all parameters and return types are explicitly annotated.

  • Enforcement of modern built-in generic types, replacing legacy typing module imports like List, Dict, Set, and Tuple with native lowercase alternatives.

  • Transition of union and optional types to modern syntax, specifically using the | operator for unions and X | None for optional values.

  • Validation of complex class attribute typing and inline variable annotations to ensure comprehensive type coverage.

  • Integration with static analysis tools like mypy, specifically supporting --strict configurations in pyproject.toml.

  • Identification of deprecated typing module patterns to prevent technical debt and ensure future-proof code.

  • Ideal for use during pull request reviews, refactoring sessions, or as a pre-merge check to verify type integrity.

  • Input requirements include raw Python code or file paths for review; the skill generates specific correction suggestions based on current typing standards.

  • It prioritizes strict adherence to PEP standards, specifically targeting the removal of older typing constructs in favor of language-native generic syntax introduced in recent Python releases.

  • Note that this skill intentionally ignores high-level architecture or performance logic, focusing exclusively on the precision of type declarations for robust code contracts.

Repository Stats

Stars
7
Forks
1
Open Issues
1
Language
Python
Default Branch
main
Sync Status
Idle
Last Synced
May 3, 2026, 07:52 PM
View on GitHub