@routerhub/agent-rules 1.4.15 → 1.4.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/AGENTS.base.md +5 -0
  2. package/package.json +1 -1
package/AGENTS.base.md CHANGED
@@ -48,6 +48,11 @@
48
48
  - 优先值传递与局部变量生命周期控制,避免内存逃逸;无必要不返回局部变量指针。
49
49
  - 所有删除操作必须使用软删除机制;`DeletedAt` 字段类型必须用 `gorm.DeletedAt`,禁止用 `*time.Time`(后者不实现 `DeleteClausesInterface`,会导致硬删除)。
50
50
 
51
+ ## GORM Model 规范
52
+
53
+ - `DeletedAt` 字段必须使用 `gorm.DeletedAt` 类型,严禁使用 `*time.Time`。`*time.Time` 不会触发 GORM v2 的软删除机制,会导致 `Delete()` 执行物理删除(DELETE FROM)而非软删除(UPDATE SET deleted_at)。
54
+ - 新建 Model 时,优先嵌入已有的公共基础结构体(如包含 ID、CreatedAt、UpdatedAt、DeletedAt 的 BaseModel),避免各 Model 独立定义这些字段导致类型不一致。
55
+
51
56
  ## Git 规范
52
57
 
53
58
  - 分支用 Git Flow(`feature/`、`bugfix/`、`hotfix/`、`refactor/`、`chore/`、`docs/`、`test/`),英文小写中划线分隔。
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@routerhub/agent-rules",
3
- "version": "1.4.15",
3
+ "version": "1.4.16",
4
4
  "description": "Shared Copilot agent rules and guidelines for RouterHub projects",
5
5
  "main": "AGENTS.base.md",
6
6
  "bin": {