.NET Minimal API Review (TypedResults, ProblemDetails, Auth)

    1

    This skill gives your agent the rules a senior ASP.NET Core reviewer applies, plus a stdlib-only Python scanner that flags 7 issues (MAPI001–007) before the agent changes anything.

    Free

    Security scanned

    Works with the AI Agents you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIMuseMuseDotsDots+21 more

    .NET Minimal API Review (TypedResults, ProblemDetails, Auth)

    Example session with this skill installed

    Review my ASP.NET Core Minimal API (src/Orders.Api) before we expose it outside localhost. Run the scanner, fix what it finds, and tell me exactly what changed.

    • Read your context and instructions
    • Compiled the net minimal api

    Summary

    Ran python scripts/scan_minimal_api.py src/Orders.Api (read-only). 10 findings across all 7 rules in Program.cs. Each finding is a review prompt; I confirmed each in context before changing code.

    Scanner output (verbatim, paths shortened)

    Program.cs:1: MAPI005 no AddProblemDetails() anywhere in scanned sources
    Program.cs:1: MAPI007 POST/PUT/PATCH endpoints but no request validation registered (AddValidation / IValidator / endpoint filter)
    Program.cs:2: MAPI006 CORS AllowAnyOrigin() (list explicit origins)
    Program.cs:4: MAPI003 UseDeveloperExceptionPage() not guarded by IsDevelopment()
    Program.cs:6: MAPI004 endpoint has no explicit auth decision (RequireAuthorization / AllowAnonymous / fallback policy)
    Program.cs:9: MAPI001 untyped Results.* (prefer TypedResults / Results<T1,T2>)
    Program.cs:12: MAPI004 endpoint has no explicit auth decision (RequireAuthorization / AllowAnonymous / fallback policy)
    Program.cs:18: MAPI001 untyped Results.* (prefer TypedResults / Results<T1,T2>)
    Program.cs:22: MAPI001 untyped Results.* (prefer TypedResults / Results<T1,T2>)
    Program.cs:22: MAPI002 exception text returned to caller (log it; return ProblemDetails)
    
    10 finding(s).
    

    Changes

    RuleBeforeAfter
    MAPI004app.MapGet("/orders/{id}", ...) anonymousvar api = app.MapGroup("/api").RequireAuthorization(); endpoints moved under it; /health marked .AllowAnonymous()
    MAPI001Results.Ok(o) returning the EF entityTask<Results<Ok<OrderDto>, NotFound>> + TypedResults.Ok(dto)
    MAPI002catch (Exception ex) { return Results.BadRequest(ex.Message); }catch removed; unhandled errors go to UseExceptionHandler() as problem+json
    MAPI005no ProblemDetailsbuilder.Services.AddProblemDetails(); + app.UseExceptionHandler();
    MAPI003app.UseDeveloperExceptionPage(); always onwrapped in if (app.Environment.IsDevelopment())
    MAPI006AllowAnyOrigin()named policy with origins from Cors:Origins config
    MAPI007POST body unvalidatedbuilder.Services.AddValidation(); + DataAnnotations on CreateOrder

    API contract changes

    • Endpoints now require an authenticated caller (except /health).
    • 500 and 400 bodies are now application/problem+json; exception text is no longer returned.

    Verification

    • Scanner re-run on the fixed project: 0 finding(s). exit 0.
    • Next: dotnet build and dotnet test; add a test that POSTs an invalid body and asserts 400, and one that calls /api/orders/1 without a token and asserts 401.

    Connects securely to your tools. The creator never sees your data.

    About this skill

    AI agents scaffold ASP.NET Core Minimal APIs that compile and demo well but ship with anonymous endpoints, untyped Results.Ok(entity), exception text returned to callers, no input validation and AllowAnyOrigin(). This skill gives your agent the rules a senior ASP.NET Core reviewer applies, plus a stdlib-only Python scanner that flags 7 issues (MAPI001–007) before the agent changes anything.

    What it does

    • Scan → apply rules → verify (re-scan, dotnet build, dotnet test)
    • Auth: every endpoint authorized (RequireAuthorization, authorized MapGroup, or fallback policy) or deliberately AllowAnonymous
    • Errors: AddProblemDetails + UseExceptionHandler; no ex.Message in responses; dev exception page only in Development
    • Validation: .NET 10 AddValidation or an endpoint filter; TypedResults.ValidationProblem
    • Output: file:line, rule, before/after, how verified, and any API contract change

    Targets ASP.NET Core 8+ (rules written for .NET 10). Scanner is heuristic and read-only; it writes nothing and makes no network calls. MIT licensed.

    Scanner uses heuristics. May miss auth applied by custom extensions or external assemblies. Tracks statements to terminating semicolons. Requires manually running the Python scanner script.

    How to use

    1. 1

      Connect your agent to the Agensi MCP

      Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup

    2. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 3

      Ask for what you need

      Your agent loads this skill and uses it on your task. It always asks before any payment.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill goes through the trust checks below.

    Security scanned

    Checked by our 8-point scan before listing

    Fresh listing

    Recently published to Agensi

    Free forever

    No account required to browse

    Trust & safety

    Security scan

    Security scan passed 8 days ago

    • Free with an Agensi account

    Permissions

    Terminal / Shell
    Read Files
    Write Files

    Terminal runs the read-only Python scanner. Read Files lets it scan .cs sources. Write Files is only used when you ask the agent to apply fixes to your code; the scanner itself writes nothing and makes no network calls.

    Listed8 days ago

    What's inside

    Frequently Asked Questions

    Rules are written for ASP.NET Core 8, 9 and 10. TypedResults exists from .NET 7; built-in AddValidation() is .NET 10 only, and on 8/9 the skill uses an endpoint filter (e.g. FluentValidation) instead.

    SKILL.md (workflow and rules), two reference files (endpoint rules; errors, ProblemDetails and CORS) with before/after C#, one stdlib-only Python scanner (scripts/scan_minimal_api.py, 7 checks MAPI001-007), and an MIT LICENSE.

    The agent runs a deterministic scanner first, so findings come from your code rather than the model's guess, then applies written rules and re-scans to verify. The scanner checks 7 patterns only; CancellationToken flow and DTO mapping are review rules, not scanner checks.

    The scanner exits 1 when it finds something and 0 when clean, so you can run it in CI, but it is heuristic and line-based: expect occasional false positives and treat hits as review prompts rather than a hard gate.

    Every endpoint must have an explicit auth decision (RequireAuthorization, an authorized MapGroup, a fallback policy, or deliberate AllowAnonymous), and exception text is never returned; errors go through AddProblemDetails + UseExceptionHandler.

    New in APIs & Backend