typescript

Enforce strict TypeScript patterns in .ts/.tsx files using const types, flat interfaces, and unknown-based validation.

Updated May 17, 2026
One-click install
npx skills add https://github.com/cheetah-alo/NegritaOS --skill typescript-cheetah-alo
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: typescript
Source: https://github.com/cheetah-alo/NegritaOS/tree/main/.codex/skills/typescript
Command: npx skills add https://github.com/cheetah-alo/NegritaOS --skill typescript-cheetah-alo

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

It prevents fragile, hard-to-refactor TypeScript code by enforcing strict type modeling, safer type narrowing, and banning unsafe patterns like any.

Core Features & Use Cases

  • Const object types: Creates single source of truth enums via const objects and extracted union types for better autocomplete and refactoring.
  • Flat interfaces: Encourages predictable interface boundaries by separating nested objects into dedicated interfaces.
  • No any + safer unknown: Forces validation-based parsing using unknown, with generics for reusable typing.
  • Type utilities & guards: Provides a practical set of TypeScript utility types and type guard patterns for robust runtime-to-type linkage.
  • Import type hygiene: Uses import type to keep type-only dependencies clean and intention-revealing.

Quick Start

Apply the typescript skill rules to your .ts/.tsx files to define const-based types, flat interfaces, type guards, and remove any in favor of unknown with validation.

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 enforce type safety?

To remove any and enforce type safety in TypeScript, replace unsafe types with unknown and apply validation-based parsing. This forces runtime validation before type assignment, ensuring robust type narrowing and eliminating fragile code patterns in production .ts and .tsx files.

What is the best way to create TypeScript const object types for better autocomplete?

The best way to create TypeScript const object types is using const assertions to derive single-source-of-truth enums. Extracting union types from these const objects provides better autocomplete, predictable refactoring, and strict type-first modeling for your interfaces.

How do I design flat TypeScript interfaces for predictable boundaries?

To design flat TypeScript interfaces, decompose nested objects into dedicated, separate interfaces. This flattening creates predictable interface boundaries, making your type models easier to refactor and maintain while preventing deeply nested and fragile type structures.

How do TypeScript type guards and utility types link runtime validation to types?

TypeScript type guards and utility types link runtime validation to types by providing reusable patterns for type narrowing. By combining generics with unknown-based parsing, type guards ensure that runtime checks directly enforce and secure your static type definitions.

When should I use import type for type-only dependencies in TypeScript?

You should use import type for type-only dependencies in TypeScript to keep imports clean and intention-revealing. This strict import hygiene prevents runtime bundling of types, ensuring maintainable and type-safe output across your .ts and .tsx files.