What problem does it solve?
This skill addresses the technical debt and runtime risks associated with unsafe TypeScript type assertions, commonly known as bare casts. It provides a structured decision-making framework to replace dangerous type coercions with safer alternatives like runtime checks or explicit type declarations.
Core Features & Use Cases
- Type Safety Enforcement: Guides developers through a decision tree to replace unsafe as casts with type predicates, satisfies, or explicit cast helpers.
- Auditable Escape Hatches: Provides a standardized blindCast mechanism that requires a documented reason for any necessary type compromise.
- Use Case: When refactoring legacy codebases, use this skill to systematically identify and replace unsafe type assertions with robust, type-safe patterns that satisfy the project's linting requirements.
Quick Start
Analyze the current file for any bare as casts and suggest the appropriate replacement based on the provided decision tree.