Skip to main content

typescript-rust-pattern

Stars10
Forks0
UpdatedJune 18, 2026 at 22:19

Apply Rust-inspired safety patterns to TypeScript code. Use this skill whenever writing or reviewing TypeScript โ€” especially when adding types, handling errors, validating external data (APIs, file input, user input), designing state machines, or refactoring legacy code with loose booleans or try/catch. It covers four patterns: discriminated unions (eliminate impossible states), Result types (explicit failures), schema-based parsing at boundaries (parse don't validate), and explicit mutability. If the user is working with TypeScript and mentions any of these concepts, or if their code shows patterns like boolean overloads, untyped throw, or unchecked external data, apply this skill.

Installation

Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.

SKILL.md
readonly