rules-typings

Validate Python type stubs and shims in the typings/ directory.

Updated May 20, 2025
One-click install
npx skills add https://github.com/flext-sh/flext --skill rules-typings
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: rules-typings
Source: https://github.com/flext-sh/flext/tree/main/.claude/skills/rules-typings
Command: npx skills add https://github.com/flext-sh/flext --skill rules-typings

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) and rules (resource) components.

What problem does it solve?

This Skill ensures that Python type stubs and compatibility shims are accurately maintained, improving code quality and maintainability for static analysis tools.

Core Features & Use Cases

  • Stub Synchronization: Keeps .pyi files in sync with runtime Python API signatures.
  • Precise Typing: Encourages the use of specific type annotations over broad ones.
  • Use Case: When a function's signature changes in the main Python code, this Skill helps ensure the corresponding type stub file is updated immediately to reflect the change, preventing type-checking errors.

Quick Start

Update the .pyi signatures to match the runtime API changes in typings/.

Frequently Asked Questions about rules-typings

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

FAQPage Schema
How do I keep Python type stubs in sync with runtime API signatures?

To keep Python type stubs in sync with runtime API signatures, you update the `.pyi` files within the `typings/` directory to match any changes made in the main Python code. This prevents static analysis errors.

What are Python type stubs and when do I need them for static analysis?

Python type stubs are `.pyi` files providing precise type annotations for static analysis tools. You need them when maintaining local typing shims to ensure accurate type checking and synchronize with your runtime API.

Can I use typing_extensions compatibility shims with this stub validation approach?

Yes, this approach supports compatibility shims for specific packages like `typing_extensions`. It validates these local typing shims within the `typings/` directory to promote precise type annotations for enhanced static analysis.

Why does my static type checker show errors after changing a function signature?

Static type checking errors occur after changing a function signature if the corresponding Python type stub is not updated. You must immediately update the `.pyi` file to reflect the runtime API change.

What is the best way to manage local typing shims for Python packages?

The best way to manage local typing shims is by maintaining them in the `typings/` directory. This validates synchronization with runtime API signatures and encourages specific type annotations over broad ones for static analysis.