/dotnet:thinktecturefrom dotnet
Use when declaring a Thinktecture type or fixing a TTRESG diagnostic, covering generated API and framework integration
Ships in dotnet. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Covers declaring types Thinktecture.Runtime.Extensions generates (value objects, smart enums, ad hoc and regular unions), from generated API to framework integration packages.
[REFERENCES]:
Package names omit prefix Thinktecture.Runtime.Extensions. and analyzer codes omit prefix TTRESG:
Analyzers reports 048, 049, 098, 100 to 110, and 1000 as warnings, 1001 as information, and every other rule as an errorpartial (006), a non-partial enclosing type fails with CS0260Simple value objects wrap one key member under [ValueObject<TKey>], complex value objects hold read-only members under [ComplexValueObject]:
partial, generator adds sealed to a class and readonly to a struct and owns the private constructor[ValueObject<string>(SkipIComparable = true)]
[ValidationError<Fault<Reason>>]
[KeyMemberEqualityComparer<ComparerAccessors.StringOrdinal, string>]
internal sealed partial class Code {
public int Length => _value.Length;
static partial void ValidateFactoryArguments(ref Fault<Reason>? validationError, ref string value) {
string? trimmed = value.TrimOrNullify();
if (trimmed is not { Length: <= 16 }) {
validationError = Fault.Of(Reason.Invalid, value);
return;
}
value = trimmed.ToUpperInvariant();
}
}
[ComplexValueObject]
[ValidationError<Fault<Reason>>]
internal sealed partial class Bounds {
public decimal Lower { get; }
public decimal Upper { get; }
static partial void ValidateFactoryArguments(ref Fault<Reason>? validationError, ref decimal lower, ref decimal upper) =>
validationError = lower <= upper ? null : Fault.Of(Reason.Invalid, (lower, upper));
}
Declaration rules the analyzer enforces:
init accessor is private (042), a primary constructor is rejected (043)[KeyMemberEqualityComparer] are 048 unless SkipEqualityComparison is setDefaultStringComparison (049)[IgnoreMember] removes a member from equality, the factories, and every other generated memberValidationError is the default error, its message reaches ValidationException, FormatException, JSON converters, and model state[ValidationError<T>] switches hook parameter, second TryCreate overload, and Validate to a type implementing IValidationError<T>| [INDEX] | [MEMBER] | [BEHAVIOR] |
|---|---|---|
| [01] | Create(value) | Validates and returns instance, or throws ValidationException with error text |
| [02] | TryCreate(value, out obj) | Returns false on rejection, 3-parameter overload returns the error |
| [03] | Validate(value, provider, out obj) | Returns error or null, complex form has no provider |
| [04] | Equality, GetHashCode, ==, != | Run through the configured comparer |
| [05] | ToString() | Key's ToString(), or { Lower = 1.23, Upper = 2.57 } for the complex form |
| [06] | IComparable<T>, IFormattable | Present when the key is comparable or formattable, simple form only |
| [07] | IParsable<T>, ISpanParsable<T> | Present when the key is parsable or a string, Parse throws FormatException |
| [08] | Conversions | To the key implicit, from the key explicit through Create, unsafe to a value-type key |
| [09] | [TypeConverter] | Emitted on a non-generic simple value object with factory methods |
null arguments for a non-nullable key or member return an error before the hook runs, the hook never repeats that null checkValidateFactoryArguments is static partial void with ref TError? validationError first and the key or each member by ref in declaration order:
ref parameterCreate, TryCreate, Validate, the conversion from the key, Parse, and TryParseValidateConstructorArguments(ref TKey value) exists beside the hook and rejects by throwing aloneTrailing parameters after the members are declared by value without a default (076):
private static TError? ValidateCore(members, extras, out T? obj) and private static T CreateCore(members, extras)default for every extra, a hand-written factory delegates to CreateCore[ValueObject<decimal>(MultiplyOperators = OperatorsGeneration.None, DivisionOperators = OperatorsGeneration.None)]
[ValidationError<Fault<Reason>>]
internal sealed partial class Amount {
private const int MinorUnit = 2;
static partial void ValidateFactoryArguments(ref Fault<Reason>? validationError, ref decimal value, MidpointRounding rounding) =>
(validationError, value) = value < 0 ? (Fault.Of(Reason.Invalid, value), value) : (null, decimal.Round(value, MinorUnit, rounding));
public static Amount Create(decimal value, MidpointRounding rounding) => CreateCore(value, rounding);
}
MinorUnit, the ISO 4217 minor unit of the type's currency (EUR)decimal stays disabled, the product needs a rounding decisionprivate static partial TValue ValidateFactoryArguments(...) with a non-void TValue return a value for the instancepartial void FactoryPostInit(TValue factoryArgumentsValidationError)[IgnoreMember] and an initializerString keys compare with StringComparer.OrdinalIgnoreCase by default and every other key with its own Equals:
[KeyMemberEqualityComparer<TAccessor, TKey>] selects the equality comparer[KeyMemberComparer<TAccessor, TKey>] selects the ordering comparer for IComparable<T> and the comparison operators on the simple form aloneSkipIComparable is not setComparerAccessors.StringOrdinal, StringOrdinalIgnoreCase, CurrentCulture, and CurrentCultureIgnoreCaseInvariantCulture, InvariantCultureIgnoreCase, and Default<T> complete the accessorsIEqualityComparerAccessor<T> or IComparerAccessor<T> with one static propertyDefaultStringComparison sets the comparison of their string members[MemberEqualityComparer<TAccessor, TMember>] on one member changes its comparer and drops every unattributed member out of equality and hashingDefaultWithKeyTypeOverloads adds operator overloads with the key type in both operand positions, amount > 42m compiles without a conversion:
operator checked + beside the unchecked form when the key declares itOption<T> in place of a null classToString() sets SkipToString and SkipIFormattable together, the generated IFormattable formats the key on its ownComplex value objects compose simple value objects, smart enums, and other complex value objects:
[ValueObject<TypeParamRef1>] through TypeParamRef5 bind the key to a type parameter that has a notnull, struct, or class constraint (074)where T : INumber<T> yields parsing, comparison, formatting, and arithmetic togetherSmart enums declare a fixed set of items as public static readonly fields of a partial class under [SmartEnum<TKey>], or under [SmartEnum] for a keyless set:
enum stands only where a host or file format defines the valuesItems is the one list of a set, menus, preset lists, and lookups derive from it (toSeq(X.Items), X.Items.ToFrozenDictionary(…))[SmartEnum][SmartEnum<string>(MapMethods = SwitchMapMethodsGeneration.DefaultWithPartialOverloads)]
internal sealed partial class Kind {
public static readonly Kind Standard = new("standard", rate: 0.5m, static (amount, scale) => decimal.Round(amount, scale, MidpointRounding.ToEven));
public static readonly Kind Express = new("express", rate: 0.75m, static (amount, scale) => decimal.Round(amount, scale, MidpointRounding.ToPositiveInfinity));
private readonly decimal _rate;
public decimal Price(decimal weight) => weight * _rate;
[UseDelegateFromConstructor]
public partial decimal Round(decimal amount, int scale);
static partial void ValidateConstructorArguments(ref string key, ref decimal rate) {
if (string.IsNullOrWhiteSpace(key)) throw new ArgumentException("key is blank", nameof(key));
key = key.Trim().ToUpperInvariant();
}
}
Generator emits one private constructor per base constructor with parameters in a fixed order: the key, the own fields and properties in declaration order, the base constructor parameters, and one delegate per [UseDelegateFromConstructor] method last. Declaration rules the analyzer and generator enforce:
public static readonly fields (002), static properties are not items (101), a set without items is 100, non-public items are rejectedArgumentException on the first lookup[IgnoreMember] hides a member from the generatorValidateConstructorArguments receives the key, the own members, and the base arguments by ref, not the delegates, and rejects by throwingnull keys throw ArgumentNullException after ValidateConstructorArguments returns[UseDelegateFromConstructor] marks a partial method without type parameters (050, 051), a private delegate field implements itDelegateName or a parameter a Func cannot hold (ref) makes the generator emit a nested delegate typeLazy<T> built from a static methodprivate (014) and deeper ones public (015)sealed (037), a derived class can be generic, Items lists the permitted implementationsGet, conversion operators, comparer settings, or generated ToString[ObjectFactory<string>] serializes or binds a keyless smart enumobject.ToString()| [INDEX] | [MEMBER] | [BEHAVIOR] |
|---|---|---|
| [01] | Items | Items in declaration order |
| [02] | Get(key) | null for a null key, UnknownSmartEnumIdentifierException for an unknown key |
| [03] | TryGet(key, out item) | false for an unknown key |
| [04] | Validate(key, provider, out item) | null or the error, a null key counts as unknown, the error names the identifier |
| [05] | Conversions | To the key implicit and null for a null item, from the key explicit through Get |
| [06] | Equality | Identity, GetHashCode computed once from the key with the configured comparer |
| [07] | IParsable<T>, ISpanParsable<T> | Present when the key implements them, which includes string, Parse throws FormatException |
| [08] | IComparable<T>, IFormattable | Present for a comparable or formattable key, with the comparison operators |
| [09] | ToString(), [TypeConverter] | Key's string form, ThinktectureTypeConverter<T, TKey, TValidationError> when non-generic |
UnknownSmartEnumIdentifierException is a KeyNotFoundException with the message There is no item of type 'Kind' with the identifier 'nope'.FrozenDictionaryGet, TryGet, Validate, Parse, and TryParseItems, Get, TryGet, and Validate implement the static abstract members of ISmartEnum<TKey, T, TValidationError>internal static class Items {
public static Option<T> Find<T, TKey>(TKey key) where T : ISmartEnum<TKey, T, ValidationError> where TKey : notnull =>
T.TryGet(key, out T? item) ? Some(item) : None;
}
String keys use StringComparer.OrdinalIgnoreCase for equality, the hash code, CompareTo, and the comparison operators, TryGet("STANDARD") finds Standard:
[KeyMemberEqualityComparer<TAccessor, TKey>] and [KeyMemberComparer<TAccessor, TKey>] replace them with the same accessors as a value objectFrozenDictionary, a predefined accessor gets GetAlternateLookup<ReadOnlySpan<char>>()IAlternateEqualityComparer<ReadOnlySpan<char>, string> allocate a string per span callSkipIComparable removes IComparable and IComparable<T> and leaves the comparison operators in place:
EqualityComparisonOperators, SwitchMethods, MapMethods, and SwitchMapStateParameterName[SmartEnum<TypeParamRef1>] binds the key to a notnull type parameter (074)TypeParamRef1 the generator always emits Get, TryGet, Validate, Items, equality, Switch, Map, and the conversionsTypeParamRef1 smart enum follow the constraintsstatic readonly fields that cannot be an attribute argument or a case labelAd hoc unions combine existing types that share no base, regular unions are class hierarchies where every case derives from one abstract partial base and holds its own properties and behavior, and smart enum items can return a union:
| [INDEX] | [ASPECT] | [AD_HOC_UNION] | [REGULAR_UNION] |
|---|---|---|---|
| [01] | Declaration | partial class, partial struct, ref partial struct | partial class or partial record, generated as abstract |
| [02] | Attribute | [Union<T1, T2>] up to 5 types, or [AdHocUnion] | [Union] on the base |
| [03] | Cases | Type arguments | Nested types that derive from the base |
| [04] | Generic | TypeParamRef1 to TypeParamRef5 name type parameters | Base can be generic, a case cannot (053) |
[AdHocUnion] with typeof exists for a member type a generic attribute cannot spell (List<string?>):
IsX and AsX named after the member type (IsString, AsInt32) and Value as objectNormalize{Member} partial hooks per stateful member run first in the generated constructor before any null checkToString, Switch, Value, and every serializer read the normalized value[Union<string, int>(T1Name = "Text", T2Name = "Count")]
internal sealed partial class TextOrCount {
static partial void NormalizeText(ref string text) => text = text?.Trim() ?? "";
}
AsX on the wrong member and the explicit cast throw InvalidOperationException ('TextOrCount' is not of type 'string' but of type 'int'.)ToString and GetHashCode delegate to the memberstring members compare with OrdinalIgnoreCase unless DefaultStringComparison says otherwiseobject or an interface receive a constructor and no operatorobject, or a duplicate type add CreateX for every member beside the constructorsCS0029), an object argument boxes the union or routes into the more specific memberCreateT(value) to keep normalization runningCS0457) where T closes over another member's typeTypeParamRef past the parameter count is 071, on a non-generic union 072, an allows ref struct parameter 073, no referenced parameter 107object? field with value types unboxedUseSingleBackingField boxes everything into one field, SingleBackingFieldType names a base or interface for that field and Value (075, 079)TxIsStateless = true, the union stores the discriminator aloneAsX of a stateless member returns default(T), and its CreateX is parameterlessConversionFromValue = None and ConstructorAccessModifier = Private[SetsRequiredMembers]Generator gives the base a private constructor, types declared outside the base cannot derive from it:
sealed or keep private constructors (054), record cases are sealed (055)Switch state overloadValidated over Unless checks[Union]
internal abstract partial record Phase {
public abstract bool CanCancel();
internal sealed record Open(string By) : Phase {
public override bool CanCancel() => true;
}
internal sealed record Closed(Instant At, string Reference) : Phase {
public override bool CanCancel() => false;
}
}
internal sealed record CloseRequest(Instant Now, string Reference, bool Allowed);
internal static class Transitions {
public static Phase Close(Phase phase, CloseRequest request) =>
phase.Switch<CloseRequest, Phase>(request,
open: static (close, open) => close.Allowed ? new Phase.Closed(close.Now, close.Reference) : open,
closed: static (_, closed) => closed);
}
ConversionFromValue = None on [Union] removes the operators[Union] become nested unions with their own cases, records cannot nest a unionSwitch prefixes nested arm names with the parent (failureNotFound)NestedUnionParameterNames = Simple drops the prefix and collides when nested unions share a case name[UnionSwitchMapOverload(StopAt = [typeof(Nested)])] adds an exhaustive overload with one arm per StopAt type in place of its casesUnknown cases are a [ComplexValueObject(SkipFactoryMethods = true)] with one Instance in place of nullSmart enums and unions generate Switch with one Action per case, Switch<TResult> with one Func per case, and Map<TResult> with one value per case:
static (1001)TState first and pass it to every lambdastate unless SwitchMapStateParameterName renames it, TState : allows ref struct holdsTResult on the call moves the error to the one arm that disagreesinternal static class Matching {
public static string Label(Kind kind, decimal weight, CultureInfo culture) =>
kind.Switch(
(weight, culture),
standard: static state => string.Create(state.culture, $"ground, {state.weight} kg"),
express: static state => string.Create(state.culture, $"air, {state.weight} kg"));
public static string Handling(Kind kind) => kind.Map(standard: "standard", express: "priority");
}
SwitchPartially and MapPartially exist only under SwitchMethods and MapMethods set to DefaultWithPartialOverloadsSwitchPartially takes an optional @default and does nothing for an unhandled case, the value-returning forms require @default@default receives the current member as object?, on a regular union the base typeSwitch and Map ends in an unreachable arm that throws InvalidOperationExceptionThe instance is not a known item of 'Kind'., regular union arm message is Unexpected type '...'.Map arm message is Unexpected value index '...'., ad hoc Switch throws IndexOutOfRangeException in that arm[ObjectFactory<T>] declares a conversion between a type and one other type T on a smart enum, a value object, a union, or a plain partial type:
IObjectFactory<TSelf, T, ValidationError> and demands one static method (061)string factories add IParsable<TSelf>static ValidationError? Validate(T? value, IFormatProvider? provider, out TSelf? item)
null and sets item on success, and returns the error with a null item on failurenull input sets a null item and returns null, no serializer or model binder passes it, Parse returns nullValidate, the hook normalizes once for both pathsT equal to the key type collide with the generated overloadUseForSerialization other than None or UseWithEntityFramework = true makes them two-wayIConvertible<T> and demand an instance T ToValue() (062)UseForSerialization is a flags enum (SystemTextJson, NewtonsoftJson, Json for both, MessagePack, All)UseForModelBinding = true binds from one route, query, header, or form valueHasCorrespondingConstructor = true declares a one-T constructor for the Entity Framework Core read pathSkipFactoryMethods = true on a value object removes its converters until a factory with UseForSerialization restores themAd hoc unions serialize no discriminator, a string factory is their one wire format, Validate assigns a member through the implicit conversion and ToValue renders the active case through Switch:
[Union<string, int>(T1Name = "Text", T2Name = "Count")]
[ObjectFactory<string>(UseForSerialization = SerializationFrameworks.All, UseForModelBinding = true)]
internal sealed partial class TextOrCount {
public static ValidationError? Validate(string? value, IFormatProvider? provider, out TextOrCount? item) {
item = null;
if (value is null) return null;
if (value.StartsWith("text:", StringComparison.Ordinal)) item = value["text:".Length..];
else if (value.StartsWith("count:", StringComparison.Ordinal) && int.TryParse(value["count:".Length..], NumberStyles.Integer, CultureInfo.InvariantCulture, out int count)) item = count;
return item is null ? new ValidationError($"'{value}' is neither text:<text> nor count:<integer>") : null;
}
public string ToValue() => Switch(
text: static text => $"text:{text}",
count: static count => string.Create(CultureInfo.InvariantCulture, $"count:{count}"));
}
JsonException with the error message, Parse throws FormatException with the same message, TryParse returns falsenull deserializes to null without a Validate callGenerated Validate returns an error beside an out value, TryCreate returns bool, and Create throws. Domain factories returning Fin preserve native typed errors, with Fault the error record dotnet:coding declares:
TypeConverter, or Parse reads set SkipFactoryMethods = true and drop [ValidationError<Fault<Reason>>] with the hookValidated(members) states the rule once, a numeric range included, as Fault.Unless(rule, reason, members).Map(_ => new X(members)) over private constructorApply, a rule per element traverses with its indexTypeConverter, or Parse reads keep the hook, and Validated is TryCreate(members, out X? x, out Fault<Reason>? fault) ? x : fault[ObjectFactory] converters on a SkipFactoryMethods type cost a Validate converting Fin back and change a complex type's wire shapeValidate through IObjectFactory<T, TValue, TValidationError>, retaining its nullable error and value contractIMinMaxValue<TSelf>, the change saturates into MinValue and MaxValue before ValidatedX.Validated(raw).ToOption()Create and a skipped type's to Validated(…).ThrowIfFail()[ValueObject<int>(SkipFactoryMethods = true)]
internal sealed partial class Count : IMinMaxValue<Count> {
public static Count MinValue { get; } = new(0);
public static Count MaxValue { get; } = new(100);
public Fin<Count> Next() => Validated(_value + 1);
public static Fin<Count> Validated(int value) => Fault.Unless(value >= MinValue && value <= MaxValue, Reason.Invalid, value).Map(_ => new Count(value));
}
[ValueObject<string>]
[ValidationError<Fault<Reason>>]
[KeyMemberEqualityComparer<ComparerAccessors.StringOrdinal, string>]
[KeyMemberComparer<ComparerAccessors.StringOrdinal, string>]
internal sealed partial class Glyphs {
public static Fin<Glyphs> Validated(string value) => TryCreate(value, out Glyphs? glyphs, out Fault<Reason>? fault) ? glyphs : fault;
static partial void ValidateFactoryArguments(ref Fault<Reason>? validationError, ref string value) =>
validationError = value.Length > 0 && toHashSet(value).Count == value.Length ? null : Fault.Of(Reason.Invalid, value);
}
internal static class Crossings {
public static Fin<Seq<Count>> Counts(Seq<int> raw) => raw.Traverse(Count.Validated).As();
}
Plain static members the package supplies beside its generators stay at the BCL boundary, code behind it uses Seq<A>(), Seq(x), Set(x), and toSeq in their place:
Thinktecture.Empty.Action converts to Action delegates through arity 16Empty.Disposable() and Empty.AsyncDisposable() return cached no-op resourcesEmpty.Collection<T>(), Empty.Dictionary<TKey, TValue>(), Empty.Lookup<TKey, TValue>(), and Empty.Set<T>() return cached read-only emptiesnull key throws on the dictionarySingleItem.Set and SingleItem.Dictionary build a read-only collection around one item with an optional comparerSingleItem.Lookup takes one key with its element sequence and enumerates that sequence liveToReadOnlyCollection(count) wraps a sequence without enumerating it and trusts the caller's countToReadOnlyCollection(selector) composes a projection with the source count and reruns the selector on every enumerationTrimOrNullify() returns null for blank text and the trimmed text otherwise, TrimOrNullify(maxLength) cuts the trimmed text by char countTrimOrNullify sits inside a validation hook that assigns the result back to value, an absent value is Option<string> through OptionalThinktecture.Collections.ProjectionEqualityComparer<T, TItem> compares projectionsStringKeyedObjectComparer<T> compares ToValue() of any IConvertible<string> type with its Ordinal and culture fieldsStringKeyedObjectComparer<T>.Ordinal restores exact matches for one collection of a case-insensitive typeSimple value objects and keyed smart enums cross every boundary as their key, complex value objects cross JSON and MessagePack as objects with their members, and every type crosses a boundary as one value through an object factory:
| [INDEX] | [INTEGRATION] | [PACKAGE] | [REGISTRATION] |
|---|---|---|---|
| [01] | System.Text.Json | Json | Referenced by the declaring project, the converter attribute is emitted |
| [02] | System.Text.Json at the host | Json | options.Converters.Add(new ThinktectureJsonConverterFactory()) |
| [03] | Newtonsoft.Json | Newtonsoft.Json | ThinktectureNewtonsoftJsonConverterFactory |
| [04] | MessagePack | MessagePack | Generated formatter, or ThinktectureMessageFormatterResolver.Instance |
| [05] | MVC model binding | AspNetCore | ModelBinderProviders.Insert(0, new ThinktectureModelBinderProvider()) |
| [06] | OpenAPI | Swashbuckle | services.AddThinktectureOpenApiFilters() |
| [07] | Entity Framework Core | EntityFrameworkCore10 | optionsBuilder.UseThinktectureValueConverters() |
| [08] | Serilog | Serilog | Destructure.UsingThinktectureRuntimeExtensions() |
Json and receives the [JsonConverter] attributeJson register the converter factory at the hostAddControllers().AddJsonOptions, minimal APIs read ConfigureHttpJsonOptions(bool skipObjectsWithJsonConverterAttribute, Func<Type, bool>? skipSpanBasedDeserialization) skips attributed typesskipSpanBasedDeserialization opts single types out of span-based readsJsonException with the validation text[JsonDerivedType] on the base per case or a [ObjectFactory<string>] on the base, MessagePack has no integration for themTypeNameHandling reads a regular union and is a deserialization risk unless the binder restricts the typesIParsable<T>.TryParse and answer a failed bind with a plain 400Validate, writes the error into ModelState, and [ApiController] answers 400 with the textskipBindingFromBody at its default trueAddThinktectureOpenApiFilters renders a value object as its key or its members and a smart enum as its key with the allowed valuesSmartEnumSchemaFilter selects Default, OneOf, AnyOf, AllOf, or FromDependencyInjectionSmartEnumSchemaExtension adds x-enum-varnamesRequiredMemberEvaluator marks a member implementing IDisallowDefaultValue or a non-nullable reference member as requiredRequiredMemberEvaluator.All and None override the default evaluationUseThinktectureValueConverters applies to every context on the optionsAddThinktectureValueConverters narrows to a model, entity, owned, or complex builder, HasThinktectureValueConverter to one propertyHasDiscriminator<string> with one HasValue<TCase> per case, or as table-per-typeHasColumnName| [INDEX] | [WRONG_FORM] | [CORRECT_FORM] |
|---|---|---|
| [01] | throw, Create, Parse, Get, or a key cast inside the hook | Assign validationError and return, a nested Validate result |
| [02] | Hooks that trim into a local and never assign value | value = trimmed |
| [03] | value.Trim().ToUpper() in a hook depends on the current culture | value.Trim().ToUpperInvariant() |
| [04] | String key without [KeyMemberEqualityComparer] | Equality comparer and [KeyMemberComparer] or SkipIComparable |
| [05] | TrimOrNullify(maxLength), Substring, Take, or ranges in a hook | Reject the over-long input, a cut merges distinct inputs |
| [06] | HasConversion with a lambda that calls Create | HasThinktectureValueConverter() or the converter registration |
| [07] | Factory [JsonConverter] by hand, or at the host for a complex type | Json referenced by the declaring project, or an object factory |
| [08] | Catch-all switch arm over a smart enum, union, Key, or Value | Generated Switch or Map |
| [09] | Lambdas without static in a Switch arm | State overload with a static lambda |
| [10] | SwitchPartially where every case matters | Exhaustive Switch |
| [11] | Ad hoc union declared partial struct | partial class |
| [12] | string failure case beside a string success value | One distinct type per case |
| [13] | Hand-written serializers for an ad hoc union | [ObjectFactory<string>] with ToValue and Validate |
| [14] | new List<T>() as an empty IReadOnlyList<T> at the BCL boundary | Thinktecture.Empty.Collection<T>() |
| [15] | Hook bridge on unserialized types, Create in a Try, Error.New | SkipFactoryMethods, Unless rule in Validated |
| [16] | Items scanned for the item with a matching Key | Get(key), or TryGet(key, out item) where the key can miss |
| [17] | switch or Equals over text keys selecting one of a closed set | [SmartEnum<string>] item per key, TryGet reads, Key writes |
| [18] | Smart enum or union ToString override, or one returning case text | Key, or the consumer's own text through Map |
| [19] | Union with Switch arms writing only host members from case fields | Func<T, IO<Unit>> closures folded in order |
| [20] | Stateless union cases selecting static presets of a host type | Preset type itself, each caller passing its preset |
| [21] | X.Create(<expression>) on a drag delta, extent, or measured value | X.Validated(<expression>) returning Fin |
| [22] | Clamp before Create, or a successor restating the bound | Saturation into MinValue and MaxValue, then Validated |
| [23] | Hand-written JsonConverter for a value parsed from text | [ObjectFactory<string>(UseForSerialization = SystemTextJson)] |
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub bsamiee/rasm --plugin dotnet8 skills in this plugin
/codelensUse when reading, diagnosing, or refactoring a file in a .NET solution, covering the roslyn-codelens MCP server/codingUse when writing or reviewing C#, covering functional design with result and effect types/debuggingUse when C# or another CoreCLR program misbehaves at runtime and its cause is unproven (wrong value, failing test, exception, hang, crash, breakpoint that never stops), covering DNCDbg launches and attaches, held starts, test runners, PDB documents, exception stops, expressions, live process reads, and dumpsOther plugins' skills for the same job