aspnet-core
Build, debug, modernize, or review ASP.NET Core applications with correct hosting, middleware, security, configuration, logging, and deployment patterns on…
Integrate ManagedCode.Orleans.Graph into an Orleans-based .NET application for grain-call policy enforcement, deadlock detection, live-call telemetry, and Mermaid graph diagnostics. USE FOR: ManagedCode.Orleans.Graph integration; allowed grain transitions; Orleans call filters;
$ npx -y skills add managedcode/dotnet-skills --skill managedcode-orleans-graph --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/managedcode-orleans-graphContext preview
The summary Claude sees to decide when to auto-load this skill.
Integrate ManagedCode.Orleans.Graph into an Orleans-based .NET application for grain-call policy enforcement, deadlock detection, live-call telemetry, and Mermaid graph diagnostics. USE FOR: ManagedCode.Orleans.Graph integration; allowed grain transitions; Orleans call filters;
name: managedcode-orleans-graph description: "Integrate ManagedCode.Orleans.Graph into an Orleans-based .NET application for grain-call policy enforcement, deadlock detection, live-call telemetry, and Mermaid graph diagnostics. USE FOR: ManagedCode.Orleans.Graph integration; allowed grain transitions; Orleans call filters; live policy graphs; reviewing Orleans call-cycle risk. DO NOT USE FOR: generic graph data modeling or traversal unrelated to Orleans calls. INVOKES: inspect the repository context, edit targeted files, and run relevant build, test, lint, or validation commands when changes are made." compatibility: "Requires .NET 10, Microsoft Orleans 10, and an Orleans silo or client that needs explicit grain-call policy enforcement or diagnostics."
Current upstream release reviewed: `v10.0.3`.
dotnet add package ManagedCode.Orleans.Graph
The upstream package targets the current .NET 10 / Orleans 10 stack. Do not add it to older Orleans applications without first checking target frameworks and Orleans package compatibility.
1. Confirm the application needs grain-call policy enforcement or live-call diagnostics. If the task is generic graph data traversal, use normal Orleans grain modeling instead. 2. Register Orleans.Graph filters in the silo with `AddOrleansGraph(...)`. 3. Model the policy from source grain to target grain and method. Start with explicit allow rules for client entry points and grain-to-grain transitions. 4. Use `AllowAll()` observe mode only to discover traffic before enforcement. Keep a follow-up step to convert observed edges into reviewed policy. 5. Register the client-side outgoing filter with `clientBuilder.AddOrleansGraph()` only when Orleans clients should participate in call-history tracking. 6. Use attributes when colocating policy with grain contracts is clearer than central fluent setup. 7. Generate Mermaid diagrams and inspect policy edges for review artifacts. 8. Validate with real Orleans runtime tests, including timer, reminder, hosted-service, and stateless-worker call origins when those are part of the topology.
flowchart LR
A["Orleans call"] --> B["Outgoing filter records source"]
B --> C["Incoming filter checks transition policy"]
C --> D{"Allowed?"}
D -->|Yes| E["Target grain method runs"]
D -->|No| F["Blocked before target code"]
E --> G["Telemetry worker aggregates live edge"]
G --> H["Telemetry grain / Mermaid graph"]using ManagedCode.Orleans.Graph.Extensions;
siloBuilder.AddOrleansGraph(graph =>
{
graph.AllowClientCallGrain<IOrderGrain>();
graph.AddGrainTransition<IOrderGrain, IPaymentGrain>()
.Method(
source => source.SubmitAsync(GraphParam.Any<Order>()),
target => target.ChargeAsync(GraphParam.Any<Payment>()))
.And();
graph.AddGrain<IPaymentGrain>()
.WithReentrancy();
});siloBuilder.AddOrleansGraph(
configureFilters: filters =>
{
filters.LiveGraphFlushPeriod = TimeSpan.FromSeconds(1);
},
configureGraph: graph =>
{
graph.AllowAll();
});
clientBuilder.AddOrleansGraph();After the app receives traffic, inspect the observed graph:
var telemetry = grainFactory.GetGrain<IOrleansGraphTelemetryGrain>(
Constants.LiveGraphTelemetryGrainKey);
var observedGraph = await telemetry.GetObservedGraphAsync();
var mermaid = await telemetry.GenerateLiveMermaidDiagramAsync();using ManagedCode.Orleans.Graph.Attributes;
[AllowClientCall]
[AllowGrainCall(
typeof(IPaymentGrain),
AllowAllMethods = false,
SourceMethods = [nameof(IOrderGrain.SubmitAsync)],
TargetMethods = [nameof(IPaymentGrain.ChargeAsync)])]
public interface IOrderGrain : IGrainWithStringKey
{
Task SubmitAsync(Order order);
}
[AllowSelfReentrancy]
public interface IPaymentGrain : IGrainWithStringKey
{
Task ChargeAsync(Payment payment);
}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
Build, debug, modernize, or review ASP.NET Core applications with correct hosting, middleware, security, configuration, logging, and deployment patterns on…
Build, upgrade, and operate Aspire 13.5.x C# or TypeScript application hosts with the current CLI, AppHost, ServiceDefaults, integrations, dashboard, testing,…
Build, review, or migrate Azure Functions in .NET with correct execution model, isolated worker setup, bindings, DI, and Durable Functions patterns. USE FOR:…
Build and review Blazor applications across server, WebAssembly, web app, and hybrid scenarios with correct component design, state flow, rendering, and…
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…
Design, tune, or review EF Core data access with proper modeling, migrations, query translation, performance, and lifetime management for modern .NET…