review-bench/andresharpe_dotbot/implement-api-endpoint

Claude Code and agent skill by review-bench/andresharpe_dotbot

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

Implement ASP.NET Core REST API endpoints with routing, validation, MediatR handlers, and proper HTTP status codes. Use when creating new API routes, adding HTTP endpoints, building RESTful resources, implementing controllers, or adding GET/POST/PUT/DELETE operations.

Install

npx vskill@latest install review-bench/andresharpe_dotbot/implement-api-endpoint

SKILL.md

Implement API Endpoint

Implement REST API endpoints in ASP.NET Core with thin controllers and service-layer delegation.

Workflow

  1. Define the route — resource-oriented URL following REST conventions
  2. Create request/response DTOs — never expose domain entities
  3. Implement handler — business logic in service layer or MediatR handler
  4. Wire the controller action — validate, delegate, return appropriate status code
  5. Verify — test happy path, validation errors, and error responses

Controller Pattern

csharp
[ApiController]
[Route("api/[controller]")]
public class ItemsController : ControllerBase
{
private readonly IMediator _mediator;
public ItemsController(IMediator mediator) => _mediator = mediator;
[HttpGet("{id:guid}")]
public async Task<IActionResult> GetItem(Guid id)
{
var result = await _mediator.Send(new GetItemQuery(id));
if (result.IsFailure)
return NotFound();
return Ok(result.Value);
}
[HttpPost]
public async Task<IActionResult> CreateItem([FromBody] CreateItemRequest request)
{
var result = await _mediator.Send(new CreateItemCommand(request));
if (result.IsFailure)
return BadRequest(result.Error);
return CreatedAtAction(nameof(GetItem), new { id = result.Value.Id }, result.Value);
}
[HttpDelete("{id:guid}")]
public async Task<IActionResult> DeleteItem(Guid id)
{
var result = await _mediator.Send(new DeleteItemCommand(id));
return result.IsFailure ? NotFound() : NoContent();
}
}

Best Practices

  • Thin controllers — delegate all business logic to services or MediatR handlers
  • `[ApiController]` — enables automatic model validation and [FromBody] inference
  • DTOs for input/output — never return domain entities; map with AutoMapper or manual projection
  • Async everywhere — all I/O-bound actions must use async Task<IActionResult>
  • Problem Details for errors — use RFC 7807 format via ProblemDetails middleware
  • Location header on 201 Created — always return CreatedAtAction or CreatedAtRoute

Checklist

  • [ ] Route follows REST conventions (GET /resource, POST /resource, etc.)
  • [ ] Request and response DTOs defined (no domain entity exposure)
  • [ ] Controller action delegates to service/handler — no inline business logic
  • [ ] Appropriate HTTP status codes returned (200, 201, 204, 400, 404)
  • [ ] Model validation handled (via [ApiController] or manual checks)
  • [ ] Integration test covers happy path and error cases

Security

  • Security scanPassed, 95 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

7-day trend score
5

Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/review-bench/andresharpe_dotbot/implement-api-endpoint/badge)](https://verified-skill.com/skills/review-bench/andresharpe_dotbot/implement-api-endpoint)

Something wrong with this skill or its page? Tell us.