typescript

Enforce TypeScript best practices and strict typing in .ts/.tsx files.

1|2|Updated Oct 1, 2025
One-click install
npx skills add https://github.com/sernafernando/pricing-app --skill typescript-sernafernando
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: typescript
Source: https://github.com/sernafernando/pricing-app/tree/main/skills/typescript
Command: npx skills add https://github.com/sernafernando/pricing-app --skill typescript-sernafernando

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill enforces TypeScript best practices and strict typing across codebases, reducing bugs and improving maintainability.

Core Features & Use Cases

  • Const Types Pattern: establish a single source of truth with runtime values and derived types.
  • Flat Interfaces: keep models maintainable with one-level interfaces when possible.
  • Never Use any: prefer unknown and explicit types to catch errors early.
  • Utility Types: leverage Pick, Omit, Partial, Required, Readonly, and more to compose types.
  • Type Guards & Import Types: provide robust type checks and clean type imports across modules.

Quick Start

To apply these patterns, review a TypeScript codebase and request guidance on converting inline types into named interfaces, const objects, and safe type guards.

Frequently Asked Questions about typescript

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

FAQPage Schema
What's the best way to enforce TypeScript strict patterns in .tsx files?

To enforce TypeScript strict patterns in .tsx files, apply flat interfaces, const types, and utility types to remove any and tighten unknown. This approach establishes a single source of truth for runtime values and derived types, improving overall safety.

How do I convert inline types into named interfaces and safe type guards?

Converting inline types into named interfaces and safe type guards involves refactoring models into one-level interfaces and leveraging const objects. You derive types from these const objects to create a robust, maintainable source of truth across your modules.

Why should I prefer unknown over any when refactoring TypeScript interfaces?

You should prefer unknown over any when refactoring TypeScript interfaces because unknown forces explicit type checking and catches errors early. Using any bypasses compiler checks, whereas unknown requires type guards to safely narrow down types before usage.

When do I need utility types like Pick and Omit for TypeScript codebases?

You need utility types like Pick and Omit when composing TypeScript types to keep models maintainable. They allow you to derive new type variations from existing flat interfaces without duplicating property definitions across your codebase.

Does using const types and flat interfaces improve TypeScript maintainability at scale?

Using const types and flat interfaces significantly improves TypeScript maintainability at scale by establishing a single source of truth. Flat interfaces limit nesting complexity while const objects simultaneously provide runtime values alongside derived types.