wopal-cn/wopal-space-ontology/cnb-pr-diff
Claude Code and agent skill by wopal-cn/wopal-space-ontology
Trust tier 3
- community
Source check pending
Checking that the SKILL.md file is still in the repository.
Install
npx vskill@latest install wopal-cn/wopal-space-ontology/cnb-pr-diffSKILL.md
The same SKILL.md was published earlier as wopal-cn/wopal-space-ontology/cnb-pr-diff.
获取 PR Diff
获取 PR 的代码变更差异信息,用于代码评审、变更总结等场景。
1. 判断场景并获取 SHA
场景 A:PR 评论触发(CNB_PULL_REQUEST_IID 存在)
直接从环境变量获取:
- head SHA:
CNB_PULL_REQUEST_SHA - target SHA:
CNB_PULL_REQUEST_TARGET_SHA
若环境变量不存在,通过 API 查询当前 PR 详情。
场景 B:Issue 或其他场景引用 PR
用户输入中提及了 PR 编号(如 !45),需要:
- 从用户输入中解析 PR 编号
- 通过 API 查询该 PR 详情获取 SHA
- fetch 对应的 commit(本地可能没有)
API 查询 PR 详情
2. 获取 Diff
获取变更文件列表
获取变更统计
获取完整 Diff
获取特定文件的 Diff
3. 过滤文件
根据使用场景,可排除无需关注的文件:
可排除的文件类型:
- 锁文件:
package-lock.json、yarn.lock、pnpm-lock.yaml、go.sum、Cargo.lock - 图片/字体:
*.png、*.jpg、*.gif、*.svg、*.woff、*.ttf - 二进制:
*.exe、*.dll、*.so、*.jar、*.pyc - 压缩包:
*.zip、*.tar.gz、*.rar - 构建产物:
dist/、build/、out/、target/、.next/ - 依赖目录:
node_modules/、vendor/、.venv/ - 压缩文件:
*.min.js、*.min.css、*.map
4. 使用建议
- diff 过大时:先用
--name-only查看文件列表,再按需获取具体文件 - 代码评审:建议排除锁文件、图片、构建产物
- 变更总结:可保留更多文件,但排除二进制和依赖目录
- 上下文行数:
-U5提供 5 行上下文,可按需调整
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/cnb-pr-diff/SKILL.md
Popularity
- Repository stars
- 3
- Repository forks
- 1
- 7-day trend score
- 0
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/wopal-cn/wopal-space-ontology/cnb-pr-diff)