no-redundant-type-casting
Installation
SKILL.md
Zero Redundant Type Casting Protocol (Defensive Coercion Elimination)
Overview
When generating code in TypeScript, Python, or JavaScript, default LLM outputs frequently exhibit Defensive Coercion Syndrome: defensively wrapping variables in redundant cast functions (str(user.email) when user.email is already a typed string) or writing redundant TypeScript type assertions (x as unknown as string as string).
Redundant type casting:
- Bloats Generated Code: Adds 3 to 6 unnecessary syntax tokens per expression across dozens of statements.
- Obscures Real Type Invariants: Defensive casting silences compiler errors without validating underlying data schemas.
- Clutters AST Parsing: Slows down linter passes and AST transformation scripts.
The Zero Redundant Type Casting Protocol relies on native compiler type inference and clean single-point validation, eliminating defensive double-casting.