TypeScript patterns for strictness, any vs unknown, satisfies, unions, generics, and module boundaries. Load before any edit to a .ts, .tsx, or tsconfig file, however small, or for TS questions.
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Typescript Patterns?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/ku5ic-typescript-patterns)
---
name: typescript-patterns
description: TypeScript patterns for strictness, any vs unknown, satisfies, unions, generics, and module boundaries. Load before any edit to a .ts, .tsx, or tsconfig file, however small, or for TS questions.
---
# TypeScript patterns
Default assumption: TypeScript 7.0 with `strict` on, per the TypeScript release notes.
A row applies when the `typescript` version in the project's `package.json` and lockfile is at least its version.
## Reference files
Loading this skill isn't enough. Before your next edit, read the file of every row that matches it. The rules live in those files, and this one only points at them.
| Before | Read |
| --------------------------------------------------------------------- | ---------------------------------------------------------------- |
| Writing TypeScript, or raising the `typescript` version | [reference/upgrades.md](reference/upgrades.md) |
| Writing, changing, or reviewing TypeScript code | [reference/anti-patterns.md](reference/anti-patterns.md) |
| Writing a type, a narrowing check, a signature, or a type-only import | [reference/practices.md](reference/practices.md) |
| Configuring or running `tsc`, typescript-eslint, or a cycle checker | [reference/tooling.md](reference/tooling.md) |
| Writing or changing a `tsconfig.json` | [reference/tsconfig.md](reference/tsconfig.md) |
| Writing or changing a `.d.ts` file | [reference/declaration-files.md](reference/declaration-files.md) |