Skip to content
This repository was archived by the owner on Mar 23, 2026. It is now read-only.

v0.1.0 - Initial Release

Choose a tag to compare

@tmustier tmustier released this 31 Dec 21:40
· 2 commits to main since this release

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