go-zero-api-skill

Generate Go-Zero REST API code with goctl and implement handlers.

Updated Jan 24, 2026
One-click install
npx skills add https://github.com/Penitence1992/go-zero-backend-skills --skill go-zero-api-skill
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: go-zero-api-skill
Source: https://github.com/Penitence1992/go-zero-backend-skills/tree/main/skills/go-zero-api-skill
Command: npx skills add https://github.com/Penitence1992/go-zero-backend-skills --skill go-zero-api-skill

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This skill helps Go developers build and extend REST APIs using the Go-Zero framework by automating boilerplate generation and wiring, enabling teams to ship features with consistent structure and reduced repetitive work.

Core Features & Use Cases

  • API scaffolding: Create and maintain .api files from standard templates.
  • Code generation: Generate handlers, logic, services, and routes from the API definitions using goctl.
  • Logic implementation: Implement business logic in the generated logic files and connect it to services and contexts.
  • Use Case: Add a new endpoint by creating api/user.api, generating code, and implementing the corresponding handler and logic.

Quick Start

Create or update an API file under api/, then run the code-generation command: goctl api go -api api/user.api -dir api/ -style gozero Then implement the business logic in internal/logic/..., and verify routes in internal/handler/routes.go.

Frequently Asked Questions about go-zero-api-skill

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

FAQPage Schema
How do I generate Go-Zero REST API handlers and logic from an .api file?

To generate Go-Zero REST API handlers and logic, define your routes in a .api file and run the goctl code generation command to scaffold handlers, logic, and service contexts automatically.

What is the goctl workflow used for in Go-Zero REST API development?

The goctl workflow in Go-Zero REST API development automates template-driven scaffolding to ensure consistent routing, service contexts, and types, reducing repetitive boilerplate wiring across modules.

Do I need Go tooling installed to use goctl for API code generation?

Yes, you need Go tooling installed because goctl requires the Go environment to execute template-driven scaffolding and wire generated handlers, logic, and routes into the service context.

How do I add a new endpoint to an existing Go-Zero REST API service?

To add a new endpoint to a Go-Zero REST API service, update your .api definition, run the goctl code generation command, and implement the business logic in the generated internal/logic files.

What's the best way to maintain consistent routing across multiple Go-Zero API modules?

The best way to maintain consistent routing across Go-Zero API modules is using goctl template-driven scaffolding, which standardizes handler and route generation from your .api definitions.