jzero-io/jzero/jzero-skills
Claude Code and agent skill by jzero-io/jzero
- community
- ext:[{"type":"template","description":"Custom templates for code generation"}]
Checking that the SKILL.md file is still in the repository.
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-rea…
Install
npx vskill@latest install jzero-io/jzero/jzero-skillsSemi-extensibleMentions customization, but needs skill-specific knowledge. Read the extensible skills standard
SKILL.md
jzero Skills for AI Agents
Structured knowledge base optimized for AI agents to help developers work effectively with the jzero framework (enhanced go-zero).
Overview
This skill provides AI agents with comprehensive jzero knowledge to:
- Generate accurate code following jzero conventions
- Understand the three-layer architecture (Handler → Logic → Model)
- Apply best practices for microservices development
- Use jzero-specific features
- Build production-ready applications
Quick Start
When helping with jzero development:
- For new projects: Start with Development Workflows
- For REST APIs: Check REST API File Structure - ⚠️ Critical rules
- For RPC services: Review Proto File Structure - Proto standards & multi-proto support
- For databases: Review Database Best Practices - ⚠️ Must read
- For SQL changes: Check SQL Migration Guide - ⚠️ Schema changes
- For specific operations: Reference the appropriate pattern guide below
Core Patterns
REST API Development
Reference: references/rest-api-patterns/api-file-structure.md
- API file structure with required settings (
go_package,group,compact_handler) - Three-layer architecture (Handler → Logic → Model)
- Request/response type definitions with validation
- Handler patterns and HTTP concerns
- Logic patterns and business implementation
- ✅ Correct vs ❌ incorrect patterns with examples
When to use: Creating or modifying REST API services, implementing HTTP endpoints
RPC Services
- [Proto File Structure](references/rpc-patterns/proto-file-structure.md): Proto standards, multi-proto support, file structure, HTTP gateway, OpenAPI docs
- [Proto Field Validation](references/rpc-patterns/proto-validation.md): Field validation with protovalidate, CEL expressions, built-in constraints
- [Proto Middleware](references/rpc-patterns/proto-middleware.md): HTTP/RPC middleware at service and method levels
When to use: Creating or modifying RPC services, working with proto files, adding validation or middleware
Database Operations
- [Best Practices](references/database-patterns/best-practices.md): Model import rules, condition chain usage, error handling, field constants ⚠️🚨
- [SQL Migration Guide](references/database-patterns/sql-migration.md): Managing schema changes with up/down migrations ⚠️
- [Model Generation](references/database-patterns/model-generation.md): From SQL files or remote datasource
- [Database Connection](references/database-patterns/database-connection.md): MySQL, PostgreSQL, SQLite, Redis configuration
- [CRUD Operations](references/database-patterns/crud-operations.md): Generated methods (Insert, FindOne, Update, Delete, etc.)
⚠️ CRITICAL REMINDER: ALWAYS use condition.NewChain() - NEVER use condition.New()
When to use: Implementing data persistence, queries, or database operations
Development Workflows
Reference: Project Structure
Creating a New REST API Endpoint
- Define API specification in
.apifile with required settings: - Generate api code:
jzero gen --desc desc/api/user.api - Implement logic in
internal/logic/following three-layer architecture
See detailed patterns: REST API File Structure
Implementing Database Operations
Choose your schema mode first:
Local SQL Mode (schema files in desc/sql/):
- Create/update SQL schema in
desc/sql/*.sql - Create migration files in
desc/sql_migration/(xx.up.sql & xx.down.sql) ⚠️ - Apply migrations (development:
jzero migrate up, production: auto incmd/server.go) - Generate model:
jzero gen --desc desc/sql/users.sql
Remote Datasource Mode (schema from live database):
- Create migration files in
desc/sql_migration/(xx.up.sql & xx.down.sql) ⚠️ - Apply migrations (development:
jzero migrate up, production: auto incmd/server.go) - Generate model:
jzero gen
Common steps (both modes):
- Inject model into ServiceContext
- Use condition builder in logic layer
- Handle errors properly
⚠️ Migration rules: Always create both up/down files, use consecutive numbering (1, 2, 3...)
See detailed patterns: SQL Migration Guide | Database Best Practices
Setting Up Database Connection
- Configure in `etc/etc.yaml`:
- Initialize in ServiceContext with modelx.MustNewConn
- Register models in Model struct
See detailed guide: Database Connection
Project Structure
Typical jzero project structure:
Key Principles
✅ Always Follow
- 🚨 Condition builder: ALWAYS use
condition.NewChain(), NEVER usecondition.New()- THIS IS CRITICAL 🚨 - Three-layer architecture: Handler → Logic → Model separation
- API file requirements: Set
go_package,group,compact_handler: true - Model imports: Use alias
xxmodel "project/internal/model/xx" - Error handling: Use
errors.Is(err, model.ErrNotFound)fromgithub.com/pkg/errors - Code generation: Run
jzero gen --descbefore implementing logic - Type safety: Use generated field constants (e.g.,
usersmodel.Id)
❌ Never Do
- 🚫 NEVER use `condition.New()` - This is error-prone and deprecated. ALWAYS use `condition.NewChain()`
- Put business logic in handlers (belongs in logic layer)
- Skip
go_package,group, orcompact_handlerin.apifiles - Import models without alias:
"project/internal/model/users"(wrong) - Use
==for error comparison:if err == ErrNotFound(wrong) - Hard-code configuration values
- Implement logic before generating code
Progressive Learning
New to jzero?
- Read this file (SKILL.md) for overview
- Create a project:
jzero new myapi --frame api - Follow Development Workflows
- Study REST API File Structure
Building REST APIs?
- Master API file requirements (critical for avoiding regeneration issues)
- Learn three-layer architecture patterns
- Study Database Best Practices
Creating RPC services?
- Learn proto file structure: Proto File Structure
- Add validation: Proto Field Validation
- Implement middleware: Proto Middleware
Working with databases?
- ⚠️ Must read: Database Best Practices
- ⚠️ Must read: SQL Migration Guide - Schema changes
- Set up connection: Database Connection
- Generate models: Model Generation
- Learn CRUD operations: CRUD Operations
Production deployment?
- Review all best practices in reference guides
- Configure proper error handling and logging
- Set up caching strategies with Redis
- Implement resilience patterns (circuit breaker, rate limiting)
Resources
- Official documentation: docs.jzero.io
- GitHub repository: jzero-io/jzero
- Examples: jzero-io/examples
- Base framework: zeromicro/go-zero
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingcmd/jzero/.template/skills/jzero-skills/SKILL.md
Popularity
- Repository stars
- 181
- Repository forks
- 18
- 7-day trend score
- 26
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 19 Mar 2026, 7 months ago.
Extension points
templateCustom templates for code generation
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/jzero-io/jzero/jzero-skills)