typescript

Write strict, type-safe TypeScript 5.9+ code following modern patterns and TypeScript 6.0 migration rules.

1|Updated Apr 8, 2026
One-click install
npx skills add https://github.com/Domush/ai-agent-web-development-skills --skill typescript-domush
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: typescript
Source: https://github.com/Domush/ai-agent-web-development-skills/tree/main/skills/typescript
Command: npx skills add https://github.com/Domush/ai-agent-web-development-skills --skill typescript-domush

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? TypeScript codebases often accumulate unsafe patterns like any types, unchecked errors, and outdated compiler configurations, especially when migrating to TypeScript 6.0 with its breaking changes. This Skill enforces strict type safety, modern async patterns, and correct tsconfig.json setup so code compiles cleanly and stays maintainable. ## Core Features & Use Cases - Strict Type Safety Enforcement: Eliminates any types and unsafe as assertions, promoting discriminated unions, generics with constraints, and as const literal types. - TypeScript 6.0 Migration Guidance: Covers breaking changes such as strict defaulting to true, empty types arrays, deprecated baseUrl and es5 target, and the shift from assert to with import attributes. - Production Patterns Library: Provides reusable implementations of repository, observer, dependency injection, API client, and Result-type error handling patterns. - Use Case: When upgrading a Node.js backend to TypeScript 6.0, use this Skill to fix Cannot find module 'node' errors by setting explicit types, configure rootDir correctly, and refactor callback-based code to async/await with custom error classes. ## Quick Start Ask the agent to review your TypeScript file or tsconfig.json and rewrite it following strict mode best practices and TypeScript 6.0 compatibility rules.

Frequently Asked Questions about typescript

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I migrate my project to TypeScript 6.0?▼

Update tsconfig.json by explicitly listing required types like ["node", "jest"], setting rootDir to ./src, replacing baseUrl with paths mappings, and switching moduleResolution to bundler or nodenext. Then fix strict mode errors since strict now defaults to true.

How do I avoid using any types in TypeScript?▼

Replace any with unknown plus type narrowing, specific interfaces, or constrained generics. For runtime validation of unknown data, use schema validators like zod to parse and verify shapes before use.

Why does TypeScript 6.0 say Cannot find module 'node'?▼

TypeScript 6.0 defaults the types compiler option to an empty array, so @types packages are no longer auto-included. Add "types": ["node"] to your tsconfig.json compilerOptions to restore Node.js type definitions.

What moduleResolution should I use for TypeScript projects?▼

Use bundler for web apps built with Vite, Next.js, or similar tools, and nodenext for Node.js backends. The older node (node10) and classic modes are deprecated or removed in TypeScript 6.0.

Should I use classes or functions in TypeScript service layers?▼

Prefer composition over deep inheritance: define repository interfaces, inject them into service classes via constructors, and keep base classes minimal. Use discriminated unions and Result types instead of throwing generic errors.