pr-triage by xtone/ai_development_tools
npx skills add https://github.com/xtone/ai_development_tools --skill pr-triage分析 PR 的变更内容,并结构化输出后续代码审查阶段所需信息的技能。它设计为在轻量模型(Haiku)上运行,有助于优化 CI 环境中的成本。
gh pr view <PR编号> --json title,body,headRefName,baseRefName,changedFiles 获取 PR 信息gh pr diff <PR编号> --name-only 获取变更文件列表gh pr diff <PR编号> 获取代码差异gh pr diff <PR编号> -- <file> 单独获取.pr-review-state.json 是否存在(上次审查状态)广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
.pr-triage.json 文件利用上次的审查状态优化检查范围:
.pr-review-state.json 中的 last_reviewed_commitgit diff <last_reviewed_commit>..HEAD --name-only 识别自上次审查以来发生变更的文件surface_issues 直接从上次状态继承(添加 "carried_over": true 标记)。不重新检查。surface_issues 和 review_comments 中,对应位置已修复的问题包含到 resolved_issues 中.pr-triage.json 中添加 "incremental": true、"base_commit"、"changed_since_last_review"、"unchanged_since_last_review"、"resolved_issues" 字段resolved_issues 的格式:
{
"comment_id": 12345678,
"file": "<文件路径>",
"line": 42,
"issue": "<原始问题描述>",
"resolution": "fixed"
}
如果
.pr-review-state.json不存在,则执行完整的分类流程。如果.pr-review-state.json格式无效(如 JSON 解析错误等),则输出警告并执行完整的分类流程。不得基于损坏的状态文件执行增量模式。
仅在满足以下条件时,将对应的参考文件包含到 required_references 中:
typescript-best-practices.mdauthorization-review-general.mdauthorization-review-postgres-rls.mdskill-review.mdgithub-pr-review-actions.md(始终包含)检查差异,并检测以下问题(仅列出相关项):
any 类型(TypeScript)var 关键字(TypeScript/JavaScript)以以下 JSON 结构输出到 .pr-triage.json:
{
"pr_number": 123,
"incremental": false,
"base_commit": "<上次审查时的提交 SHA(仅在增量模式下)>",
"summary": "<变更摘要(1-2 句话)>",
"files": {
"added": ["<新增文件路径>"],
"modified": ["<修改文件路径>"],
"deleted": ["<删除文件路径>"]
},
"changed_since_last_review": ["<自上次审查以来发生变更的文件(仅在增量模式下)>"],
"unchanged_since_last_review": ["<自上次审查以来未发生变更的文件(仅在增量模式下)>"],
"languages": ["<检测到的语言>"],
"frameworks": ["<检测到的框架>"],
"change_categories": {
"has_auth_changes": false,
"has_db_changes": false,
"has_rls_changes": false,
"has_api_changes": false,
"has_test_changes": false,
"has_config_changes": true,
"has_skill_changes": true
},
"required_references": ["<所需的参考文件名>"],
"surface_issues": [
{
"severity": "Minor|Suggestion",
"file": "<文件路径>",
"line": 15,
"issue": "<问题描述>",
"suggestion": "<改进建议>",
"carried_over": true
}
],
"resolved_issues": [
{
"comment_id": 12345678,
"file": "<文件路径>",
"line": 42,
"issue": "<原始问题描述>",
"resolution": "fixed"
}
],
"diff_summary": "<差异摘要(200 字符以内)>",
"estimated_complexity": "low|medium|high",
"focus_areas": ["<审查时的关注点>"]
}
重要:
.pr-triage.json 的输出。Weekly Installs
458
Repository
GitHub Stars
3
First Seen
Mar 6, 2026
Security Audits
Installed on
claude-code458
opencode4
gemini-cli4
github-copilot4
codex4
kimi-cli4
PRの変更内容を分析し、後続のコードレビューフェーズに必要な情報を構造化して出力するスキルです。 軽量モデル(Haiku)での実行を想定しており、CI環境でのコスト最適化に寄与します。
gh pr view <PR番号> --json title,body,headRefName,baseRefName,changedFiles でPR情報を取得gh pr diff <PR番号> --name-only で変更ファイル一覧を取得gh pr diff <PR番号> でコード差分を取得gh pr diff <PR番号> -- <file> で取得.pr-review-state.json が存在するか確認する(前回レビュー状態).pr-triage.json ファイルに出力する前回のレビュー状態を活用してチェック範囲を最適化する:
.pr-review-state.json の last_reviewed_commit を取得するgit diff <last_reviewed_commit>..HEAD --name-only で前回レビュー以降に変更されたファイルを特定するsurface_issues は前回の状態からそのまま引き継ぐ("carried_over": true を付与)。再チェックしない。surface_issues と review_comments のうち、該当箇所が修正されたものを resolved_issues に含める.pr-triage.json に 、、、、 フィールドを追加するresolved_issues のフォーマット:
{
"comment_id": 12345678,
"file": "<ファイルパス>",
"line": 42,
"issue": "<元の問題の説明>",
"resolution": "fixed"
}
.pr-review-state.jsonが存在しない場合は、通常のフルトリアージを実行する。.pr-review-state.jsonが不正な形式(JSONパースエラー等)の場合は、警告を出力してフルトリアージを実行する。破損した状態ファイルに基づいてインクリメンタルモードを実行してはならない。
以下の条件に該当する場合のみ、対応するリファレンスを required_references に含める:
typescript-best-practices.mdauthorization-review-general.mdauthorization-review-postgres-rls.mdskill-review.mdgithub-pr-review-actions.md(常に含める)差分を確認し、以下の問題を検出する(該当するもののみ):
any 型の使用(TypeScript)var キーワードの使用(TypeScript/JavaScript).pr-triage.json に以下のJSON構造で出力すること:
{
"pr_number": 123,
"incremental": false,
"base_commit": "<前回レビュー時のコミットSHA(インクリメンタル時のみ)>",
"summary": "<変更の概要(1-2文)>",
"files": {
"added": ["<追加ファイルパス>"],
"modified": ["<変更ファイルパス>"],
"deleted": ["<削除ファイルパス>"]
},
"changed_since_last_review": ["<前回から変更があったファイル(インクリメンタル時のみ)>"],
"unchanged_since_last_review": ["<前回から変更がないファイル(インクリメンタル時のみ)>"],
"languages": ["<検出された言語>"],
"frameworks": ["<検出されたフレームワーク>"],
"change_categories": {
"has_auth_changes": false,
"has_db_changes": false,
"has_rls_changes": false,
"has_api_changes": false,
"has_test_changes": false,
"has_config_changes": true,
"has_skill_changes": true
},
"required_references": ["<必要なリファレンスファイル名>"],
"surface_issues": [
{
"severity": "Minor|Suggestion",
"file": "<ファイルパス>",
"line": 15,
"issue": "<問題の説明>",
"suggestion": "<改善案>",
"carried_over": true
}
],
"resolved_issues": [
{
"comment_id": 12345678,
"file": "<ファイルパス>",
"line": 42,
"issue": "<元の問題の説明>",
"resolution": "fixed"
}
],
"diff_summary": "<差分の要約(200文字以内)>",
"estimated_complexity": "low|medium|high",
"focus_areas": ["<レビュー時の注目ポイント>"]
}
重要:
.pr-triage.json の出力に集中してください。Weekly Installs
458
Repository
GitHub Stars
3
First Seen
Mar 6, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykWarn
Installed on
claude-code458
opencode4
gemini-cli4
github-copilot4
codex4
kimi-cli4
agent-browser 浏览器自动化工具 - Vercel Labs 命令行网页操作与测试
138,300 周安装
Rust调用关系图生成器 - 可视化函数调用层次结构,提升代码分析效率
539 周安装
parallel-web-extract:并行网页内容提取工具,高效抓取网页数据
595 周安装
腾讯云CloudBase AI模型Web技能:前端调用混元/DeepSeek模型,实现流式文本生成
560 周安装
Apollo Connectors 模式助手:GraphQL API 连接器开发与集成指南
565 周安装
GitHub Trending 趋势分析工具:实时发现热门项目、技术洞察与开源机会
556 周安装
GSAP React 集成教程:useGSAP Hook 动画库与 React 组件开发指南
546 周安装
"incremental": true"base_commit""changed_since_last_review""unchanged_since_last_review""resolved_issues"