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.zip

Installs 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.
121 chars✓ has a “when” trigger
Intermediate

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

You give it
API service requirements
You get back
Structured Go HTTP service code

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

  1. Choose router — Select based on complexity needs (stdlib for simple, Echo/Gin for production).
  2. Separate concerns — Handlers parse requests, call services, and format responses. No business logic in handlers.
  3. Add middleware — Use middleware for cross-cutting concerns (Logging, Recovery, CORS, Auth, Tracing).
  4. Include health endpoints — Always expose /health and /ready endpoints.
  5. Enforce content types — Require application/json for REST APIs.
  6. 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.

SkillInstallsUpdatedSafetyDifficulty
api-server (this skill)129dNo flagsIntermediate
templ-htmx37moNo flagsIntermediate
ccxt-go16moReviewIntermediate
generating-grpc-services126dReviewAdvanced

Try saying

Example prompts that trigger this skill in your AI assistant.

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'.

314

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.

15

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".

13

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.

12

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.

00

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

00

Search skills

Search the agent skills registry