@routerhub/agent-rules 1.4.14 → 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 +6 -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/`),英文小写中划线分隔。
@@ -66,6 +71,7 @@
66
71
 
67
72
  - 默认本地 `docker build`,构建后 `docker push` 到 `ghcr.io`,推送前确保正确 tag。
68
73
  - 部署通过 Portainer 管理界面操作,禁止 SSH 手动执行 docker 命令;地址和账号配置在 `AGENTS.private.md` 或环境变量中,禁止硬编码。
74
+ - 始终通过 Portainer API 更新 Stack 环境变量触发重新部署,不要 SSH 手动操作 Portainer 管理的容器。
69
75
 
70
76
  ## 测试
71
77
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@routerhub/agent-rules",
3
- "version": "1.4.14",
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": {