typescript-debugger

Enforce strict TypeScript typing and prevent unsafe constructs during code reviews.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/aster-void/dotfiles --skill typescript-debugger
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: typescript-debugger
Source: https://github.com/aster-void/dotfiles/tree/main/modules/home/profile-dev/programs/claude-code/skills/typescript-debugger
Command: npx skills add https://github.com/aster-void/dotfiles --skill typescript-debugger

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill provides a systematic approach to debugging and resolving TypeScript type errors, specifically targeting common anti-patterns and dangerous features (like any, as, !) that frequently lead to runtime issues. It helps developers write more robust, type-safe code and navigate complex refactoring with confidence.

Core Features & Use Cases

  • Anti-Pattern Checklist: Guides on avoiding any, as, !, and value is T for safer type assertions, promoting cleaner and more predictable code.
  • Good Practices: Promotes as const, satisfies, discriminated unions, and built-in narrowing for robust type inference and improved code readability.
  • Troubleshooting Strategy: Provides a clear workflow for when to consult documentation, search issues, or ask the user, emphasizing persistence over "giving up" with any.
  • Use Case: When refactoring a large TypeScript module, use this skill to systematically address multiple type errors, ensuring each fix improves type safety without introducing new issues or compromising code quality.

Quick Start

I'm getting a TypeScript error in src/utils.ts related to an any type. Apply the typescript-debugger checklist to help me identify and fix the root cause without using any or as.

Frequently Asked Questions about typescript-debugger

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

FAQPage Schema
How do I fix TypeScript type errors without using any or as?

Type errors without `any` or `as` require identifying the root cause: check if the value needs narrowing, use discriminated unions, apply `as const` for literals, or validate with tools like valibot. Work through documentation and existing issues first; `any` masks the real problem and breaks type safety.

What's the best way to refactor TypeScript code for type safety?

Refactor systematically by addressing type errors one at a time, replacing unsafe patterns (`any`, `as`, `!`) with safe alternatives like `satisfies`, built-in narrowing, and const assertions. This ensures each fix improves safety without introducing new issues or compromising code quality.

When should I use discriminated unions and const assertions in TypeScript?

Use discriminated unions to create type-safe exhaustive patterns with literal types; use `as const` to narrow object or array types to their exact literal values. Both enable robust type inference and eliminate the need for unsafe assertions like `as` or non-null `!`.

Can I validate TypeScript types at runtime with valibot?

Yes, valibot validates runtime data against TypeScript types without overhead. Use it during library and API development to enforce type contracts, catch mismatches early, and guide users toward safe type narrowing instead of bypassing checks with `any`.

What are the dangers of using any, as, and non-null assertions?

These constructs bypass type safety and hide errors, causing unpredictable runtime failures. They prevent the type system from catching bugs early and make refactoring risky. Type-safe alternatives like narrowing, `satisfies`, and validators provide better protection without performance overhead.

How do I debug complex TypeScript type errors during code review?

Apply a checklist approach: avoid `any`, `as`, `!`, and unsafe patterns; promote `as const`, discriminated unions, and built-in narrowing; persist through documentation and issue searches before escalating. This ensures reviewers catch anti-patterns early and enforce consistent type-safety practices across the codebase.