Comprehensive knowledge base for jzero framework (enhanced go-zero). Use this skill when working with jzero to understand correct patterns for REST APIs (Handler/Logic/Context architecture), RPC services (service discovery, load balancing), Gateway services, database operations (sqlx, MongoDB, caching), resilience patterns (circuit breaker, rate limiting), and jzero-specific features (git-change-based generation, flexible configuration, custom templates). Essential for generating production-ready jzero code that follows framework conventions.
Structured knowledge base optimized for AI agents to help developers work effectively with the jzero framework (enhanced go-zero).
This skill provides AI agents with comprehensive jzero knowledge to:
When helping with jzero development:
Reference: references/rest-api-patterns/api-file-structure.md
go_package, group, compact_handler)When to use: Creating or modifying REST API services, implementing HTTP endpoints
When to use: Creating or modifying RPC services, working with proto files, adding validation or middleware
⚠️ CRITICAL REMINDER: ALWAYS use condition.NewChain() - NEVER use condition.New()
When to use: Implementing data persistence, queries, or database operations
Reference: Project Structure
.api file with required settings:jzero gen --desc desc/api/user.apiinternal/logic/ following three-layer architectureSee detailed patterns: REST API File Structure
Choose your schema mode first:
Local SQL Mode (schema files in desc/sql/):
desc/sql/*.sqldesc/sql_migration/ (xx.up.sql & xx.down.sql) ⚠️jzero migrate up, production: auto in cmd/server.go)jzero gen --desc desc/sql/users.sqlRemote Datasource Mode (schema from live database):
desc/sql_migration/ (xx.up.sql & xx.down.sql) ⚠️jzero migrate up, production: auto in cmd/server.go)jzero genCommon steps (both modes):
⚠️ Migration rules: Always create both up/down files, use consecutive numbering (1, 2, 3...)
See detailed patterns: SQL Migration Guide | Database Best Practices
etc/etc.yaml:See detailed guide: Database Connection
jzero-skills/
├── SKILL.md # This file - skill entry point
├── references/ # Detailed pattern documentation
│ ├── rest-api-patterns/ # REST API guides
│ │ └── api-file-structure.md # ⚠️ Critical rules for .api files
│ ├── rpc-patterns/ # RPC/Proto service guides
│ │ ├── proto-file-structure.md # Proto standards & multi-proto
│ │ ├── proto-validation.md # Field validation guide
│ │ └── proto-middleware.md # Middleware patterns
│ └── database-patterns/ # Database operation guides
│ ├── best-practices.md # ⚠️ Critical rules with examples
│ ├── sql-migration.md # ⚠️ Schema changes & migrations
│ ├── database-connection.md # DB & Redis setup
│ ├── model-generation.md # Generate models from SQL
│ └── crud-operations.md # CRUD methods reference
Typical jzero project structure:
myproject/
├── .jzero.yaml # CLI config: code generation, ⚠️ migrate settings
├── desc/
│ ├── api/ # .api files → generates handlers
│ ├── sql/ # .sql files → generates models (local SQL mode)
│ ├── sql_migration/ # xx.up.sql & xx.down.sql for schema changes ⚠️
│ └── proto/ # .proto files → generates RPC code
├── internal/
│ ├── handler/ # HTTP handlers (generated)
│ ├── logic/ # Business logic (implement here)
│ ├── model/ # Data models (generated)
│ ├── svc/ # Service context (dependencies)
│ ├── config/ # Config structs
│ └── middleware/ # Custom middleware
├── etc/
│ └── etc.yaml # Configuration
└── .jzero.yaml # jzero CLI config
condition.NewChain(), NEVER use condition.New() - THIS IS CRITICAL 🚨go_package, group, compact_handler: truexxmodel "project/internal/model/xx"errors.Is(err, model.ErrNotFound) from github.com/pkg/errorsjzero gen --desc before implementing logicusersmodel.Id)condition.New() - This is error-prone and deprecated. ALWAYS use condition.NewChain()go_package, group, or compact_handler in .api files"project/internal/model/users" (wrong)== for error comparison: if err == ErrNotFound (wrong)New to jzero?
jzero new myapi --frame apiBuilding REST APIs?
Creating RPC services?
Working with databases?
Production deployment?
Search for places (restaurants, cafes, etc.) via Google Places API proxy on localhost.
Interact with GitHub using the `gh` CLI. Use `gh issue`, `gh pr`, `gh run`, and `gh api` for issues, PRs, CI runs, and advanced queries.
Create or update AgentSkills. Use when designing, structuring, or packaging skills with scripts, references, and assets.
Start voice calls via the OpenClaw voice-call plugin.
Notion API for creating and managing pages, databases, and blocks.
Gemini CLI for one-shot Q&A, summaries, and generation.
Category:developer