Zum Inhalt springen
Kitbay
Skill

no-bare-casts

Apache-2.0Aktualisiert am 11. Nov. 202647.664GitHub-Sterne

A contributed skill in the Prisma ORM repository that treats every bare as cast in production TypeScript as a reason to stop and work through a decision tree.

Was der Skill vermittelt

A contributed skill in the Prisma ORM repository that treats every bare as cast in production TypeScript as a reason to stop and work through a decision tree. In order, the agent tries to tighten the source type, add a runtime type guard, restructure a generic with a constraint, or use satisfies, and only then uses the repository's castAs helper for declarative assertions or, as a last resort, blindCast with a literal reason string a reviewer can judge. Test files are exempt. When editing any file that holds a bare cast, the agent converts or removes it, since a CI ratchet rejects pull requests that raise the cast count.

Funktionen

  • Replace bare TypeScript casts with safer forms
  • Add type guards instead of assertions
  • Document unavoidable casts with a reason
  • Reduce the cast count when touching files