typescript-any-eliminator

Replace TypeScript any with generated database types and type guards.

Updated Oct 16, 2025
One-click install
npx skills add https://github.com/sanchezx1/v0-fullcolor-cotizador --skill typescript-any-eliminator
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: typescript-any-eliminator
Source: https://github.com/sanchezx1/v0-fullcolor-cotizador/tree/main/.claude/skills/typescript-any-eliminator
Command: npx skills add https://github.com/sanchezx1/v0-fullcolor-cotizador --skill typescript-any-eliminator

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps eliminate the use of any in TypeScript by guiding you to use precise, generated types from your database schema, and by replacing loose any with unknown plus type guards. It reduces runtime errors caused by unchecked types.

Core Features & Use Cases

  • Type strengthening: Replace any with generated types from Supabase database schemas (e.g., cotizaciones row type).
  • Safe data handling: Use unknown with type guards to narrow down data before processing.
  • Guided refactor examples: Convert dynamic or loosely-typed callbacks and dynamic objects to well-typed structures.

Quick Start

Search for occurrences of any in your codebase. Replace with precise types using generated Database Tables types and add type guards to validate unknown inputs. For example, convert a function parameter typed as any to data: unknown and implement a guard like isValidData to cast to a known interface before use.

Frequently Asked Questions about typescript-any-eliminator

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

FAQPage Schema
How do I remove any types from my TypeScript codebase?

Replace any with precise types generated from your database schema or use unknown with type guards to validate data before processing. This eliminates runtime errors from unchecked types and strengthens type safety across your application.

What's the best way to refactor any to specific types in TypeScript?

Convert any to generated database types from your schema, or use unknown paired with type guards like isValidData to narrow types before use. Replace dynamic objects with fixed Record-based typings to ensure strict typing.

Can I generate TypeScript types from my database schema?

Yes. Extract row types from your database schema—for example, cotizaciones row types from Supabase—and use them to replace any-typed variables. This aligns your data structures with your actual database schema.

Why should I replace any with unknown and type guards in TypeScript?

Type guards let you safely validate unknown data before processing it, catching errors at compile time rather than runtime. This approach maintains flexibility while enforcing strict type checking where it matters.

How do I implement type guards for callback functions in TypeScript?

Convert callback parameters typed as any to unknown, then implement a type guard function to cast the input to a known interface before use. This ensures type safety for dynamic or loosely-typed callbacks.

When do I need to refactor any types in my TypeScript project?

Refactor any when handling data from external sources, processing database records, managing dynamic objects, or when type checking reveals unsafe patterns. This reduces bugs and improves code maintainability.