Generates ASP.NET Core authorization policies, custom handlers, and resource-based checks. Use for policy-vs-role decisions, endpoint restrictions, and IDOR prevention.
Ships in TheCodeMan .NET AI ToolKit. 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.
Design ASP.NET Core authorization the right way: named policies over scattered role strings, custom requirements/handlers for real rules, and resource-based checks for "can this user act on this object".
Works on a target: a project or GitHub URL. Inspect current setup: grep -rn "AddAuthorization\|RequireRole\|RequireClaim\|\[Authorize\|RequireAuthorization\|IAuthorizationHandler" --include=*.cs <target>.
builder.Services.AddAuthorizationBuilder()
.AddPolicy("CanManageOrders", p => p.RequireClaim("permission", "orders:manage"))
.AddPolicy("AdminOnly", p => p.RequireRole("Admin"))
.AddPolicy("Over18", p => p.AddRequirements(new MinimumAgeRequirement(18)));
public record MinimumAgeRequirement(int Age) : IAuthorizationRequirement;
public class MinimumAgeHandler : AuthorizationHandler<MinimumAgeRequirement>
{
protected override Task HandleRequirementAsync(AuthorizationHandlerContext ctx, MinimumAgeRequirement req)
{
var dob = ctx.User.FindFirst("dob")?.Value;
if (DateTime.TryParse(dob, out var d) && d.AddYears(req.Age) <= DateTime.Today)
ctx.Succeed(req);
return Task.CompletedTask;
}
}
builder.Services.AddSingleton<IAuthorizationHandler, MinimumAgeHandler>();
var auth = await _authService.AuthorizeAsync(User, order, "OrderOwnerPolicy");
if (!auth.Succeeded) return Results.Forbid();
This is how you stop IDOR — ownership checked against the actual resource, not just a role.
app.MapPost("/orders", ...).RequireAuthorization("CanManageOrders");
group.RequireAuthorization("AdminOnly");
// Consider a FallbackPolicy so endpoints are authenticated by default.
if (User.IsInRole(...)) blocks."Design authorization policies for my API", "restrict this endpoint to managers", "add a custom authorization rule", "stop users from accessing others' records" (resource-based). Pairs with jwt-auth-setup and the aspnetcore-security-auditor agent.
What SKILL.md sets; muted values are Claude Code's defaults
/dotnet-ai-toolkit:authorization-policy-generatorfrom TheCodeMan .NET AI ToolKit
npx claudepluginhub stefanthecode/dotnet-ai-toolkit --plugin dotnet-ai-toolkit49 skills in this plugin
/adonet-data-access-auditorAudit and fix classic ADO.NET data-access code (SqlConnection / SqlCommand / SqlDataReader / DataSet) on .NET Framework. Use this skill whenever the user shares raw ADO.NET code, a DAL / repository built on SqlCommand, stored-proc calls, string-concatenated SQL, or mentions SQL injection, parameterized queries, connection leaks, "using / Dispose", reading the same column multiple times, transactions, or "why does my old data layer leak connections / is it safe". Always use this skill for classic ADO.NET review instead of answering from memory; it applies a fixed security + correctness + performance checklist and rewrites the code./async-await-auditorAudit C#/.NET code for async/await anti-patterns and concurrency bugs. Use this skill whenever the user shares async C# code or asks about deadlocks, async void, .Result/.Wait(), blocking calls, ConfigureAwait, sync-over-async, fire-and-forget tasks, CancellationToken usage, or "why does my async code hang/deadlock". Always use this skill for async correctness/performance reviews instead of answering from memory; it applies a fixed checklist and rewrites the code./benchmarkdotnet-setupSet up BenchmarkDotNet for a .NET project and interpret the results — proper benchmark classes, memory diagnostics, baselines, and reading ns/op + allocations. Use this skill whenever the user wants to benchmark code, measure performance, compare two implementations, set up BenchmarkDotNet, or asks "which is faster / how do I benchmark this / interpret these benchmark results". Always use this skill for micro-benchmarking requests; it writes correct benchmarks and explains the numbers.Other plugins' skills for the same job