rc-typescript

Enforces TypeScript type design that makes illegal states unrepresentable at compile time.

19|1|Updated Jun 27, 2026
One-click install
npx skills add https://github.com/rodolfochicone/rc-project --skill rc-typescript-rodolfochicone
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: rc-typescript
Source: https://github.com/rodolfochicone/rc-project/tree/main/skills/promoted/rc-typescript
Command: npx skills add https://github.com/rodolfochicone/rc-project --skill rc-typescript-rodolfochicone

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? TypeScript code often compiles while still permitting bugs: boolean flags multiply into impossible states, unvalidated data crosses trust boundaries, and escape hatches like as any silence real errors. This Skill applies type design discipline so wrong code fails to compile instead of failing in production. ## Core Features & Use Cases - Discriminated union modeling: Replace boolean flag combinations with exact state unions so the compiler narrows types at every use site. - Boundary validation: Treat external data as unknown, validate once with Zod schemas, and derive types via z.infer for a single source of truth. - Escape hatch elimination: Replace as, !, @ts-ignore, and any with narrowing, satisfies, branded types, and exhaustive never checks. - Use Case: When reviewing a React data-fetching hook, convert { loading, error, data } optional fields into a discriminated union so every component handles exactly the states that exist. ## Quick Start Ask the AI to review your TypeScript code for type design issues such as boolean state flags, unvalidated API responses, and unsafe type assertions.

Frequently Asked Questions about rc-typescript

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

FAQPage Schema
How do I model loading and error states in TypeScript?▼

Use a discriminated union instead of boolean flags: define variants like idle, loading, failed with error, and loaded with data. After checking the status discriminant, the compiler narrows the type so optional chaining and non-null assertions disappear.

How to validate API responses in TypeScript with Zod?▼

Treat response data as unknown, define a Zod schema, and call schema.parse at the boundary so failures throw where context exists. Derive the TypeScript type with z.infer from the schema rather than declaring both separately.

What should I use instead of as type assertions in TypeScript?▼

Replace as-casts with parsing at trust boundaries, type narrowing with if checks, or satisfies when you want a value checked without widening its inferred type. The satisfies operator keeps literal keys while validating against a target shape.

Does strict mode matter for TypeScript type safety?▼

Yes, strict: true is the baseline that enforces most type design rules. The noUncheckedIndexedAccess flag adds further safety by typing array index access as T or undefined, reflecting that the element may not exist.

When should I use branded types in TypeScript?▼

Use branded types when two same-typed values like UserId and OrgId strings could plausibly be swapped and the cost is real. Reserve branding for identifiers, money, and units rather than every string to avoid ceremony.