Skip to content

Releases: tmustier/python-typing

v0.1.1 - Self-Typing

31 Dec 21:54

Choose a tag to compare

Python Typing Skill v0.1.1

What's Changed

The skill now dogfoods itself - all scripts and tests pass pyright strict mode with 0 errors.

Improvements

  • Added strict type annotations to all scripts (init_typing.py, analyze_typing.py)
  • Added strict type annotations to all test files
  • Configured pyright to discover pytest types from venv
  • Fixed CompletedProcess[str] return type annotations

Technical Details

  • Uses from __future__ import annotations for Python 3.9 compatibility
  • pyproject.toml now configures venv discovery for type checking
  • All 18 tests pass with 0 pyright strict mode errors

Full Changelog: v0.1.0...v0.1.1

v0.1.0 - Initial Release

31 Dec 21:40

Choose a tag to compare

Python Typing Skill v0.1.0

An agent skill for migrating Python codebases to strict type checking with pyright.

Features

Setup Automation

  • scripts/init_typing.py - Initialize typing setup in any project
  • Creates pyrightconfig.json (strict/standard/basic modes)
  • Installs typing discipline rules
  • Sets up pre-commit hook (warns on errors)
  • Optional long-task-harness integration for progress tracking
  • Optional ralph-wiggum integration for iteration loops (Claude Code only)

Fix Patterns & Guidance

  • references/patterns.md - Common fix patterns organized in 6 layers:
    1. Quick wins (unused imports, missing return types)
    2. Annotation completeness (parameters, attributes)
    3. Type safety (None checks, narrowing, unions)
    4. Structural patterns (TypedDict, Protocol, conditional imports)
    5. External dependencies (stubs, third-party workarounds)
    6. Edge cases (complex generics, metaprogramming)
  • references/faq.md - Detailed FAQ for common questions

Typing Discipline Rules

Enforced via long-task-harness rules:

  • block-type-ignore - No # type: ignore without documentation
  • block-gratuitous-assert - Warns on assert x is not None hacks
  • warn-any-type - Warns on explicit Any usage
  • warn-cast-overuse - Warns on cast() usage

Analysis Tools

  • scripts/analyze_typing.py - Analyze error distribution
    • Breakdown by error type with hints
    • Breakdown by file
    • Suggested starting point

Installation

git clone https://github.com/tmustier/python-typing ~/.claude/skills/python-typing

Usage

Ask your AI agent:

Set up strict type checking for this project

Tests

18 tests covering:

  • init_typing.py functionality (10 tests)
  • analyze_typing.py parsing (8 tests)
  • Test fixtures with known error counts

Run with:

uv run pytest tests/ -v

Requirements

  • Python 3.9+
  • pyright (via npm or pip)
  • Optional: long-task-harness, ralph-wiggum

License

MIT