@routerhub/agent-rules 1.4.8 → 1.4.9
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.
- package/AGENTS.base.md +1 -0
- package/package.json +1 -1
package/AGENTS.base.md
CHANGED
|
@@ -75,6 +75,7 @@
|
|
|
75
75
|
- 能复用现有函数或配置时,不要复制粘贴出第二份近似实现。
|
|
76
76
|
- 编写 Go 代码时,优先使用值传递与局部变量生命周期控制,避免不必要的内存逃逸(如无必要不要返回局部变量指针、避免在热路径中产生额外堆分配)。
|
|
77
77
|
- 编写代码需遵循 SOLID 原则,并结合场景合理应用设计模式优化可维护性与扩展性,避免过度设计。
|
|
78
|
+
- 编写代码时必须注重封装性:同一份数据、配置或字段定义只在一个地方维护,其余位置通过引用或派生获取;修改某个字段或逻辑时,应只需改动一处即可全局生效,禁止同一语义散落在多处需要逐一同步修改。
|
|
78
79
|
|
|
79
80
|
## 测试用例规范
|
|
80
81
|
|