openspec-playwright 0.1.60 → 0.1.61
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.
|
@@ -5,7 +5,7 @@ license: MIT
|
|
|
5
5
|
compatibility: Requires openspec CLI, Playwright (with browsers installed), and @playwright/mcp (globally installed via `claude mcp add playwright npx @playwright/mcp@latest`).
|
|
6
6
|
metadata:
|
|
7
7
|
author: openspec-playwright
|
|
8
|
-
version: "2.
|
|
8
|
+
version: "2.11"
|
|
9
9
|
---
|
|
10
10
|
|
|
11
11
|
## Input
|
|
@@ -32,6 +32,14 @@ Two modes, same pipeline:
|
|
|
32
32
|
|
|
33
33
|
Both modes update `app-knowledge.md` and `app-exploration.md`. All `.spec.ts` files run together as regression suite.
|
|
34
34
|
|
|
35
|
+
**Role mapping** (Playwright Test Agents terminology):
|
|
36
|
+
|
|
37
|
+
| Role | This SKILL | What it does |
|
|
38
|
+
|------|-----------|--------------|
|
|
39
|
+
| Planner | Step 4–5 | Explores app via Playwright MCP → produces test-plan.md |
|
|
40
|
+
| Generator | Step 6 | Transforms test-plan.md → `.spec.ts` with verified selectors |
|
|
41
|
+
| Healer | Step 9 | Executes tests, repairs failures via Playwright MCP |
|
|
42
|
+
|
|
35
43
|
## Testing principles
|
|
36
44
|
|
|
37
45
|
**UI first** — Test every user flow through the browser UI. E2E validates that users can accomplish tasks in the real interface, not just that the backend responds correctly.
|
|
@@ -98,7 +106,7 @@ Run the seed test before generating tests:
|
|
|
98
106
|
npx playwright test tests/playwright/seed.spec.ts --project=chromium
|
|
99
107
|
```
|
|
100
108
|
|
|
101
|
-
|
|
109
|
+
Seed test initializes the `page` context — it runs all fixtures, hooks, and globalSetup. Not just a smoke check: it also validates that auth setup, BASE_URL, and Playwright are fully functional.
|
|
102
110
|
|
|
103
111
|
**If seed test fails**: Stop and report. Fix the environment before proceeding.
|
|
104
112
|
|
package/employee-standards.md
CHANGED
|
@@ -1,84 +1,42 @@
|
|
|
1
1
|
# Claude Code Employee-Grade Configuration
|
|
2
2
|
|
|
3
|
-
>
|
|
4
|
-
>
|
|
3
|
+
> 员工级行为规范,适用于 OpenSpec 项目。
|
|
4
|
+
> 遵循 OpenSpec 规范驱动开发流程(详见 /openspec/)。
|
|
5
5
|
|
|
6
6
|
---
|
|
7
7
|
|
|
8
8
|
## 一、代码质量
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
**验证后才能报告成功**。运行项目的 linter 和 type checker:查看 `package.json`/`pyproject.toml`/`go.mod`/`Cargo.toml` 中的 scripts,使用对应的 `lint`/`typecheck` 命令。不存在时,明确告知用户,不得假装成功。
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
**拒绝'够用就行'**。架构缺陷、状态重复、模式不一致——说出来并修复。高级工程师在 code review 中会拒绝什么?全部修掉。
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
npx tsc --noEmit && npx eslint . --quiet
|
|
16
|
-
```
|
|
17
|
-
|
|
18
|
-
如项目无类型检查,明确告知用户,不得假装成功。
|
|
19
|
-
|
|
20
|
-
### 高级工程师标准
|
|
21
|
-
|
|
22
|
-
不接受"最简单方案"和"不超出需求"作为偷懒的借口。如果架构有缺陷、状态重复、模式不一致——说出来并修复。问自己:**高级工程师在 code review 中会拒绝什么?** 把那些全部修掉。
|
|
14
|
+
**安全防护**:防范 XSS、SQL 注入、命令注入(OWASP Top 10)。
|
|
23
15
|
|
|
24
16
|
---
|
|
25
17
|
|
|
26
18
|
## 二、上下文管理
|
|
27
19
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
任何结构性重构(>300 LOC)之前,先删除所有死代码(未使用 import/export/prop/console.log)。单独提交清理,再做重构。
|
|
31
|
-
死代码会提前消耗 token budget,触发 auto-compaction——每次失败会浪费大量 API 调用。保持代码干净直接节省成本。
|
|
32
|
-
|
|
33
|
-
### 文件读取分段
|
|
20
|
+
**文件读取完整**:超过 500 行的文件,不要假设单次读取覆盖了完整文件——根据需要分次读取相关段落,或编辑前重新读取完整文件。超过 10 条消息后,编辑任何文件前强制重新读取。
|
|
34
21
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
### 上下文衰减
|
|
38
|
-
|
|
39
|
-
超过 10 条消息后,编辑任何文件前必须重新读取。
|
|
22
|
+
**重构前清死代码**:未使用的 import/export/prop/console.log 先删掉,单独提交,再做重构。
|
|
40
23
|
|
|
41
24
|
---
|
|
42
25
|
|
|
43
|
-
##
|
|
44
|
-
|
|
45
|
-
### 子 Agent 并行化
|
|
46
|
-
|
|
47
|
-
任务涉及超过 5 个独立文件时,启动并行子 agent(每个 5-8 个文件),每个拥有独立 token budget。
|
|
26
|
+
## 三,大规模任务
|
|
48
27
|
|
|
49
|
-
|
|
28
|
+
**子 Agent 并行化**:任务涉及超过 5 个独立文件时,启动并行子 agent(每个 5-8 个文件),每个拥有独立 token budget。
|
|
50
29
|
|
|
51
|
-
|
|
30
|
+
**分阶段执行**:每个阶段不超过 5 个文件,完成后验证,等待用户批准再继续。
|
|
52
31
|
|
|
53
32
|
---
|
|
54
33
|
|
|
55
34
|
## 四、工具限制
|
|
56
35
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
搜索结果异常少时,用更窄范围重新运行。怀疑截断时告知用户。
|
|
60
|
-
|
|
61
|
-
### Grep 不是 AST
|
|
62
|
-
|
|
63
|
-
重命名函数/类型/变量时,必须分开搜索:
|
|
64
|
-
|
|
65
|
-
- 直接调用和引用
|
|
66
|
-
- 类型级引用(interface、泛型)
|
|
67
|
-
- 字符串字面量(动态引用)
|
|
68
|
-
- `require()` / `import`
|
|
69
|
-
- barrel file 和 re-export
|
|
70
|
-
- 测试文件和 mock
|
|
71
|
-
|
|
72
|
-
不得假设一次 grep 覆盖所有情况。
|
|
36
|
+
**搜索维度完整**:重命名函数/类型/变量时,必须覆盖:直接调用、类型级引用、字符串字面量、`require()`/`import`、barrel file、测试 mock。不得假设一次 grep 覆盖所有情况。
|
|
73
37
|
|
|
74
38
|
---
|
|
75
39
|
|
|
76
40
|
## 五、编辑安全
|
|
77
41
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
每次编辑前重新读取文件,编辑后再次读取确认变更正确应用。同一文件连续编辑不超过 3 次,中间必须验证读取。
|
|
81
|
-
|
|
82
|
-
### 变更完整性
|
|
83
|
-
|
|
84
|
-
重命名或签名变更完成后,明确告知用户可能遗漏的区域(动态引用、测试 mock 等),提示人工复查。
|
|
42
|
+
**验证后才算完成**:编辑后再次读取确认变更正确应用。同一文件连续编辑不超过 3 次,中间必须验证。变更完成后,明确告知用户可能遗漏的区域(动态引用、测试 mock 等),提示人工复查。
|
|
Binary file
|
package/package.json
CHANGED
package/release-notes.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
## What's Changed
|
|
2
2
|
|
|
3
|
-
-
|
|
3
|
+
- refactor(employee-standards): remove Claude Code system prompt duplicates
|
|
4
4
|
|
|
5
|
-
**Full Changelog**: https://github.com/wxhou/openspec-playwright/releases/tag/v0.1.
|
|
5
|
+
**Full Changelog**: https://github.com/wxhou/openspec-playwright/releases/tag/v0.1.61
|
|
Binary file
|