dotnet-coding

Guides writing and reviewing C# code using functional patterns with LanguageExt, Thinktecture, and Mapperly.

Updated Jun 30, 2026
One-click install
npx skills add https://github.com/bsamiee/Rasm --skill dotnet-coding-bsamiee
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: dotnet-coding
Source: https://github.com/bsamiee/Rasm/tree/main/.claude/skills/dotnet-coding
Command: npx skills add https://github.com/bsamiee/Rasm --skill dotnet-coding-bsamiee

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Writing C# under strict functional standards (totality, purity, immutability, explicit effects) is error-prone without clear rules for signatures, result types, error handling, and effect boundaries. This Skill encodes those decisions so C# code stays honest, composable, and testable. ## Core Features & Use Cases - Honest signatures and purity rules: Narrow inputs to validated types, widen outputs to Option, Fin, or Validation, and keep side effects out of pure functions. - Result and effect composition: Compose Option, Fin, Validation, IO, and Eff with Map, Bind, Traverse, and LINQ queries, with typed Expected errors and union modeling via Thinktecture. - Boundary and host patterns: Isolate I/O with IO.lift and IO.liftAsync, inject dependencies as functions, run effects once at the host with RunSafe, and apply retry, fallback, and recovery policies. - Use Case: When implementing a command handler that validates input, loads state, applies a pure transition, and persists the result, use this Skill to structure the flow as one IO query with typed errors and a single host-side Match. ## Quick Start Ask the AI to write or review a C# workflow following the dotnet-coding standards, for example a validation-and-persistence handler using Fin and IO.

Frequently Asked Questions about dotnet-coding

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I handle errors in C# without throwing exceptions?▼

Model expected failures as data in the return type using Fin<A> for short-circuiting failures or Validation<Error, A> for accumulating independent failures. Declare each error as a sealed record extending Expected with a message and code, and reserve exceptions for developer defects.

How do I compose Option and Fin results in a C# workflow?▼

Use Map for pure transformations, Bind or LINQ from clauses for dependent steps, and guard on Fin to attach a named error to a failing condition. Convert between result types only at one named boundary using ToFin, ToValidation, or ToOption.

When should I use IO<A> versus Task in C#?▼

Use IO<A> to describe a side effect that performs nothing until the host runs it, which keeps fallback and retry composable. Adapt task-returning operations through IO.liftAsync, and run the effect once at the host with RunSafe to get a Fin for translation.

Does LanguageExt support dependency injection without interfaces?▼

Yes, inject the narrowest function that represents the consumer's need, such as Func<Instant> for a clock or T -> IO<Unit> for persistence. For consumers reading many capabilities, use Eff<RT, A> with a runtime record implementing one Has trait per capability.

What are the limitations of recursion in C# functional code?▼

C# does not optimize tail calls, so unbounded direct recursion can overflow the stack. Use Trampoline<A> for pure unbounded transitions, Monad.recur for effectful loops needing only the final value, or LanguageExt.List.unfold when intermediate states matter.

How do I model domain states with discriminated unions in C#?▼

Use the Thinktecture [Union] attribute on an abstract partial record with one sealed record case per valid state. Every Switch lacking an arm for a new case fails to compile, which keeps pattern matching exhaustive as the domain evolves.