dotnet-aspnetcore-service

dotnet-aspnetcore-service is a skill for Claude Code, Codex from makifbaysal/tasktrooper. It costs 48 tokens per session (1,738 once invoked), scanned A, original, Apache-2.0.

A set of guidelines for building or changing C# services with ASP.NET Core, Microsoft's framework for web applications and APIs. It covers HTTP endpoints, dependency injection, configuration, database access, errors, outbound HTTP, and asynchronous work.

In plain words
What is it for?
Use it to build or extend ASP.NET Core services with Minimal APIs or controllers, Entity Framework Core or Dapper, PostgreSQL access, and background work.
Why use it?
It keeps business rules separate from web and database details and helps new code match the repository's existing structure. It also provides consistent handling for validation, failures, cancellation, and external requests.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to build or extend ASP.NET Core services with Minimal APIs or controllers, Entity Framework Core or Dapper, PostgreSQL access, and background work.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/makifbaysal/tasktrooper/dotnet-aspnetcore-service
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add makifbaysal/tasktrooper --skill dotnet-aspnetcore-service
Clone the repo
git clone --depth 1 https://github.com/makifbaysal/tasktrooper

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for dotnet-aspnetcore-service

README.md
[![agentmods](https://agentmods.dev/badge/skills/makifbaysal/tasktrooper/dotnet-aspnetcore-service/github.svg)](https://agentmods.dev/skills/makifbaysal/tasktrooper/dotnet-aspnetcore-service)
Your own site
<a href="https://agentmods.dev/skills/makifbaysal/tasktrooper/dotnet-aspnetcore-service"><img src="https://agentmods.dev/badge/skills/makifbaysal/tasktrooper/dotnet-aspnetcore-service/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for dotnet-aspnetcore-service

Your own site · 80×15
<a href="https://agentmods.dev/skills/makifbaysal/tasktrooper/dotnet-aspnetcore-service"><img src="https://agentmods.dev/badge/skills/makifbaysal/tasktrooper/dotnet-aspnetcore-service.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 48 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,738 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00048 $0.01738
Opus 5.5 $0.00019 $0.00695
Sonnet 5.5 $0.00010 $0.00348
Haiku 4.5 $0.00005 $0.00174

Measured 4d ago against content hash ab25e9dd91fb, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

dotnet-aspnetcore-service scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

catalog/agents/backend-developer/skills/dotnet-aspnetcore-service/SKILL.md · 101 lines

How it starts

The opening of the file, as written. The whole thing — 101 lines — stays where its author put it; the contents beside it link to each section on GitHub.

ASP.NET Core Service (C#)

Overview

ASP.NET Core is the .NET backend stack: one host for HTTP, DI, configuration, logging and background work. Build in layers so the framework stays at the edges and the domain stays plain C#.

Core principle: the repository's shape wins. Minimal APIs or MVC controllers, EF Core or Dapper, Clean Architecture projects or one project — follow what is there. The patterns below are for new code and for the gaps.

Layers

Layer Responsibility ASP.NET Core surface
Endpoint HTTP in/out, binding, status codes MapGroup + MapPost (Minimal APIs) or [ApiController] controllers
Application service Use-case orchestration, business rules a class registered in DI, constructor-injected, CancellationToken on every async method
Domain Entities, value objects, invariants plain C#, no ASP.NET or EF attributes driving behaviour
Infrastructure Persistence, outbound HTTP, queues DbContext, typed HttpClient, BackgroundService

Dependencies point inward: an endpoint calls a service, a service depends on an interface the infrastructure implements. An endpoint never contains business rules; a service never takes HttpContext.

Patterns

  • Target framework: keep the repository's TargetFramework. A new service targets the current LTS (net10.0); never move a repository to a preview SDK in a feature task. global.json pins the SDK when the repository has one.
  • Nullable reference types on (<Nullable>enable</Nullable>); treat a new nullable warning as a bug, not noise. Respect TreatWarningsAsErrors and .editorconfig analyzers.
  • Constructor injection (primary constructors are fine): public sealed class TaskService(ITaskRepository repo, TimeProvider clock). Lifetimes: DbContext scoped, stateless services scoped or singleton, never a scoped dependency captured by a singleton.
  • Options pattern for configuration: builder.Services.AddOptions<SmtpOptions>().BindConfiguration("Smtp").ValidateDataAnnotations().ValidateOnStart(); — never read IConfiguration["..."] in a service, never hardcode.
  • DTOs at the edge (records), mapped to and from the domain in the service. Never bind a request onto an EF entity or return one.
  • Validation at the boundary: DataAnnotations on the request record with builder.Services.AddValidation() (Minimal APIs, .NET 10) or [ApiController] model validation; FluentValidation where the repository already uses it. The domain enforces its own invariants too.
  • Errors in one shape: builder.Services.AddProblemDetails(), app.UseExceptionHandler() and an IExceptionHandler that maps domain exceptions to 400/404/409. Endpoints return TypedResults (Results<Created<TaskResponse>, ValidationProblem>), not ad-hoc anonymous objects. No stack trace in a response body.
  • Async all the way: await every I/O call and pass the request's CancellationToken down to EF and HttpClient. Never .Result, .Wait() or async void (outside event handlers).
  • EF Core: AsNoTracking() for reads, projection (Select) to DTOs instead of loading graphs, Include only for what the response needs. Postgres via Npgsql.EntityFrameworkCore.PostgreSQL. Raw SQL only through FromSql/SqlQuery with interpolated parameters (they are parameterized) — never FromSqlRaw with string concatenation.
  • Migrations: dotnet ef migrations add <Name>, review the generated Up/Down, commit the migration and the model snapshot together. Deploys apply an idempotent script (dotnet ef migrations script --idempotent) or a migration bundle; Database.Migrate() at startup races when several instances start and EnsureCreated() never belongs outside tests. postgres-migrations covers safe DDL.
  • Outbound HTTP: a typed client from IHttpClientFactory (builder.Services.AddHttpClient<PaymentsClient>()) with AddStandardResilienceHandler() (Microsoft.Extensions.Http.Resilience) for timeouts, retries and circuit breaking. Never new HttpClient() per call.
  • Background work: a BackgroundService that creates a scope per unit of work (IServiceScopeFactory) and honours stoppingToken.
  • Logging: ILogger<T> with message templates (logger.LogInformation("Task {TaskId} created", id)), never string interpolation in a log call; [LoggerMessage] source-generated methods on hot paths. No secrets or PII in a log or a ProblemDetails body.
  • Time and ids: inject TimeProvider instead of DateTime.UtcNow so tests control the clock; Guid.CreateVersion7() for new time-ordered ids where the repository has no id scheme.
  • OpenAPI: the built-in builder.Services.AddOpenApi() / app.MapOpenApi() document; keep it in step with api-contract-openapi. New code does not add Swashbuckle.

Read the full file on GitHub · 101 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago First seen · 101 lines · 48 tokens per session scan A ab25e9dd91fb

Subscribe to this mod's changes

dotnet-aspnetcore-service is a skill published in the GitHub repository makifbaysal/tasktrooper (117 stars, last pushed yesterday), licensed Apache-2.0. It adds 48 tokens to every session and 1,738 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-10-17.

Related

Other skills, from other repositories

dotnet-backend

Build and upgrade ASP.NET Core services with typed contracts, dependency lifetimes and verified persistence. Use when implementing .NET APIs, background services or runtime migrations; coordinate SDK, target framework and package support.

WrongStack/WrongStack · 45 tokens

outsystems-custom-code

Beta Feature. This skill is a Beta Feature: a non-final OutSystems capability provided to collect customer feedback. It can change significantly, including through breaking changes, or be discontinued. The first time you use this skill in a conversation, tell the user it's a Beta Feature and share .

OutSystems/outsystems-mcp · 173 tokens

software-csharp-backend

Applies C# and .NET backend standards to ASP.NET Core APIs, EF Core, Dapper, and workers. Use when shaping API boundaries, data access, resilience, or observability.

vasilyu1983/AI-Agents-public · 45 tokens

sinch-functions-dotnet

Write C#/.NET Sinch Functions with the Sinch.Functions.Runtime NuGet package. Use when writing or editing a function controller: answering and controlling calls with Voice API v2, IVR menus, placing, bridging or transferring calls, realtime AI voice agents, SMS/WhatsApp/RCS webhooks, custom HTTP endpoints, dependency…

sinch/skills · 94 tokens

crud-vs-event-sourcing

Decide whether a .NET feature/aggregate should be built as CRUD, Event Sourcing, or an event-driven design — and give the concrete implementation path. Use this skill whenever the user describes a domain, feature, aggregate, table, or entity and asks "CRUD or event sourcing?", "should this be event-sourced?", "is…

StefanTheCode/dotnet-ai-toolkit · 161 tokens

cqrs-mediatr-setup

Set up CQRS with MediatR (or a thin custom dispatcher) in an ASP.NET Core project — commands, queries, handlers, and pipeline behaviors for validation, logging, and transactions. Use this skill whenever the user wants CQRS, MediatR, command/query handlers, a request pipeline, MediatR behaviors, or asks "how do I add…

StefanTheCode/dotnet-ai-toolkit · 117 tokens