controller-api-implementation

Community

Build thin API controllers that stay contract-safe.

Authormachenjie
Version1.0.0
Installs0

System Documentation

What problem does it solve?

This Skill prevents API controllers from turning into messy business-logic hotspots by enforcing a strict transport-adapter pattern that keeps validation, auth context extraction, response mapping, and error handling consistent and contract-aligned.

Core Features & Use Cases

  • Thin transport adapter design: Parse and validate inputs, extract authentication context, and delegate all business decisions to the application layer.
  • Contract-compliant response mapping: Convert service results into DTOs that match the OpenAPI (or equivalent) response shape and correct HTTP status codes.
  • Safe error boundaries: Transform errors into RFC 7807 Problem Details without leaking internal messages, stack traces, or topology details.
  • Security guardrails at the boundary: Apply trusted-boundary validation, content negotiation discipline, and idempotency-key format validation.

Quick Start

Use controller-api-implementation to guide the implementation of a request handler or gRPC method as a contract-safe adapter: validate input at the boundary, extract auth context, call the service, map outputs to the contract, and return Problem Details for failures.

Dependency Matrix

Required Modules

None required

Components

references

💻 Claude Code Installation

Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.

Please help me install this Skill:
Name: controller-api-implementation
Download link: https://github.com/machenjie/rd-skills/archive/main.zip#controller-api-implementation

Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
View Source Repository

Agent Skills Search Helper

Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.