openspec-playwright 0.3.22 → 0.3.23
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/employee-standards.md +11 -0
- package/package.json +1 -1
package/employee-standards.md
CHANGED
|
@@ -34,6 +34,17 @@ E2E 工作流前提(由用户确保,非 AI 操作):
|
|
|
34
34
|
|
|
35
35
|
**lint + typecheck 通过(项目标准工具链)才算成功**。动手前扫描项目根目录源码文件扩展名检测主语言——`.py`→Python(ruff + mypy)、`.ts`/`.tsx`→TypeScript(ESLint + tsc)、`.go`→Go(gofmt + vet),工具不存在时告知用户。
|
|
36
36
|
|
|
37
|
+
**禁止非通用性改动**:
|
|
38
|
+
- 不写只适配特定输入值的逻辑
|
|
39
|
+
- 假设所有外部数据都有效 → 必须校验类型/范围/null
|
|
40
|
+
- 处理数据时考虑边界情况(空值、异常值、边界值)
|
|
41
|
+
- 断言用通用规则,不用具体值(除非明确要求)
|
|
42
|
+
- 禁止魔法数字 → 用常量或枚举,注释说明原因
|
|
43
|
+
- 禁止隐式成功假设 → 异步/外部操作必须处理失败情况
|
|
44
|
+
- 禁止响应结构假设 → 先校验返回结构再访问深层属性
|
|
45
|
+
- 禁止精度/范围假设 → 计算前确认数值在安全范围内
|
|
46
|
+
- 禁止资源泄漏假设 → 文件/连接/cursor 等使用后必须释放
|
|
47
|
+
|
|
37
48
|
## 3. 上下文管理
|
|
38
49
|
|
|
39
50
|
**文件读取完整**:超过 500 行的文件,不要假设单次读取覆盖完整内容——根据需要分次读取或编辑前重新读取完整文件。超过 10 条消息后,编辑任何文件前强制重新读取。
|