flext-strict-typing

Enforce strict typing rules with Mapping-first contracts and Pydantic v2 standards.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

This Skill enforces strict typing rules within the FLEXT ecosystem, preventing common type-related bugs and improving code maintainability and reliability.

Core Features & Use Cases

  • Mapping-First Policy: Enforces the use of Mapping over dict for contracts, promoting better interface design.
  • Modern Typing Syntax: Mandates modern Python typing features (e.g., X | None, list[X]) for clarity and conciseness.
  • Pydantic v2 Standards: Ensures Pydantic models adhere to the latest best practices, including ConfigDict and modern validator decorators.
  • Use Case: Ensure all API request and response payloads are strictly typed, preventing runtime errors due to unexpected data structures.

Quick Start

Run the validation checks for the flext-strict-typing skill to identify any typing violations.

Frequently Asked Questions about flext-strict-typing

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

FAQPage Schema
How do I enforce strict Python type safety and prevent Any usage in my codebase?

To enforce strict Python type safety, apply rules that prevent Any and dict usage in annotations, mandate explicit return types for functions, and require modern type-hinting standards across the codebase.

What is the best way to enforce Pydantic v2 best practices for API contracts?

Enforcing Pydantic v2 best practices involves ensuring models use ConfigDict and modern validator decorators, preventing unexpected data structures in API payloads and improving runtime safety.

Why use Mapping instead of dict for Python type annotations?

Using Mapping instead of dict for Python type annotations enforces a mapping-first contract policy, promoting better interface design and improving code maintainability within your ecosystem.

How do I mandate modern Python typing syntax like X | None and list[X]?

To mandate modern Python typing syntax, apply strict typing rules that require features like X | None and list[X] for all type annotations, ensuring clarity and conciseness across your Python codebase.

Does strict typing prevent runtime errors in API request and response payloads?

Yes, strict typing prevents runtime errors in API payloads by ensuring all request and response structures are strictly typed, avoiding failures due to unexpected data structures.