skills/create-controller/SKILL.md
Create an API controller for a given entity in an ASP.NET Core Web API project. Use when the user wants to scaffold a new controller, create REST API endpoints, or set up CRUD operations with Entity Framework Core and OpenAPI annotations.
npx skillsauth add jim60105/copilot-prompt create-controllerInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Create a controller for a given entity in an ASP.NET Core Web API project.
Create an empty controller with the naming rule: {EntityName}Controller
Set up DI and inject Entity Framework context and ILogger<T>.
Do not use Entity Class for model binding. Create DTO classes for each CRUD operation instead.
Add CRUD REST API methods with required OpenAPI-related annotations.
Add OperationId to each action method. Example:
// Before
[HttpGet]
// After
[HttpGet(Name = "GetCourses")]
Give each OperationId a meaningful name.
Apply [ProducesResponseType] attribute to each action reflecting API behavior.
Edit coursemanagement.http for testing:
@HostAddress variable definition.HostAddress variable.Run dotnet build to verify everything compiles.
Add Swashbuckle.AspNetCore.SwaggerUI package:
dotnet add package Swashbuckle.AspNetCore.SwaggerUI
Add the following code to Program.cs:
app.UseSwaggerUI(options =>
{
options.SwaggerEndpoint("/openapi/v1.json", "OpenAPI V1");
});
Run dotnet run to verify the application starts successfully.
development
Generate images via the Stable Diffusion WebUI / Forge HTTP API (AUTOMATIC1111-compatible `/sdapi/v1/*`). Use when the user wants to (1) discover or pick a model / extra module (TE/VAE) / sampler / scheduler / style preset from a running sd-webui server, (2) generate an image with a given prompt (txt2img), (3) check generation progress, (4) cancel/interrupt an in-flight generation, (5) inspect or change a global sd-webui option (e.g. active checkpoint), or (6) test connectivity. This skill talks to a *generic* sd-webui-compatible server (AUTOMATIC1111, Forge, reForge, sd-webui-forge-classic). Do NOT trigger for requests that are purely writing the prompt itself.
testing
Verify implementation matches change artifacts. Use when the user wants to validate that implementation is complete, correct, and coherent before archiving.
development
Update an OpenSpec change by revising its existing planning artifacts and keeping them coherent with one another. Use when the user wants to revise a change's plan, fold new decisions into it, or reconcile its artifacts after an edit. Never edits code.
data-ai
Sync delta specs from a change to main specs. Use when the user wants to update main specs with changes from a delta spec, without archiving the change.