@autobest-ui/agent 1.0.18 → 1.0.20
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 -12
- package/mcp/azurepr-mcp-bridge/README.md +2 -2
- package/mcp/azurepr-mcp-bridge/config.toml.example +1 -1
- package/mcp/code-mcp-pr/README.md +1 -1
- package/mcp/code-mcp-pr/config.toml.example +1 -1
- package/mcp/figma-mcp-bridge/README.md +3 -3
- package/mcp/figma-mcp-bridge/config.toml.example +1 -1
- package/mcp/rag-mcp-bridge/README.md +3 -3
- package/mcp/rag-mcp-bridge/config.toml.example +1 -1
- package/mcp/trace-mcp-recorder/README.md +2 -2
- package/mcp/trace-mcp-recorder/config.toml.example +1 -1
- package/mcp/trace-mcp-recorder/index.js +7 -4
- package/mcp/trace-mcp-recorder/index.test.js +2 -0
- package/package.json +1 -1
- package/plugins/autobest-delivery/README.md +4 -4
- package/plugins/figma-plugin/README.md +2 -2
- package/skills/README.md +4 -4
- package/skills/common/code-quality/SKILL.md +39 -0
- package/skills/common/code-quality/agents/openai.yaml +7 -0
- package/skills/common/code-quality/references/report-format.md +47 -0
- package/skills/common/trace-recorder/SKILL.md +1 -1
- package/skills/common/ui-pagespeed/SKILL.md +44 -0
- package/skills/common/ui-pagespeed/agents/openai.yaml +7 -0
- package/skills/common/ui-pagespeed/references/report-format.md +47 -0
package/README.md
CHANGED
|
@@ -7,13 +7,13 @@ Autobest 面向 Codex 等智能体发布的 Skills、Plugins 和 MCP 服务集
|
|
|
7
7
|
Common Skills 对当前用户全局生效,安装到 `~/.agents/skills`:
|
|
8
8
|
|
|
9
9
|
```bash
|
|
10
|
-
npx --yes --package=@autobest-ui/agent@
|
|
10
|
+
npx --yes --package=@autobest-ui/agent@1.0.19 autobest-agent-sync common
|
|
11
11
|
```
|
|
12
12
|
|
|
13
13
|
React Skills 只对单个项目生效。在项目根目录运行,安装到该项目的 `.agents/skills`:
|
|
14
14
|
|
|
15
15
|
```bash
|
|
16
|
-
npx --yes --package=@autobest-ui/agent@
|
|
16
|
+
npx --yes --package=@autobest-ui/agent@1.0.19 autobest-agent-sync react
|
|
17
17
|
```
|
|
18
18
|
|
|
19
19
|
也可以把项目绝对路径作为最后一个参数。完整的分类、Skill 清单和更新行为见 [Skills 使用说明](skills/README.md)。
|
|
@@ -27,7 +27,7 @@ npx --yes --package=@autobest-ui/agent@latest autobest-agent-sync react
|
|
|
27
27
|
```bash
|
|
28
28
|
RAG_API_BASE_URL="http://192.168.1.12:3000/api/knowledge" \
|
|
29
29
|
npx --yes \
|
|
30
|
-
--package=@autobest-ui/agent@
|
|
30
|
+
--package=@autobest-ui/agent@1.0.19 \
|
|
31
31
|
autobest-rag-mcp
|
|
32
32
|
```
|
|
33
33
|
|
|
@@ -36,19 +36,19 @@ npx --yes \
|
|
|
36
36
|
```bash
|
|
37
37
|
AZURE_DEVOPS_PAT="your-personal-access-token" \
|
|
38
38
|
npx --yes \
|
|
39
|
-
--package=@autobest-ui/agent@
|
|
39
|
+
--package=@autobest-ui/agent@1.0.19 \
|
|
40
40
|
autobest-azurepr-mcp
|
|
41
41
|
```
|
|
42
42
|
|
|
43
43
|
启动 Playwright Trace 人工录制 MCP:
|
|
44
44
|
|
|
45
45
|
```bash
|
|
46
|
-
npx --yes --package=@autobest-ui/agent@
|
|
46
|
+
npx --yes --package=@autobest-ui/agent@1.0.19 playwright install chromium
|
|
47
47
|
|
|
48
48
|
BACKEND_BASE_URL="http://127.0.0.1:3001" \
|
|
49
49
|
MAX_RECORD_DURATION="1800000" \
|
|
50
50
|
npx --yes \
|
|
51
|
-
--package=@autobest-ui/agent@
|
|
51
|
+
--package=@autobest-ui/agent@1.0.19 \
|
|
52
52
|
autobest-trace-mcp-recorder
|
|
53
53
|
```
|
|
54
54
|
|
|
@@ -70,7 +70,7 @@ Codex 配置示例分别位于:
|
|
|
70
70
|
- [Figma MCP 配置](mcp/figma-mcp-bridge/config.toml.example)
|
|
71
71
|
- [Trace Recorder MCP 配置](mcp/trace-mcp-recorder/config.toml.example)
|
|
72
72
|
|
|
73
|
-
|
|
73
|
+
安装示例固定使用当前版本 `1.0.19`,升级时应同步更新这里的版本号。
|
|
74
74
|
|
|
75
75
|
如果 `@autobest-ui` 发布在私有 npm registry,使用前需要在 npm 的 `.npmrc` 中配置该 scope 对应的 registry 和认证信息。
|
|
76
76
|
|
|
@@ -79,7 +79,7 @@ Codex 配置示例分别位于:
|
|
|
79
79
|
Figma Plugin 与 `figma-mcp-bridge` 分目录维护,并通过同一个 npm 包提供两个独立命令。安装或更新到稳定目录:
|
|
80
80
|
|
|
81
81
|
```bash
|
|
82
|
-
npx --yes --package=@autobest-ui/agent@
|
|
82
|
+
npx --yes --package=@autobest-ui/agent@1.0.19 figma-plugin
|
|
83
83
|
```
|
|
84
84
|
|
|
85
85
|
命令会输出 `manifest.json` 的稳定路径。首次安装后,在 Figma 中通过 **Plugins -> Development -> Import plugin from manifest** 导入该文件。详细说明见 [Figma Plugin 使用说明](plugins/figma-plugin/README.md)。
|
|
@@ -87,7 +87,7 @@ npx --yes --package=@autobest-ui/agent@latest figma-plugin
|
|
|
87
87
|
卸载本地文件:
|
|
88
88
|
|
|
89
89
|
```bash
|
|
90
|
-
npx --yes --package=@autobest-ui/agent@
|
|
90
|
+
npx --yes --package=@autobest-ui/agent@1.0.19 figma-plugin uninstall
|
|
91
91
|
```
|
|
92
92
|
|
|
93
93
|
## Codex Plugin
|
|
@@ -97,7 +97,7 @@ Autobest Delivery 将交付闭环 Skills 和隔离的 Playwright MCP 运行器
|
|
|
97
97
|
安装或更新:
|
|
98
98
|
|
|
99
99
|
```bash
|
|
100
|
-
npx --yes --package=@autobest-ui/agent@
|
|
100
|
+
npx --yes --package=@autobest-ui/agent@1.0.19 autobest-delivery-setup
|
|
101
101
|
```
|
|
102
102
|
|
|
103
103
|
安装器会下载固定版本的运行依赖和 Chromium,将插件持久化到 `~/.autobest-agent/marketplaces/autobest-team`,注册 `autobest-team` 本地市场并安装 `autobest-delivery`。如果同名市场仍指向旧的源码仓库,安装器会自动迁移。完成后重启 Codex,并在新会话中使用插件。
|
|
@@ -105,10 +105,10 @@ npx --yes --package=@autobest-ui/agent@latest autobest-delivery-setup
|
|
|
105
105
|
卸载:
|
|
106
106
|
|
|
107
107
|
```bash
|
|
108
|
-
npx --yes --package=@autobest-ui/agent@
|
|
108
|
+
npx --yes --package=@autobest-ui/agent@1.0.19 autobest-delivery-setup uninstall
|
|
109
109
|
```
|
|
110
110
|
|
|
111
|
-
|
|
111
|
+
安装示例固定使用当前版本 `1.0.19`。插件能力、运行隔离和本地开发验证见 [Autobest Delivery 使用说明](plugins/autobest-delivery/README.md)。
|
|
112
112
|
|
|
113
113
|
## 发布前本地联调
|
|
114
114
|
|
|
@@ -19,10 +19,10 @@ PAT 至少需要目标项目的代码读取权限。不要把 PAT 直接写进 `
|
|
|
19
19
|
Codex 将通过 npm 安装并启动发布包中的 MCP。也可以手动验证启动命令:
|
|
20
20
|
|
|
21
21
|
```bash
|
|
22
|
-
npx --yes --package=@autobest-ui/agent@
|
|
22
|
+
npx --yes --package=@autobest-ui/agent@1.0.19 autobest-azurepr-mcp
|
|
23
23
|
```
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
安装示例固定使用当前版本 `1.0.19`。
|
|
26
26
|
|
|
27
27
|
工具 `get_azure_pull_request` 接受 PR URL。可以使用 `path` 查询参数限制变更目录:
|
|
28
28
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[mcp_servers.azurepr-mcp-bridge]
|
|
2
2
|
command = "npx"
|
|
3
|
-
args = ["--yes", "--package=@autobest-ui/agent@
|
|
3
|
+
args = ["--yes", "--package=@autobest-ui/agent@1.0.19", "autobest-azurepr-mcp"]
|
|
4
4
|
env_vars = ["AZURE_DEVOPS_PAT"]
|
|
5
5
|
startup_timeout_sec = 30
|
|
6
6
|
tool_timeout_sec = 120
|
|
@@ -23,7 +23,7 @@ npm start
|
|
|
23
23
|
随 `@autobest-ui/agent` 包运行:
|
|
24
24
|
|
|
25
25
|
```bash
|
|
26
|
-
npx --yes --package=@autobest-ui/agent@
|
|
26
|
+
npx --yes --package=@autobest-ui/agent@1.0.19 autobest-code-mcp-pr
|
|
27
27
|
```
|
|
28
28
|
|
|
29
29
|
Codex 配置示例见 [config.toml.example](config.toml.example)。
|
|
@@ -7,13 +7,13 @@
|
|
|
7
7
|
先安装 Figma Plugin:
|
|
8
8
|
|
|
9
9
|
```bash
|
|
10
|
-
npx --yes --package=@autobest-ui/agent@
|
|
10
|
+
npx --yes --package=@autobest-ui/agent@1.0.19 figma-plugin
|
|
11
11
|
```
|
|
12
12
|
|
|
13
13
|
然后将 [config.toml.example](config.toml.example) 中的配置加入 `~/.codex/config.toml`,重启 Codex。Codex 会通过 npm 安装并启动 MCP:
|
|
14
14
|
|
|
15
15
|
```bash
|
|
16
|
-
npx --yes --package=@autobest-ui/agent@
|
|
16
|
+
npx --yes --package=@autobest-ui/agent@1.0.19 figma-mcp-bridge
|
|
17
17
|
```
|
|
18
18
|
|
|
19
19
|
MCP 使用 stdio 通信,启动后持续等待客户端请求属于正常状态。WebSocket 默认从 `3055` 端口开始;如果端口已被占用,会依次尝试到 `3070`。
|
|
@@ -22,4 +22,4 @@ MCP 使用 stdio 通信,启动后持续等待客户端请求属于正常状态
|
|
|
22
22
|
|
|
23
23
|
在 Figma 中通过 **Plugins -> Development -> Import plugin from manifest** 导入安装器输出的 `manifest.json`。打开目标文件并运行插件,将插件显示的端口设置为 MCP 实际监听端口。状态显示 `Connected` 后即可使用。
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
安装示例固定使用当前版本 `1.0.19`,以固定 MCP 行为。
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[mcp_servers.figma-mcp-bridge]
|
|
2
2
|
command = "npx"
|
|
3
|
-
args = ["--yes", "--package=@autobest-ui/agent@
|
|
3
|
+
args = ["--yes", "--package=@autobest-ui/agent@1.0.19", "figma-mcp-bridge"]
|
|
4
4
|
startup_timeout_sec = 30
|
|
5
5
|
tool_timeout_sec = 120
|
|
6
6
|
enabled = true
|
|
@@ -9,18 +9,18 @@
|
|
|
9
9
|
```bash
|
|
10
10
|
RAG_API_BASE_URL="http://192.168.1.12:3000/api/knowledge" \
|
|
11
11
|
npx --yes \
|
|
12
|
-
--package=@autobest-ui/agent@
|
|
12
|
+
--package=@autobest-ui/agent@1.0.19 \
|
|
13
13
|
autobest-rag-mcp
|
|
14
14
|
```
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
安装示例固定使用当前版本 `1.0.19`。启动成功后,服务会通过 stdio 持续等待 MCP 客户端请求,并且不会向标准输出写日志;终端看起来没有响应属于正常状态,可按 `Ctrl+C` 停止。
|
|
17
17
|
|
|
18
18
|
供 Codex 长期使用时,将下面的完整配置加入 `~/.codex/config.toml`,然后重启 Codex:
|
|
19
19
|
|
|
20
20
|
```toml
|
|
21
21
|
[mcp_servers.rag-mcp-bridge]
|
|
22
22
|
command = "npx"
|
|
23
|
-
args = ["--yes", "--package=@autobest-ui/agent@
|
|
23
|
+
args = ["--yes", "--package=@autobest-ui/agent@1.0.19", "autobest-rag-mcp"]
|
|
24
24
|
startup_timeout_sec = 30
|
|
25
25
|
tool_timeout_sec = 120
|
|
26
26
|
enabled = true
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[mcp_servers.rag-mcp-bridge]
|
|
2
2
|
command = "npx"
|
|
3
|
-
args = ["--yes", "--package=@autobest-ui/agent@
|
|
3
|
+
args = ["--yes", "--package=@autobest-ui/agent@1.0.19", "autobest-rag-mcp"]
|
|
4
4
|
startup_timeout_sec = 30
|
|
5
5
|
tool_timeout_sec = 120
|
|
6
6
|
enabled = true
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# trace-mcp-recorder
|
|
2
2
|
|
|
3
|
-
`trace-mcp-recorder` 是基于 `@modelcontextprotocol/sdk` 和 `StdioServerTransport` 的 Node.js MCP Server。它打开非无头 Chromium,并在页面左下角注入半透明的“开始录制”“停止录制”和设备切换按钮供测试人员手动控制 Trace;默认是 PC 端,也可切换为 iPhone 14 Pro Max
|
|
3
|
+
`trace-mcp-recorder` 是基于 `@modelcontextprotocol/sdk` 和 `StdioServerTransport` 的 Node.js MCP Server。它打开非无头 Chromium,并在页面左下角注入半透明的“开始录制”“停止录制”和设备切换按钮供测试人员手动控制 Trace;默认是 PC 端,也可切换为 iPhone 14 Pro Max 移动端模拟。点击开始后先自动刷新一次页面,确保 DOM Snapshot 所引用的图片、CSS 和网络资源被 Trace 捕获;后续用户活动经过防抖后以 `步骤N | 页面标题 | 事件类型` 的 Trace Group 写入轻量 Playwright Action,空闲超过 2 分钟自动结束,然后上传原生 `trace.zip` 和浏览器元数据,并返回私有后端的 Trace Viewer 链接。同一进程同一时间只允许一个录制任务。
|
|
4
4
|
|
|
5
5
|
## 安装与启动
|
|
6
6
|
|
|
@@ -43,7 +43,7 @@ npm start
|
|
|
43
43
|
|
|
44
44
|
录制超时后服务自动停止并自动上传(无需人工确认),随后第一次人工调用 `stop_trace_recording` 会取回自动停止的结果;再调用则返回没有活动会话。
|
|
45
45
|
|
|
46
|
-
Trace
|
|
46
|
+
Trace 在点击页面左下角“开始录制”后先刷新页面,再开始计时;点击“停止录制”会立即停止并自动上传,随后可通过 `stop_trace_recording` 取回回放链接。设备切换和录制控制按钮不会写入操作步骤;新打开的页面会继承当前设备模式。连续用户操作停止 800ms 后写入一个带自定义名称的 `tracing.group()`,组内使用 `waitForTimeout(1)` 推进官方 Viewer 播放;连续 2 分钟没有真实用户操作时自动停止并上传。停止录制时会补一个最终 Action。页面自身的轮播、动画和图片加载不会触发录制节点。官方 Viewer 的具体显示可能是 Group 标签或 Group 内嵌 Wait 节点,取决于 Viewer 版本。
|
|
47
47
|
|
|
48
48
|
## 后端接口契约
|
|
49
49
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[mcp_servers.trace-mcp-recorder]
|
|
2
2
|
command = "npx"
|
|
3
|
-
args = ["--yes", "--package=@autobest-ui/agent@
|
|
3
|
+
args = ["--yes", "--package=@autobest-ui/agent@1.0.19", "autobest-trace-mcp-recorder"]
|
|
4
4
|
startup_timeout_sec = 30
|
|
5
5
|
tool_timeout_sec = 180
|
|
6
6
|
enabled = true
|
|
@@ -491,6 +491,11 @@ export class TraceRecorder {
|
|
|
491
491
|
if (session.tracingStarted || session.state !== 'waiting_for_start') return;
|
|
492
492
|
await session.context.tracing.start({ screenshots: true, snapshots: true, sources: true });
|
|
493
493
|
session.tracingStarted = true;
|
|
494
|
+
// The initial navigation happened before Trace started. Reload now so the
|
|
495
|
+
// DOM snapshot also has response bodies for images, CSS, and other assets.
|
|
496
|
+
if (typeof session.page.reload === 'function') {
|
|
497
|
+
await session.page.reload({ waitUntil: 'load' });
|
|
498
|
+
}
|
|
494
499
|
session.state = 'recording';
|
|
495
500
|
session.lastActivityAt = Date.now();
|
|
496
501
|
session.timer = this.setTimer(() => {
|
|
@@ -559,10 +564,7 @@ export class TraceRecorder {
|
|
|
559
564
|
if (session.state === 'recording') return { state: session.state };
|
|
560
565
|
if (session.state !== 'waiting_for_start') return { state: session.state };
|
|
561
566
|
if (!session.activityPromise) {
|
|
562
|
-
session.activityPromise = this.beginRecording(session).catch(error =>
|
|
563
|
-
session.state = 'failed';
|
|
564
|
-
throw error;
|
|
565
|
-
});
|
|
567
|
+
session.activityPromise = this.beginRecording(session).catch(error => this.failSession(session, error));
|
|
566
568
|
}
|
|
567
569
|
return session.activityPromise.then(() => ({ state: session.state, deviceMode: session.deviceMode }));
|
|
568
570
|
}
|
|
@@ -719,6 +721,7 @@ export class TraceRecorder {
|
|
|
719
721
|
this.clearTimer(session.timer);
|
|
720
722
|
this.clearTimer(session.idleTimer);
|
|
721
723
|
this.clearTimer(session.activityDebounceTimer);
|
|
724
|
+
if (session.tracingStarted) await session.context.tracing.stop({ path: session.tracePath }).catch(() => {});
|
|
722
725
|
await this.closeResources(session);
|
|
723
726
|
await this.removeTemporaryDirectory(session.temporaryDirectory).catch(() => {});
|
|
724
727
|
if (this.activeSession === session) this.activeSession = undefined;
|
|
@@ -22,6 +22,7 @@ function createFixture(options = {}) {
|
|
|
22
22
|
};
|
|
23
23
|
const page = {
|
|
24
24
|
goto: async url => calls.push(['goto', url]),
|
|
25
|
+
reload: async options => calls.push(['reload', options]),
|
|
25
26
|
evaluate: async () => 'Fixture User Agent',
|
|
26
27
|
waitForTimeout: async duration => calls.push(['wait', duration]),
|
|
27
28
|
viewportSize: () => ({ width: 1280, height: 720 }),
|
|
@@ -110,6 +111,7 @@ test('page controls start recording, record activity, upload and clean up one se
|
|
|
110
111
|
state: 'recording',
|
|
111
112
|
deviceMode: 'desktop'
|
|
112
113
|
});
|
|
114
|
+
assert.ok(calls.some(call => call[0] === 'reload' && call[1].waitUntil === 'load'));
|
|
113
115
|
recorder.handleUserActivity(recorder.activeSession, {
|
|
114
116
|
type: 'click',
|
|
115
117
|
title: '首页功能'
|
package/package.json
CHANGED
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
安装或更新插件:
|
|
20
20
|
|
|
21
21
|
```bash
|
|
22
|
-
npx --yes --package=@autobest-ui/agent@
|
|
22
|
+
npx --yes --package=@autobest-ui/agent@1.0.19 autobest-delivery-setup
|
|
23
23
|
```
|
|
24
24
|
|
|
25
25
|
安装器会在临时目录中执行 `npm ci` 并下载固定版本的 Chromium。运行时完整就绪后,插件才会替换到以下持久化目录:
|
|
@@ -35,19 +35,19 @@ npx --yes --package=@autobest-ui/agent@latest autobest-delivery-setup
|
|
|
35
35
|
生产环境建议固定 npm 包版本,例如:
|
|
36
36
|
|
|
37
37
|
```bash
|
|
38
|
-
npx --yes --package=@autobest-ui/agent@1.0.
|
|
38
|
+
npx --yes --package=@autobest-ui/agent@1.0.19 autobest-delivery-setup
|
|
39
39
|
```
|
|
40
40
|
|
|
41
41
|
卸载插件及 Autobest 专用本地市场:
|
|
42
42
|
|
|
43
43
|
```bash
|
|
44
|
-
npx --yes --package=@autobest-ui/agent@
|
|
44
|
+
npx --yes --package=@autobest-ui/agent@1.0.19 autobest-delivery-setup uninstall
|
|
45
45
|
```
|
|
46
46
|
|
|
47
47
|
卸载命令只会删除 `~/.autobest-agent/marketplaces/autobest-team` 这一精确路径。查看命令帮助可执行:
|
|
48
48
|
|
|
49
49
|
```bash
|
|
50
|
-
npx --yes --package=@autobest-ui/agent@
|
|
50
|
+
npx --yes --package=@autobest-ui/agent@1.0.19 autobest-delivery-setup --help
|
|
51
51
|
```
|
|
52
52
|
|
|
53
53
|
## MCP 工具
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
## 安装
|
|
6
6
|
|
|
7
7
|
```bash
|
|
8
|
-
npx --yes --package=@autobest-ui/agent@
|
|
8
|
+
npx --yes --package=@autobest-ui/agent@1.0.19 figma-plugin
|
|
9
9
|
```
|
|
10
10
|
|
|
11
11
|
安装器会将插件文件同步到稳定目录:
|
|
@@ -19,7 +19,7 @@ npx --yes --package=@autobest-ui/agent@latest figma-plugin
|
|
|
19
19
|
卸载本地文件:
|
|
20
20
|
|
|
21
21
|
```bash
|
|
22
|
-
npx --yes --package=@autobest-ui/agent@
|
|
22
|
+
npx --yes --package=@autobest-ui/agent@1.0.19 figma-plugin uninstall
|
|
23
23
|
```
|
|
24
24
|
|
|
25
25
|
卸载后,Figma Development Plugins 列表中的记录需要在 Figma 内移除。
|
package/skills/README.md
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
Common Skills 适用于当前用户的所有项目,安装到 `~/.agents/skills`:
|
|
8
8
|
|
|
9
9
|
```bash
|
|
10
|
-
npx --yes --package=@autobest-ui/agent@
|
|
10
|
+
npx --yes --package=@autobest-ui/agent@1.0.19 autobest-agent-sync common
|
|
11
11
|
```
|
|
12
12
|
|
|
13
13
|
当前包含:
|
|
@@ -27,19 +27,19 @@ npx --yes --package=@autobest-ui/agent@latest autobest-agent-sync common
|
|
|
27
27
|
React Skills 只应用于单个项目。进入项目根目录后运行:
|
|
28
28
|
|
|
29
29
|
```bash
|
|
30
|
-
npx --yes --package=@autobest-ui/agent@
|
|
30
|
+
npx --yes --package=@autobest-ui/agent@1.0.19 autobest-agent-sync react
|
|
31
31
|
```
|
|
32
32
|
|
|
33
33
|
安装目标为当前项目的 `.agents/skills`。也可以显式指定项目目录:
|
|
34
34
|
|
|
35
35
|
```bash
|
|
36
|
-
npx --yes --package=@autobest-ui/agent@
|
|
36
|
+
npx --yes --package=@autobest-ui/agent@1.0.19 autobest-agent-sync react /absolute/path/to/project
|
|
37
37
|
```
|
|
38
38
|
|
|
39
39
|
当前包含:
|
|
40
40
|
|
|
41
41
|
- `react-code-standards`
|
|
42
42
|
|
|
43
|
-
再次运行相同命令会更新包内已有的同名文件,不会删除目标 Skill
|
|
43
|
+
再次运行相同命令会更新包内已有的同名文件,不会删除目标 Skill 目录中的额外文件。安装示例固定使用当前版本 `1.0.19`。
|
|
44
44
|
|
|
45
45
|
Codex 会自动检测 Skill 变更;如果新安装的 Skill 没有出现,请重启 Codex。目录规则参考 [OpenAI Codex Skills 文档](https://developers.openai.com/codex/skills/)。
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: code-quality
|
|
3
|
+
description: 对前端仓库执行只读的安全与工程质量检查,并在项目根目录 `.scratch` 下生成带证据和修改建议的 Markdown 报告。用户要求前端安全扫描、依赖漏洞检查、代码质量 Review 或工程风险审查时使用;不修改源码、依赖、锁文件或配置。
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# 前端代码质量检查
|
|
7
|
+
|
|
8
|
+
对当前前端项目执行安全与工程质量审查。最终必须生成 `.scratch/code-quality-report.md`;报告内容、严重级别和单条 finding 字段遵循 [report-format.md](references/report-format.md)。
|
|
9
|
+
|
|
10
|
+
## 边界
|
|
11
|
+
|
|
12
|
+
- 从仓库根目录开始,先确认 `git rev-parse --show-toplevel`;扫描目标必须是当前仓库或用户明确指定的仓库内路径。
|
|
13
|
+
- 只读源码、依赖清单、锁文件、构建配置、lint/类型/测试配置和 Git 元数据;跳过 `node_modules`、构建产物、缓存和二进制文件。
|
|
14
|
+
- 报告是唯一允许写入的项目产物,写入前创建 `.scratch`;不得修改业务源码、依赖版本、锁文件、配置、提交历史或远程状态。
|
|
15
|
+
- 不读取或复制 `.env`、凭据、私钥和其他秘密值;发现疑似秘密时只记录脱敏位置和类型。
|
|
16
|
+
- 工具不可用、网络不可达或项目命令失败时,记录 `Incomplete`/`Blocked` 及原因,不把缺失证据当作通过。
|
|
17
|
+
|
|
18
|
+
## 执行流程
|
|
19
|
+
|
|
20
|
+
1. 记录扫描时间、仓库根目录、当前分支/提交和工作树状态,明确用户指定的审查范围;保留既有改动。
|
|
21
|
+
2. 读取项目 manifest、锁文件、源码类型和可用脚本,识别 npm/Yarn/pnpm、框架和构建工具;不要凭目录名猜测技术栈。
|
|
22
|
+
3. 选择当前环境实际存在的检查命令:依赖审计、密钥扫描、静态规则、类型检查、lint、测试或构建。执行前确认命令为只读。
|
|
23
|
+
4. 检查安全风险:依赖漏洞、XSS/DOM 注入、危险动态执行、不安全 URL/重定向、敏感数据存储、凭据暴露、第三方脚本和生产配置。
|
|
24
|
+
5. 检查工程质量:类型逃逸、异常与 Promise 处理、边界条件、复杂度/重复、依赖一致性、构建配置和关键路径测试保护。
|
|
25
|
+
6. 复核工具告警的源码上下文,区分 `Confirmed`、`Suspected`、`False Positive` 和 `Needs Manual Verification`;只有有证据的问题才进入结论。
|
|
26
|
+
7. 按报告格式写入 `.scratch/code-quality-report.md`,记录未执行的工具、未覆盖范围、风险统计和逐项修改建议。
|
|
27
|
+
8. 重新读取报告并检查 Markdown 结构、路径、行号、证据和建议是否对应;最后复查 `git status --short`,确认业务文件未被修改。
|
|
28
|
+
|
|
29
|
+
## 发现要求
|
|
30
|
+
|
|
31
|
+
- 安全问题优先按 `Critical`、`High`、`Medium`、`Low`、`Info` 分级;不要用普通风格偏好掩盖安全问题。
|
|
32
|
+
- 每条问题必须包含影响、证据、修复优先级、修改建议和修复后的验证方式。
|
|
33
|
+
- 依赖漏洞同时记录包名、受影响版本、漏洞编号(如 CVE/OSV)和可用修复版本;无法联网时说明数据库覆盖限制。
|
|
34
|
+
- 修改建议只描述安全、可验证的改法,不直接编辑代码,也不承诺一次修复即可消除所有风险。
|
|
35
|
+
- 报告结论只能表示本次范围内的扫描结果,不能宣称项目绝对安全或完成渗透测试。
|
|
36
|
+
|
|
37
|
+
## 完成条件
|
|
38
|
+
|
|
39
|
+
只有以下条件全部满足才算完成:`.scratch/code-quality-report.md` 已生成并可读;报告包含扫描范围、工具结果、风险分级、证据、修改建议和限制;工作树中除报告目录外没有本次 Skill 产生的代码或配置改动。
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# Code Quality 报告格式
|
|
2
|
+
|
|
3
|
+
报告路径固定为项目根目录 `.scratch/code-quality-report.md`。报告使用简体中文;JSON、命令、包名、规则编号、CVE/OSV 编号、路径和代码标识符保留原始格式。
|
|
4
|
+
|
|
5
|
+
## 固定章节
|
|
6
|
+
|
|
7
|
+
```md
|
|
8
|
+
# Code Quality Report
|
|
9
|
+
|
|
10
|
+
## 扫描摘要
|
|
11
|
+
## 扫描范围
|
|
12
|
+
## 项目与环境
|
|
13
|
+
## 工具执行记录
|
|
14
|
+
## 风险统计
|
|
15
|
+
## Critical 问题
|
|
16
|
+
## High 问题
|
|
17
|
+
## Medium/Low/Info 问题
|
|
18
|
+
## 工程质量问题
|
|
19
|
+
## 修改建议与验证方式
|
|
20
|
+
## 未覆盖范围与残余风险
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## 单条 finding
|
|
24
|
+
|
|
25
|
+
```md
|
|
26
|
+
### CQ-001: 问题标题
|
|
27
|
+
|
|
28
|
+
- 严重级别:High
|
|
29
|
+
- 状态:Confirmed
|
|
30
|
+
- 置信度:High
|
|
31
|
+
- 文件位置:`src/example.ts:42`
|
|
32
|
+
- 类型:DOM XSS / dependency / configuration / maintainability
|
|
33
|
+
- 证据:简短、脱敏的源码或工具证据
|
|
34
|
+
- 影响:说明攻击面、用户影响或故障后果
|
|
35
|
+
- 修改建议:给出可执行但不直接改代码的建议
|
|
36
|
+
- 修复优先级:立即 / 本迭代 / 后续
|
|
37
|
+
- 验证方式:修复后应运行的命令或测试
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## 结果状态
|
|
41
|
+
|
|
42
|
+
- `Passed`:已完成声明范围,未发现确认的阻断问题。
|
|
43
|
+
- `Findings`:完成扫描并发现一个或多个问题。
|
|
44
|
+
- `Incomplete`:部分工具、目录或数据源不可用。
|
|
45
|
+
- `Blocked`:目标不可读、范围不明确或安全边界无法满足。
|
|
46
|
+
|
|
47
|
+
`Passed` 不表示项目绝对安全;必须同时列出未覆盖的运行时、后端和人工验证范围。
|
|
@@ -14,7 +14,7 @@ description: 通过 trace-mcp-recorder 启动或停止 Playwright Trace 人工
|
|
|
14
14
|
1. 从原话提取 `url`、`version`、`title`、`operator`。支持 `key=value` 和自然语言表达,不改写用户给出的值。
|
|
15
15
|
2. `url` 必填;缺少时只询问目标页面地址。其他字段缺失时不要阻断录制。
|
|
16
16
|
3. 调用 `start_trace_recording`,只传入用户明确提供的可选字段。服务端会优先使用 MCP 上下文中的操作人身份。
|
|
17
|
-
4. 告知用户浏览器已打开:默认是 PC 端;如需移动端测试,先点击左下角“切换移动端”(iPhone 14 Pro Max,430×932,DPR 3
|
|
17
|
+
4. 告知用户浏览器已打开:默认是 PC 端;如需移动端测试,先点击左下角“切换移动端”(iPhone 14 Pro Max,430×932,DPR 3),再点击“开始录制”;点击开始后服务会先刷新一次当前页面以捕获图片等资源,再启动计时,用户正式操作前不要提交表单或进行其他操作;操作完成后点击“停止录制”。新打开的页面会继承当前设备模式。连续 2 分钟没有真实操作时服务会自动停止并上传。真实操作经防抖后会在官方 Trace Viewer 中以 `步骤N | 页面标题 | 事件类型` 的分组节点呈现。
|
|
18
18
|
|
|
19
19
|
示例:`trace-mcp-recorder 启动Playwright trace 访问https://cpd.dev.autobestdevops.com,version=v2.1.0 title=bug3452 operator=张三`。这里 `title=bug3452` 是本次录制的标题/功能描述,页面由 `url=https://cpd.dev.autobestdevops.com` 确定。
|
|
20
20
|
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ui-pagespeed
|
|
3
|
+
description: 对前端页面执行只读的 PageSpeed/Lighthouse 性能、Core Web Vitals、布局和 CSS 检查,并在项目根目录 `.scratch` 下生成带证据和修改建议的 Markdown 报告。用户要求页面性能、移动端适配、布局溢出、CSS 或 PageSpeed 分析时使用;不修改业务代码、样式、资源或配置。
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# 前端 UI 与 PageSpeed 检查
|
|
7
|
+
|
|
8
|
+
对前端项目执行静态或运行时 UI 性能审查。最终必须生成 `.scratch/ui-pagespeed-report.md`;报告字段、指标和证据要求遵循 [report-format.md](references/report-format.md)。
|
|
9
|
+
|
|
10
|
+
## 模式选择
|
|
11
|
+
|
|
12
|
+
- **静态模式**:没有可访问的页面时,读取源码、资源引用、构建配置和 CSS;可以分析包体积风险、加载策略和样式结构,但不得伪造浏览器性能指标。
|
|
13
|
+
- **运行时模式**:用户提供启动命令或 URL 时,使用可用的 Lighthouse、PageSpeed、Playwright 或浏览器性能能力;至少覆盖桌面和移动视口,并记录浏览器、视口、网络、CPU 和运行环境。
|
|
14
|
+
- 页面无法启动、访问或稳定复现时,将运行时结果标记为 `Blocked`/`Incomplete`,保留失败原因和已取得的证据。
|
|
15
|
+
|
|
16
|
+
## 边界
|
|
17
|
+
|
|
18
|
+
- 只读源码、构建产物分析结果和运行时页面;报告写入前创建 `.scratch`,不得修改组件、CSS、图片、字体、依赖、配置或服务端状态。
|
|
19
|
+
- 运行时测试使用用户提供或仓库已有的启动方式,不安装依赖、不改变端口配置、不写入业务数据。
|
|
20
|
+
- 截图、Trace、HAR 等证据如需保存,放在 `.scratch` 内并在报告中链接;不要把秘密、用户数据或生产凭据复制进报告。
|
|
21
|
+
- 单次实验室测试不能代表线上真实用户体验;区分 Lighthouse 实验室数据、PageSpeed/CrUX 真实用户数据和本地观察。
|
|
22
|
+
|
|
23
|
+
## 执行流程
|
|
24
|
+
|
|
25
|
+
1. 确认仓库根目录、页面入口、启动方式和测试范围;记录工作树状态与扫描时间。
|
|
26
|
+
2. 识别静态检查能力,读取 manifest、构建脚本、资源引用和样式组织;确认可用的 Lighthouse/Playwright/PageSpeed 工具。
|
|
27
|
+
3. 运行时可用时,在桌面和移动视口执行稳定的性能采样;保留指标、控制台错误、网络失败和截图证据,必要时重复运行并说明采样方式。
|
|
28
|
+
4. 分析 LCP、INP、CLS、FCP、TBT、TTFB、Speed Index、资源瀑布、长任务、包体积、图片、字体、缓存和第三方脚本。
|
|
29
|
+
5. 检查布局与 CSS:横向溢出、重叠遮挡、响应式断点、固定尺寸、布局抖动、层叠上下文、冗余/冲突样式、触控区域和加载/错误状态。
|
|
30
|
+
6. 将客观可验证的问题与主观设计建议分开;每条结论必须绑定指标、截图、DOM、网络或源码证据。
|
|
31
|
+
7. 按报告格式写入 `.scratch/ui-pagespeed-report.md`,给出预期收益、修改成本、优先级和复测方法。
|
|
32
|
+
8. 重新读取报告并校验证据链接、视口信息、指标单位和限制;最后复查 `git status --short`,确认业务文件未被修改。
|
|
33
|
+
|
|
34
|
+
## 判定要求
|
|
35
|
+
|
|
36
|
+
- 参考阈值:LCP < 2.5s、INP < 200ms、CLS < 0.1;除非项目另有基准,不把它们当成绝对合规线。
|
|
37
|
+
- 性能问题要尽量定位原因,例如首屏资源过大、关键 CSS 阻塞、接口等待或主线程长任务,不能只报告分数。
|
|
38
|
+
- 布局问题优先报告溢出、遮挡、抖动、不可操作和断点失效;间距、层级和美观性属于建议并标记为主观判断。
|
|
39
|
+
- 修改建议必须保持只读:说明推荐的代码、资源或配置方向以及验证方式,不直接执行修改。
|
|
40
|
+
- 报告必须列出没有访问到的页面、没有执行的工具、测试环境限制和剩余风险。
|
|
41
|
+
|
|
42
|
+
## 完成条件
|
|
43
|
+
|
|
44
|
+
只有以下条件全部满足才算完成:`.scratch/ui-pagespeed-report.md` 已生成并可读;报告包含模式、环境、指标/静态证据、布局与 CSS 结果、修改建议和限制;工作树中除报告目录外没有本次 Skill 产生的业务改动。
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# UI PageSpeed 报告格式
|
|
2
|
+
|
|
3
|
+
报告路径固定为项目根目录 `.scratch/ui-pagespeed-report.md`。报告使用简体中文;指标名、命令、URL、路径和工具原始错误保留原始格式。
|
|
4
|
+
|
|
5
|
+
## 固定章节
|
|
6
|
+
|
|
7
|
+
```md
|
|
8
|
+
# UI PageSpeed Report
|
|
9
|
+
|
|
10
|
+
## 测试摘要
|
|
11
|
+
## 页面与测试环境
|
|
12
|
+
## Lighthouse/PageSpeed 结果
|
|
13
|
+
## Core Web Vitals
|
|
14
|
+
## 资源与加载分析
|
|
15
|
+
## 布局与 CSS 问题
|
|
16
|
+
## 移动端问题
|
|
17
|
+
## 截图与证据
|
|
18
|
+
## 修改建议、收益与优先级
|
|
19
|
+
## 未覆盖范围与测试限制
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## 单条 finding
|
|
23
|
+
|
|
24
|
+
```md
|
|
25
|
+
### UI-001: 问题标题
|
|
26
|
+
|
|
27
|
+
- 严重级别:High
|
|
28
|
+
- 类型:performance / layout / css / accessibility / resource
|
|
29
|
+
- 页面或组件:`/dashboard` / `DashboardPanel`
|
|
30
|
+
- 测试模式:静态 / 运行时
|
|
31
|
+
- 当前值:4.8s(如适用)
|
|
32
|
+
- 参考值:2.5s(如适用)
|
|
33
|
+
- 设备与环境:移动端,视口、浏览器、网络和 CPU 条件
|
|
34
|
+
- 证据:指标、截图、DOM、网络或源码位置
|
|
35
|
+
- 可能原因:基于证据的原因分析
|
|
36
|
+
- 修改建议:可执行但不直接改代码
|
|
37
|
+
- 预期收益:指标、布局稳定性或用户体验影响
|
|
38
|
+
- 修改成本:低 / 中 / 高
|
|
39
|
+
- 验证方式:相同条件下的复测命令或检查
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## 数据边界
|
|
43
|
+
|
|
44
|
+
- 标注数据来源:`Lighthouse lab`、`PageSpeed/CrUX field`、本地浏览器观察或静态分析。
|
|
45
|
+
- 记录采样次数;单次运行只描述为单次结果,多次运行才可给出平均或范围。
|
|
46
|
+
- 运行时失败使用 `Blocked` 或 `Incomplete`,并保留失败原因。
|
|
47
|
+
- 没有运行时数据时,报告不得填写推测的 LCP、INP 或 CLS 数值。
|