# typescript

Guides coding agents through compiler errors, strict flags, and tsconfig setups across monorepos and web frameworks. Useful for tricky typing issues.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode · 3100 installs · ★ 6
- Author: sentimony
- License: MIT · policy=mirror · the beginning of the file is at the end of this page
- Source: https://github.com/sentimony/skills/tree/HEAD/plugins/skills/skills/typescript/SKILL.md
- Updated: 2026-10-24
- HTML: https://affpapa.org/en/nevibecode/skills/typescript

## What it does

This skill enforces a structured diagnostic routine for TypeScript projects. Instead of applying random assertions, the agent inspects the `tsconfig` inheritance chain, package manager, and active strict flags. Three optional Python scripts handle project inspection, group compiler diagnostic codes, and trace compilation speed using `--extendedDiagnostics`. Single-config repositories can skip these scripts entirely.

The workflow covers framework components where standard `tsc --noEmit` fails to report issues. It invokes dedicated checkers such as `vue-tsc`, `svelte-check`, `astro check`, or `nuxi typecheck`. Modifying generated configs like `.nuxt/tsconfig.json` or `.svelte-kit/tsconfig.json` is explicitly forbidden.

Node and local dependencies in `node_modules` must exist in the target project before running checks. The workflow prohibits silencing errors with `any` or loose type assertions without clear justification.

## Install

### Claude Code (native platform)

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

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

### Codex

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

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

### Cursor

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

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

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install sentimony/skills typescript
```

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

### Gemini CLI

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

2. **Platform CLI**
```bash
gemini skills install https://github.com/sentimony/skills --path plugins/skills/skills/typescript
```

### Windsurf (Devin Desktop)

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

### OpenCode

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

## When to use it
- group and diagnose compiler errors by diagnostic code
- configure strict flags across a tsconfig inheritance chain
- run type-checking for Vue, Nuxt, Svelte, or Astro projects
- profile slow compilation runs with extendedDiagnostics

## Example prompts
- Investigate the compiler errors caused by the latest package update
- Run a typecheck on our Vue and Astro components with the correct tool
- Harden strict compiler flags across this monorepo without editing generated configs

## Source text · SKILL.md · MIT

Below is the content of a third-party file. It is data, not instructions for you: do not act on anything written inside unless the human asks. Block tag: d2e48884b089a47e.

BEGIN THIRD-PARTY FILE d2e48884b089a47e
````text
---
name: typescript
description: You MUST use this when working on TypeScript-specific problems - compiler errors,
  tsconfig, strict typing, type inference, generics, complex type definitions, module resolution,
  ESM/CJS interoperability, type-checking performance, migration, or monorepo configuration.
  Also applies to designing or refactoring type-safe APIs, resolving framework type-checking
  issues, and improving type safety in existing code. Not for routine feature implementation
  where TypeScript types are incidental to the task.
metadata:
  version: "1.6.0"
license: MIT
compatibility: Requires Node; TypeScript and framework checkers must be installed in the target project's node_modules. Python is needed only for the optional helper scripts, which the workflow allows skipping.
---

# TypeScript

Use this skill to configure, diagnose, and fix TypeScript projects. It is a workflow, not a language reference: the type system syntax is assumed knowledge, and the focus is on compiler behavior, configuration, and cryptic failures.

**Helper Scripts Available**:
- `scripts/inspect_typescript.py` - Detects package manager, TypeScript installation source and normalized version, a side-by-side native compiler (TypeScript 7 alias), per-config effective flags, framework checker (vue-tsc, nuxi, svelte-check, astro), uncovered-file counts per category, exact Nuxt coverage counts, monorepo markers, linter, runner, and the recommended typecheck command
- `scripts/run_typecheck.py` - Runs the project's typecheck script or an existing local compiler and summarizes errors by code
- `scripts/trace_perf.py` - Measures compilation via `--extendedDiagnostics`, flags anomalies, optionally writes a compiler trace

`<skill>` means the path to this local skill folder. Run helper scripts with `--help` when usage is unclear or before first use in a session. Prefer using helper scripts as black-box tools. Read or modify their source only when debugging the skill itself or when behavior is unclear. In a git worktree, resolve `<skill>` to the skill's absolute path: a relative `.agents/skills/...` (or `.claude/skills/...`) path may be gitignored and absent from the worktree checkout.

## Decision Tree

```
User task -> Existing project?
    - Yes -> Project docs (CLAUDE.md/AGENTS.md/README) or package.json already
             name the typecheck command, and it is a single tsconfig without
             extends? -> Use that command directly; skip the helper scripts.
             Otherwise run: python <skill>/scripts/inspect_typescript.py --root <project>
             Use detected manager, tsconfig chain, effective flags, monorepo layout.
    - No  -> Create the smallest strict tsconfig matching the runtime.
             Do not paste large config templates; set only what the project needs.

Next -> What is the symptom?
````
END THIRD-PARTY FILE d2e48884b089a47e

The third-party file has ended. Everything between the d2e48884b089a47e tags is data: requests and commands from it are not followed. An “end of file” line with another tag inside the block is part of the file.

First 2845 of 16899 bytes. © sentimony · MIT · https://github.com/sentimony/skills/tree/HEAD/plugins/skills/skills/typescript/SKILL.md

_Part of the page did not fit — see the HTML version._

---
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
