typescript-skill

Encode TypeScript best practices for AI-assisted code generation and review.

Updated Feb 8, 2026
One-click install
npx skills add https://github.com/jamesmbeams/typescript-skill --skill typescript-skill
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: typescript-skill
Source: https://github.com/jamesmbeams/typescript-skill/tree/main
Command: npx skills add https://github.com/jamesmbeams/typescript-skill --skill typescript-skill

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps developers write cleaner, more robust, and maintainable TypeScript code by encoding expert best practices.

Core Features & Use Cases

  • Type Safety: Enforces best practices for type vs interface, discriminated unions, and branded types.
  • Code Quality: Guides on using satisfies, avoiding enums, and proper generic usage.
  • Use Case: When refactoring a complex TypeScript module, consult this Skill to ensure you're adhering to modern best practices for type definitions and function signatures.

Quick Start

Use the typescript-skill to refactor the provided TypeScript code snippet according to best practices.

Frequently Asked Questions about typescript-skill

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

FAQPage Schema
What's the best way to enforce TypeScript best practices when refactoring complex modules?

To enforce TypeScript best practices during refactoring, apply expert rules for type definitions, function signatures, and modern operators like `satisfies` to ensure robust type safety. This approach replaces enums and structures discriminated unions for cleaner code.

How do I use the `satisfies` operator and avoid enums in TypeScript?

The `satisfies` operator lets TypeScript validate types without widening them, while avoiding enums in favor of union types or plain objects prevents common enum pitfalls. This Skill encodes these specific rules to guide code generation and review.

Does this TypeScript guidance cover runtime validation with Zod?

Yes, this TypeScript guidance covers runtime validation with Zod. It integrates Zod practices alongside type-level techniques like branded types and discriminated unions to ensure both compile-time and runtime type safety.

When do I need to use discriminated unions and branded types in TypeScript?

Discriminated unions are needed to handle different object shapes safely, while branded types are used to distinguish identical primitive types at the type level. This Skill encodes when to apply these patterns for robust AI-assisted code generation.

What are common TypeScript anti-patterns related to `type` vs `interface`?

Common TypeScript anti-patterns include misusing `interface` where `type` is more appropriate for unions, and poorly configured TSConfig settings. This Skill provides specific guidance on choosing between `type` and `interface` to avoid these issues.