typing-patterns

typing-patterns is a skill for Claude Code, Codex from ruslan-korneev/claude-plugins. It costs 0 tokens per session (1,384 once invoked), scanned A, original, MIT.

A Python typing skill that explains how to add precise type annotations without using type: ignore, which suppresses a type-checking error.

In plain words
What is it for?
Use it for generics, protocols, type variables, typed dictionaries, and other Python annotation problems.
Why use it?
It addresses type-checker errors directly instead of hiding possible bugs or leaving technical debt.

Skill for Claude CodeCodex

Installs and runs on its own, but its text points at files inside its plugin — anything it tells you to read at a ${CLAUDE_PLUGIN_ROOT} path is only there once the plugin is installed. Installing the plugin gets both.

Part of the python plugin — 4 skills, 10 commands, 1 agent, 1 hook shipped together

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/ruslan-korneev/claude-plugins/typing-patterns
Any agent
npx skills add ruslan-korneev/claude-plugins --skill typing-patterns
Clone the repo
git clone --depth 1 https://github.com/ruslan-korneev/claude-plugins

Made for: Claude Code, Codex.

Or install python, the plugin that ships this one along with the rest of its 4 skills, 10 commands, 1 agent, 1 hook.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for typing-patterns

README.md
[![agentmods](https://agentmods.dev/badge/skills/ruslan-korneev/claude-plugins/typing-patterns.svg)](https://agentmods.dev/skills/ruslan-korneev/claude-plugins/typing-patterns)
Your own site
<a href="https://agentmods.dev/skills/ruslan-korneev/claude-plugins/typing-patterns"><img src="https://agentmods.dev/badge/skills/ruslan-korneev/claude-plugins/typing-patterns.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,384 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00000 $0.01384
Opus 5 $0.00000 $0.00692
Sonnet 5 $0.00000 $0.00277
Haiku 4.5 $0.00000 $0.00138

Measured 4d ago against content hash be8e07f92b65, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

typing-patterns scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugins/python/skills/typing-patterns/SKILL.md · 277 lines

How it starts

The opening of the file, as written. The whole thing — 277 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Python Typing Patterns

Python type annotation patterns without type: ignore. Always the correct solution.

Triggers

Use this skill when the user:

  • Gets mypy/pyright errors
  • Asks about Python type annotations
  • Wants to add type hints
  • Works with generics, protocols, TypeVar

Main Principle: NEVER type: ignore

Every type error has a correct solution. type: ignore is:

  • Masking potential bugs
  • Disabling type checking
  • Technical debt

More details: ${CLAUDE_PLUGIN_ROOT}/skills/typing-patterns/references/why-no-type-ignore.md

Dictionary Typing — TypedDict Instead of dict

More details: ${CLAUDE_PLUGIN_ROOT}/skills/typing-patterns/references/dict-typing.md

# Bad: Weak level
def process(data: dict): ...

# Warning: Medium level
def process(data: dict[str, Any]): ...

# Good: Strong level
class UserData(TypedDict):
    id: int
    email: str
    name: str

def process(data: UserData): ...

Why TypedDict is better:

  • Key checking at compile time (data["emial"] → error)
  • Value type checking
  • IDE autocomplete
  • Data structure documentation

When dict[K, V] is acceptable:

  • Homogeneous collections: dict[str, User], dict[int, float]
  • Caches, counters, ID → object mappings

Basic Types (Python 3.10+)

# Primitives
x: int = 1
y: str = "hello"
z: bool = True
f: float = 1.5

# Collections (built-in)
items: list[str] = ["a", "b"]
mapping: dict[str, int] = {"a": 1}
unique: set[int] = {1, 2, 3}
pair: tuple[int, str] = (1, "a")

# Union (Python 3.10+)
value: int | str = 1
optional: str | None = None

# Callable
from collections.abc import Callable
handler: Callable[[int, str], bool] = lambda x, s: True

Generics

More details: ${CLAUDE_PLUGIN_ROOT}/skills/typing-patterns/references/generics.md

from typing import TypeVar, Generic

T = TypeVar("T")
K = TypeVar("K")
V = TypeVar("V")


class Repository(Generic[T]):
    def get(self, id: int) -> T | None: ...
    def save(self, item: T) -> T: ...


# Usage
class UserRepository(Repository[User]):
    pass


# Python 3.12+ syntax
class Repository[T]:
    def get(self, id: int) -> T | None: ...

Read the full file on GitHub · 277 lines

Files

What ships with it

3 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago First seen · 277 lines · 0 tokens per session scan A be8e07f92b65

Subscribe to this mod's changes

typing-patterns is a skill published in the GitHub repository ruslan-korneev/claude-plugins (4 stars, last pushed 6mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,384 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

writing-python

How Python is written in this repo — free functions over classes, structured returns instead of mutated arguments, comprehensions, no module state, and the stdlib-only, annotation-free, Python 3.8 dialect the AST lints enforce. Covers modular structure and the import-layer rule, DRY without copying a helper into a…

AleksandarBisevac/claude-plugins · 161 tokens

no-silent-pass

Write Python whose failures are visible and checks that actually fire — distinct sentinels for success and error, filters that narrow to nothing without reading as "all clear", output never discarded on a non-zero exit, and selftest cases proven red before they are trusted (mutate the fix, mutate it the other way too…

AleksandarBisevac/claude-plugins · 143 tokens

postgres-database-migration

Use this skill for planning, testing, and safely executing PostgreSQL schema migrations — especially when working with production data or shared databases. Trigger when user asks to: Test a schema migration before applying it to production Add, remove, or rename columns safely on a live table Change a column's data…

timescale/pg-aiguide · 222 tokens

setup-timescaledb-hypertables

Use this skill when creating database schemas or tables for Timescale, TimescaleDB, TigerData, or Tiger Cloud, especially for time-series, IoT, metrics, events, or log data. Use this to improve the performance of any insert-heavy table. Trigger when user asks to: Create or design SQL schemas/tables AND…

timescale/pg-aiguide · 219 tokens

design-postgis-tables

Comprehensive PostGIS spatial table design reference covering geometry types, coordinate systems, spatial indexing, and performance patterns for location-based applications.

timescale/pg-aiguide · 31 tokens

pgvector-semantic-search

Use this skill for setting up vector similarity search with pgvector for AI/ML embeddings, RAG applications, or semantic search. Trigger when user asks to: Store or search vector embeddings in PostgreSQL Set up semantic search, similarity search, or nearest neighbor search Create HNSW or IVFFlat indexes for vectors…

timescale/pg-aiguide · 190 tokens