test-your-types
Installation
SKILL.md
Write Tests for Your Types
Overview
Just as you write tests for runtime code, you should write tests for your types. Type-level code can have bugs too, and type declarations can drift out of sync with implementations. Testing types ensures your declarations work correctly and catch the errors they should.
Type testing is particularly important for library authors, complex type utilities, and whenever types are defined separately from implementations.
When to Use This Skill
- Writing type declarations for libraries
- Creating complex type utilities
- Types and implementation are in separate files
- Refactoring type-level code
- Types contain conditional logic or recursion
The Iron Rule
Write tests for your types. Test that valid types work, invalid types fail, and the error messages are helpful.