.github/Skills/domainprimitive-builder/SKILL.md
Helps create and implement DomainPrimitive types correctly using the AltaSoft DomainPrimitives framework. Guides the agent to generate generator-compatible primitives, add proper validation logic, apply normalization when needed, and follow all structural and domain invariant rules required for safe DomainPrimitive design.
npx skillsauth add altasoft/domainprimitives domainprimitive-builderInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
This skill applies only to C# projects using the AltaSoft DomainPrimitives framework and its source generator.
Agent must:
Agent must NOT:
All templates, rules, and examples in this skill are C#-specific.
This skill guides the agent to correctly create and maintain DomainPrimitive types using the AltaSoft DomainPrimitives framework. It ensures primitives are generator-compatible, domain-safe, and follow strict structural and validation rules.
Use this skill when:
When the user asks to create a DomainPrimitive and the domain rules are not fully specified, the agent must ask clarification questions before generating code.
Agent must not generate a primitive implementation unless it is confident about the domain invariants and validation rules.
If uncertainty exists, the agent must pause generation and ask targeted questions.
Agent must ask questions when any of the following are unclear:
If the user asks to create TransactionAmount, the agent should ask questions such as:
Agent must wait for answers before generating the primitive.
Agent may generate immediately only if:
Otherwise → clarification required.
Before clarification, agent may suggest:
But must label them as proposals, not final implementation.
These rules are project-specific and override any generic recommendations.
sealed partial classreadonly partial structCorrect:
public sealed partial class Email : IDomainValue<string>
public readonly partial struct OrderId : IDomainValue<Guid>
Forbidden:
public readonly partial struct Email : IDomainValue<string>
public sealed partial class OrderId : IDomainValue<Guid>
DomainPrimitives may wrap only these C# types:
Rules:
These rules are mandatory and must never be violated.
Every DomainPrimitive must implement:
IDomainValue<T> (AltaSoft.DomainPrimitives)
All DomainPrimitive types must be declared partial.
Do not generate:
Construction is generator-controlled.
Do not declare:
Generator provides storage and access APIs.
Do not declare:
Must be exactly:
public static PrimitiveValidationResult Validate(T value)
Rules:
Forbidden:
Validation must be pure.
Validation defines domain invariants and must be explicit and domain-focused. Validation method must not call Transform.
Use implicit string → PrimitiveValidationResult conversion:
if (value < 0) return "number is negative";
Avoid PrimitiveValidationResult.Error(...) unless explicitly required.
Always return:
PrimitiveValidationResult.Ok
when validation passes.
Use ordered early-return checks:
if (value.Length == 0) return "must not be empty";
if (value.Length > 50) return "too long";
return PrimitiveValidationResult.Ok;
Avoid nested validation trees.
Agent must generate concrete domain validation — not placeholders.
Forbidden outputs:
Validation must match primitive semantics inferred from the name.
Examples:
Validation must stay local to the value and not depend on external systems.
Validation error messages must be:
Good:
Bad:
Agent must select template strictly by underlying type.
sealed partial class + IDomainValue<string>
readonly partial struct + IDomainValue<T>
Templates must follow Structural Generator Safety Rules.
Optional normalization hook executed before Validate.
Signature:
static T Transform(T value)
Allowed:
Forbidden:
Must be idempotent.
Attributes express structural or mechanical constraints.
Validate expresses domain semantics.
Use only for string primitives with fixed length limits.
Use for numeric primitives to restrict arithmetic operators: Addition, Subtraction, Multiplication, Division, Modulus.
Use for Date/Time/Duration types when canonical external format is required.
Do not use attributes for dynamic or contextual rules.
DomainPrimitives may define:
public static string ToString(T value)
This is a generator formatting hook — not an override.
Rules:
Example:
public static string ToString(DateOnly value) => value.ToString("dd", CultureInfo.InvariantCulture);
Do not add when default formatting is sufficient or when SerializationFormat covers the need.
Agent must refuse to generate primitives that:
development
Maintainer-only workflow for handling GitHub Secret Scanning alerts on OpenClaw. Use when Codex needs to triage, redact, clean up, and resolve secret leakage found in issue comments, issue bodies, PR comments, or other GitHub content.
development
Maintainer workflow for OpenClaw releases, prereleases, changelog release notes, and publish validation. Use when Codex needs to prepare or verify stable or beta release steps, align version naming, assemble release notes, check release auth requirements, or validate publish-time commands and artifacts.
development
Run, watch, debug, and extend OpenClaw QA testing with qa-lab and qa-channel. Use when Codex needs to execute the repo-backed QA suite, inspect live QA artifacts, debug failing scenarios, add new QA scenarios, or explain the OpenClaw QA workflow. Prefer the live OpenAI lane with regular openai/gpt-5.4 in fast mode; do not use gpt-5.4-pro or gpt-5.4-mini unless the user explicitly overrides that policy.
development
End-to-end Parallels smoke, upgrade, and rerun workflow for OpenClaw across macOS, Windows, and Linux guests. Use when Codex needs to run, rerun, debug, or interpret VM-based install, onboarding, gateway smoke tests, latest-release-to-main upgrade checks, fresh snapshot retests, or optional Discord roundtrip verification under Parallels.