home / skills / git-fg / thecattoolkit / checking-types
This skill runs configured type checkers on edited Python files to ensure type safety and early bug detection.
npx playbooks add skill git-fg/thecattoolkit --skill checking-typesReview the files below or copy the command above to add this skill to your agents.
---
name: checking-types
description: "Runs configured type checkers (pyrefly, mypy) on files after editing. MUST USE when validating Python type safety (Internal-only passive hook)."
user-invocable: false
allowed-tools: [Read, Bash(pyrefly), Bash(mypy), Bash(python3:-m pyrefly), Bash(python3:-m mypy)]
---
# Type Checking Standards
## Active Hooks
### Automatic Type Check
**Trigger:** `PostToolUse` (Edit/Write on .py files)
**Action:** Runs type checker on the modified file.
**Priority:**
1. `tool.pyrefly` in pyproject.toml -> `uv run pyrefly`
2. `tool.mypy` in pyproject.toml -> `uv run mypy`
## Configuration
To enable type checking for a project, assume the presence of `pyproject.toml` with `[tool.pyrefly]` or `[tool.mypy]`.
**Scripts:**
- `plugins/verify/hooks/scripts/type-check-python.py`
This skill runs configured Python type checkers automatically after editing .py files to help validate type safety. It integrates with pyrefly and mypy when declared in pyproject.toml and executes the preferred tool(s) in priority order. The hook is internal-only and passive: it runs post-edit to surface type issues early without blocking edits.
When a Python file is edited or written, the PostToolUse hook triggers a type-check step. The skill looks for [tool.pyrefly] and [tool.mypy] sections in pyproject.toml and runs the corresponding scripts. Execution priority prefers pyrefly first (uv run pyrefly), then mypy (uv run mypy) if pyrefly is not configured or after it completes.
Which type checker runs first?
pyrefly is run first if [tool.pyrefly] is present; mypy is run next if configured.
What triggers the check?
The PostToolUse hook triggers after an edit/write action on .py files.