Skip to content
Skill

Go API design

Guides Go agents in designing HTTP REST APIs, handlers, middleware and shutdown

Go API design is an open-source agent skill for developer tools. It is available on Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose.

Scripts
None
Platforms
Claude Code, Codex, Cursor
GitHub stars
90
Last commit
License
MIT
Listing updated

Similar skills

About Go API design

This skill gives an agent a set of conventions for building HTTP and REST APIs in Go using the standard library ServeMux. It covers how handlers are structured as methods on dependency-holding structs, how domain errors map to status codes, and how a shared JSON helper should write responses. It also sets out a middleware order with recovery outermost, followed by request ID, logging, authentication and rate limiting.

The guidance extends to request handling and operations: capping request bodies before decoding, URL and naming rules such as versioned plural nouns, cursor-based pagination, and a graceful shutdown sequence using signal handling and server timeouts. It also describes liveness and readiness endpoints and an error response shape, with a note on RFC 9457 problem details. An optional Idempotency-Key pattern for POST endpoints is included.

The skill is written for Claude Code or similar agents working in Go projects and expects the Go toolchain to be installed. Its allowed tools include file reading and editing plus go and gofmt commands. It points to related skills for gRPC, OpenAPI, architecture review, concurrency and security audits.

When your agent uses it

HTTP/REST API design for Go services: handlers, ServeMux routing, middleware, request validation, pagination, idempotency, health checks, error responses, and graceful shutdown. Use when designing APIs, writing HTTP handlers, implementing middleware, or structuring REST endpoints. Trigger examples: "design API", "REST endpoints", "HTTP handler", "middleware pattern", "graceful shutdown", "API versioning". Not for: gRPC services (go-grpc), spec-first OpenAPI work (go-openapi), general architecture (go-architecture-review), concurrency in handlers (go-concurrency-review).

From the skill's SKILL.md. Your agent reads this description to decide when to load the skill.

What it can access

From a static check of its 2 files (11 KB) on GitHub on 3 December 2026. Nothing was run. Read the files before you install a skill: it can tell your agent to run anything its tools allow.

Check another skill before you install it.

Install

Download the skill folder from https://github.com/eduardo-sl/go-agent-skills and copy it into your agent's skills folder.

What it does

Handler structure
Guidance on dependency-holding handler structs and mapping domain errors to HTTP responses.
Middleware ordering
A recommended chain of recovery, request ID, logging, auth and rate limiting.
Request validation
Body size limits, typed decoding and stable 400 responses without echoing decoder errors.
URL and naming rules
Versioned plural resource paths, kebab-case segments and camelCase JSON fields.
Pagination pattern
Cursor-based paging types and the reasoning for preferring it over offset paging.
Graceful shutdown
Signal-aware server startup and a timed shutdown sequence with safe timeouts.
Health and error responses
Liveness and readiness endpoint patterns plus a consistent JSON error format.

Good for

  • Design REST endpoints for a new Go service
  • Write an HTTP handler that maps errors to status codes
  • Add a logging and auth middleware chain to a Go API
  • Implement graceful shutdown for a Go HTTP server
  • Add readiness and liveness health checks to a Go service
  • Add cursor pagination to a list endpoint

Go API design FAQ

What does Go API design need to run?

It requires the Go toolchain. Its allowed tools include Read, Edit, Write, Glob, Grep and the go and gofmt commands.

Which parts of the API design does Go API design cover?

Handlers, ServeMux routing, middleware order, request validation, URL naming, pagination, graceful shutdown, health checks, error responses and idempotency keys for POST endpoints.

Does Go API design cover gRPC or OpenAPI work?

No. The skill says gRPC services belong to the go-grpc skill and spec-first OpenAPI work to go-openapi.

Does Go API design include scripts?

No. The skill ships with two files and no scripts.

Does Go API design run scripts?

No. It is instructions only, with no scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.

Which AI agents can use Go API design?

Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose. Each reads skills in the SKILL.md format from its own folder; the install steps on this page list them.

What are the best alternatives to Go API design?

The closest alternatives to Go API design are API design, API design, HTTP semantics, Go backend and Go openapi.

Where this comes from

  • Description: from the skill's own SKILL.md.

More from eduardo-sl/go-agent-skills

  1. Reviews Go project structure, dependency direction and module boundaries

    • Open source
    • 90 GitHub stars
    • Developer tools
  2. Guides an AI agent to build Go command-line tools with clean flags, streams and exit codes

    • Open source
    • 90 GitHub stars
    • Developer tools
  3. Guides Go code toward constructor injection, explicit wiring and no global state

    • Open source
    • 90 GitHub stars
    • Developer tools
  4. Guides Go code toward idiomatic design patterns like functional options and factories

    • Open source
    • 90 GitHub stars
    • Developer tools
  5. Guides building Go GraphQL servers with gqlgen, covering N+1 batching and query limits

    • Open source
    • 90 GitHub stars
    • Developer tools
  6. Guides an AI agent through production gRPC services in Go: protos, errors, streaming

    • Open source
    • 90 GitHub stars
    • Developer tools