typescript

Enforce strict TypeScript patterns for interfaces, unions, generics, and type guards.

19|2|Updated Apr 28, 2026
One-click install
npx skills add https://github.com/CamiloAndresGTRUniandes/lucy-ai --skill typescript-camiloandresgtruniandes
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: typescript
Source: https://github.com/CamiloAndresGTRUniandes/lucy-ai/tree/main/skills/typescript
Command: npx skills add https://github.com/CamiloAndresGTRUniandes/lucy-ai --skill typescript-camiloandresgtruniandes

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps prevent fragile or inconsistent TypeScript code by enforcing strict, readable patterns for types, interfaces, generics, and imports.

Core Features & Use Cases

  • Const-first union types: Defines string literal unions from runtime-safe const objects to improve autocomplete and refactoring.
  • Flat interfaces: Encourages shallow interface nesting for clarity, replacing inline nested object types with dedicated interfaces.
  • No any policy: Requires unknown for unknown inputs and uses generics for flexible, type-safe functions.
  • Utility types & type guards: Provides reusable patterns for transforming types and validating unknown values at runtime.
  • Type-only imports: Promotes import type and type-prefixed imports to keep dependencies and intent clear.

Quick Start

Use the typescript skill rules to refactor your current TypeScript models by replacing inline nested object types with flat interfaces, removing any in favor of unknown plus type guards, and defining union types from as const objects.

Frequently Asked Questions about typescript

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

FAQPage Schema
How do I remove any from TypeScript code and use unknown with type guards?

TypeScript flat interfaces replace inline nested object types with dedicated, shallow interface definitions. This structure improves code readability and refactoring by preventing deeply nested type dependencies.

How do I create runtime-safe string literal unions from const objects in TypeScript?

Runtime-safe string literal unions in TypeScript are created by defining const objects using the as const assertion. Types are then derived from these objects to improve autocomplete and ensure refactoring consistency.

What is the best way to use TypeScript utility types for precise type transformations?

The best way to use TypeScript utility types is applying them for precise type transformations alongside type guards. This provides reusable patterns for modifying existing types rather than creating redundant, inconsistent type models.

Does TypeScript require type-only imports and what do they do?

TypeScript type-only imports use the import type syntax to keep dependencies clear. They ensure that only type definitions are imported at compile time, preventing unintended runtime module execution.

When should I use TypeScript generics instead of any for flexible functions?

TypeScript generics should be used instead of any when building flexible functions. Generics maintain strict typing by preserving input types across the function, whereas any disables type checking completely.