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:

  1. Bloats Generated Code: Adds 3 to 6 unnecessary syntax tokens per expression across dozens of statements.
  2. Obscures Real Type Invariants: Defensive casting silences compiler errors without validating underlying data schemas.
  3. 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.


Defensive Coercion vs. Compiler-Inferred Clean Syntax

Installs
1
GitHub Stars
2
First Seen
Oct 24, 2026