typescript-strict

Enforces strict TypeScript type safety, error handling, and security rules during code writing and review.

Updated Jan 1, 2026
One-click install
npx skills add https://github.com/sarkarshivaditya-lab/WellMate --skill typescript-strict-sarkarshivaditya-lab
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: typescript-strict
Source: https://github.com/sarkarshivaditya-lab/WellMate/tree/main/.engineering-skills/0xMassi-claude-skills/typescript-strict
Command: npx skills add https://github.com/sarkarshivaditya-lab/WellMate --skill typescript-strict-sarkarshivaditya-lab

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? TypeScript codebases often accumulate unsafe patterns like any types, unchecked type assertions, swallowed errors, and unvalidated external input. This Skill provides a concrete, numbered rule set (TS-01 through TS-25) that keeps code strictly typed, secure, and consistent when writing, reviewing, or refactoring TypeScript. ## Core Features & Use Cases - Strict Type Safety Enforcement: Bans any, @ts-ignore, and unnecessary as casts; promotes type guards, discriminated unions, satisfies, NoInfer, and exhaustiveness checks. - Error Handling & Security Rules: Mandates structured Result patterns, Zod validation at boundaries, environment variable validation at startup, and prevention of XSS, SQL injection, and secret leakage. - React & Modern Runtime Conventions: Covers event listener cleanup, context layering, using/await using resource management, and a baseline tsconfig.json strict configuration. - Use Case: When reviewing a pull request that casts an API response with as User, apply TS-02 to replace it with a type guard, and apply TS-17 to add Zod validation at the API boundary. ## Quick Start Review my TypeScript code and refactor it to comply with the strict type safety, error handling, and security rules.

Frequently Asked Questions about typescript-strict

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

FAQPage Schema
How do I avoid using any in TypeScript?▼

Replace any with unknown for untyped data, then narrow with type guards before use. For library boundaries that genuinely require any, add an eslint-disable comment explaining why. Use Record<string, unknown> for generic object shapes instead of any.

How to replace as type assertions in TypeScript?▼

Use type guard functions with the is keyword, generics, or instanceof checks instead of as casts. For typed literals, use satisfies to validate shape while keeping narrow inference. Reserve as unknown as T for rare cases with a SAFETY comment.

What tsconfig settings enable strict TypeScript mode?▼

Enable strict, noUnusedLocals, noUnusedParameters, noFallthroughCasesInSwitch, isolatedModules, and verbatimModuleSyntax as a baseline. For maximum strictness add exactOptionalPropertyTypes, noUncheckedSideEffectImports, erasableSyntaxOnly, and isolatedDeclarations.

Should I use type or interface in TypeScript?▼

Default to type for unions, intersections, mapped types, and props definitions. Use interface only when you need declaration merging or extends behavior, such as extending Record<string, unknown> for library-compatible node data.

How do I validate environment variables in TypeScript?▼

Define a Zod schema for all environment variables and parse process.env at startup so the app fails fast on missing or invalid values. Keep secrets like database URLs unprefixed so they are never exposed to the browser bundle.

When is it acceptable to use any in TypeScript?▼

Only at third-party library integration boundaries where types genuinely require any, such as certain UI component props or extension APIs. Each occurrence must include an eslint-disable comment explaining the reason, and the project target is zero unexplained any usages.