一键导入
cherry-pr-test
Test Cherry Studio PRs by checking out the branch, launching the Electron app in debug mode, and running interactive UI tests via CDP.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Test Cherry Studio PRs by checking out the branch, launching the Electron app in debug mode, and running interactive UI tests via CDP.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Create or update GitHub pull requests using the repository-required workflow and template compliance. Use when asked to create/open/update a PR so the assistant reads `.github/pull_request_template.md`, fills every template section, preserves markdown structure exactly, and marks missing data as N/A or None instead of skipping sections.
Automated Cherry Studio code review for local branches, PRs, commits, and files. Use for reviewing code, docs, or pull requests with project-specific checks for DataApi boundaries, service ownership, renderer data hooks, React Hooks, lifecycle services, i18n, UI conventions, and tests. Supports single-agent review with interactive fix selection, or multi-agent deep review with reviewer-verifier adversarial mechanism and risk-based auto-fix. To find gaps in this skill's own instructions after a session, run `/gh-pr-review diag`.
Use when reviewing a PR, API, IPC channel, endpoint, parameter, type, or config that adds new surface area — BEFORE commenting on implementation quality. Also use immediately when a review surfaces signals like "no consumers yet", "unused export", "speculative", "additive", "forward-compatible", or "for future use".
Cherry Studio 产品知识库、源码路径索引、故障排查和页面导航。当用户询问 Cherry Studio 的功能、配置、报错、使用方法时触发。也适用于用户提到 provider、模型、知识库、Agent、MCP、OpenClaw、PDF、快捷短语等关键词的场景。
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy.
将成功解决的用户问题收录到 FAQ 知识库。问题解决后自动判断是否收录。也可以在用户说"收录到 FAQ"、"记录这个问题"、"add to FAQ"时手动触发。
| name | cherry-pr-test |
| description | Test Cherry Studio PRs by checking out the branch, launching the Electron app in debug mode, and running interactive UI tests via CDP. |
Automated PR testing workflow for Cherry Studio. Checks out a PR, launches the Electron app with Chrome DevTools Protocol, connects agent-browser, and runs interactive UI + code review tests.
gh CLI installed and authenticatedagent-browser installed (for CDP-based UI testing)pnpm installed with project dependencies (pnpm install)$ARGUMENTS may contain:
13955)https://github.com/CherryHQ/cherry-studio/pull/13955)gh pr list --repo CherryHQ/cherry-studio --state open --limit 10 \
--json number,title,author,createdAt,headRefName,changedFiles \
--template '{{range .}}#{{.number}} | {{.title}} | by {{.author.login}} | files: {{.changedFiles}}
{{end}}'
gh pr view <NUMBER> --json title,body,headRefName,files
gh pr checkout <NUMBER>
Static analysis and app launch are independent — run them in parallel to save time.
pnpm typecheck 2>&1 | grep -E "error TS|exited with code"
@deprecated / V2 DATA&UI REFACTORING headers. These files are blocked
for feature changes until v2.0.0.console.log usage (should use loggerService)Record all findings for the final report.
Kill any existing Cherry Studio processes (graceful SIGTERM first):
pkill -f "cherry-studio.*Electron" 2>/dev/null
pkill -f "electron-vite" 2>/dev/null
lsof -ti :9222 | xargs kill 2>/dev/null
lsof -ti :5173 | xargs kill 2>/dev/null
sleep 3
# Escalate to SIGKILL only if processes remain
lsof -ti :9222 | xargs kill -9 2>/dev/null
lsof -ti :5173 | xargs kill -9 2>/dev/null
Start in debug mode (includes --remote-debugging-port=9222):
nohup pnpm debug > /tmp/cherry-debug.log 2>&1 &
Wait for startup (typically 20-30s):
for i in $(seq 1 30); do
lsof -i :9222 2>/dev/null | grep LISTEN && break
sleep 2
done
Connect:
agent-browser connect 9222
If connect fails, fall back to websocket URL from logs:
WS_URL=$(grep "DevTools listening" /tmp/cherry-debug.log | sed 's/.*ws:/ws:/')
agent-browser --cdp "$WS_URL" navigate http://localhost:5173
Verify connection and identify the main page:
agent-browser tab
You should see the main Cherry Studio page at http://localhost:5173/.
If multiple tabs are listed, use agent-browser tab <N> to select the main one.
Handle first-launch scenarios:
/migrationV2.html) before the main UI.
Click through: 介绍(下一步) → 备份(我已备份,开始迁移) → 迁移(确定) → 完成(重启应用).
After "重启应用", kill and relaunch the app (the restart button doesn't work in dev mode).Create screenshot directory for this PR:
mkdir -p /tmp/pr-<NUMBER>
Use this directory for all screenshots: /tmp/pr-<NUMBER>/<descriptive-name>.png
Based on the PR's changed files, navigate to the relevant pages and test. Use your judgement to decide what to test — the PR description and changed files should guide your testing strategy.
agent-browser snapshot -i to discover interactive elementsagent-browser eval)After testing:
Kill all Cherry Studio processes (graceful SIGTERM first):
pkill -f "cherry-studio.*Electron" 2>/dev/null
pkill -f "electron-vite" 2>/dev/null
lsof -ti :9222 | xargs kill 2>/dev/null
lsof -ti :5173 | xargs kill 2>/dev/null
sleep 3
lsof -ti :9222 | xargs kill -9 2>/dev/null
lsof -ti :5173 | xargs kill -9 2>/dev/null
Switch back to the default branch:
default_branch=$(git symbolic-ref refs/remotes/origin/HEAD 2>/dev/null | sed 's@^refs/remotes/origin/@@')
git checkout "${default_branch:-main}"
Generate a structured report with screenshots. Save the report as
/tmp/pr-<NUMBER>/report.md alongside the screenshots.
# PR #<NUMBER> 测试报告
**PR 标题**: <title>
**作者**: @<author>
**分支**: <branch>
**修改文件数**: <count>
## 静态分析
| 检查项 | 结果 | 说明 |
|--------|------|------|
| TypeScript 类型检查 | ✅/❌ | ... |
| 受阻文件检查 | ✅/⚠️ | ... |
| console.log 使用 | ✅/❌ | ... |
## UI 测试
### <Test Case Name>
<description of what was tested and the result>

## 发现的问题
(if any)
## 结论
- 问题总数:N
- 建议:APPROVE / REQUEST_CHANGES / COMMENT
If the user requests, copy the report directory to a more accessible location (e.g., Desktop) for sharing.
The pnpm debug script passes --remote-debugging-port=9222 to Electron.
If not working:
tail -50 /tmp/cherry-debug.loglsof -ti :9222 | xargs kill -9ps aux | grep electron-viteUse direct websocket URL:
WS_URL=$(grep "DevTools listening" /tmp/cherry-debug.log | grep 9222 | sed 's/.*\(ws:\/\/[^ ]*\)/\1/')
agent-browser --cdp "$WS_URL" tab
Electron apps have multiple CDP targets (main window + webviews for mini-apps).
If agent-browser connects to a webview instead of the main page:
# List all targets
agent-browser tab
# Switch to the main page (usually tab 0, URL contains localhost:5173)
agent-browser tab 0
After opening/closing mini-apps, always verify you're on the right target
with agent-browser tab.
On the v2 branch, the app may show a data migration wizard on first launch. This is not a bug — it's expected when dev data hasn't been migrated yet. Click through the wizard steps, then restart the app manually (kill + relaunch). The wizard only appears once; subsequent launches go straight to the main UI.
Wait longer (up to 30s on first launch). The app needs to:
After connecting, if agent-browser tab shows only about:blank:
agent-browser navigate http://localhost:5173
sleep 10
agent-browser tab