/managedcode-communication
Use ManagedCode.Communication when a .NET application needs explicit result objects, structured errors, and predictable service or API boundaries instead of exception-driven control flow. USE FOR: integrating ManagedCode.Communication into services or APIs; replacing
$ npx -y skills add managedcode/dotnet-skills --skill managedcode-communication --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
- Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
- You can call itInvoke it directly when you want it.
- Slash command
/managedcode-communication
Context preview
The summary Claude sees to decide when to auto-load this skill.
Use ManagedCode.Communication when a .NET application needs explicit result objects, structured errors, and predictable service or API boundaries instead of exception-driven control flow. USE FOR: integrating ManagedCode.Communication into services or APIs; replacing
SKILL.md
managedcode-communication.SKILL.mdname: managedcode-communication
description: "Use ManagedCode.Communication when a .NET application needs explicit result objects, structured errors, and predictable service or API boundaries instead of exception-driven control flow. USE FOR: integrating ManagedCode.Communication into services or APIs; replacing exception-driven result handling with explicit results; reviewing service boundaries that return. DO NOT USE FOR: unrelated stacks; generic tasks that do not need this specific guidance. INVOKES: inspect the repository context, edit targeted files, and run relevant build, test, lint, or validation commands when changes are made."
compatibility: "Requires a .NET application, service layer, or API boundary that integrates ManagedCode.Communication."
ManagedCode.Communication
Trigger On
- integrating `ManagedCode.Communication` into services or APIs
- replacing exception-driven result handling with explicit results
- reviewing service boundaries that return success or failure payloads
- documenting result-pattern usage across ASP.NET Core or application services
- mapping application errors to RFC 7807 problem details, Minimal API results, SignalR filters, or Orleans call filters
Install
Use the package that matches the boundary. Current upstream release reviewed: `v10.0.4`.
dotnet add package ManagedCode.Communication
dotnet add package ManagedCode.Communication.AspNetCore
dotnet add package ManagedCode.Communication.Extensions
dotnet add package ManagedCode.Communication.Orleans
For pinned project files:
<PackageReference Include="ManagedCode.Communication" Version="10.0.4" />
<PackageReference Include="ManagedCode.Communication.AspNetCore" Version="10.0.4" />
<PackageReference Include="ManagedCode.Communication.Extensions" Version="10.0.4" />
<PackageReference Include="ManagedCode.Communication.Orleans" Version="10.0.4" />
Workflow
1. Confirm the boundary where the library belongs:
- service result contracts
- application manager boundaries
- API endpoints that translate results into HTTP responses
2. Keep result creation and error mapping explicit instead of mixing exceptions, nulls, and ad-hoc tuples. 3. Pattern-match result objects at the boundary that converts them into user-facing responses. 4. Do not hide domain failures behind generic success wrappers. 5. Configure framework integration only where it removes manual translation:
- `ConfigureCommunication()` for ASP.NET Core logging and converters
- `WithCommunicationResults()` for Minimal API endpoint or group conversion
- Orleans or SignalR packages only when those runtime filters are actually in use
6. Validate positive, negative, and error-path handling after integration.
flowchart LR
A["Domain or service operation"] --> B["ManagedCode.Communication result"]
B --> C["Application or API boundary"]
C --> D["HTTP response or caller-visible contract"]
Practical Usage
Read path with explicit failures
public sealed class OrderService(IOrderRepository orders)
{
public async Task<Result<OrderDto>> GetAsync(Guid id, CancellationToken ct)
{
var order = await orders.FindAsync(id, ct);
return order is null
? Result<OrderDto>.FailNotFound($"Order {id} was not found.")
: Result<OrderDto>.Succeed(OrderDto.From(order));
}
}Use this shape when absence, validation, authorization, or domain rejection is an expected outcome. Reserve exceptions for unexpected infrastructure faults.
Write path through Minimal APIs
var builder = WebApplication.CreateBuilder(args);
builder.Services.ConfigureCommunication();
var app = builder.Build();
app.MapGroup("/orders")
.WithCommunicationResults()
.MapPost(string.Empty, async (CreateOrder command, OrderService orders, CancellationToken ct) =>
await orders.CreateAsync(command, ct));Handlers can return `Result` or `Result<T>` and let the extension package map failures to HTTP results and problem details at the API boundary.
Compose validation and domain steps
public async Task<Result<OrderReceipt>> CreateAsync(CreateOrder command, CancellationToken ct)
{
var validation = Validate(command);
if (validation.IsFailed)
{
return Result<OrderReceipt>.Fail(validation.Problem!);
}
return await Result<Order>.From(() => BuildOrder(command))
.ThenAsync(order => SaveAsync(order, ct))
.Then(order => Result<OrderReceipt>.Succeed(new OrderReceipt(order.Id, order.CreatedAt)));
}Use railway-style composition when each step can return a result and the caller should stop at the first real failure.
Options And Constraints
- `Result`, `Result<T>`, `CollectionResult<T>`, and `Problem` are the core surfaces. Keep them at service/API boundaries rather than leaking framework-specific HTTP results into domain code.
- `CollectionResult<T>` plus `PaginationRequest` / `PaginationOptions` should own paged API metadata instead of ad-hoc `(items, total)` tuples.
- Minimal APIs can use `WithCommunicationResults()` on one endpoint or an entire group. Prefer the group form only when every child endpoint follows the same result contract.
- `ManagedCode.Communication.Orleans` is for grain-call integration and serialization boundaries; use it with the Orleans skill when reviewing grain APIs.
- `v10.0.4` release notes call out error-handling fixes and dependency maintenance. Re-test negative paths after upgrading.
Deliver
- guidance on where explicit result objects improve clarity
- usage boundaries for translating results into API or caller responses
- validation expectations for success and failure flows
- package and integration choices for the actual runtime boundary
Validate
- result handling is consistent across the boundary that uses the library
- callers do not fall back to exception-only logic for normal failure cases
- negative and error scenarios are
Read more
name: managedcode-communication description: "Use ManagedCode.Communication when a .NET application needs explicit result objects, structured errors, and predictable service or API boundaries instead of exception-driven control flow. USE FOR: integrating ManagedCode.Communication into services or APIs; replacing exception-driven result handling with explicit results; reviewing service boundaries that return. DO NOT USE FOR: unrelated stacks; generic tasks that do not need this specific guidance. INVOKES: inspect the repository context, edit targeted files, and run relevant build, test, lint, or validation commands when changes are made." compatibility: "Requires a .NET application, service layer, or API boundary that integrates ManagedCode.Communication."
ManagedCode.Communication
Trigger On
- integrating `ManagedCode.Communication` into services or APIs
- replacing exception-driven result handling with explicit results
- reviewing service boundaries that return success or failure payloads
- documenting result-pattern usage across ASP.NET Core or application services
- mapping application errors to RFC 7807 problem details, Minimal API results, SignalR filters, or Orleans call filters
Install
Use the package that matches the boundary. Current upstream release reviewed: `v10.0.4`.
dotnet add package ManagedCode.Communication dotnet add package ManagedCode.Communication.AspNetCore dotnet add package ManagedCode.Communication.Extensions dotnet add package ManagedCode.Communication.Orleans
For pinned project files:
<PackageReference Include="ManagedCode.Communication" Version="10.0.4" /> <PackageReference Include="ManagedCode.Communication.AspNetCore" Version="10.0.4" /> <PackageReference Include="ManagedCode.Communication.Extensions" Version="10.0.4" /> <PackageReference Include="ManagedCode.Communication.Orleans" Version="10.0.4" />
Workflow
1. Confirm the boundary where the library belongs:
- service result contracts
- application manager boundaries
- API endpoints that translate results into HTTP responses
2. Keep result creation and error mapping explicit instead of mixing exceptions, nulls, and ad-hoc tuples. 3. Pattern-match result objects at the boundary that converts them into user-facing responses. 4. Do not hide domain failures behind generic success wrappers. 5. Configure framework integration only where it removes manual translation:
- `ConfigureCommunication()` for ASP.NET Core logging and converters
- `WithCommunicationResults()` for Minimal API endpoint or group conversion
- Orleans or SignalR packages only when those runtime filters are actually in use
6. Validate positive, negative, and error-path handling after integration.
flowchart LR A["Domain or service operation"] --> B["ManagedCode.Communication result"] B --> C["Application or API boundary"] C --> D["HTTP response or caller-visible contract"]
Practical Usage
Read path with explicit failures
public sealed class OrderService(IOrderRepository orders)
{
public async Task<Result<OrderDto>> GetAsync(Guid id, CancellationToken ct)
{
var order = await orders.FindAsync(id, ct);
return order is null
? Result<OrderDto>.FailNotFound($"Order {id} was not found.")
: Result<OrderDto>.Succeed(OrderDto.From(order));
}
}Use this shape when absence, validation, authorization, or domain rejection is an expected outcome. Reserve exceptions for unexpected infrastructure faults.
Write path through Minimal APIs
var builder = WebApplication.CreateBuilder(args);
builder.Services.ConfigureCommunication();
var app = builder.Build();
app.MapGroup("/orders")
.WithCommunicationResults()
.MapPost(string.Empty, async (CreateOrder command, OrderService orders, CancellationToken ct) =>
await orders.CreateAsync(command, ct));Handlers can return `Result` or `Result<T>` and let the extension package map failures to HTTP results and problem details at the API boundary.
Compose validation and domain steps
public async Task<Result<OrderReceipt>> CreateAsync(CreateOrder command, CancellationToken ct)
{
var validation = Validate(command);
if (validation.IsFailed)
{
return Result<OrderReceipt>.Fail(validation.Problem!);
}
return await Result<Order>.From(() => BuildOrder(command))
.ThenAsync(order => SaveAsync(order, ct))
.Then(order => Result<OrderReceipt>.Succeed(new OrderReceipt(order.Id, order.CreatedAt)));
}Use railway-style composition when each step can return a result and the caller should stop at the first real failure.
Options And Constraints
- `Result`, `Result<T>`, `CollectionResult<T>`, and `Problem` are the core surfaces. Keep them at service/API boundaries rather than leaking framework-specific HTTP results into domain code.
- `CollectionResult<T>` plus `PaginationRequest` / `PaginationOptions` should own paged API metadata instead of ad-hoc `(items, total)` tuples.
- Minimal APIs can use `WithCommunicationResults()` on one endpoint or an entire group. Prefer the group form only when every child endpoint follows the same result contract.
- `ManagedCode.Communication.Orleans` is for grain-call integration and serialization boundaries; use it with the Orleans skill when reviewing grain APIs.
- `v10.0.4` release notes call out error-handling fixes and dependency maintenance. Re-test negative paths after upgrading.
Deliver
- guidance on where explicit result objects improve clarity
- usage boundaries for translating results into API or caller responses
- validation expectations for success and failure flows
- package and integration choices for the actual runtime boundary
Validate
- result handling is consistent across the boundary that uses the library
- callers do not fall back to exception-only logic for normal failure cases
- negative and error scenarios are
Stop explaining .NET to your AI. Start building. We've all been there: asking Claude to use Entity Framework, only to get EF6 patterns in a .NET 8 project. Explaining to Copilot that Blazor Server and Blazor WebAssembly aren't the same thing.
Repo: managedcode/dotnet-skills
Other skills on dotnet-skills.
- /aspnet-core
Build, debug, modernize, or review ASP.NET Core applications with correct hosting, middleware, security, configuration, logging, and deployment patterns on current .NET. USE FOR: working on ASP.NET Core apps, services, or middleware; changing auth, routing, configuration,
Open skill - /aspire
Build, upgrade, and operate Aspire 13.4.x C# or TypeScript application hosts with the current CLI, AppHost, ServiceDefaults, integrations, dashboard, testing, MCP, and deployment patterns for distributed apps. USE FOR: Aspire.AppHost.Sdk, Aspire.Hosting.*,
Open skill - /azure-functions
Build, review, or migrate Azure Functions in .NET with correct execution model, isolated worker setup, bindings, DI, and Durable Functions patterns. USE FOR: working on Azure Functions in .NET; migrating from the in-process model to the isolated worker model; adding Durable
Open skill - /blazor
Build and review Blazor applications across server, WebAssembly, web app, and hybrid scenarios with correct component design, state flow, rendering, and hosting choices. USE FOR: building interactive web UIs with C# instead of JavaScript; choosing between Server, WebAssembly, or
Open skill - /entity-framework6
Maintain or migrate EF6-based applications with realistic guidance on what to keep, what to modernize, and when EF Core is or is not the right next step. USE FOR: EF6 codebases; runtime versus ORM migration decisions; EDMX, code-first, ObjectContext, and legacy data-access
Open skill - /entity-framework-core
Design, tune, or review EF Core data access with proper modeling, migrations, query translation, performance, and lifetime management for modern .NET applications. USE FOR: DbContext, migrations, model configuration, EF queries, tracking, loading, performance, transactions, and
Open skill

