cnb-pr-diff
获取 PR 的 diff 变更信息。当需要查看 PR 代码变更、获取文件差异时使用此技能。
Mit Codex oder Claude installieren Kopieren Sie diesen Prompt, fügen Sie ihn in Codex, Claude oder einen anderen Assistant ein und lassen Sie die Skill-Seite prüfen und installieren.
Menü
获取 PR 的 diff 变更信息。当需要查看 PR 代码变更、获取文件差异时使用此技能。
Mit Codex oder Claude installieren Kopieren Sie diesen Prompt, fügen Sie ihn in Codex, Claude oder einen anderen Assistant ein und lassen Sie die Skill-Seite prüfen und installieren.
Basierend auf der SOC-Berufsklassifikation
Create professional architecture, workflow, sequence, data-flow, and lifecycle/state diagrams as standalone HTML files with SVG graphics, a built-in dark/light theme toggle, and one-click export to PNG / JPEG / WebP / SVG. Accepts plain-language descriptions or pasted Mermaid code (flowchart, sequenceDiagram, stateDiagram) and lays the diagram out from scratch in archify style. Use when the user asks for system architecture diagrams, infrastructure diagrams, cloud architecture visualizations, security diagrams, network topology, technical workflows, approval flows, runbooks, CI/CD flows, process diagrams, API call sequences, request lifecycles, data pipelines, ETL/ELT maps, PII boundaries, data lineage, state machines, lifecycle diagrams, status transitions, or asks to convert/beautify a Mermaid diagram.
Use when the user requests diagrams, flowcharts, architecture diagrams, ER diagrams, UML / sequence / class diagrams, network topology, cloud architecture from Terraform or Kubernetes manifests, ML/DL model figures (Transformer/CNN/LSTM), mind maps, or any visualization. Also use proactively when explaining systems with 3+ components, complex data flows, or relationships that benefit from visual representation. Best suited when the diagram needs custom styling, rich shape vocabulary, swimlanes, or exportable images (PNG/SVG/PDF/JPG). Generates .drawio XML and exports locally via the native draw.io desktop CLI.
专家团总路由器。用于 Codex CLI 的 $expert-team 调用。 自动在软件开发团队、设计原型专家团、产品战略团队、基础设施运维专家和安全专家之间路由,也支持显式指定 software/design/product/ops/security。 触发词:专家团、团队协作、软件开发、设计原型、产品战略、基础设施运维、安全专家、威胁建模、代码审计、SRE、PRD、竞品、路线图、监控、部署、安全加固
Specialized agent for developing AIUI applications. Invoke when writing AIUI code, needing API references for jsui/wx, debugging AIUI applications, or aligning AIUI visual design with this Skill's design guidelines.
为文章规划并生成可读性强的极简强线条手绘配图。先建立文章地图,识别段落适合流程图、架构图、对比图、关系图、结构图还是概念插图,再通过构思卡组织单一命题、原文指纹、信息单位、阅读顺序和固定橙白圆猫角色。构思通过可读性测试后默认直接生成。用户说配图、手绘配图、给文章配图、文章插图、技术文章插图、流程图、架构图、关系图或 illustrate my article 时使用。
CNB 平台交互命令,支持代码仓库、Issue、PR、CI、制品库读写等操作。
| name | cnb-pr-diff |
| description | 获取 PR 的 diff 变更信息。当需要查看 PR 代码变更、获取文件差异时使用此技能。 |
获取 PR 的代码变更差异信息,用于代码评审、变更总结等场景。
CNB_PULL_REQUEST_IID 存在)直接从环境变量获取:
CNB_PULL_REQUEST_SHACNB_PULL_REQUEST_TARGET_SHA若环境变量不存在,通过 API 查询当前 PR 详情。
用户输入中提及了 PR 编号(如 !45),需要:
# 将 ${pr_iid} 替换为实际 PR 编号
pr_info=$(curl -s \
"${CNB_API_ENDPOINT:-https://api.cnb.cool}/${CNB_REPO_SLUG}/-/pulls/${pr_iid}" \
-H "Accept: application/vnd.cnb.api+json" \
-H "Authorization: Bearer $CNB_TOKEN")
head_sha=$(echo "$pr_info" | jq -r '.head.sha')
target_sha=$(echo "$pr_info" | jq -r '.base.sha')
# 场景 B 需要确保本地有这些 commit
git fetch origin "$head_sha" "$target_sha" 2>/dev/null || git fetch origin
git diff --name-only "${target_sha}...${head_sha}"
git diff --stat "${target_sha}...${head_sha}"
git diff -U5 "${target_sha}...${head_sha}"
git diff -U5 "${target_sha}...${head_sha}" -- path/to/file.ts
根据使用场景,可排除无需关注的文件:
# 常见排除模式
git diff -U5 "${target_sha}...${head_sha}" -- . \
':!package-lock.json' ':!yarn.lock' ':!pnpm-lock.yaml' ':!go.sum' ':!*.lock' \
':!*.png' ':!*.jpg' ':!*.gif' ':!*.svg' ':!*.ico' \
':!*.min.js' ':!*.min.css' ':!*.map' \
':!dist/*' ':!build/*' ':!node_modules/*'
可排除的文件类型:
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、*.rardist/、build/、out/、target/、.next/node_modules/、vendor/、.venv/*.min.js、*.min.css、*.map--name-only 查看文件列表,再按需获取具体文件-U5 提供 5 行上下文,可按需调整