# andrewlock/StronglyTypedId

A Rosyln-powered generator for strongly-typed IDs

Repository: https://github.com/andrewlock/StronglyTypedId
Canonical: https://ross.abutalabs.com/products/stronglytypedid
Language: C#
License: MIT
License Family: permissive
Last push: 2025-02-21T21:47:30+00:00

## Health v2 (maintenance only)
Score: 35/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 7, release rhythm 35, longevity 100
- inputs: {"age_days": 2661, "days_push": 558, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: no_releases
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1752, forks 90 (observed 2026-08-28T04:05:31.767744+00:00)

## What it is
A Roslyn-powered compile-time source generator for .NET that creates strongly-typed ID types from a simple attribute, eliminating boilerplate when wrapping primitives like Guid or int. It helps prevent primitive obsession by ensuring IDs of different entity types are not interchangeable.

## Use cases
- generate strongly-typed IDs in C#
- avoid passing the wrong ID type to methods
- eliminate boilerplate for wrapping primitive IDs
- enforce type safety for domain entity identifiers
- generate code at compile time with Roslyn source generators

## When to choose
- you use .NET 7+ and want type-safe entity IDs without hand-writing boilerplate
- you want to fix primitive obsession in a C# codebase with minimal ceremony

## When to avoid
- you are not on .NET Core SDK 7.0 or greater
- you prefer runtime generics or value objects over compile-time generated types

## Facets
- artifact type: library
- maturity: active
- function: type-system, developer-tools, parser
- domain: developer-tools, backend, programming-languages
- platform: dotnet, cross-platform
- tags: source-generator, roslyn, strongly-typed-ids, primitive-obsession, csharp, compile-time-codegen

## Member repositories
- andrewlock/StronglyTypedId (main) score 35

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:05:31.767744+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T03:28:17.442631+00:00, confidence not recorded.
  - readme: https://github.com/andrewlock/StronglyTypedId (fetched 2026-08-28T04:05:31.767744+00:00, sha 0cbbac96e457)
- Data as of 2026-08-30T08:39:29.467469+00:00.
