- Home
- Skills
- Racar
- Racar Agent Skills
- Dotnet Webapi
dotnet-webapi_skill
- Shell
0
GitHub Stars
1
Bundled Files
2 months ago
Catalog Refreshed
4 months ago
First Indexed
Readme & install
Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.
Installation
Preview and clipboard use veilstrat where the catalogue uses aiagentskills.
npx veilstrat add skill racar/racar_agent_skills --skill dotnet-webapi- SKILL.md11.5 KB
Overview
This skill scaffolds and accelerates ASP.NET Core Web API development targeting .NET 10 and C# 14.0. It generates projects, controllers, services, tests, and Docker artifacts following 2025 best practices so you can focus on business logic. Use the included scripts to add CRUD entities, configure Entity Framework, add authentication, and produce production-ready Docker builds.
How this skill works
Run simple shell scripts to create a solution with API and test projects, or to add entity scaffolds that include model, service interface, service implementation, controller, and DI registration. Add common NuGet presets (EF Core, JWT auth, FluentValidation) with a single script, generate optimized Dockerfiles and compose files, and run automated xUnit integration tests. The generated code follows a controller-service pattern, includes OpenAPI, output caching, and rate limiting hooks for immediate production readiness.
When to use it
- Creating a new REST API or microservice using .NET 10 and modern C# features
- Rapidly scaffolding CRUD endpoints and consistent service layers for domain entities
- Setting up Entity Framework Core with Postgres or SQL Server and running migrations
- Adding JWT authentication, validation, and OpenAPI documentation quickly
- Containerizing APIs with multi-stage Dockerfiles and docker-compose for local dev
Best practices
- Use the generated service layer for business logic; keep controllers thin and focused on HTTP concerns
- Register DbContext and services via DI and prefer constructor injection for testability
- Use the provided xUnit integration tests with WebApplicationFactory for realistic endpoint tests
- Enable OpenAPI and document endpoints; protect sensitive endpoints with Authorize attributes
- Apply migrations and verify connection strings before running database tasks in CI/CD
Example use cases
- Bootstrap an inventory CRUD API: scripts/new_api.sh InventoryApi then scripts/add_entity.sh Product ./InventoryApi
- Create a microservice with Postgres and Docker: add ef-postgres preset then scripts/generate_dockerfile.sh and docker-compose up
- Secure endpoints with JWT: add auth preset and wire up authentication/authorization in Program.cs
- Set up automated integration tests: use the generated xUnit project and WebApplicationFactory to exercise endpoints
- Add validation and consistent error handling: include FluentValidation preset and follow produced patterns
FAQ
This skill targets .NET 10; ensure dotnet --version reports a 10.x SDK before using the scripts.
Can I use a different database provider?
Yes. Presets include ef-postgres and ef-sqlserver; you can also add individual EF Core providers with the package script.