effective-typescript

Enforce TypeScript best practices for type safety and maintainability.

3|1|Updated Mar 11, 2026
One-click install
npx skills add https://github.com/jon23d/skillz --skill effective-typescript
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: effective-typescript
Source: https://github.com/jon23d/skillz/tree/main/skills/effective-typescript
Command: npx skills add https://github.com/jon23d/skillz --skill effective-typescript

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps developers write safer, more maintainable TypeScript code by enforcing best practices and avoiding common pitfalls that lead to runtime errors and bugs.

Core Features & Use Cases

  • Type Safety Enforcement: Guides users to avoid any and unchecked type assertions, promoting the use of unknown and proper validation.
  • Code Quality Improvement: Encourages the use of discriminated unions, generics, and utility types for better code structure and reusability.
  • Configuration Best Practices: Recommends optimal tsconfig.json settings for enhanced type checking and maintainability.
  • Use Case: When refactoring a JavaScript codebase to TypeScript, or when designing complex types, this Skill provides clear rules and examples to ensure type safety and prevent regressions.

Quick Start

Use the effective-typescript skill to refactor the provided TypeScript code snippet to eliminate the use of any.

Frequently Asked Questions about effective-typescript

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

FAQPage Schema
How do I eliminate any from my TypeScript code to improve type safety?

Refactoring TypeScript code to eliminate `any` involves replacing it with `unknown` and applying proper runtime validation for external data. This enforces strict typing rules and prevents unchecked type assertions from causing runtime errors.

What is the best way to structure complex TypeScript types for maintainability?

The best way to structure complex types for maintainability is by using discriminated unions and generics. These features allow the compiler to safely infer types, ensuring code reuse while enforcing strict type safety rules across your codebase.

How do I configure tsconfig settings for strict type checking?

Configuring `tsconfig.json` for strict type checking requires enabling optimal compiler settings that maximize type safety. Adhering to strict typing rules and compiler inference ensures enhanced type checking and maintainability across the project.

When do I need to use unknown instead of type assertions in TypeScript?

You need to use `unknown` instead of unchecked type assertions when handling external data that lacks a guaranteed shape. Applying proper validation to `unknown` values enforces type safety and prevents runtime bugs caused by assuming invalid data structures.

Does refactoring JavaScript to TypeScript require changing my external data validation?

Refactoring JavaScript to TypeScript does require changing external data validation by replacing untyped inputs with `unknown` and applying explicit validation. This prevents regressions and ensures the compiler safely infers types without relying on `any`.