type-hints-guide

type-hints-guide is a skill for Claude Code from VersoXBT/claude-initial-setup. It costs 79 tokens per session (1,840 once invoked), scanned A, original, MIT.

A guide to adding type annotations to Python code, including descriptions for values, functions, reusable classes, and callback relationships.

In plain words
What is it for?
Use it to type Python functions, generic classes, data structures, callbacks, and library interfaces.
Why use it?
It makes code contracts clearer and lets tools such as mypy or pyright find some mistakes before the program runs.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the claude-initial-setup plugin — 75 skills, 15 commands, 14 agents, 2 hooks shipped together

Good fit Use it to type Python functions, generic classes, data structures, callbacks, and library interfaces.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/versoxbt/claude-initial-setup/type-hints-guide
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 VersoXBT/claude-initial-setup --skill type-hints-guide
Clone the repo
git clone --depth 1 https://github.com/VersoXBT/claude-initial-setup

Made for: Claude Code.

Or install claude-initial-setup, the plugin that ships this one along with the rest of its 75 skills, 15 commands, 14 agents, 2 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 type-hints-guide

README.md
[![agentmods](https://agentmods.dev/badge/skills/versoxbt/claude-initial-setup/type-hints-guide/github.svg)](https://agentmods.dev/skills/versoxbt/claude-initial-setup/type-hints-guide)
Your own site
<a href="https://agentmods.dev/skills/versoxbt/claude-initial-setup/type-hints-guide"><img src="https://agentmods.dev/badge/skills/versoxbt/claude-initial-setup/type-hints-guide/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 type-hints-guide

Your own site · 80×15
<a href="https://agentmods.dev/skills/versoxbt/claude-initial-setup/type-hints-guide"><img src="https://agentmods.dev/badge/skills/versoxbt/claude-initial-setup/type-hints-guide.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 79 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,840 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.00079 $0.01840
Opus 5.5 $0.00032 $0.00736
Sonnet 5.5 $0.00016 $0.00368
Haiku 4.5 $0.00008 $0.00184

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

Security

Grade A, and why

type-hints-guide 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 2mo 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.

skills/python/type-hints-guide/SKILL.md · 242 lines

How it starts

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

Python Type Hints Guide

Write precise, expressive type annotations that catch bugs at static analysis time. Modern Python typing (3.10+) is powerful enough to express complex relationships without runtime overhead.

When to Use

  • User writes or refactors Python functions without type hints
  • User asks about typing, generics, or protocols
  • User encounters mypy or pyright errors
  • User builds libraries or APIs that need clear contracts
  • User works with complex data structures or callbacks

Core Patterns

Modern Built-in Types (Python 3.10+)

Prefer built-in generics and union syntax over typing imports.

# Python 3.10+ -- use built-in types and | union
def process_items(
    items: list[str],
    config: dict[str, int | float],
    callback: Callable[[str], None] | None = None,
) -> tuple[int, list[str]]:
    ...

# For older Python, import from typing
from typing import List, Dict, Optional, Union, Tuple

TypeVar and Generic Classes

Use TypeVar for functions/classes that work with any type while preserving type relationships.

from typing import TypeVar, Generic

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

class Result(Generic[T]):
    """A container that holds either a value or an error."""

    def __init__(self, value: T | None = None, error: str | None = None):
        self._value = value
        self._error = error

    def unwrap(self) -> T:
        if self._error is not None:
            raise ValueError(self._error)
        assert self._value is not None
        return self._value

    def map(self, func: Callable[[T], V]) -> "Result[V]":
        if self._error:
            return Result(error=self._error)
        return Result(value=func(self.unwrap()))

# Bounded TypeVar -- restrict to specific types
Numeric = TypeVar("Numeric", int, float)

def add(a: Numeric, b: Numeric) -> Numeric:
    return a + b

# Upper bound -- must be subclass of
from datetime import datetime
DateLike = TypeVar("DateLike", bound=datetime)

Read the full file on GitHub · 242 lines

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 · 242 lines · 79 tokens per session scan A 6ed8a0c9665a

Subscribe to this mod's changes

type-hints-guide is a skill published in the GitHub repository VersoXBT/claude-initial-setup (4 stars, last pushed 6mo ago), licensed MIT. It adds 79 tokens to every session and 1,840 once invoked, about $0.0003 per session on Opus 5.5. 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-09-03.

Related

type-hints-guide compared with skills from other repositories

type-hints-guide next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
type-hints-guideVersoXBT/claude-initial-setupSkill46mo agoMITA79Claude Code
fastapi-templateswshobson/agentsSkill43k6d agoMITA37Claude Code
temporal-python-testingwshobson/agentsSkill43k6d agoMITA45Claude Code
py-debugberekvolgyipeter/dotclaudeSkill2yesterdayMITA54Claude Code, Codex
python-conventionstmj-90/gafferSkill1yesterdayApache-2.0A120Claude Code, Codex
sota-pythonmartinholovsky/SOTA-skillsSkill31yesterdayCC-BY-4.0A141Claude Code
python-expertApexIQ/skillsmithSkill58mo agoMITA47Claude Code, Codex