roninforge/roninforge-aspnet/aspnet-validate

Claude Code and agent skill by roninforge/roninforge-aspnet

Trust tier 2
  • community
LLM review pending
Source check pending

Checking that the SKILL.md file is still in the repository.

Scan an ASP.NET Core / .NET codebase for legacy patterns and anti-patterns: Startup.cs, sync-over-async, new HttpClient(), Newtonsoft.Json, IActionResult overuse, tracking queries, hand-rolled JWT, hardcoded secrets, CORS misconfiguration, Swashbuckle leftovers, missing CancellationToken.

Install

npx vskill@latest install roninforge/roninforge-aspnet/aspnet-validate

SKILL.md

The same SKILL.md was published earlier as roninforge/roninforge-aspnet/aspnet-validate.

Validate ASP.NET Core Codebase

When to Use

When auditing AI-generated ASP.NET Core, reviewing a migration to .NET 9, or preparing for production. Output is a list of locations and suggested fixes.

Instructions

Run each grep. Each hit is a candidate; review case by case.

Legacy hosting
bash
# Startup.cs pattern
grep -rn 'class Startup\b' --include='*.cs' .
grep -rn 'UseStartup<' --include='*.cs' .
grep -rn 'IWebHostBuilder\b' --include='*.cs' .
Sync over async
bash
grep -rnE '\.Result\b|\.Wait\(\)|GetAwaiter\(\)\.GetResult\(\)' --include='*.cs' .
grep -rn 'Thread\.Sleep' --include='*.cs' .

Each match needs visual inspection - .Result on a Task is bad, but .Result on a Func return type is fine.

Wrong JSON stack
bash
grep -rnE 'using Newtonsoft\.Json|JsonConvert\.' --include='*.cs' .
grep -rn 'AddNewtonsoftJson(' --include='*.cs' .
HttpClient misuse
bash
grep -rn 'new HttpClient(' --include='*.cs' .

Every match should be replaced with an IHttpClientFactory injection.

Tracking-by-default reads
bash
# Find ToListAsync without AsNoTracking nearby
grep -rn '\.ToListAsync(' --include='*.cs' . | grep -v 'AsNoTracking\|Select('
# Find FirstOrDefault / FirstOrDefaultAsync without AsNoTracking
grep -rn '\.FirstOrDefault(' --include='*.cs' . | grep -v 'AsNoTracking\|Select('
grep -rn '\.FirstOrDefaultAsync(' --include='*.cs' . | grep -v 'AsNoTracking\|Select('
Returning IEnumerable from repositories
bash
grep -rnE 'public\s+IEnumerable<\w+>\s+\w+\s*\(' --include='*.cs' .
Hardcoded secrets / connection strings
bash
grep -rnE '"sk_(live|test)_|"Server=.*Password=|"Host=.*Password=|api[_-]?key\s*=\s*"' --include='*.cs' .
CORS landmine

CORS policies often span multiple fluent-chain lines, so a single piped grep misses them. Run both and cross-reference the files manually:

bash
grep -rn 'AllowAnyOrigin()' --include='*.cs' .
grep -rn 'AllowCredentials' --include='*.cs' .

If any file appears in both lists, the policy almost certainly combines them. Open and verify - the runtime throws InvalidOperationException when the policy executes.

Static mutable state in controllers
bash
grep -rnE 'private\s+static\s+(?!readonly)(\w+<|Dictionary|List|HashSet)' --include='*.cs' .

The --pcre2 flag is not portable; if your grep does not support lookaheads, run this two-step:

bash
grep -rnE 'private\s+static\s+\w+' --include='*.cs' . | grep -v readonly
Hand-rolled JWT
bash
grep -rn 'HMACSHA256\|new JwtSecurityToken(' --include='*.cs' .
Missing CancellationToken on async endpoints
bash
# All async public methods returning Task
grep -rnE 'public\s+(async\s+)?Task<[^>]+>\s+\w+\s*\(' --include='*.cs' . | grep -v CancellationToken
String-interpolated log messages
bash
grep -rnE 'Log(Information|Warning|Error|Debug|Trace)\(\$"' --include='*.cs' .
Swashbuckle in a .NET 9 project
bash
grep -rn 'Swashbuckle\.AspNetCore' .
IActionResult returning everywhere
bash
grep -rnE 'Task<IActionResult>' --include='*.cs' .

Many of these are valid (controllers with multiple result types). Flag for review, not auto-fix.

N+1: Include without AsSplitQuery on collections
bash
grep -rn '\.Include(' --include='*.cs' .

Hits with multiple chained .Include of collection navigations should pair with .AsSplitQuery(); reference navigations (o.Customer) do not need it.

ConfigureAwait(false) usage
bash
grep -rn 'ConfigureAwait(false)' --include='*.cs' .

In application code (web project), every hit is noise to remove. In library code (NuGet packages), every await should have it.

Missing await using on IAsyncDisposable
bash
grep -rn 'IAsyncDisposable' --include='*.cs' .
# Then for known IAsyncDisposable types
grep -rn 'using var .* = new \(DbContext\|NpgsqlConnection\|HttpResponseMessage\)' --include='*.cs' .

Each hit on the second grep should be await using var ....

Task.Run wrapping async methods
bash
grep -rnE 'Task\.Run\(\s*(\(\)\s*=>|async\b)' --include='*.cs' .

Task.Run is for CPU-bound work; wrapping async IO adds a thread-pool hop for nothing.

Captive dependencies - singleton with scoped
bash
# All singleton registrations
grep -rn 'AddSingleton<' --include='*.cs' .

Then for each singleton, verify the constructor parameters are not scoped (DbContext, IHttpContextAccessor, etc).

Output Format

=== Critical ===
src/MyApi/Startup.cs:5 - Startup.cs pattern; rewrite as top-level Program.cs
src/MyApi/Services/Payment.cs:23 - new HttpClient() per call; register typed client
src/MyApi/Services/Auth.cs:45 - HMACSHA256 hand-rolled JWT; use AddJwtBearer
=== Warnings ===
src/MyApi/Endpoints/Orders.cs:12 - ToListAsync without AsNoTracking on read path
src/MyApi/Repositories/UserRepo.cs:34 - returns IEnumerable<User> with deferred execution
src/MyApi/MyApi.csproj:11 - Newtonsoft.Json package reference (no JsonConvert usage found)
=== Suggestions ===
src/MyApi/Endpoints/Orders.cs - consider projecting to DTO at the DB level

Security

  • Security scanPassed, 100 of 100Pattern checks on the skill's files.
  • Model reviewNot runA model review is scheduled for the next rescan.

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

7-day trend score
5

Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/roninforge/roninforge-aspnet/aspnet-validate/badge)](https://verified-skill.com/skills/roninforge/roninforge-aspnet/aspnet-validate)

Something wrong with this skill or its page? Tell us.