关于 fetch-unresolved-comments
此技能通过 GitHub GraphQL API 获取拉取请求中尚未解决的评审线程,帮助贡献者聚焦仍需处理的反馈。
主要功能
- 01获取未解决的评审线程
- 02接受拉取请求 URL
- 03查找当前分支的 PR URL
- 04从环境变量或 gh 读取 GitHub 令牌
适用场景
- 01查看仍需处理的评审反馈
- 02从 PR 评审中筛除已解决线程
安装
复制下面的命令,在终端中运行。
$
npx skills add https:/ / github.com/ mlflow/ mlflow --skill fetch-unresolved-comments安装后在 Claude Code 中输入/fetch-unresolved-comments确认已加载。
详细介绍
获取未解决的 PR 评审评论
使用 GitHub 的 GraphQL API 仅从拉取请求中获取未解决的评审线程评论。
适用场景
- 你只需要获取 PR 中未解决的评审评论
- 你希望过滤掉已经解决的反馈
操作说明
-
获取 PR URL:
- 首先检查环境变量:
- 如果设置了
PR_NUMBER和GITHUB_REPOSITORY,则将 URL 构造为https://github.com/${GITHUB_REPOSITORY}/pull/${PR_NUMBER}
- 如果设置了
- 否则:
- 使用
gh pr view --json url -q '.url'获取当前分支的 PR URL
- 使用
- 首先检查环境变量:
-
运行该技能:
uv run skills fetch-unresolved-comments <pr_url>示例:
uv run skills fetch-unresolved-comments https://github.com/mlflow/mlflow/pull/18327脚本会自动从以下位置读取 GitHub 令牌:
GH_TOKEN环境变量,或- 如果未设置环境变量,则使用
gh auth token命令
输出示例
{
"total": 3,
"by_file": {
".github/workflows/resolve.yml": [
{
"thread_id": "PRRT_kwDOAL...",
"line": 40,
"startLine": null,
"diffHunk": "@@ -0,0 +1,245 @@\n+name: resolve...",
"comments": [
{
"id": 2437935275,
"body": "We can remove this once we get the key.",
"author": "harupy",
"createdAt": "2025-10-17T00:53:20Z"
},
{
"id": 2437935276,
"body": "Good catch, I'll update it.",
"author": "contributor",
"createdAt": "2025-10-17T01:10:15Z"
}
]
}
],
".gitignore": [
{
"thread_id": "PRRT_kwDOAL...",
"line": 133,
"startLine": null,
"diffHunk": "@@ -130,0 +133,2 @@\n+.claude/*",
"comments": [
{
"id": 2437935280,
"body": "Should we add this to .gitignore?",
"author": "reviewer",
"createdAt": "2025-10-17T01:15:42Z"
}
]
}
]
}
}
评论
支持 Markdown