@routerhub/agent-rules 1.4.10 → 1.4.11

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 +1 -0
  2. package/package.json +1 -1
package/AGENTS.base.md CHANGED
@@ -73,6 +73,7 @@
73
73
  - 代码注释统一使用中文编写。
74
74
  - 每一行代码都必须有对应的中文注释,明确说明该行代码的作用。
75
75
  - 能复用现有函数或配置时,不要复制粘贴出第二份近似实现。
76
+ - 发现重复或相似的代码、逻辑、样式时,必须主动提取并封装为公共函数、组件或工具方法,避免同类代码散落在多处;能封装的一律封装,降低维护成本。
76
77
  - 编写 Go 代码时,优先使用值传递与局部变量生命周期控制,避免不必要的内存逃逸(如无必要不要返回局部变量指针、避免在热路径中产生额外堆分配)。
77
78
  - 编写代码需遵循 SOLID 原则,并结合场景合理应用设计模式优化可维护性与扩展性,避免过度设计。
78
79
  - 编写代码时必须注重封装性:同一份数据、配置或字段定义只在一个地方维护,其余位置通过引用或派生获取;修改某个字段或逻辑时,应只需改动一处即可全局生效,禁止同一语义散落在多处需要逐一同步修改。
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@routerhub/agent-rules",
3
- "version": "1.4.10",
3
+ "version": "1.4.11",
4
4
  "description": "Shared Copilot agent rules and guidelines for RouterHub projects",
5
5
  "main": "AGENTS.base.md",
6
6
  "bin": {