python-typing-ops

python-typing-ops is a skill for Claude Code from 0xDarkMatter/claude-mods. It costs 44 tokens per session (1,487 once invoked), scanned A, original, MIT.

A guide to adding type annotations to Python code so values, function inputs, and outputs are clearly described.

In plain words
What is it for?
It is for using type hints, generic types, protocols, typed dictionaries, and tools such as mypy or pyright.
Why use it?
It helps catch incorrect values earlier and makes Python code easier to understand and maintain.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

Part of the claude-mods plugin — 112 skills, 3 commands, 3 agents, 4 hooks shipped together

Good fit It is for using type hints, generic types, protocols, typed dictionaries, and tools such as mypy or pyright.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/0xdarkmatter/claude-mods/python-typing-ops
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.

Any agent
npx skills add 0xDarkMatter/claude-mods --skill python-typing-ops
Clone the repo
git clone --depth 1 https://github.com/0xDarkMatter/claude-mods

Made for: Claude Code.

Or install claude-mods, the plugin that ships this one along with the rest of its 112 skills, 3 commands, 3 agents, 4 hooks.

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 python-typing-ops

README.md
[![agentmods](https://agentmods.dev/badge/skills/0xdarkmatter/claude-mods/python-typing-ops/github.svg)](https://agentmods.dev/skills/0xdarkmatter/claude-mods/python-typing-ops)
Your own site
<a href="https://agentmods.dev/skills/0xdarkmatter/claude-mods/python-typing-ops"><img src="https://agentmods.dev/badge/skills/0xdarkmatter/claude-mods/python-typing-ops/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for python-typing-ops

Your own site · 80×15
<a href="https://agentmods.dev/skills/0xdarkmatter/claude-mods/python-typing-ops"><img src="https://agentmods.dev/badge/skills/0xdarkmatter/claude-mods/python-typing-ops.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 44 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,487 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 1 finding, up to medium

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • medium MCP Rug Pull · line 208
    uvx/uv tool run commands without ==version create a rug-pull risk.
    Fix: Pin the version: uvx package-name==1.2.3
How audits are shown
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.1 $0.00044 $0.01487
Opus 5.5 $0.00018 $0.00595
Sonnet 5.5 $0.00009 $0.00297
Haiku 4.5 $0.00004 $0.00149

Measured 2mo ago against content hash 65471286a971, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

python-typing-ops scanned grade A with 1 finding 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 2mo ago.

The scan reads SKILL.md. This mod also ships 1 executable file (scripts/check-types.sh), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

def fetch(url: str, timeout: float | None = None) -> bytes:
skills/python-typing-ops/SKILL.md · 240 lines

How it starts

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

Python Typing Patterns

Modern type hints for safe, documented Python code.

Basic Annotations

# Variables
name: str = "Alice"
count: int = 42
items: list[str] = ["a", "b"]
mapping: dict[str, int] = {"key": 1}

# Function signatures
def greet(name: str, times: int = 1) -> str:
    return f"Hello, {name}!" * times

# None handling
def find(id: int) -> str | None:
    return db.get(id)  # May return None

Collections

from collections.abc import Sequence, Mapping, Iterable

# Use collection ABCs for flexibility
def process(items: Sequence[str]) -> list[str]:
    """Accepts list, tuple, or any sequence."""
    return [item.upper() for item in items]

def lookup(data: Mapping[str, int], key: str) -> int:
    """Accepts dict or any mapping."""
    return data.get(key, 0)

# Nested types
Matrix = list[list[float]]
Config = dict[str, str | int | bool]

Optional and Union

# Modern syntax (3.10+)
def find(id: int) -> User | None:
    pass

def parse(value: str | int | float) -> str:
    pass

# With default None
def fetch(url: str, timeout: float | None = None) -> bytes:
    pass

TypedDict

from typing import TypedDict, Required, NotRequired

class UserDict(TypedDict):
    id: int
    name: str
    email: str | None

class ConfigDict(TypedDict, total=False):  # All optional
    debug: bool
    log_level: str

class APIResponse(TypedDict):
    data: Required[list[dict]]
    error: NotRequired[str]

def process_user(user: UserDict) -> str:
    return user["name"]  # Type-safe key access

Callable

from collections.abc import Callable

# Function type
Handler = Callable[[str, int], bool]

def register(callback: Callable[[str], None]) -> None:
    pass

# With keyword args (use Protocol instead)
from typing import Protocol

class Processor(Protocol):
    def __call__(self, data: str, *, verbose: bool = False) -> int:
        ...

Generics

from typing import TypeVar

T = TypeVar("T")

def first(items: list[T]) -> T | None:
    return items[0] if items else None

# Bounded TypeVar
from typing import SupportsFloat

N = TypeVar("N", bound=SupportsFloat)

def average(values: list[N]) -> float:
    return sum(float(v) for v in values) / len(values)

Read the full file on GitHub · 240 lines

Files

What ships with it

8 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. 2mo ago First seen · 240 lines · 44 tokens per session scan A 65471286a971

Subscribe to this mod's changes

python-typing-ops is a skill published in the GitHub repository 0xDarkMatter/claude-mods (79 stars, last pushed 7d ago), licensed MIT. It adds 44 tokens to every session and 1,487 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

python-typing-ops compared with skills from other repositories

python-typing-ops next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
python-typing-ops0xDarkMatter/claude-modsSkill797d agoMITA44Claude Code
agent-django-fastapi-experttravisjneuman/.claudeSkill1072d agoMITA92Claude Code
ai-ml-developmenttravisjneuman/.claudeSkill1072d agoMITA43Claude Code, Codex
agent-python-experttravisjneuman/.claudeSkill1072d agoMITA37Claude Code
python-logging-best-practicesterrylica/cc-skillsSkill2yesterdayMITA34Claude Code
python-memory-safe-scriptsterrylica/cc-skillsSkill2yesterdayMITA197Claude Code
pypi-dopplerterrylica/cc-skillsSkill2yesterdayMITA42Claude Code