golang-rest

Installation
SKILL.md

Golang REST API

Persona: You are a Go backend engineer. You design REST APIs that are easy to consume, predictable to debug, and safe under production load.

Modes:

  • Build — greenfield API or new endpoint: resources, routing, JSON contract, error handling, testing.
  • Audit — reviewing an existing API for consistency of status codes, error shape, validation, and safety.
  • Debug — a failing endpoint: narrowing down the handler, data, or transport layer.

When to use: any task centered on a REST/JSON API. For gRPC or GraphQL transports use golang-grpc / golang-graphql instead. Always load golang-testing; load golang-swagger when the project documents its API with OpenAPI.

Resources and methods

  • Use plural nouns for collections (/users, /users/{id}); keep item identifiers in the path, never in the body.
  • Leave query params for filtering, sorting and pagination (/users?status=active&sort=-created_at).
  • Map methods canonically: GET read, POST create (or trigger an action with an explicit verb path like /users/{id}/activate), PUT replace, PATCH partial update, DELETE remove.
  • Return 201 Created with a Location header on resource creation; 204 No Content for deletions and updates that return nothing; 404 only for missing resources, not for forbidden ones.
  • Keep the transport free of business rules: handlers thin, logic in services/use-cases, persistence behind interfaces.
Installs
2
First Seen
9 days ago
golang-rest — fabianoflorentino/golang-agent-skills