go-api-design

Standardize Go RESTful API design with JSON envelopes and versioning.

Updated Apr 20, 2026
One-click install
npx skills add https://github.com/vincent119/ai-rules-kit --skill go-api-design-vincent119
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: go-api-design
Source: https://github.com/vincent119/ai-rules-kit/tree/main/skills/go-api-design
Command: npx skills add https://github.com/vincent119/ai-rules-kit --skill go-api-design-vincent119

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Standardizes Go API design and versioning to deliver consistent, production-ready interfaces.

Core Features & Use Cases

  • JSON envelope structure for uniform responses
  • API versioning with path-based and header strategies
  • Pagination, filtering, sorting, and Swagger/OpenAPI integration
  • Deprecation notices and error code conventions
  • Use case: designing a RESTful Go service with stable public contracts across v1 and v2

Quick Start

Define a new Go API module following this standard and generate the initial OpenAPI spec for v1 endpoints.

Frequently Asked Questions about go-api-design

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I standardize Go REST API response structures and error codes?

Standardize Go REST API responses by enforcing a uniform JSON envelope and consistent error code conventions. This approach delivers production-ready interfaces with stable public contracts across multiple API versions.

What is the best way to version a RESTful Go API with OpenAPI integration?

Version a RESTful Go API using path-based and header routing strategies while generating Swagger annotations. This method maintains stable public contracts and applies deprecation notices across v1 and v2 endpoints.

How do I implement pagination, filtering, and sorting in a Go API?

Implement pagination, filtering, and sorting in a Go API by applying standardized response envelopes. This ensures uniform data retrieval and consistent query handling across versioned RESTful services.

Can I use this approach for designing a Go service with stable public contracts across v1 and v2?

Yes, this approach is designed for RESTful Go services requiring stable public contracts across v1 and v2. It enforces JSON envelopes, path and header version routing, and deprecation practices for production readiness.

How do I handle API deprecation notices and versioning in Go?

Handle API deprecation and versioning in Go by applying path-based routing and standardized deprecation notices. This maintains consistent interfaces while transitioning clients between multiple API versions.