·ts-best-practices
</>

ts-best-practices

TypeScript type safety guidelines for writing maximally type-safe code. Apply these patterns when writing or reviewing any TypeScript: discriminated unions, type narrowing, type guards, exhaustiveness checks, avoiding `as` casts, preferring `unknown` over `any`, and making impossible states unrepresentable. Use this skill whenever writing TypeScript code, reviewing TypeScript for type safety issues, or when the user mentions type safety, type narrowing, discriminated unions, or asks to make types stricter/more explicit.

10Installs·1Trend·@poteto

Installation

$npx skills add https://github.com/poteto/noodle --skill ts-best-practices

How to Install ts-best-practices

Quickly install ts-best-practices AI skill to your development environment via command line

  1. Open Terminal: Open your terminal or command line tool (Terminal, iTerm, Windows Terminal, etc.)
  2. Run Installation Command: Copy and run this command: npx skills add https://github.com/poteto/noodle --skill ts-best-practices
  3. Verify Installation: Once installed, the skill will be automatically configured in your AI coding environment and ready to use in Claude Code, Cursor, or OpenClaw

Source: poteto/noodle.

SKILL.md

View raw

as bypasses the compiler. Every as is a potential runtime crash the compiler can't catch.

The one exception: a cast immediately following exhaustive validation (as above) is acceptable because the cast is earned. But prefer a type guard or schema library (Zod, Valibot) over manual validation.

Refactoring as out of existing code: When encountering an as cast, determine why TypeScript can't infer the type. Usually one of:

TypeScript type safety guidelines for writing maximally type-safe code. Apply these patterns when writing or reviewing any TypeScript: discriminated unions, type narrowing, type guards, exhaustiveness checks, avoiding `as` casts, preferring `unknown` over `any`, and making impossible states unrepresentable. Use this skill whenever writing TypeScript code, reviewing TypeScript for type safety issues, or when the user mentions type safety, type narrowing, discriminated unions, or asks to make types stricter/more explicit. Source: poteto/noodle.

Facts (cite-ready)

Stable fields and commands for AI/search citations.

Install command
npx skills add https://github.com/poteto/noodle --skill ts-best-practices
Category
</>Dev Tools
Verified
First Seen
2026-03-10
Updated
2026-03-11

Browse more skills from poteto/noodle

Quick answers

What is ts-best-practices?

TypeScript type safety guidelines for writing maximally type-safe code. Apply these patterns when writing or reviewing any TypeScript: discriminated unions, type narrowing, type guards, exhaustiveness checks, avoiding `as` casts, preferring `unknown` over `any`, and making impossible states unrepresentable. Use this skill whenever writing TypeScript code, reviewing TypeScript for type safety issues, or when the user mentions type safety, type narrowing, discriminated unions, or asks to make types stricter/more explicit. Source: poteto/noodle.

How do I install ts-best-practices?

Open your terminal or command line tool (Terminal, iTerm, Windows Terminal, etc.) Copy and run this command: npx skills add https://github.com/poteto/noodle --skill ts-best-practices Once installed, the skill will be automatically configured in your AI coding environment and ready to use in Claude Code, Cursor, or OpenClaw

Where is the source repository?

https://github.com/poteto/noodle

Details

Category
</>Dev Tools
Source
skills.sh
First Seen
2026-03-10