structid

Official

Generate safe typed IDs with zero runtime deps.

Authordevlooped
Version1.0.0
Installs0

System Documentation

What problem does it solve?

StructId helps you avoid “stringly-typed” and loosely-typed identifier bugs by making every ID a distinct, strongly-typed value (as a readonly partial record struct), while keeping runtime dependencies at zero through source generation.

Core Features & Use Cases

  • Strongly-typed identifiers: Define IStructId (string-backed) and IStructId<TValue> (struct-backed) IDs using readonly partial record struct so your compiler prevents mixing IDs accidentally.
  • Factories via INewable: Use INewable<TSelf> / INewable<TSelf, TValue> for consistent New(...) creation patterns (including parameterless New() for Guid and Ulid-backed IDs).
  • Integration that “just activates”: Enable EF Core converters, Dapper type handlers, and System.Text.Json / Newtonsoft.Json converters automatically when you reference the corresponding packages.
  • Template-based extension: Extend multiple (or filtered) ID types using [TStructId] templates and specialized per-value-type handlers using [TValue].

Quick Start

Ask the AI: “Given I want a typed UserId(Guid) and a typed ProductId(int), show the two readonly partial record struct declarations using StructId and explain which New(...) overloads to call and how to enable EF Core and Dapper support.”

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: structid
Download link: https://github.com/devlooped/StructId/archive/main.zip#structid

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 471,000+ vetted skills library on demand.