code

Enforce Python type hints, error handling, and Pydantic v2 validation.

Updated Apr 20, 2026
One-click install
npx skills add https://github.com/juanmanueldaza/invencible --skill code-juanmanueldaza
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: code
Source: https://github.com/juanmanueldaza/invencible/tree/main/.claude/skills/code
Command: npx skills add https://github.com/juanmanueldaza/invencible --skill code-juanmanueldaza

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Python language standards define a baseline for type hints, error handling, logging, and style conventions to improve code reliability and maintainability.

Core Features & Use Cases

  • REJECT: Missing type hints on public functions or methods
  • REJECT: Bare except: without a specific exception type
  • REJECT: print() used in production code (use logging instead)
  • REJECT: Mutable default arguments (e.g., def f(x=[]):)
  • REQUIRE: from __future__ import annotations in all modules
  • REQUIRE: Type hints on all public functions and class attributes
  • REQUIRE: Pydantic v2 for data validation models
  • PREFER: Early returns over deeply nested conditionals
  • PREFER: pathlib.Path over os.path for filesystem operations
  • PREFER: Dataclasses or Pydantic over raw dicts for structured data

Quick Start

Audit a Python module to ensure type hints, proper error handling, and logging are in place.

Frequently Asked Questions about code

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

FAQPage Schema
How do I enforce Python type hints and coding standards across my modules?

You enforce Python coding standards by auditing modules to require type hints on public functions, mandate `from __future__ import annotations`, and reject mutable default arguments. This process ensures consistent style and improves code reliability.

Why should I use pathlib instead of os.path for filesystem operations in Python?

Using `pathlib.Path` is preferred over `os.path` for filesystem operations to align with modern Python coding standards. This approach provides an object-oriented interface for path manipulation, improving code readability and maintainability.

What is the best way to handle error handling and logging in production Python code?

Proper error handling and logging in production Python code requires using the `logging` module instead of `print()` statements. Additionally, you must reject bare `except:` clauses and always catch specific exception types.

Does this coding standard require Pydantic for data validation?

Yes, this coding standard requires Pydantic v2 for data validation models. It also prefers using dataclasses or Pydantic models over raw dictionaries to ensure structured data is properly validated and typed.

Can I use deeply nested conditionals when writing Python modules with these standards?

No, you should avoid deeply nested conditionals when writing Python modules. The standard prefers early returns to flatten the code structure, which simplifies logic and enhances overall code reliability.

What are the limitations of using bare except clauses in Python error handling?

Bare `except:` clauses are actively rejected because they catch all exceptions indiscriminately, including system exits. Catching specific exception types is enforced to prevent masking real errors and breaking application control flow.