auto-typescript

Eliminate unsafe TypeScript casts and enforce strict type narrowing.

6|Updated Mar 31, 2026
One-click install
npx skills add https://github.com/Corvalis-LLC/Crow-Stack --skill auto-typescript
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: auto-typescript
Source: https://github.com/Corvalis-LLC/Crow-Stack/tree/main/skills/auto-typescript
Command: npx skills add https://github.com/Corvalis-LLC/Crow-Stack --skill auto-typescript

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

TypeScript projects often end up with unsafe casts like as any or as unknown as X, which hides type issues and leads to runtime errors. This Skill guides you to replace unsafe casts with explicit types, proper narrowing, and validated boundaries to improve reliability.

Core Features & Use Cases

  • Eliminate as any and double casts by deriving concrete types and using type guards.
  • Apply branded types to enforce domain safety across APIs and modules.
  • Promote safe parsing and validation of external data using Zod or similar validators.
  • Enforce strict TypeScript configuration such as noUncheckedIndexedAccess and exactOptionalPropertyTypes.
  • Improve maintainability by explicit return types and robust type-level patterns. Use cases include API handling, database result processing, and complex generics where precise typing matters.

Quick Start

Refactor a sample function that uses as any to return a properly typed value and add a type guard to narrow unknown inputs.

Frequently Asked Questions about auto-typescript

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

FAQPage Schema
How do I remove unsafe TypeScript casts like `as any` from my codebase?

Eliminate unsafe TypeScript casts by replacing `as any` with explicit types, type guards, and proper narrowing. Enforce validated boundaries using Zod to ensure runtime correctness and maintainable types across your codebase.

What is the best way to enforce type safety for unknown API responses in TypeScript?

The best way to enforce type safety for unknown API responses is applying Zod validators to parse external data. This safe parsing establishes validated boundaries, preventing runtime errors and ensuring domain type correctness.

How do branded types improve domain safety in TypeScript?

Branded types improve domain safety by creating distinct nominal types for specific concepts across APIs and modules. This TypeScript pattern prevents accidental primitive assignment, enforcing strict type-level constraints throughout your architecture.

Which strict `tsconfig` rules help prevent type errors in complex generics?

Strict `tsconfig` rules like `noUncheckedIndexedAccess` and `exactOptionalPropertyTypes` prevent type errors in complex generics. Enabling these compiler options ensures explicit return types and robust type-level pattern enforcement.

Can I use type guards instead of double casts for narrowing unknown inputs?

Yes, you can use type guards instead of double casts to narrow unknown inputs. Type guards allow TypeScript to safely deduce types at runtime, eliminating the need for `as unknown as` assertions entirely.

Why does TypeScript require explicit return types for maintainable code?

TypeScript requires explicit return types to improve maintainability by preventing unintended type widening. Explicit declarations enforce robust type-level patterns and make complex generic outputs predictable across modules.