[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7DN9E221WSJNWHAF6938F10":3,"skill-same:01M7DN9E221WSJNWHAF6938F10":61},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":15,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":24,"commitSha":25,"skillDirectory":26,"forksCount":13,"repositoryHtmlUrl":27,"repositoryHomepageUrl":28,"ownerHtmlUrl":29,"ownerBlogUrl":30,"ownerDescription":31,"updatedAt":32,"install":33,"resources":46},"01M7DN9E221WSJNWHAF6938F10","cratis-fundamentals-concept",null,"Create strongly typed Cratis domain values with ConceptAs and Chronicle event-source identities with EventSourceId. Use when a C# or TypeScript domain value has meaning beyond its primitive or when an identity is actually used as a Chronicle event-source\u002Fstream ID. Do not use for enums, DTO-only transport values, arbitrary non-stream entity IDs, or event schema migration.","Cratis\u002FFundamentals.Go","Cratis","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F16456213?v=4","01M6BXRH290K4C8RS4PTKK3HXQ","01M7DN6YCMASAFGKYBBH3C1Z6E",0,"MIT","https:\u002F\u002Fgithub.com\u002FCratis\u002FFundamentals.Go\u002Fblob\u002Fmain\u002F.cratis\u002Fai\u002Fskills\u002Fcratis-fundamentals-concept\u002FLICENSE","https:\u002F\u002Fgithub.com\u002FCratis\u002FFundamentals.Go\u002Fblob\u002Fmain\u002F.cratis\u002Fai\u002Fskills\u002Fcratis-fundamentals-concept\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: cratis-fundamentals-concept\ndescription: Create strongly typed Cratis domain values with ConceptAs and Chronicle event-source identities with EventSourceId. Use when a C# or TypeScript domain value has meaning beyond its primitive or when an identity is actually used as a Chronicle event-source\u002Fstream ID. Do not use for enums, DTO-only transport values, arbitrary non-stream entity IDs, or event schema migration.\nlicense: MIT\n---\n\u003C!-- cratis-ai-managed: skills\u002Fcratis-fundamentals-concept\u002FSKILL.md -->\n\n# Cratis domain concepts and event-source identities\n\nReplace a primitive only when the domain gives it distinct meaning. Keep value\nconcepts and Chronicle stream identities separate.\n\n## Verified product sources\n\nSources:\n\n| Package | Purpose |\n| --- | --- |\n| `Cratis.Fundamentals` | `ConceptAs\u003CT>`, `IGeneratable\u003CTSelf>`, `IGeneratableInContext\u003CTSelf>`, `GenerationContext` and `GenerateValue` |\n| `Cratis.Chronicle` | `Cratis.Chronicle.Events.EventSourceId` and `EventSourceId\u003CT>` |\n| `@cratis\u002Ffundamentals` | TypeScript `ConceptAs\u003CT>`, `field`, `Guid`, and JSON conversion |\n\nReverify product sources before claiming support for another version.\n\n## Choose the type\n\n- Derive a name, amount, code, number, or non-stream entity ID from\n  `ConceptAs\u003CT>`.\n- Derive an identity from `EventSourceId\u003CT>` only when that value is actually\n  passed to Chronicle as the event-source\u002Fstream ID.\n- Do not use `ConceptAs\u003CGuid>` for a Chronicle stream identity.\n- Do not use `EventSourceId\u003CT>` merely because a value is called an ID.\n- Do not wrap an enum. An enum already expresses a closed domain concept.\n- Keep DTO-only transport values primitive unless the domain type belongs in the\n  public contract.\n\nBoth generic bases require an underlying type that implements `IComparable`.\n\n## Create a value concept\n\nA value concept contains exactly one wrapped value. Do not add extra properties;\nFundamentals converters assume the concept is a single-value type and additional\nstate can be lost during serialization.\n\n```csharp\n\u002F\u002F Copyright (c) Cratis. All rights reserved.\n\u002F\u002F Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nusing Cratis.Concepts;\n\nnamespace \u003CNamespaceRoot>.\u003CFeature>;\n\n\u002F\u002F\u002F \u003Csummary>\n\u002F\u002F\u002F Represents the \u003Cdescription>.\n\u002F\u002F\u002F \u003C\u002Fsummary>\n\u002F\u002F\u002F \u003Cparam name=\"Value\">The underlying value.\u003C\u002Fparam>\npublic record \u003CConceptName>(\u003CComparableUnderlyingType> Value) :\n    ConceptAs\u003C\u003CComparableUnderlyingType>>(Value);\n```\n\n`ConceptAs\u003CT>` supplies implicit conversion from the concept to `T`. Add the\nreverse conversion only when it improves the domain API:\n\n```csharp\npublic static implicit operator \u003CConceptName>(\u003CComparableUnderlyingType> value) =>\n    new(value);\n```\n\nPrimitive-to-concept conversion is optional; it is not a Fundamentals\nrequirement.\n\n### Absence and sentinels\n\n`ConceptAs\u003CT>` rejects a null wrapped value. Represent absence with a nullable\nconcept reference such as `\u003CConceptName>?` when absence is valid.\n\nA `NotSet` or `Empty` value is optional domain policy. Add one only when the\nchosen primitive value is impossible or explicitly reserved in that domain.\nDo not assume `string.Empty`, `0`, or `Guid.Empty` is universally invalid.\n\n## Let a concept generate its own value\n\nCheck the Cratis.Fundamentals version the project resolves first.\n\nRequires Cratis.Fundamentals 7.23.0 for `IGeneratable\u003CTSelf>`. Arc 22.66.0 or later already resolves it, so do not add a direct reference there. For an older Arc or a Chronicle-only application whose resolved version is lower, add a direct `Cratis.Fundamentals` package reference at 7.23.0 or later, or keep the existing `static New()` (without the\ninterface) until you can.\n\nWhen the system, not the caller, creates a value, the concept declares how by\nimplementing `IGeneratable\u003CTSelf>` (`Cratis.Concepts`). The interface requires `static abstract TSelf New()`, so\ngeneric code constrained on `where T : IGeneratable\u003CT>` calls `T.New()` without\nreflection. Generate a UUID with `GenerateValue`, never with `Guid.NewGuid()` in\nscattered call sites and never with `System.Random`:\n\n```csharp\nusing Cratis.Concepts;\n\npublic record \u003CConceptName>(Guid Value) : ConceptAs\u003CGuid>(Value), IGeneratable\u003C\u003CConceptName>>\n{\n    public static \u003CConceptName> New() => new(GenerateValue.Uuid());\n}\n```\n\nBoth helpers return a `Guid` with the RFC 9562 variant and fill their random\nbits from `RandomNumberGenerator`:\n\n- `GenerateValue.Uuid()` — version 4, 122 random bits. The default.\n- `GenerateValue.UuidV7()` — version 7: Unix-epoch milliseconds first, then 74\n  random bits. Choose it only when database index locality or rough creation\n  order matters, after checking how the database stores and compares UUIDs. It reveals the creation time, it is **not** monotonic within a\n  millisecond, and clock adjustments can reorder values.\n\nNeither helper guarantees uniqueness; a collision is extremely unlikely, not\nimpossible. Fundamentals also supplies ULID, TypeID, NanoID and encoded\nbytes. `IGeneratableInContext\u003CTSelf>` declares static `New(GenerationContext)`\nfor a captured time and portable tenant. Built-ins consume time, not tenant;\ncontext is not tenant isolation. Default time is rejected, not replaced with now.\nSources and the complete shop example: [shop generation](references\u002Fshop-generation.md).\n\n## Choosing a strategy\n\nThe shared shop uses CustomerId (`cus_` + ULID), context-aware OrderId (TypeID),\nInviteCode (NanoID), readable InvoiceNumber (pattern with checksum), random Int64\nTicketNumber and secret ApiKey (`Bytes(32)`, `[NotAudited]` in its host).\nRead [choices, time\u002Ftenant context and protection](references\u002Fshop-generation.md).\nRequires Fundamentals 7.24.0 for these newer helpers; the earlier\nUUID examples remain supported.\nRequires Fundamentals 7.25.0 for `GenerateValue.Pattern(pattern, checksum)`, its\n`(pattern, context, checksum)` overload, `Integer(minimum, maximum)` and\n`HasValidChecksum(value, checksum)` (`dotnet list package --include-transitive`);\nolder packages lack them. Read the shop reference for exact signatures and UTC\npatterns before using them; do not hand-roll checksum or random-range algorithms.\n\n## When not to generate\n\nClient-supplied identities stay inputs; random generation is not idempotency or\ngapless\u002Fsequential numbering. Patterns are readable references, not allocators or\nsecrets; check digits catch typos, not forgery. Short codes need collision handling\nand uniqueness\u002Ffreshness enforcement appropriate to their role. UUIDs are not credentials. Byte generation can create a secret\nin Fundamentals, but audit suppression, authorized delivery and hash storage are separate\nhost responsibilities; never treat randomness as protection.\n\nIn specifications, construct the concept from a known value\n(`new \u003CConceptName>(Guid.Parse(\"…\"))`) and assert against it. Do not seed or\nreplace the generator. Let a server-owned new identifier\nreach `Handle()` through `[GeneratedValue]` (Requires Arc 22.66.0) rather than calling `New()` inside\nit; see `cratis-arc-command` for declaration and migration, and\n`cratis-specifications-csharp` for named scenario pins (Requires Arc 22.67.0).\nGuide: `\u002Ffundamentals\u002Fcsharp\u002Fgenerating-values\u002F`.\n\n## Create a TypeScript value concept\n\nRead [typescript-concepts.md](references\u002Ftypescript-concepts.md) when declaring\nTypeScript concepts, choosing union versus instance-only types, or converting\nGuid-backed values with `@field` and `JsonSerializer`. A union accepts the raw\nprimitive too; it does not enforce nominal separation between domain values.\nC#'s `IComparable` and null-value constraints above are not TypeScript contracts.\n\n## Create a Guid-backed Chronicle stream identity\n\nUse this shape only for an identity actually supplied to Chronicle append\u002Fread\noperations as the event-source ID.\n\n```csharp\n\u002F\u002F Copyright (c) Cratis. All rights reserved.\n\u002F\u002F Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nusing Cratis.Chronicle.Events;\nusing Cratis.Concepts;\n\nnamespace \u003CNamespaceRoot>.\u003CFeature>;\n\n\u002F\u002F\u002F \u003Csummary>\n\u002F\u002F\u002F Represents the event-source identity of a \u003Cdescription>.\n\u002F\u002F\u002F \u003C\u002Fsummary>\n\u002F\u002F\u002F \u003Cparam name=\"Value\">The underlying Guid value.\u003C\u002Fparam>\npublic record \u003CConceptName>(Guid Value) : EventSourceId\u003CGuid>(Value), IGeneratable\u003C\u003CConceptName>>\n{\n    \u002F\u002F\u002F \u003Csummary>\n    \u002F\u002F\u002F Creates a new \u003CConceptName>.\n    \u002F\u002F\u002F \u003C\u002Fsummary>\n    \u002F\u002F\u002F \u003Creturns>A new \u003CConceptName>.\u003C\u002Freturns>\n    public static \u003CConceptName> New() => new(GenerateValue.Uuid());\n\n    \u002F\u002F\u002F \u003Csummary>\n    \u002F\u002F\u002F Converts a Guid to a \u003CConceptName>.\n    \u002F\u002F\u002F \u003C\u002Fsummary>\n    public static implicit operator \u003CConceptName>(Guid value) => new(value);\n}\n```\n\n`New()` (through `IGeneratable\u003CTSelf>`) and the primitive-to-derived conversion\nare conveniences on this domain type. `EventSourceId\u003CT>` does not construct an arbitrary derived identity for\nyou.\n\n## Create a non-Guid Chronicle stream identity\n\nUse a factory only when the domain has an authoritative way to create the\nunderlying value.\n\n```csharp\n\u002F\u002F Copyright (c) Cratis. All rights reserved.\n\u002F\u002F Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nusing Cratis.Chronicle.Events;\n\nnamespace \u003CNamespaceRoot>.\u003CFeature>;\n\n\u002F\u002F\u002F \u003Csummary>\n\u002F\u002F\u002F Represents the event-source identity of a \u003Cdescription>.\n\u002F\u002F\u002F \u003C\u002Fsummary>\n\u002F\u002F\u002F \u003Cparam name=\"Value\">The underlying value.\u003C\u002Fparam>\npublic record \u003CConceptName>(\u003CComparableUnderlyingType> Value) :\n    EventSourceId\u003C\u003CComparableUnderlyingType>>(Value)\n{\n    \u002F\u002F\u002F \u003Csummary>\n    \u002F\u002F\u002F Converts the underlying value to a \u003CConceptName>.\n    \u002F\u002F\u002F \u003C\u002Fsummary>\n    public static implicit operator \u003CConceptName>(\u003CComparableUnderlyingType> value) =>\n        new(value);\n}\n```\n\nThe exact `EventSourceId\u003CT>` base supports conversions among `T`, string,\nuntyped `EventSourceId`, and `EventSourceId\u003CT>`. Those operators do not create\nyour derived `\u003CConceptName>` from `T`, string, or untyped `EventSourceId`.\nDeclare only the derived-type conversions your domain API needs.\n\nString and Guid remain the safest stream-id primitives. In Chronicle\n(`Source\u002FClients\u002FDotNET\u002FEvents\u002FEventSourceId.cs`), numeric\u002Fdate\u002Ftime ids\nand concepts wrapping them convert with invariant culture (Requires Chronicle 19.37.3).\n`DateTime`, `DateTimeOffset`, `DateOnly`, `TimeOnly` use `\"O\"`; `TimeSpan` uses\n`\"c\"`. Decimal `123.45` stays `\"123.45\"` even under nb-NO.\n**Existing streams may have different legacy ids** if written under date\u002Ftime or\ndecimal-comma formats: read\u002Fappend them with their old untyped id, rather than\nsilently opening a new stream under the new format.\n\n### Unspecified and sensitive identities\n\n`EventSourceId.Unspecified` belongs to the untyped string-backed ID.\n`Guid.Empty`, `0`, `0L`, and similar typed values become real, specified stream\nIDs after conversion; they are not Chronicle's unspecified value. Treat any\nsentinel on a typed identity as explicit domain policy, not framework behavior.\n\nNever use a sensitive natural identifier directly as an event-source ID.\nChronicle cannot encrypt event-source IDs. Use a random surrogate stream ID and\nstore the sensitive value separately under the approved compliance model.\n\n## Use the identity with Chronicle\n\nPass the typed identity as the append\u002Fread event-source ID. Merely declaring an\n`EventSourceId\u003CT>` property does not select the event stream.\n\nDo not add `[Key]` or `[Subject]` to an `EventSourceId\u003CT>`-derived member;\nChronicle analyzer `CHR0026` reports that misuse. Do not add `[PII]` or\n`[Encrypted]` to an event-source ID; analyzers `CHR0034` and `CHR0052` reject them.\n\n## Placement is an application convention\n\nIn a Cratis application, place the concept with the feature that owns its\nmeaning rather than in a generic `Concepts\u002F` folder. Put genuinely cross-feature\nconcepts in `Common\u002F`. Do not introduce a top-level `Features\u002F` wrapper.\n\nThis placement is a Cratis application convention, not a Fundamentals or\nChronicle API requirement. Framework and client repositories follow their own\nrepository structure.\n\n## Verify\n\n- `ConceptAs\u003CT>` and `EventSourceId\u003CT>` use an `IComparable` underlying type.\n- A concept contains exactly one wrapped value and no extra properties.\n- Enums remain enums.\n- A concept that creates its own value implements `IGeneratable\u003CTSelf>`; a\n  Guid-backed one uses `GenerateValue`, not `Guid.NewGuid()` or `Random`.\n  Client-supplied\u002Fidempotent values are not freshly generated; secrets use the\n  explicit entropy, audit and storage contract in [shop generation](references\u002Fshop-generation.md).\n- Null absence uses a nullable concept reference rather than a null wrapped\n  value.\n- Primitive-to-derived conversions and sentinels exist only when justified by\n  the domain.\n- An `EventSourceId\u003CT>` type represents a real Chronicle stream identity.\n- The typed identity is passed explicitly to Chronicle operations.\n- No `[Key]`, `[Subject]`, `[PII]`, or `[Encrypted]` attribute is placed on the stream identity.\n- Sensitive natural identifiers use a surrogate stream ID.\n- The file carries the repository license header.\n- The project builds and its relevant specifications pass against the verified\n  package versions.\n","\u003C!-- cratis-ai-managed: skills\u002Fcratis-fundamentals-concept\u002FSKILL.md -->\n\n# Cratis domain concepts and event-source identities\n\nReplace a primitive only when the domain gives it distinct meaning. Keep value\nconcepts and Chronicle stream identities separate.\n\n## Verified product sources\n\nSources:\n\n| Package | Purpose |\n| --- | --- |\n| `Cratis.Fundamentals` | `ConceptAs\u003CT>`, `IGeneratable\u003CTSelf>`, `IGeneratableInContext\u003CTSelf>`, `GenerationContext` and `GenerateValue` |\n| `Cratis.Chronicle` | `Cratis.Chronicle.Events.EventSourceId` and `EventSourceId\u003CT>` |\n| `@cratis\u002Ffundamentals` | TypeScript `ConceptAs\u003CT>`, `field`, `Guid`, and JSON conversion |\n\nReverify product sources before claiming support for another version.\n\n## Choose the type\n\n- Derive a name, amount, code, number, or non-stream entity ID from\n  `ConceptAs\u003CT>`.\n- Derive an identity from `EventSourceId\u003CT>` only when that value is actually\n  passed to Chronicle as the event-source\u002Fstream ID.\n- Do not use `ConceptAs\u003CGuid>` for a Chronicle stream identity.\n- Do not use `EventSourceId\u003CT>` merely because a value is called an ID.\n- Do not wrap an enum. An enum already expresses a closed domain concept.\n- Keep DTO-only transport values primitive unless the domain type belongs in the\n  public contract.\n\nBoth generic bases require an underlying type that implements `IComparable`.\n\n## Create a value concept\n\nA value concept contains exactly one wrapped value. Do not add extra properties;\nFundamentals converters assume the concept is a single-value type and additional\nstate can be lost during serialization.\n\n```csharp\n\u002F\u002F Copyright (c) Cratis. All rights reserved.\n\u002F\u002F Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nusing Cratis.Concepts;\n\nnamespace \u003CNamespaceRoot>.\u003CFeature>;\n\n\u002F\u002F\u002F \u003Csummary>\n\u002F\u002F\u002F Represents the \u003Cdescription>.\n\u002F\u002F\u002F \u003C\u002Fsummary>\n\u002F\u002F\u002F \u003Cparam name=\"Value\">The underlying value.\u003C\u002Fparam>\npublic record \u003CConceptName>(\u003CComparableUnderlyingType> Value) :\n    ConceptAs\u003C\u003CComparableUnderlyingType>>(Value);\n```\n\n`ConceptAs\u003CT>` supplies implicit conversion from the concept to `T`. Add the\nreverse conversion only when it improves the domain API:\n\n```csharp\npublic static implicit operator \u003CConceptName>(\u003CComparableUnderlyingType> value) =>\n    new(value);\n```\n\nPrimitive-to-concept conversion is optional; it is not a Fundamentals\nrequirement.\n\n### Absence and sentinels\n\n`ConceptAs\u003CT>` rejects a null wrapped value. Represent absence with a nullable\nconcept reference such as `\u003CConceptName>?` when absence is valid.\n\nA `NotSet` or `Empty` value is optional domain policy. Add one only when the\nchosen primitive value is impossible or explicitly reserved in that domain.\nDo not assume `string.Empty`, `0`, or `Guid.Empty` is universally invalid.\n\n## Let a concept generate its own value\n\nCheck the Cratis.Fundamentals version the project resolves first.\n\nRequires Cratis.Fundamentals 7.23.0 for `IGeneratable\u003CTSelf>`. Arc 22.66.0 or later already resolves it, so do not add a direct reference there. For an older Arc or a Chronicle-only application whose resolved version is lower, add a direct `Cratis.Fundamentals` package reference at 7.23.0 or later, or keep the existing `static New()` (without the\ninterface) until you can.\n\nWhen the system, not the caller, creates a value, the concept declares how by\nimplementing `IGeneratable\u003CTSelf>` (`Cratis.Concepts`). The interface requires `static abstract TSelf New()`, so\ngeneric code constrained on `where T : IGeneratable\u003CT>` calls `T.New()` without\nreflection. Generate a UUID with `GenerateValue`, never with `Guid.NewGuid()` in\nscattered call sites and never with `System.Random`:\n\n```csharp\nusing Cratis.Concepts;\n\npublic record \u003CConceptName>(Guid Value) : ConceptAs\u003CGuid>(Value), IGeneratable\u003C\u003CConceptName>>\n{\n    public static \u003CConceptName> New() => new(GenerateValue.Uuid());\n}\n```\n\nBoth helpers return a `Guid` with the RFC 9562 variant and fill their random\nbits from `RandomNumberGenerator`:\n\n- `GenerateValue.Uuid()` — version 4, 122 random bits. The default.\n- `GenerateValue.UuidV7()` — version 7: Unix-epoch milliseconds first, then 74\n  random bits. Choose it only when database index locality or rough creation\n  order matters, after checking how the database stores and compares UUIDs. It reveals the creation time, it is **not** monotonic within a\n  millisecond, and clock adjustments can reorder values.\n\nNeither helper guarantees uniqueness; a collision is extremely unlikely, not\nimpossible. Fundamentals also supplies ULID, TypeID, NanoID and encoded\nbytes. `IGeneratableInContext\u003CTSelf>` declares static `New(GenerationContext)`\nfor a captured time and portable tenant. Built-ins consume time, not tenant;\ncontext is not tenant isolation. Default time is rejected, not replaced with now.\nSources and the complete shop example: [shop generation](references\u002Fshop-generation.md).\n\n## Choosing a strategy\n\nThe shared shop uses CustomerId (`cus_` + ULID), context-aware OrderId (TypeID),\nInviteCode (NanoID), readable InvoiceNumber (pattern with checksum), random Int64\nTicketNumber and secret ApiKey (`Bytes(32)`, `[NotAudited]` in its host).\nRead [choices, time\u002Ftenant context and protection](references\u002Fshop-generation.md).\nRequires Fundamentals 7.24.0 for these newer helpers; the earlier\nUUID examples remain supported.\nRequires Fundamentals 7.25.0 for `GenerateValue.Pattern(pattern, checksum)`, its\n`(pattern, context, checksum)` overload, `Integer(minimum, maximum)` and\n`HasValidChecksum(value, checksum)` (`dotnet list package --include-transitive`);\nolder packages lack them. Read the shop reference for exact signatures and UTC\npatterns before using them; do not hand-roll checksum or random-range algorithms.\n\n## When not to generate\n\nClient-supplied identities stay inputs; random generation is not idempotency or\ngapless\u002Fsequential numbering. Patterns are readable references, not allocators or\nsecrets; check digits catch typos, not forgery. Short codes need collision handling\nand uniqueness\u002Ffreshness enforcement appropriate to their role. UUIDs are not credentials. Byte generation can create a secret\nin Fundamentals, but audit suppression, authorized delivery and hash storage are separate\nhost responsibilities; never treat randomness as protection.\n\nIn specifications, construct the concept from a known value\n(`new \u003CConceptName>(Guid.Parse(\"…\"))`) and assert against it. Do not seed or\nreplace the generator. Let a server-owned new identifier\nreach `Handle()` through `[GeneratedValue]` (Requires Arc 22.66.0) rather than calling `New()` inside\nit; see `cratis-arc-command` for declaration and migration, and\n`cratis-specifications-csharp` for named scenario pins (Requires Arc 22.67.0).\nGuide: `\u002Ffundamentals\u002Fcsharp\u002Fgenerating-values\u002F`.\n\n## Create a TypeScript value concept\n\nRead [typescript-concepts.md](references\u002Ftypescript-concepts.md) when declaring\nTypeScript concepts, choosing union versus instance-only types, or converting\nGuid-backed values with `@field` and `JsonSerializer`. A union accepts the raw\nprimitive too; it does not enforce nominal separation between domain values.\nC#'s `IComparable` and null-value constraints above are not TypeScript contracts.\n\n## Create a Guid-backed Chronicle stream identity\n\nUse this shape only for an identity actually supplied to Chronicle append\u002Fread\noperations as the event-source ID.\n\n```csharp\n\u002F\u002F Copyright (c) Cratis. All rights reserved.\n\u002F\u002F Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nusing Cratis.Chronicle.Events;\nusing Cratis.Concepts;\n\nnamespace \u003CNamespaceRoot>.\u003CFeature>;\n\n\u002F\u002F\u002F \u003Csummary>\n\u002F\u002F\u002F Represents the event-source identity of a \u003Cdescription>.\n\u002F\u002F\u002F \u003C\u002Fsummary>\n\u002F\u002F\u002F \u003Cparam name=\"Value\">The underlying Guid value.\u003C\u002Fparam>\npublic record \u003CConceptName>(Guid Value) : EventSourceId\u003CGuid>(Value), IGeneratable\u003C\u003CConceptName>>\n{\n    \u002F\u002F\u002F \u003Csummary>\n    \u002F\u002F\u002F Creates a new \u003CConceptName>.\n    \u002F\u002F\u002F \u003C\u002Fsummary>\n    \u002F\u002F\u002F \u003Creturns>A new \u003CConceptName>.\u003C\u002Freturns>\n    public static \u003CConceptName> New() => new(GenerateValue.Uuid());\n\n    \u002F\u002F\u002F \u003Csummary>\n    \u002F\u002F\u002F Converts a Guid to a \u003CConceptName>.\n    \u002F\u002F\u002F \u003C\u002Fsummary>\n    public static implicit operator \u003CConceptName>(Guid value) => new(value);\n}\n```\n\n`New()` (through `IGeneratable\u003CTSelf>`) and the primitive-to-derived conversion\nare conveniences on this domain type. `EventSourceId\u003CT>` does not construct an arbitrary derived identity for\nyou.\n\n## Create a non-Guid Chronicle stream identity\n\nUse a factory only when the domain has an authoritative way to create the\nunderlying value.\n\n```csharp\n\u002F\u002F Copyright (c) Cratis. All rights reserved.\n\u002F\u002F Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nusing Cratis.Chronicle.Events;\n\nnamespace \u003CNamespaceRoot>.\u003CFeature>;\n\n\u002F\u002F\u002F \u003Csummary>\n\u002F\u002F\u002F Represents the event-source identity of a \u003Cdescription>.\n\u002F\u002F\u002F \u003C\u002Fsummary>\n\u002F\u002F\u002F \u003Cparam name=\"Value\">The underlying value.\u003C\u002Fparam>\npublic record \u003CConceptName>(\u003CComparableUnderlyingType> Value) :\n    EventSourceId\u003C\u003CComparableUnderlyingType>>(Value)\n{\n    \u002F\u002F\u002F \u003Csummary>\n    \u002F\u002F\u002F Converts the underlying value to a \u003CConceptName>.\n    \u002F\u002F\u002F \u003C\u002Fsummary>\n    public static implicit operator \u003CConceptName>(\u003CComparableUnderlyingType> value) =>\n        new(value);\n}\n```\n\nThe exact `EventSourceId\u003CT>` base supports conversions among `T`, string,\nuntyped `EventSourceId`, and `EventSourceId\u003CT>`. Those operators do not create\nyour derived `\u003CConceptName>` from `T`, string, or untyped `EventSourceId`.\nDeclare only the derived-type conversions your domain API needs.\n\nString and Guid remain the safest stream-id primitives. In Chronicle\n(`Source\u002FClients\u002FDotNET\u002FEvents\u002FEventSourceId.cs`), numeric\u002Fdate\u002Ftime ids\nand concepts wrapping them convert with invariant culture (Requires Chronicle 19.37.3).\n`DateTime`, `DateTimeOffset`, `DateOnly`, `TimeOnly` use `\"O\"`; `TimeSpan` uses\n`\"c\"`. Decimal `123.45` stays `\"123.45\"` even under nb-NO.\n**Existing streams may have different legacy ids** if written under date\u002Ftime or\ndecimal-comma formats: read\u002Fappend them with their old untyped id, rather than\nsilently opening a new stream under the new format.\n\n### Unspecified and sensitive identities\n\n`EventSourceId.Unspecified` belongs to the untyped string-backed ID.\n`Guid.Empty`, `0`, `0L`, and similar typed values become real, specified stream\nIDs after conversion; they are not Chronicle's unspecified value. Treat any\nsentinel on a typed identity as explicit domain policy, not framework behavior.\n\nNever use a sensitive natural identifier directly as an event-source ID.\nChronicle cannot encrypt event-source IDs. Use a random surrogate stream ID and\nstore the sensitive value separately under the approved compliance model.\n\n## Use the identity with Chronicle\n\nPass the typed identity as the append\u002Fread event-source ID. Merely declaring an\n`EventSourceId\u003CT>` property does not select the event stream.\n\nDo not add `[Key]` or `[Subject]` to an `EventSourceId\u003CT>`-derived member;\nChronicle analyzer `CHR0026` reports that misuse. Do not add `[PII]` or\n`[Encrypted]` to an event-source ID; analyzers `CHR0034` and `CHR0052` reject them.\n\n## Placement is an application convention\n\nIn a Cratis application, place the concept with the feature that owns its\nmeaning rather than in a generic `Concepts\u002F` folder. Put genuinely cross-feature\nconcepts in `Common\u002F`. Do not introduce a top-level `Features\u002F` wrapper.\n\nThis placement is a Cratis application convention, not a Fundamentals or\nChronicle API requirement. Framework and client repositories follow their own\nrepository structure.\n\n## Verify\n\n- `ConceptAs\u003CT>` and `EventSourceId\u003CT>` use an `IComparable` underlying type.\n- A concept contains exactly one wrapped value and no extra properties.\n- Enums remain enums.\n- A concept that creates its own value implements `IGeneratable\u003CTSelf>`; a\n  Guid-backed one uses `GenerateValue`, not `Guid.NewGuid()` or `Random`.\n  Client-supplied\u002Fidempotent values are not freshly generated; secrets use the\n  explicit entropy, audit and storage contract in [shop generation](references\u002Fshop-generation.md).\n- Null absence uses a nullable concept reference rather than a null wrapped\n  value.\n- Primitive-to-derived conversions and sentinels exist only when justified by\n  the domain.\n- An `EventSourceId\u003CT>` type represents a real Chronicle stream identity.\n- The typed identity is passed explicitly to Chronicle operations.\n- No `[Key]`, `[Subject]`, `[PII]`, or `[Encrypted]` attribute is placed on the stream identity.\n- Sensitive natural identifiers use a surrogate stream ID.\n- The file carries the repository license header.\n- The project builds and its relevant specifications pass against the verified\n  package versions.\n",{"name":5,"license":14,"description":7},"main","45728854e223fd51b203724ca0e5be9c8f93a5a4",".cratis\u002Fai\u002Fskills\u002Fcratis-fundamentals-concept","https:\u002F\u002Fgithub.com\u002FCratis\u002FFundamentals.Go","https:\u002F\u002Fwww.cratis.io\u002Ffundamentals\u002Fgo\u002F","https:\u002F\u002Fgithub.com\u002FCratis","https:\u002F\u002Fwww.cratis.io","Open-source (MIT) event sourcing and CQRS for .NET and beyond: Chronicle, Arc, Components and Screenplay.","2026-11-14 15:52:19",{"source":8,"skillName":5,"commands":34,"prompt":44,"zipAvailable":45},[35,38,41],{"tool":36,"command":37},"npx","npx skills add Cratis\u002FFundamentals.Go --skill cratis-fundamentals-concept",{"tool":39,"command":40},"bunx","bunx skills add Cratis\u002FFundamentals.Go --skill cratis-fundamentals-concept",{"tool":42,"command":43},"pnpm","pnpm dlx skills add Cratis\u002FFundamentals.Go --skill cratis-fundamentals-concept","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FCratis\u002FFundamentals.Go\u002Fblob\u002Fmain\u002F.cratis\u002Fai\u002Fskills\u002Fcratis-fundamentals-concept\u002FSKILL.md",true,[47,51,57],{"path":48,"resourceType":48,"resourceTypeDesc":49,"sizeBytes":50,"sourceHtmlUrl":15},"LICENSE","许可证",206,{"path":52,"resourceType":53,"resourceTypeDesc":54,"sizeBytes":55,"sourceHtmlUrl":56},"references\u002Fshop-generation.md","REFERENCE","参考文档",8793,"https:\u002F\u002Fgithub.com\u002FCratis\u002FFundamentals.Go\u002Fblob\u002Fmain\u002F.cratis\u002Fai\u002Fskills\u002Fcratis-fundamentals-concept\u002Freferences\u002Fshop-generation.md",{"path":58,"resourceType":53,"resourceTypeDesc":54,"sizeBytes":59,"sourceHtmlUrl":60},"references\u002Ftypescript-concepts.md",3750,"https:\u002F\u002Fgithub.com\u002FCratis\u002FFundamentals.Go\u002Fblob\u002Fmain\u002F.cratis\u002Fai\u002Fskills\u002Fcratis-fundamentals-concept\u002Freferences\u002Ftypescript-concepts.md",[62,70,78,86,95,102],{"skillNo":63,"name":64,"nameZh":6,"description":65,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":66,"sourceHtmlUrl":67,"categories":68,"keywords":69,"publishedAt":19},"01M7DNCY3BCGY3MC5BFJ9S59BF","spf13-go","Review Go library APIs, package boundaries, tests, iterators and standard-library choices. Load for broad design or idiom reviews after the repository-owned Go skills.","https:\u002F\u002Fgithub.com\u002FCratis\u002FFundamentals.Go\u002Fblob\u002Fmain\u002F.cratis\u002Fai\u002Fskills\u002Fspf13-go\u002FLICENSE","https:\u002F\u002Fgithub.com\u002FCratis\u002FFundamentals.Go\u002Fblob\u002Fmain\u002F.cratis\u002Fai\u002Fskills\u002Fspf13-go\u002FSKILL.md",[],[],{"skillNo":71,"name":72,"nameZh":6,"description":73,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":74,"sourceHtmlUrl":75,"categories":76,"keywords":77,"publishedAt":19},"01M7DNCSQQH7GQ03ZETFX9XHAS","samber-golang-error-handling","Review Go error creation, wrapping, inspection and logging boundaries. Load when changing caller-visible failures after go-errors-and-context.","https:\u002F\u002Fgithub.com\u002FCratis\u002FFundamentals.Go\u002Fblob\u002Fmain\u002F.cratis\u002Fai\u002Fskills\u002Fsamber-golang-error-handling\u002FLICENSE","https:\u002F\u002Fgithub.com\u002FCratis\u002FFundamentals.Go\u002Fblob\u002Fmain\u002F.cratis\u002Fai\u002Fskills\u002Fsamber-golang-error-handling\u002FSKILL.md",[],[],{"skillNo":79,"name":80,"nameZh":6,"description":81,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":82,"sourceHtmlUrl":83,"categories":84,"keywords":85,"publishedAt":19},"01M7DNCM4ZC15SSDA5FAAHN5S0","samber-golang-context","Design Go context propagation, cancellation, deadlines and request metadata. Load for operation-lifetime changes or context-related leaks after go-errors-and-context.","https:\u002F\u002Fgithub.com\u002FCratis\u002FFundamentals.Go\u002Fblob\u002Fmain\u002F.cratis\u002Fai\u002Fskills\u002Fsamber-golang-context\u002FLICENSE","https:\u002F\u002Fgithub.com\u002FCratis\u002FFundamentals.Go\u002Fblob\u002Fmain\u002F.cratis\u002Fai\u002Fskills\u002Fsamber-golang-context\u002FSKILL.md",[],[],{"skillNo":87,"name":88,"nameZh":6,"description":89,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":90,"licenseFileUrl":91,"sourceHtmlUrl":92,"categories":93,"keywords":94,"publishedAt":19},"01M7DNCGNSMHK640AK1R3J0CPD","jetbrains-go-modern-guidelines","Choose version-compatible modern Go syntax and standard-library APIs. Load when modernizing touched Go code after reading go.mod and build constraints.","Apache-2.0","https:\u002F\u002Fgithub.com\u002FCratis\u002FFundamentals.Go\u002Fblob\u002Fmain\u002F.cratis\u002Fai\u002Fskills\u002Fjetbrains-go-modern-guidelines\u002FLICENSE","https:\u002F\u002Fgithub.com\u002FCratis\u002FFundamentals.Go\u002Fblob\u002Fmain\u002F.cratis\u002Fai\u002Fskills\u002Fjetbrains-go-modern-guidelines\u002FSKILL.md",[],[],{"skillNo":96,"name":97,"nameZh":6,"description":98,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":99,"categories":100,"keywords":101,"publishedAt":19},"01M7DNCBYSD6FPAPWM6PPSJR96","go-testing","Write and review Go unit, contract, transport, race, fuzz, and deterministic concurrency tests. Use for new behavior, bug fixes, flaky tests, and public API parity evidence.","https:\u002F\u002Fgithub.com\u002FCratis\u002FFundamentals.Go\u002Fblob\u002Fmain\u002F.cratis\u002Fai\u002Fskills\u002Fgo-testing\u002FSKILL.md",[],[],{"skillNo":103,"name":104,"nameZh":6,"description":105,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":106,"categories":107,"keywords":108,"publishedAt":19},"01M7DNC7ES2RD6WGKC94KMMXTD","go-release-modules","Review Go module dependencies, minimum versions, compatibility, semantic labels, release-action tags, and proxy discoverability. Use for release preparation, retractions, and major-version migration planning.","https:\u002F\u002Fgithub.com\u002FCratis\u002FFundamentals.Go\u002Fblob\u002Fmain\u002F.cratis\u002Fai\u002Fskills\u002Fgo-release-modules\u002FSKILL.md",[],[]]