api-endpoint

Generate versioned REST API controllers with MediatR and OpenAPI documentation.

Updated Dec 31, 2025
One-click install
npx skills add https://github.com/ademceper/merge --skill api-endpoint-ademceper
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: api-endpoint
Source: https://github.com/ademceper/merge/tree/main/server/.cursor/skills/api-endpoint
Command: npx skills add https://github.com/ademceper/merge --skill api-endpoint-ademceper

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill automates the creation of a REST API controller scaffold with proper versioning, authorization, and OpenAPI documentation, reducing boilerplate and ensuring consistency across resources.

Core Features & Use Cases

  • Versioned Controllers: Generates v1 controllers under Merge.API/Controllers/v1/{Entity}sController.cs with consistent routing and attributes.
  • Security & Documentation: Enforces Authorize and OpenAPI annotations for documentation and security.
  • Use Case: When introducing a new API resource like Product, this skill creates a standardized ProductsController with GetAll, GetById, Create, Update, and Delete endpoints.

Quick Start

Create a new {Entity}sController.cs for your {Entity} resource (e.g., Product) under Merge.API/Controllers/v1.

Frequently Asked Questions about api-endpoint

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I generate a versioned REST API controller with OpenAPI documentation?

This Skill automates scaffolding a v1 REST API controller with OpenAPI documentation under Merge.API/Controllers/v1. It generates standardized routing, Authorize attributes, and per-endpoint ProducesResponseType annotations for your new API resources.

What is the best way to add CRUD endpoints for a new API resource using MediatR?

Scaffolding a thin controller using MediatR with a primary constructor is the best way to add CRUD endpoints. This generates GetAll, GetById, Create, Update, and Delete endpoints with CancellationToken support and per-endpoint ProducesResponseType.

Does this API scaffolding approach enforce authorization and XML documentation for every endpoint?

Yes, API scaffolding enforces authorization and XML documentation for every endpoint. It applies Authorize attributes and OpenAPI annotations to ensure security and structural consistency across all generated v1 controller endpoints.

How do I structure API controllers to support versioning and per-endpoint OpenAPI responses?

To structure API controllers for versioning and per-endpoint OpenAPI responses, place controllers under Merge.API/Controllers/v1 and apply per-endpoint ProducesResponseType attributes. This ensures proper v1 routing and accurate OpenAPI documentation.

Can I use this controller scaffolding for a C# API that needs CancellationToken usage?

Yes, you can use this controller scaffolding for a C# API needing CancellationToken usage. The generated thin controllers automatically include CancellationToken parameters in all scaffolding endpoints for listing, retrieving, creating, updating, and deleting entities.