# typescript-advanced

Guides agents through advanced TypeScript types and compile-time contracts. Use it when generic inference or reusable type utilities are the hard part.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode · 552 installs · ★ 643
- Author: Pedro Nauck
- License: not stated · policy=link-only · description only; the file stays with the author
- Source: https://github.com/pedronauck/skills/tree/HEAD/skills/mine/typescript-advanced/SKILL.md
- Updated: 2026-10-20
- HTML: https://affpapa.org/en/nevibecode/skills/typescript-advanced

## What it does

This skill covers TypeScript work involving generics, conditional and mapped types, template literal types, and inference. Its reference files focus on core concepts, reusable patterns, inference and narrowing, plus compiler settings and maintainability: `references/core-concepts.md`, `references/advanced-patterns.md`, `references/type-inference.md`, and `references/best-practices.md`.

The guidance favors small types that express the needed contract. At boundaries with untrusted values, it recommends `unknown` followed by narrowing. It also says to keep the project’s existing `tsconfig`; sample configurations are not a reason to change it. Run the repository’s affected typecheck gate. For one ordinary call site, the skill advises against building an elaborate generic framework.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add pedronauck/skills --skill typescript-advanced -a claude-code
```

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

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add pedronauck/skills --skill typescript-advanced -a codex
```

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

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add pedronauck/skills --skill typescript-advanced -a cursor
```

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

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install pedronauck/skills typescript-advanced
```

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

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add pedronauck/skills --skill typescript-advanced -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/pedronauck/skills --path skills/mine/typescript-advanced
```

### Windsurf (Devin Desktop)

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

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add pedronauck/skills --skill typescript-advanced -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/pedronauck/skills/tree/HEAD/skills/mine/typescript-advanced/SKILL.md

## When to use it
- infer a function’s return type from its generic arguments
- model relationships with conditional and mapped types
- build reusable utilities for deeply nested types
- test type narrowing and inference at compile time
- keep advanced types aligned with the existing `tsconfig`

## Example prompts
- Infer this function’s result type from its arguments using generics.
- Model this relationship with conditional types and `infer`.
- Check this type contract and suggest a compile-time test in the existing suite.

## Similar
- [migrate-to-shoehorn](https://affpapa.org/en/nevibecode/skills/migrate-to-shoehorn.md) — skill · 475388 installs
- [write-swift](https://affpapa.org/en/nevibecode/skills/write-swift.md) — skill · 119300 installs
- [megacave](https://affpapa.org/en/nevibecode/skills/megacave.md) — skill · 25400 installs
- [find-docs](https://affpapa.org/en/nevibecode/skills/find-docs.md) — skill · 9400 installs
- [typescript-advanced-types](https://affpapa.org/en/nevibecode/skills/typescript-advanced-types.md) — skill · 92169 installs
- [smart-explore](https://affpapa.org/en/nevibecode/skills/smart-explore.md) — skill · 7300 installs

From the same set: [pedronauck/skills](https://affpapa.org/en/nevibecode/by/pedronauck/skills.md) — 18 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
