goframe-v2

Installation
Summary

GoFrame v2 development conventions and component standards for Go services and APIs.

  • Use gf init to scaffold HTTP and microservice projects; auto-generated dao, do, and entity files must never be manually modified
  • Implement business logic directly in the service/ directory; avoid the logic/ directory unless explicitly required
  • Always use DO objects from internal/model/do/ for database operations; never use g.Map or map[string]interface{}, and leverage nil field handling for conditional updates
  • Apply gerror for all error handling to maintain complete stack traces; reuse existing components and methods before creating new ones
  • Reference included best practice examples for HTTP services, gRPC services, and project patterns
SKILL.md

Critical Conventions

Project Development Standards

  • For complete projects (HTTP/microservices), install GoFrame CLI and use gf init to create project scaffolding. See Project Creation - init for details.
  • Auto-generated code files (dao, do, entity) MUST NOT be manually created or modified per GoFrame conventions.
  • Unless explicitly requested, do NOT use the logic/ directory for business logic. Implement business logic directly in the service/ directory.
  • Reference complete project examples:

Component Usage Standards

  • Before creating new methods or variables, check if they already exist elsewhere and reuse existing implementations.
  • Use the gerror component for all error handling to ensure complete stack traces for traceability.
  • When exploring new components, prioritize GoFrame built-in components and reference best practice code from examples.
  • Database Operations MUST use DO objects (internal/model/do/), never g.Map or map[string]interface{}. DO struct fields are interface{}; unset fields remain nil and are automatically ignored by the ORM:
    // Good - use DO object
    dao.Users.Ctx(ctx).Where(cols.Id, id).Data(do.User{Uid: uid}).Update()
    
Installs
1.6K
Repository
gogf/skills
GitHub Stars
62
First Seen
Feb 10, 2026