go-api

Generates Go REST and gRPC services from OpenAPI and protobuf specs.

Updated Dec 31, 2025
One-click install
npx skills add https://github.com/victorzhuk/go-ent --skill go-api-victorzhuk
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: go-api
Source: https://github.com/victorzhuk/go-ent/tree/main/pkg/skills/go/go-api
Command: npx skills add https://github.com/victorzhuk/go-ent --skill go-api-victorzhuk

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill streamlines the creation of robust and production-ready REST and gRPC APIs in Go by enforcing a spec-first development approach, reducing boilerplate and ensuring consistency.

Core Features & Use Cases

  • Spec-Driven Development: Design APIs using OpenAPI for REST and protobuf for gRPC.
  • Code Generation: Leverage tools like ogen and protoc for generating API code.
  • Transport Layer Separation: Ensures business logic is distinct from API concerns.
  • Error Handling & Middleware: Implements best practices for error mapping, logging, metrics, and security.
  • Use Case: Generate a complete Go gRPC service definition and handler implementation from a protobuf schema, including error mapping and context propagation.

Quick Start

Use the go-api skill to generate a Go REST handler implementation based on an OpenAPI specification.

Frequently Asked Questions about go-api

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

FAQPage Schema
How do I generate Go REST handlers from an OpenAPI specification?

You can generate Go REST handlers from an OpenAPI specification by applying a spec-first development approach using code generation tools like ogen. This process reduces boilerplate and ensures your API implementation remains consistent with the design.

What is the best way to structure a Go gRPC service using protobuf?

The best way to structure a Go gRPC service using protobuf is to enforce spec-first design and separate the transport layer from business logic. This approach generates maintainable service definitions and handler implementations directly from your schema.

How do you handle error mapping and middleware in Go API services?

Error mapping and middleware in Go API services are handled by implementing best practices for logging, metrics, and security within the transport layer. This ensures robust error handling while keeping business logic distinct from API concerns.

Can I use code generation tools for both REST and gRPC APIs in Go?

Yes, you can use code generation tools for both REST and gRPC APIs in Go by leveraging ogen for OpenAPI and protoc for protobuf. These tools facilitate spec-driven development and produce production-ready code for both service types.

Why should I adopt a spec-first approach for Go API development?

You should adopt a spec-first approach for Go API development because it enforces API design consistency and reduces manual boilerplate. By defining OpenAPI and protobuf schemas first, you ensure your services are maintainable and scalable.

Does spec-first Go API design support context propagation in gRPC?

Yes, spec-first Go API design supports context propagation in gRPC by generating complete handler implementations from protobuf schemas. This ensures that request contexts and error mappings are correctly managed across the service boundary.