m05-type-driven

Community

Shift C++ design toward safe, expressive types.

Author13eholder
Version1.0.0
Installs0

System Documentation

What problem does it solve?

C++ code often relies on primitive types (int, double) for IDs or monetary values, which can lead to accidental misuse and bugs. Type-driven design introduces strong types, phantom types, and type-state patterns to encode invariants in the type system, reducing errors and improving API safety.

Core Features & Use Cases

  • Strong types to prevent mixing domains (e.g., UserId vs OrderId).
  • Phantom types to encode metadata without storage.
  • Type-state patterns and builders to enforce valid sequences at compile time.
  • Guided API design examples for resource handles, file operations, and domain models.

Quick Start

Start by wrapping primitive IDs with small structs and define a simple builder to enforce valid construction at compile time.

Dependency Matrix

Required Modules

None required

Components

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: m05-type-driven
Download link: https://github.com/13eholder/Modern-Cpp-Skills/archive/main.zip#m05-type-driven

Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
View Source Repository

Agent Skills Search Helper

Install a tiny helper to your Agent, search and equip skill from 223,000+ vetted skills library on demand.