branded-types
OfficialCreate type-safe distinct primitives.
Authorwellcrafted-dev
Version1.0.0
Installs0
System Documentation
What problem does it solve?
This Skill solves the problem of TypeScript's structural typing allowing interchangeable primitive types (like strings or numbers) that should be distinct, preventing accidental misuse of values like user IDs and order IDs.
Core Features & Use Cases
- Nominal Typing: Creates distinct types from primitives using phantom branding.
- Type Safety: Prevents mixing up different kinds of IDs, tokens, or other primitives at compile time.
- Brand Constructor Pattern: Encourages a single source of truth for creating branded types, optionally including runtime validation.
- Use Case: Define
UserIdandOrderIdas distinct types, ensuring that a function expecting aUserIdcannot accidentally receive anOrderId.
Quick Start
Use the branded-types skill to create a new type ProductId that is a string and cannot be confused with other strings.
Dependency Matrix
Required Modules
None requiredComponents
Standard package💻 Claude Code Installation
Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.
Please help me install this Skill: Name: branded-types Download link: https://github.com/wellcrafted-dev/wellcrafted/archive/main.zip#branded-types Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
Agent Skills Search Helper
Install a tiny helper to your Agent, search and equip skill from 223,000+ vetted skills library on demand.