openspec-playwright 0.3.48 → 0.3.50
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/README.md +12 -6
- package/README.zh-CN.md +12 -6
- package/employee-standards.md +3 -5
- package/package.json +1 -1
- package/templates/e2e-command.md +1 -1
package/README.md
CHANGED
|
@@ -20,7 +20,7 @@ openspec-pw init # Install Playwright E2E integration
|
|
|
20
20
|
|
|
21
21
|
## Supported AI Coding Assistants
|
|
22
22
|
|
|
23
|
-
**Claude Code** (Anthropic) — E2E workflow is driven by the `/opsx:e2e` command using a browser exploration tool (
|
|
23
|
+
**Claude Code** (Anthropic) — E2E workflow is driven by the `/opsx:e2e` command using a browser exploration tool (Playwright MCP or `openspec-pw explore`) + Playwright MCP (test execution).
|
|
24
24
|
|
|
25
25
|
**OpenCode** (SST) — E2E workflow is driven by the `/opsx-e2e` command (hyphenated per OpenSpec convention) using the same browser exploration + Playwright MCP stack. Playwright MCP is configured under `mcp.playwright` in `opencode.jsonc`.
|
|
26
26
|
|
|
@@ -67,7 +67,7 @@ openspec-pw uninstall # Remove integration from the project
|
|
|
67
67
|
│
|
|
68
68
|
├── 3. Validate env → run seed.spec.ts
|
|
69
69
|
│
|
|
70
|
-
├── 4. Explore app → browser exploration (
|
|
70
|
+
├── 4. Explore app → browser exploration (Playwright MCP / `openspec-pw explore`)
|
|
71
71
|
│ ├─ Read app-knowledge.md (project-level knowledge)
|
|
72
72
|
│ ├─ Extract routes from specs
|
|
73
73
|
│ ├─ Navigate each route → snapshot → screenshot
|
|
@@ -100,9 +100,15 @@ openspec-pw uninstall # Remove integration from the project
|
|
|
100
100
|
- **Claude Code**: `claude mcp add playwright npx @playwright/mcp@latest`
|
|
101
101
|
- **OpenCode**: merged into `opencode.jsonc` under `mcp.playwright = { type: "local", command: ["npx", "@playwright/mcp@latest"] }`
|
|
102
102
|
|
|
103
|
-
**Optional** —
|
|
103
|
+
**Optional** — enhance your AI coding assistant with Superpowers methodology:
|
|
104
104
|
|
|
105
|
-
- **
|
|
105
|
+
- **Superpowers**: a complete development methodology plugin for Claude Code. It enhances the OpenSpec workflow (propose → apply → verify) with conversational spec exploration, TDD discipline, and subagent-driven implementation. Superpowers does **not** replace OpenSpec — the E2E verification pipeline (`/opsx:e2e`, `openspec-pw doctor/explore/run`) remains unchanged.
|
|
106
|
+
```bash
|
|
107
|
+
/plugin install superpowers@claude-plugins-official
|
|
108
|
+
```
|
|
109
|
+
See [github.com/obra/superpowers](https://github.com/obra/superpowers) for details.
|
|
110
|
+
|
|
111
|
+
Browser exploration is provided out of the box by Playwright MCP and `openspec-pw explore`; no extra browser tool is needed.
|
|
106
112
|
|
|
107
113
|
## What `openspec-pw init` Does
|
|
108
114
|
|
|
@@ -129,11 +135,11 @@ Run through these steps in order when using the E2E workflow for the first time:
|
|
|
129
135
|
| 8. Configure auth (if needed) | See "Authentication" below | Debug with `npx playwright test --project=setup` |
|
|
130
136
|
| 9. Run first E2E | `/opsx:e2e <change-name>` (Claude) or `/opsx-e2e <change-name>` (OpenCode) | Check `openspec/reports/` for the report |
|
|
131
137
|
|
|
132
|
-
**Optional —
|
|
138
|
+
**Optional — enhance your AI coding assistant with Superpowers methodology:**
|
|
133
139
|
|
|
134
140
|
| Step | Command | If it fails |
|
|
135
141
|
|------|---------|-------------|
|
|
136
|
-
| A. Install
|
|
142
|
+
| A. Install Superpowers | `/plugin install superpowers@claude-plugins-official` | See [github.com/obra/superpowers](https://github.com/obra/superpowers) for alternative install methods |
|
|
137
143
|
|
|
138
144
|
## App Server Detection
|
|
139
145
|
|
package/README.zh-CN.md
CHANGED
|
@@ -21,9 +21,15 @@ npm install -g openspec-playwright@latest
|
|
|
21
21
|
- **Claude Code**:`claude mcp add playwright npx @playwright/mcp@latest`
|
|
22
22
|
- **OpenCode**:合并到 `opencode.jsonc` 的 `mcp.playwright = { type: "local", command: ["npx", "@playwright/mcp@latest"] }`
|
|
23
23
|
|
|
24
|
-
**可选** —
|
|
24
|
+
**可选** — 用 Superpowers 增强 AI 编码助手的能力:
|
|
25
25
|
|
|
26
|
-
- **
|
|
26
|
+
- **Superpowers**:完整的 AI 编码助手开发方法论插件。它在 OpenSpec 工作流(propose → apply → verify)阶段增强 AI 能力:对话式 spec 探索、TDD 纪律、subagent 并行实现。Superpowers **不替换 OpenSpec**,E2E 验证管线(`/opsx:e2e`、`openspec-pw doctor/explore/run` 等)保持不变。
|
|
27
|
+
```bash
|
|
28
|
+
/plugin install superpowers@claude-plugins-official
|
|
29
|
+
```
|
|
30
|
+
详见 [github.com/obra/superpowers](https://github.com/obra/superpowers)
|
|
31
|
+
|
|
32
|
+
浏览器探索能力由 Playwright MCP 和 `openspec-pw explore` 内置提供,无需额外工具。
|
|
27
33
|
|
|
28
34
|
## 初始化
|
|
29
35
|
|
|
@@ -37,7 +43,7 @@ openspec-pw init # 安装 Playwright E2E 集成
|
|
|
37
43
|
|
|
38
44
|
## 支持的 AI 编码助手
|
|
39
45
|
|
|
40
|
-
**Claude Code**(Anthropic)— E2E 工作流由
|
|
46
|
+
**Claude Code**(Anthropic)— E2E 工作流由 `探索 + 测试执行` 两步组成:Playwright MCP + `openspec-pw explore`。
|
|
41
47
|
|
|
42
48
|
**OpenCode**(SST)— E2E 工作流由 `/opsx-e2e` 命令驱动(按 OpenSpec 惯例使用连字符),使用相同的浏览器探索 + Playwright MCP 技术栈。Playwright MCP 通过 `opencode.jsonc` 的 `mcp.playwright` 配置。
|
|
43
49
|
|
|
@@ -82,7 +88,7 @@ openspec-pw uninstall # 移除项目中的集成
|
|
|
82
88
|
│
|
|
83
89
|
├── 3. 验证环境 → 运行 seed.spec.ts
|
|
84
90
|
│
|
|
85
|
-
├── 4. 探索应用 → 浏览器探索(
|
|
91
|
+
├── 4. 探索应用 → 浏览器探索(Playwright MCP / `openspec-pw explore`)
|
|
86
92
|
│ ├─ 读取 app-knowledge.md(项目级知识)
|
|
87
93
|
│ ├─ 从 specs 提取路由
|
|
88
94
|
│ ├─ 遍历每个路由 → snapshot → screenshot
|
|
@@ -127,11 +133,11 @@ openspec-pw uninstall # 移除项目中的集成
|
|
|
127
133
|
| 8. 配置认证(如需要) | 见下方"认证配置" | `npx playwright test --project=setup` 调试 |
|
|
128
134
|
| 9. 运行第一个 E2E | `/opsx:e2e <change-name>`(Claude)或 `/opsx-e2e <change-name>`(OpenCode) | 查看 `openspec/reports/` 中的报告 |
|
|
129
135
|
|
|
130
|
-
**可选 —
|
|
136
|
+
**可选 — 用 Superpowers 增强 AI 编码助手:**
|
|
131
137
|
|
|
132
138
|
| 步骤 | 命令 | 失败时快速修复 |
|
|
133
139
|
|------|------|----------------|
|
|
134
|
-
| A. 安装
|
|
140
|
+
| A. 安装 Superpowers | `/plugin install superpowers@claude-plugins-official` | 详见 [github.com/obra/superpowers](https://github.com/obra/superpowers) |
|
|
135
141
|
|
|
136
142
|
## 认证配置
|
|
137
143
|
|
package/employee-standards.md
CHANGED
|
@@ -58,6 +58,8 @@
|
|
|
58
58
|
|
|
59
59
|
**搜索要全**:用 Grep 搜内容,用 Glob 搜文件名。两者缺一不可。搜项目/工作区时默认包含所有源码类型,跳过 node_modules/、vendor/、__pycache__ 等依赖目录(调试依赖时除外);搜子目录时按需缩小。重命名时覆盖调用、类型、字符串、`import`、barrel file、测试 mock,不得假设一次覆盖所有情况。
|
|
60
60
|
|
|
61
|
+
**联网调研优先 agent-reach**:需要查询/调研/搜索等联网操作时,优先使用 agent-reach skill,避免 WebFetch/WebSearch 直接抓页面导致反爬失败。
|
|
62
|
+
|
|
61
63
|
**编辑要求**:编辑后重新读取文件确认变更正确应用。变更完成后,明确告知用户可能遗漏的区域(动态引用、测试 mock 等),提示人工复查。
|
|
62
64
|
|
|
63
65
|
**禁止脚本改文件**:修改源码文件只能使用内置编辑工具(Read/Edit/Write),禁止用 sed/awk/node -e/python -c 等管道命令改文件。格式化工具(ruff fmt、prettier)除外。
|
|
@@ -70,14 +72,10 @@
|
|
|
70
72
|
|
|
71
73
|
## 5. 完整生产工作流
|
|
72
74
|
|
|
73
|
-
|
|
75
|
+
**Superpowers(可选增强)**:安装 `/plugin install superpowers@claude-plugins-official` 后,Superpowers 在 propose → apply → verify 阶段提供更严谨的 AI 方法论(对话式 spec 探索、TDD、subagent 并行实现)。Superpowers **不改变 OpenSpec 主流程**,所有阶段仍由用户手动触发。
|
|
74
76
|
|
|
75
77
|
阶段命令即触发器:`/opsx:propose` → `/opsx:apply` → `/opsx:verify` → e2e 命令(Claude Code 用 `/opsx:e2e`,OpenCode 用 `/opsx-e2e`)→ `/opsx:archive`。**所有阶段由用户手动触发,AI 不自动进入下一阶段**(详见 §2 阶段隔离)。
|
|
76
78
|
|
|
77
|
-
可用 `npx openspec --help` 查看更多 OpenSpec 命令。
|
|
78
|
-
|
|
79
|
-
方向不明时可用 `/office-hours` 做创意验证。**Healer 需要 Playwright 环境**;非 Node.js 项目请参考各自语言的 OpenSpec 测试集成。
|
|
80
|
-
|
|
81
79
|
## 6. 禁止编撰数据
|
|
82
80
|
|
|
83
81
|
无论前后端一体还是纯前端项目,AI 助手**严禁**主动编撰任何数据填充代码,除非用户明确同意。
|
package/package.json
CHANGED
package/templates/e2e-command.md
CHANGED
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
> **Full regression is opt-in only.** `openspec-pw run <name>` → one spec file. Do NOT run `npx playwright test` (no file) or `--only-changed` unless user explicitly requests.
|
|
25
25
|
> **Roles**: Planner (Steps 4–5) → test-plan.md; Generator (Step 6) → `.spec.ts` + Page Objects; Healer (Step 9) → repairs failures via MCP.
|
|
26
26
|
|
|
27
|
-
Browser exploration is tool-agnostic:
|
|
27
|
+
Browser exploration is tool-agnostic: Playwright MCP or `openspec-pw explore --parallel N`.
|
|
28
28
|
|
|
29
29
|
## Testing Principles
|
|
30
30
|
|