typescript-strict

Enforce TypeScript strict typing with Zod and type guards.

Updated Aug 6, 2025
One-click install
npx skills add https://github.com/flosrn/.claude --skill typescript-strict-flosrn
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: typescript-strict
Source: https://github.com/flosrn/.claude/tree/main/skills/typescript-strict
Command: npx skills add https://github.com/flosrn/.claude --skill typescript-strict-flosrn

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps developers write more robust and maintainable TypeScript code by enforcing strict typing rules and providing patterns to avoid common pitfalls like any types and improper unknown usage.

Core Features & Use Cases

  • Avoids any and @ts-ignore: Promotes safer code by disallowing type-checking bypasses.
  • Proper unknown and never Usage: Guides developers on using these types correctly for better type safety.
  • Runtime Validation: Integrates Zod for validating external data at runtime.
  • Best Practices: Offers guidance on type inference, explicit typing, and const assertions.
  • Use Case: When refactoring a JavaScript codebase to TypeScript, or when encountering frequent "type errors" that indicate a lack of strictness, this Skill provides the necessary patterns and configurations.

Quick Start

Apply the typescript-strict skill to enforce strict typing in the current project.

Frequently Asked Questions about typescript-strict

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

FAQPage Schema
How do I enforce TypeScript strict typing in my project?

To enforce TypeScript strict typing, enable strict mode in tsconfig.json and apply patterns that eliminate the any type, use type guards, and integrate Zod schemas for runtime data validation.

What is the best way to handle the unknown type in TypeScript?

The best way to handle the unknown type is using type guards to narrow it down before access. This approach maintains strict type safety and prevents runtime errors when processing external data.

Can I use Zod for runtime validation with TypeScript strict mode?

Yes, you can use Zod with TypeScript strict mode to validate external data at runtime. This integration ensures that runtime inputs match your compile-time type definitions for comprehensive type safety.

Why should I remove ts-ignore directives from my TypeScript codebase?

You should remove ts-ignore directives because they bypass the compiler, hiding underlying type errors. Disallowing them enforces strict type checking and promotes safer, more maintainable code.

Does refactoring JavaScript to TypeScript require strict mode in tsconfig.json?

Refactoring JavaScript to TypeScript benefits greatly from enabling strict mode in tsconfig.json. It provides comprehensive type safety by catching implicit any types and enforcing strict null checks during the migration.