npx skills add ...
npx skills add gogf/skills --skill goframe-v2
GoFrame v2 development skill. Use only when the target Go project uses or is explicitly adopting GoFrame v2: the nearest go.mod requires github.com/gogf/gf/v2, existing Go files import github.com/gogf/gf/v2 or any github.com/gogf/gf/v2/... component package, or the user asks to scaffold, migrate, or build with GoFrame. Trigger for GoFrame-backed Go work such as APIs/controllers/services, middleware, routing/config, ORM/DAO/DO/entity/database operations, gf CLI/codegen, HTTP/gRPC services, and microservice conventions. Do not trigger for generic Go projects without GoFrame evidence, frontend-only work, shell scripts, or unrelated infrastructure tasks.
npx skills add gogf/skills --skill goframe-v2
gf init to create project scaffolding. See Project Creation - init for details.logic/ directory for business logic. Implement business logic directly in the service/ directory.gerror component for all error handling to ensure complete stack traces for traceability.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:
var block to group them for better alignment and readability:
GoFrame provides automatic soft delete and time maintenance features. When a table contains created_at, updated_at, or deleted_at fields, the ORM handles these automatically.
| Field | Auto Behavior |
|---|---|
created_at | Auto-written on Insert/InsertAndGetId, never modified afterward |
updated_at | Auto-written on Insert/Update/Save |
deleted_at | Auto-written on Delete (soft delete), auto-filtered on queries |
1. NEVER manually set time fields - GoFrame handles these automatically:
2. NEVER manually add WhereNull(cols.DeletedAt) - GoFrame auto-adds soft delete filter:
3. Use Delete() for soft delete - Framework converts to UPDATE SET deleted_at = NOW():
The deleted_at field supports multiple types:
Time field names can be customized in config.yaml:
Complete GoFrame development resources covering component design, usage, best practices, and considerations: GoFrame Documentation
Rich practical code examples covering HTTP services, gRPC services, and various project types: GoFrame Examples