# Type Hints

Type Hints — a skill that walks the agent through Python annotations and mypy setup, from function signatures to Protocol, TypedDict and strict mode.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode, Windsurf (Devin Desktop), Claude.ai · 128 installs · ★ 7 repo stars
- Author: pluginagentmarketplace
- License: LicenseRef-Proprietary · policy=link-only · description only; the file stays with the author
- Source: https://github.com/pluginagentmarketplace/custom-plugin-python/tree/HEAD/skills/type-hints/SKILL.md
- Updated: 2026-01-05
- Security check: automated, 2026-11-16 (text) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/skills/type-hints

## What it does

The skill covers annotated Python end to end. Basic annotations come first: variables, function signatures, return types, Optional and Union. Then the advanced layer: generics, TypeVar, ParamSpec, Protocol, Literal, TypedDict.

Type checking gets a section of its own — mypy config, strict settings, `# type: ignore` comments, `.pyi` stub files and type coverage. Runtime typing follows: `typing_extensions`, Pydantic validation, typed dataclasses, attrs. The last block is practice: gradual adoption, stubs for third-party packages, checking in CI.

It is bonded to the `07-best-practices` agent, so the material feeds code-review work rather than teaching syntax from scratch. Python and OOP basics are a prerequisite here. TypeVar and Protocol assume you already read ordinary class code.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add pluginagentmarketplace/custom-plugin-python --skill type-hints -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/type-hints/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/type-hints/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add pluginagentmarketplace/custom-plugin-python --skill type-hints -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/type-hints/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add pluginagentmarketplace/custom-plugin-python --skill type-hints -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/type-hints/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install pluginagentmarketplace/custom-plugin-python skills/type-hints
```

2. **Manually: put the files in place**
- File: `.github/skills/type-hints/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add pluginagentmarketplace/custom-plugin-python --skill type-hints -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/pluginagentmarketplace/custom-plugin-python --path skills/type-hints
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/type-hints/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add pluginagentmarketplace/custom-plugin-python --skill type-hints -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/pluginagentmarketplace/custom-plugin-python/tree/HEAD/skills/type-hints/SKILL.md

## When to use it
- Annotate a legacy module without rewriting its logic
- Switch mypy to strict and clear out stale `# type: ignore` lines
- Describe an interface as a Protocol instead of a base class
- Add a type check step to CI
- Write stubs for a library that ships none

## Example prompts
- Go through `billing.py` and add type hints to the public functions.
- Why does mypy reject this `Optional`? Show the strict-mode fix.
- Replace this `dict` with a `TypedDict` and tell me what changes.

## Similar
- [Python Type Hints taste](https://affpapa.org/en/nevibecode/prompts/python-type-hints-taste.md) — prompt · ★ 178201 repo stars
- [mypy](https://affpapa.org/en/nevibecode/skills/mypy.md) — skill · 484 installs
- [typing-exclusion-worker](https://affpapa.org/en/nevibecode/skills/typing-exclusion-worker.md) — skill · 1700 installs
- [ty-skills](https://affpapa.org/en/nevibecode/skills/ty-skills.md) — skill · 133 installs
- [python-type-safety](https://affpapa.org/en/nevibecode/skills/python-type-safety.md) — skill · 12643 installs
- [python-pro](https://affpapa.org/en/nevibecode/skills/httpsgithubcomjeffallan-python-pro.md) — skill · 9300 installs

From the same set: [pluginagentmarketplace/custom-plugin-python](https://affpapa.org/en/nevibecode/by/pluginagentmarketplace/custom-plugin-python.md) — 12 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
