Comprehensive knowledge base for go-zero microservices framework.
Use this skill when:
This skill provides comprehensive go-zero microservices framework knowledge, optimized for AI agents helping developers build production-ready services. It covers REST APIs, RPC services, database operations, resilience patterns, and troubleshooting.
Invoke this skill when working with go-zero:
This skill organizes go-zero knowledge into focused modules. Load specific guides as needed rather than reading everything at once:
Link: Official go-zero Documentation Contains: Installation, first API service, basic commands, hello-world examples (refer to official docs)
File: references/rest-api-patterns.md When to load: Creating HTTP endpoints, implementing CRUD operations, adding middleware Contains:
httpx.Error() and httpx.OkJson()File: references/rpc-patterns.md When to load: Building gRPC services, service-to-service communication Contains:
File: references/database-patterns.md When to load: Implementing data persistence, caching, or complex queries Contains:
goctl modelFile: references/resilience-patterns.md When to load: Production hardening, handling failures, managing system load Contains:
File: references/goctl-commands.md When to load: Generating code with goctl, setting up new services, post-generation steps Contains:
File: best-practices/overview.md When to load: Production deployment, code review, optimization Contains: Configuration management, logging, monitoring, security, performance
File: troubleshooting/common-issues.md When to load: Debugging errors, configuration issues, runtime problems Contains: Common error messages, solutions, configuration pitfalls, debugging tips
File: getting-started/claude-code-guide.md When to load: Setting up Claude Code for zero-skills usage Contains: Installation, invocation methods, advanced features (subagents, dynamic context)
File: getting-started/README.md When to load: Setting up zero-skills with Cursor, GitHub Copilot, Windsurf, or Codex Contains: Feature comparison table, per-tool setup instructions (Claude Code, Cursor, Copilot, Windsurf, Codex)
These workflows guide you through typical go-zero development tasks:
Steps:
.api file with types and routesgoctl api go -api user.api -dir .internal/logic/ layerhttpxDetailed guide: references/rest-api-patterns.md
Steps:
goctl model mysql datasource -url="..." -table="users" -dir="./model"internal/svc/service_context.goInsert, FindOne, Update, Delete)ctx propagationDetailed guide: references/database-patterns.md
Steps:
internal/middleware/ directory.api file or register programmaticallyr.Context()Detailed guide: references/rest-api-patterns.md
Steps:
.proto file with messages and RPCsgoctl rpc protoc user.proto --go_out=. --go-grpc_out=. --zrpc_out=.internal/logic/Detailed guide: references/rpc-patterns.md
When generating or reviewing go-zero code, always apply these principles:
httpx.Error(w, err) for HTTP errors, not fmt.Errorfconf.MustLoad(&c, *configFile) and inject via ServiceContextctx context.Context through all layers for tracing and cancellation.api files, generate with goctlgoctl to generate boilerplate, never hand-write handlers/routesw.Write() or fmt.Fprintf() instead of using httpx helperserr != nillogic layer instead)Follow this path based on your needs:
Start here: Official go-zero Quick Start Install go-zero, create your first API, understand basic concepts
Add a database: references/database-patterns.md Connect to MySQL/PostgreSQL, generate models, implement CRUD
Review best practices: best-practices/overview.md Configuration, logging, monitoring, security checklist
Add resilience: references/resilience-patterns.md Circuit breakers, rate limiting, graceful degradation
Check common pitfalls: troubleshooting/common-issues.md Avoid typical mistakes and know how to debug issues
Use with Claude Code: getting-started/claude-code-guide.md Learn advanced features like subagents, dynamic context, and argument passing Run demo projects to validate your environment
Verify knowledge: examples/verify-tutorial.sh Script to check if examples work correctly
This skill is part of a two-layer ecosystem for AI-assisted go-zero development:
| Tool | Purpose | Best For |
|---|---|---|
| ai-context | Concise workflow instructions (~5KB) | GitHub Copilot, Cursor, Windsurf |
| zero-skills (this repo) | Comprehensive knowledge base + goctl reference (~45KB) | All AI tools, deep learning, reference |
The AI runs goctl directly in the terminal for code generation — no separate MCP server needed. See references/goctl-commands.md for the complete command reference.
Usage in Claude Code:
/zero-skills to invoke manually for go-zero guidanceSee getting-started/claude-code-guide.md for detailed usage instructions.
Quick invocation: Use /zero-skills or ask "How do I [task] with go-zero?"
Need help? Reference the specific pattern guide for detailed examples and explanations.