strict-python-mode

Enforce type hints, Google-style docstrings, and modern Python syntax with Ruff and mypy.

77|15|Updated Sep 4, 2022
One-click install
npx skills add https://github.com/Afaneor/fastapi-docker-boilerplate --skill strict-python-mode
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: strict-python-mode
Source: https://github.com/Afaneor/fastapi-docker-boilerplate/tree/main/%7B%7Bcookiecutter.project_name%7D%7D/.claude/skills/strict-python-mode
Command: npx skills add https://github.com/Afaneor/fastapi-docker-boilerplate --skill strict-python-mode

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill ensures Python code adheres to strict typing, comprehensive documentation, and modern syntax, preventing common defects early.

Core Features & Use Cases

  • Type-hint enforcement: all parameters and return types must be annotated.
  • Docstring requirements: public functions require Google-style docstrings.
  • Modern syntax and quality checks: encourages 3.12+ syntax usage and automated linting with Ruff and mypy; suitable for refactoring, code reviews, and new feature development.

Quick Start

Install dependencies and run the quality checks to enforce typing, docstrings, and modern syntax during development.

Frequently Asked Questions about strict-python-mode

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

FAQPage Schema
How do I enforce strict Python type hints and docstrings in my codebase?

To enforce strict Python type hints and docstrings, you apply automated quality checks that require all function parameters and return types to be annotated, alongside Google-style docstrings for public functions. This prevents common defects early during development and code reviews.

What is the best way to lint Python code for modern syntax and type safety?

Linting Python code for modern syntax and type safety is best handled by combining Ruff and mypy checks. This approach verifies that 3.12+ syntax is used, type hints are present, and code meets strict quality gates before production.

Do I need Ruff and mypy to enforce strict Python coding standards?

You need Ruff and mypy to verify strict Python coding standards because they automate the quality checks for modern syntax usage and type hints. These tools guarantee new functions, refactors, and production-ready code meet your quality gates.

Can I use strict Python type checking during code refactoring?

You can use strict Python type checking during code refactoring to guarantee updated code meets quality gates. It enforces type hints, return types, and Google-style docstrings, ensuring your refactored functions maintain comprehensive documentation and modern syntax.

Why does my Python code fail quality gates when missing return type annotations?

Your Python code fails quality gates when missing return type annotations because strict quality enforcement requires all functions to have type hints and return types. Mypy checks verify these annotations are present to prevent common typing defects early.