Skip to content
Back to skills

Typescript Patterns

ASecurity

TypeScript patterns - strictness flags, type-safety anti-patterns, and a review checklist covering any vs unknown, satisfies, branded types, discriminated unions, generic constraints, and module boundaries. Use whenever the project contains `.ts`/`.tsx` files, a `tsconfig*.json`, or `typescript` in `package.json`, OR the user asks about TypeScript, its type system, or its compiler config, even if "TypeScript" is not mentioned by name.

  • 2 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added October 5, 2026
ai-agentsjavascripttypescriptgojavanodeexpress

Security analysis

A100/100

Pro scans all 6 files and shows the line behind each finding

Scanned October 5, 2026

npx -y skills add ku5ic/claude-kit --skill typescript-patterns --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Typescript Patterns?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Typescript Patterns
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/ku5ic-typescript-patterns/badge)](https://www.skillsdirectory.com/skills/ku5ic-typescript-patterns)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: typescript-patterns
description: TypeScript patterns - strictness flags, type-safety anti-patterns, and a review checklist covering any vs unknown, satisfies, branded types, discriminated unions, generic constraints, and module boundaries. Use whenever the project contains `.ts`/`.tsx` files, a `tsconfig*.json`, or `typescript` in `package.json`, OR the user asks about TypeScript, its type system, or its compiler config, even if "TypeScript" is not mentioned by name.
---

# TypeScript patterns

Default assumption: a TypeScript project with `strict` mode enabled.

- If `strict` is off, that itself is a finding.
- Verify version-sensitive claims (which flags exist, which syntax is available) against the `typescript` version pinned in the project's `package.json` and lockfile before applying deltas below.

## Reference files

| File                                                             | Covers                                                                                                     |
| ---------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- |
| [reference/strictness.md](reference/strictness.md)               | Strictness flags, tsconfig review, incremental migration patterns                                          |
| [reference/type-expressions.md](reference/type-expressions.md)   | `unknown` vs `any`, `satisfies`, discriminated unions, branded types, generic constraints, common patterns |
| [reference/narrowing.md](reference/narrowing.md)                 | `typeof` / `in` / `instanceof`, predicates, exhaustiveness, `assertNever`                                  |
| [reference/module-boundaries.md](reference/module-boundaries.md) | `import type`, project references, circular imports, barrel-file anti-pattern                              |
| [reference/anti-patterns.md](reference/anti-patterns.md)         | Twelve review-time anti-patterns with severity calls                                                       |

## References

- TypeScript handbook: https://www.typescriptlang.org/docs/handbook/
- tsconfig reference: https://www.typescriptlang.org/tsconfig
- Release notes index: https://www.typescriptlang.org/docs/handbook/release-notes/overview.html
- `satisfies` operator (4.9): https://devblogs.microsoft.com/typescript/announcing-typescript-4-9/
- Variance annotations (4.7): https://devblogs.microsoft.com/typescript/announcing-typescript-4-7/
- `verbatimModuleSyntax` and `const` type parameters (5.0): https://devblogs.microsoft.com/typescript/announcing-typescript-5-0/
- typescript-eslint rules (`no-empty-object-type`, `prefer-ts-expect-error`, `no-explicit-any`): https://typescript-eslint.io/rules/
- Vercel: package import optimization (barrel files): https://vercel.com/blog/how-we-optimized-package-imports-in-next-js

## Version notes

Checked: 2026-09-26 against https://devblogs.microsoft.com/typescript/ and Context7 /microsoft/typescript

- 7.0 (2026-07, latest 7.0.2): native Go compiler. Removed the options 6.0 deprecated: `module` none/amd/umd/system, `moduleResolution` node10/classic, `baseUrl`, `outFile`, `downlevelIteration`, `target: ES5`, `alwaysStrict: false`, `esModuleInterop: false`, `allowSyntheticDefaultImports: false`. A tsconfig using any of these does not compile on 7.
- 6.0: last JavaScript-based compiler; deprecated the options above.
- 5.0 (2023-03): `verbatimModuleSyntax`, `const` type parameters. 4.9: `satisfies`. 4.7: `in`/`out` variance annotations.

Files in this skill

  • SKILL.md3.5 KB
  • reference/anti-patterns.md2.6 KB
  • reference/module-boundaries.md2.5 KB
  • reference/narrowing.md2 KB
  • reference/strictness.md4 KB
  • reference/type-expressions.md7.4 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.