querylenshq/ef-querylens/tsp-csharp

Claude Code and agent skill by querylenshq/ef-querylens

Trust tier 2
  • community
Source check pending

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

Comprehensive C# and .NET development skill for TSP projects. Use when writing, reviewing, or debugging C# code — covers async/await, EF Core, performance, security, HTTP resilience, Options pattern, middleware, logging, and ASP.NET Core patterns. Trigger for: async, Task, CancellationToken, DbContext, LINQ, Span, Memory, hot path, authentication, authorization, validation, secrets, HttpClient, IOptions, middleware, minimal API, TypedResults, ProblemDetails, Channels, ILogger, Serilog, logging, pagination, entity design, audit fields, OpenAPI.

Install

npx vskill@latest install querylenshq/ef-querylens/tsp-csharp

SKILL.md

C# & .NET — TSP Standards

Target .NET 8+ / C# 12+. Use the reference files below for detailed guidance per domain.

Reference Files

Read the relevant reference(s) based on the current task:

When working with...Read
Async/await, Tasks, CancellationToken, IAsyncEnumerable, ChannelsAsync & Concurrency
DbContext, LINQ queries, migrations, change tracking, N+1Entity Framework Core
Hot paths, Span/Memory, pooling, allocations, benchmarkingPerformance
Auth, secrets, input validation, CORS, rate limiting, middlewareSecurity
Structured logging, Serilog, correlation, severity, maskingLogging

Decision Tables

Result vs Exception
Error typeExpected?Use
Domain / business ruleYesResult<T> / ErrorOr<T>
Domain / business ruleNoException
Infrastructure (DB, network)—Exception
IOptions Selection
Need runtime reload?Per-request scope?Use
No—IOptions<T> (most common)
YesYesIOptionsSnapshot<T>
YesNo (live + OnChange)IOptionsMonitor<T>
Service Lifetime
ScenarioLifetime
Default for most servicesScoped
Stateless utilities, factoriesTransient
Thread-safe caches, channels, singletons by designSingleton
Multiple implementations of same interfaceKeyed services (.NET 8+)

Default Patterns

PatternDefaultEscalate to
Web entrypointMinimal APIs with TypedResultsControllers when filters/conventions help
HTTP resultsTypedResults.Ok() + ProblemDetailsResult envelope only when API needs stable error shape
ConfigurationOptions pattern + ValidateOnStart()IValidateOptions<T> for cross-property validation
Outbound HTTPTyped clients + AddStandardResilienceHandler()Custom retry/circuit-breaker only when measured
Error handlingProblemDetails (RFC 9457) + UseExceptionHandler()ErrorOr<T> when failure is expected, not exceptional
ConcurrencyChannel<T> for producer/consumer with backpressureSemaphoreSlim, other primitives when channels don't fit
Health checksAddHealthChecks() with liveness + readiness probesCustom checks for external dependencies
LoggingSerilog + message templates + correlation IDsCustom enrichers/sinks for specialized needs

API Endpoint Conventions

  • Dedicated request and response models per endpoint — never bind directly to entities
  • Explicit parameter binding: [FromQuery], [FromBody], [FromRoute] — no ambiguous model binding
  • OpenAPI annotations on every endpoint: Produces<T>() / [ProducesResponseType] for all response codes
  • Use enums for status fields and other enumerations — never raw strings or magic integers
  • No business logic in endpoint methods — delegate to services
  • Return ProblemDetails for all error responses (4xx and 5xx)

Anti-Patterns Quick Reference

Anti-PatternFix
new HttpClient() per requestIHttpClientFactory or typed client
Manual Polly configurationAddStandardResilienceHandler()
Results.Ok()TypedResults.Ok() (explicit contract)
Missing ValidateOnStart()Always add to Options registration
Singleton capturing ScopedIServiceScopeFactory
.Result / .Wait() in asyncawait
Exceptions for flow controlErrorOr<T> / Result pattern
DateTime.NowDateTime.UtcNow or TimeProvider
Console.WriteLineILogger<T>
Silent catch blocksLog + rethrow or handle explicitly

Middleware Ordering (ASP.NET Core)

Order matters. Follow this sequence:

1. UseExceptionHandler() // Catch everything downstream
2. UseStatusCodePages()
3. UseHttpsRedirection()
4. UseStaticFiles() // If applicable
5. UseRouting() // Before auth
6. UseCors() // After routing, before auth
7. UseRateLimiter()
8. UseAuthentication() // Identify user
9. UseAuthorization() // Check permissions
10. UseOutputCache() // After auth
11. MapEndpoints() // Last

Reference Contract

All reference files follow a consistent structure. See _contract.md for details.

Security

  • Security scanPassed, 100 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

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

Source

Popularity

Repository stars
225
Repository forks
6
7-day trend score
27

Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 28 Apr 2026, 6 months ago.

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/querylenshq/ef-querylens/tsp-csharp/badge)](https://verified-skill.com/skills/querylenshq/ef-querylens/tsp-csharp)

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