api-server
Provides patterns and standards for building robust REST APIs and middleware using Go.
Install
mkdir -p .claude/skills/api-server && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/5098" && unzip -o skill.zip -d .claude/skills/api-server && rm skill.zipInstalls to .claude/skills/api-server
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
Build HTTP services, REST APIs, and middleware in Go. Use when building Go HTTP servers, REST APIs, or custom middleware.Key capabilities
- →Implement REST API endpoints
- →Develop custom middleware
- →Configure HTTP service architecture
- →Handle graceful shutdowns
How it works
The skill provides standards for building Go HTTP services, emphasizing separation of concerns, middleware usage, and graceful shutdown patterns.
Inputs & outputs
When to use api-server
- →Create new REST API endpoint
- →Implement Go middleware
- →Define API service architecture
About this skill
Golang API Server
Priority: P0 (CRITICAL)
Router Selection
- Standard Lib (
net/http): Use for simple services or zero-dependency requirements.http.ServeMux(Go 1.22+) method-based routing. - Echo (
labstack/echo): Recommended for production REST APIs with middleware, binding, and error handling. - Gin (
gin-gonic/gin): High performance alternative.
Implementation Workflow
- Choose router — Select based on complexity needs (stdlib for simple, Echo/Gin for production).
- Separate concerns — Handlers parse requests, call services, and format responses. No business logic in handlers.
- Add middleware — Use middleware for cross-cutting concerns (Logging, Recovery, CORS, Auth, Tracing).
- Include health endpoints — Always expose
/healthand/readyendpoints. - Enforce content types — Require
application/jsonfor REST APIs. - Implement graceful shutdown — Handle SIGINT/SIGTERM to drain in-flight requests.
See graceful shutdown example and Echo handler patterns
Anti-Patterns
- No business logic in handlers: parse request, call service, and format response only.
- No global router vars: pass router instance via constructor or DI.
- No missing shutdown: handle SIGTERM to drain in-flight requests.
References
When not to use it
- →Non-HTTP service development
Limitations
- →Requires Go language knowledge
How it compares
It enforces architectural standards and best practices for Go APIs rather than allowing unstructured implementation.
Compared to similar skills
api-server side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| api-server (this skill) | 1 | 29d | No flags | Intermediate |
| templ-htmx | 3 | 7mo | No flags | Intermediate |
| ccxt-go | 1 | 6mo | Review | Intermediate |
| generating-grpc-services | 1 | 26d | Review | Advanced |
Try saying
Example prompts that trigger this skill in your AI assistant.
More by HoangNguyen0403
View all by HoangNguyen0403 →You might also like
templ-htmx
Xe
Build interactive hypermedia-driven applications with templ and HTMX. Use when creating dynamic UIs, real-time updates, AJAX interactions, mentions 'HTMX', 'dynamic content', or 'interactive templ app'.
ccxt-go
ccxt
CCXT cryptocurrency exchange library for Go developers. Covers both REST API (standard) and WebSocket API (real-time). Helps install CCXT, connect to exchanges, fetch market data, place orders, stream live tickers/orderbooks, handle authentication, and manage errors in Go projects. Use when working with crypto exchanges in Go applications, microservices, or trading systems.
generating-grpc-services
jeremylongshore
Generate gRPC service definitions, stubs, and implementations from Protocol Buffers. Use when creating high-performance gRPC services. Trigger with phrases like "generate gRPC service", "create gRPC API", or "build gRPC server".
higress-wasm-go-plugin
alibaba
Develop Higress WASM plugins using Go 1.24+. Use when creating, modifying, or debugging Higress gateway plugins for HTTP request/response processing, external service calls, Redis integration, or custom gateway logic.
API service
TheBearIsOne
Use this skill when: - adding HTTP endpoints; - defining request and response models; - wiring document generation into an API surface; - shaping controller, route, or handler behavior.
senior-backend
Cor-Incorporated
Guides backend system development with Node.js, Express, Go, Python, PostgreSQL, GraphQL, and REST APIs. Use when the user says: 'design an API', 'optimize database queries', 'implement authentication', 'set up backend', 'create API endpoint', 'database migration', 'fix N+1 query', 'add rate limitin