Works with the AI Agents you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIMuseMuseDotsDots+22 more

    C# Code Doctor

    1

    Diagnose .NET defects from evidence and deliver focused, safe fixes for async, DI, APIs, EF Core, performance, tests, and production reliability.

    $9.99

    Secure checkout via Stripe

    Money-back guarantee

    Converts to your local currency at checkout

    Security scanned
    C# Code Doctor

    C# Code Doctor

    Example session with this skill installed

    Review this fictional ASP.NET Core 8 API service. The endpoint GET /orders/{id} calls an async repository but uses .Result inside the request path. A singleton OrderCache depends on a scoped AppDbContext. The EF query returns all order lines, then filters them in memory. No stack trace or benchmark is available. Please identify likely defects versus confirmed facts, explain risks, propose a minimal repair plan with illustrative C# snippets, list tests to add, and state what evidence is still needed. Do not claim to have run the code.

    • Read your context and instructions
    • Compiled the c code doctor

    Evidence-Led .NET Review

    Confirmed from the prompt

    • An asynchronous repository result is synchronously blocked with .Result in a request path. This is sync-over-async and can block request threads; exact deadlock or starvation behavior depends on runtime, hosting, and surrounding code.
    • A singleton cache depends directly on a scoped AppDbContext. This is a lifetime mismatch and may capture a scoped dependency beyond its intended request scope.
    • The query loads order lines before filtering in memory, so unnecessary rows may be transferred and materialized. The performance impact is unmeasured.

    Minimal repair direction

    1. Make the endpoint and call chain asynchronous end to end. var order = await repository.GetAsync(id, cancellationToken); and propagate cancellation to database and HTTP calls. Avoid .Result and .Wait().
    2. Keep DbContext scoped. If the cache needs database work outside a request scope, inject IDbContextFactory<AppDbContext> and create/dispose a context per operation, or redesign the cache around a scoped service. Do not simply change lifetimes without checking cache ownership and concurrency.
    3. Push supported predicates into the EF query: context.OrderLines.Where(x => x.OrderId == id && x.IsActive).Select(...).ToListAsync(ct). Confirm the intended semantics, indexes, projection, and provider translation before altering production behavior.

    Validation plan

    • Add an endpoint test that verifies successful retrieval and cancellation propagation.
    • Add DI validation or a startup test to catch captive scoped dependencies.
    • Add repository tests that assert filtering and projection semantics against the actual provider where translation matters.
    • Compare generated SQL and row counts; profile a representative workload before claiming performance improvement.
    • Run the solution's build, analyzer, and relevant integration tests using its documented SDK and target framework.

    Evidence still needed

    Inspect registrations, cache threading/eviction behavior, repository signatures, query predicates, EF provider and versions, generated SQL, expected null/not-found behavior, project tests, and actual runtime traces if thread starvation is suspected. No compilation, benchmark, or production test was performed for this illustrative review.

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

    About this skill

    C# Code Doctor

    Review and improve C#/.NET codebases with evidence-led diagnosis. Start by establishing intended behavior, target framework, SDK/runtime, project layout, dependencies, hosting, persistence, deployment, and constraints. Use supplied source, errors, logs, test output, traces, or profiles to separate symptoms from root causes and bound the impact.

    Cover ASP.NET Core and APIs, async/cancellation, dependency-injection lifetimes, nullability, exceptions, resource ownership, concurrency, HTTP clients, EF Core and Dapper, transactions, configuration, security, reliability, tests, observability, and modernization. Prefer the smallest safe correction that preserves public contracts and working behavior. Make assumptions explicit and identify validation steps.

    Never claim to have built, tested, benchmarked, profiled, scanned, patched, deployed, or verified a project unless the relevant capability was actually available and used. Do not fabricate runtime facts, package versions, vulnerabilities, or performance gains. This agent provides engineering assistance; a maintainer must review changes and run project-appropriate validation before release.

    How to use

    Skills on Agensi run inside your AI agent. Copy the prompt, paste it into your agent, and it connects to Agensi and installs this skill for you. If a payment is needed, your agent shows it to you first.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill passes our trust checks below.

    Security scanned

    Passed our 8-point scan before listing

    Fresh listing

    Recently published to Agensi

    Money-back guarantee

    Doesn't do what its page promises? You get your money back.

    Trust & safety

    Security scanned

    Verified clean 10 days ago

    • Passed all security checks, Safe to install

    Listed10 days ago

    What's inside

    Frequently Asked Questions