fluid-tools avatar

Typescript Strict Mode

This is essentially a reference guide you'll want around if you're enforcing strict TypeScript rules, especially in codebases with no-explicit-any enabled. It walks through practical alternatives to using any (unknown, generics, union types, type guards), covers common event handler types for React and DOM, and includes patterns for promises, callbacks, and utility types. The examples are concrete and show both wrong and correct approaches, which is helpful when you're staring at a type error. It's not going to teach you TypeScript from scratch, but if you keep reaching for any out of frustration or uncertainty, this gives you the specific patterns to use instead. Treats type assertions with appropriate suspicion and includes a solid section on discriminated unions for handling multiple related types safely.

skills.sh installs
156
GitHub stars
16
last updated
Jun 3, 2026

Install

$ npx -y skills add fluid-tools/claude-skills --skill typescript-strict-mode --agent claude-code

Installs into .claude/skills of the current project.

Files

TypeScript Strict Mode Best Practices

Overview

This skill covers strict TypeScript practices applicable across all frameworks. It focuses on avoiding any, using proper type annotations, and leveraging TypeScript's type system for safer, more maintainable code.

The Golden Rule: NEVER Use any

CRITICAL RULE: Many codebases have @typescript-eslint/no-explicit-any enabled. Using any will cause build failures.

Why any is dangerous:

  • Defeats the purpose of TypeScript's type system
  • Hides bugs that would be caught at compile time
  • Propagates type unsafety through the codebase
  • Makes refactoring difficult and error-prone

Alternatives to any

1. Use Specific Types

❌ WRONG:

function processData(data: any) { ... }
const items: any[] = [];

✅ CORRECT:

function processData(data: { id: string; name: string }) { ... }
const items: string[] = [];

2. Use unknown When Type is Truly Unknown

unknown is the type-safe counterpart to any. It forces you to narrow the type before using it.

❌ WRONG:

Sponsors

Details

Repository
github.com/fluid-tools/claude-skills
First seen
Jun 3, 2026

More from fluid-tools/claude-skills

All 2

Recommended

1juliusbrussee avatarcavemanjuliusbrussee/cavemanUltra-compressed communication mode. Cuts output tokens 65% (measured) by speaking like caveman while keeping full technical accuracy. Supports intensity levels618.3Kskills.sh installs
2mattpocock avatargrill-memattpocock/skillsA relentless interview to sharpen a plan or design.1.5Mskills.sh installs
3shadcn avatarimproveshadcn/improveSurvey any codebase as a senior advisor and produce prioritized, self-contained implementation plans for OTHER models/agents to execute. Strictly read-only on s40Kskills.sh installs
4obra avatarsystematic-debuggingobra/superpowersUse when encountering any bug, test failure, or unexpected behavior, before proposing fixes326.7Kskills.sh installs
5forrestchang avatarkarpathy-guidelinesforrestchang/andrej-karpathy-skillsBehavioral guidelines to reduce common LLM coding mistakes through explicit assumptions, simplicity, and verifiable success criteria.17.9Kskills.sh installs
6vercel-labs avatarfind-skillsvercel-labs/skillsHelps users discover and install agent skills when they ask questions like "how do I do X", "find a skill for X", "is there a skill that can...", or express int4.3Mskills.sh installs