1. Habit
  2. Skills
  3. ASP.NET Core Web API skill
dotnet · 4K installs

ASP.NET Core Web API skill
Runs by itself, API endpoint change.

New API endpoints follow HTTP conventions.

Install the ASP.NET Core Web API skill and make it a habit: follow https://gethabit.dev/skills/dotnet/dotnet-webapi.md

  1. 1Copy
  2. 2Paste into Claude Code, Codex or Cursor
  3. 3It runs by itself

4K installs6K starsMIT licenceSource on GitHub ↗

ASP.NET Core Web API

by dotnet · 4K installs

The skill

Dotnet webapi guides creating and changing ASP.NET Core Web API endpoints with correct HTTP semantics, sealed record DTOs, OpenAPI metadata, RFC 7807 error handling and .http test files.

Only when you ask.

The habit

New API endpoints follow HTTP conventions.

↻ Runs by itselfAPI endpoint change

How the habit works.
You don't have to.

Three questionsWhen does it start? How does it check its work? What does it remember?

One run, step by step.
Then it stops.

Stop ruleStops after the changed endpoints of one pull request.

  1. 01

    Detect the style

    Scan for ControllerBase or app.MapGet to see whether the project uses controllers or minimal APIs, and do not mix them.

  2. 02

    Check DTOs

    Confirm request and response types are sealed records with XML summaries and DateTimeOffset for dates.

  3. 03

    Check HTTP semantics

    Confirm status codes, Location headers on create, and a CancellationToken forwarded to async calls.

  4. 04

    Check OpenAPI

    Confirm endpoints carry summary and description metadata and enums serialize as strings.

  5. 05

    Check errors

    Confirm a global exception handler returns RFC 7807 Problem Details and lives in the Middleware folder.

  6. 06

    Build and test

    Run dotnet build, load the OpenAPI document and run the .http requests.

What it may do.
Nothing more.

Safe by defaultIt writes only in its own folder and asks you before anything goes out.

Is it for you?
Use it when it fits.

Quick checkRead both lists. If the left one sounds like you, the ASP.NET Core Web API skill helps.

Use it when

  • ✓ You add a Web API endpoint
  • ✓ You wire up OpenAPI docs
  • ✓ You set up global error handling

Skip it when

  • – You work on Blazor or gRPC
  • – You tune EF Core queries

Questions

ASP.NET Core Web API skill, answered.

Should I add Swashbuckle to a .NET 9 project?

No. The skill says use the built-in AddOpenApi and MapOpenApi and avoid Swashbuckle on .NET 9 and later.

Can DTOs be mutable classes?

No. The skill requires sealed record types.

How do I install the ASP.NET Core Web API skill?

Copy the prompt at the top into your agent. It installs the skill from dotnet/skills and sets up the habit. Or run npx skills add dotnet/skills --skill dotnet-webapi.

Is the ASP.NET Core Web API skill free?

Yes. It is published under MIT. Habit is free too.

ASP.NET Core Web API. Now as a habit.

Install the ASP.NET Core Web API skill and make it a habit: follow https://gethabit.dev/skills/dotnet/dotnet-webapi.md

  • Free
  • No account
  • Undo in one line

All dotnet skills →More code skills →

Works in

  • Claude Code
  • Codex
  • Cursor
  • ChatGPT
  • Claude app

Made by dotnet, published under MIT. Habit links to the original and never changes it. Is this your skill?

Copying didn't work here. Select the line and copy it by hand.