Community编程与开发github.com

duongphuhiep/dakubo-skills

当用户想要回复 GitHub 拉取请求上的代码审查意见并解决其讨论线程时使用。触发词包括“回答 PR 中的第 N 条意见”、“回复审查者”或“解决此审查评论”。

dakubo-skills 是什么?

这是一个专门用于在 GitHub 拉取请求中回复代码审查意见并自动解决对应讨论线程的技能。它适用于 Claude Code、Cursor、Codex 等 AI 代理平台,通过对操作意图的自然语言理解,自动识别 PR 编号、目标意见和回复内容。该技能会执行完整的操作流程:首先通过 GitHub API 获取 PR 的所有行内审查评论,匹配用户指向的具体意见并获取其 ID;然后以回复形式发布用户提供的回答(无需手动指定评论 ID);最后通过 GraphQL API 找到包含该意见的审查线程并标记为已解决。它要求所有输入从对话上下文中推断(例如之前展示的 PR URL、意见表格或用户讨论的内容),并在信息不足时主动询问用户,避免猜测或编造答案。

兼容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/duongphuhiep/dakubo-skills/tree/HEAD/package/skills/dakubo-answer-review-remark-in-pr

Installed? Explore more 编程与开发 skills: steipete/bluebubbles, steipete/eightctl, steipete/blucli · View all 6 →

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

在 PR 中回复审查意见

回复 GitHub PR 上的代码审查意见并解决对应的讨论线程。

输入

所有输入均从对话上下文中推断。仅在存在歧义时才询问。

输入 1 — PR 编号或 URL。 要操作的拉取请求。从上下文推断(例如之前展示的 PR URL 或分支名称)。如果确实存在歧义,运行:

gh pr list --head "$(git rev-parse --abbrev-ref HEAD)" --json number,url --jq '.[0]'

输入 2 — 要回答的意见。 具体的审查者发现——通常通过编号(#2)、文件名+行号或对话中之前展示的意见表格中的引用文本来识别。 如果对话中没有意见表格,并且 dakubo-display-pr-remarks 技能可用,则使用它以生成表格。如果不可用,则询问用户该意见。

输入 3 — 回答内容。 要发布的回复:解释、确认或修复摘要。根据上下文推断(例如刚刚修复或讨论的内容)。如果不清楚则询问。

流程

1. 解析评论 ID

获取 PR 的行内审查评论:

gh api repos/:owner/:repo/pulls/<PR>/comments --paginate \
  --jq '.[] | {id, path, line: (.line // .original_line), body: .body[0:120]}'

通过行号、文件路径或评论内容片段匹配目标意见。记录其 id。

2. 发布回复

gh api repos/:owner/:repo/pulls/<PR>/comments \
  --method POST \
  --field body="<answer>" \
  --field in_reply_to=<comment_id>

3. 解决讨论线程

找到包含此评论的审查线程:

gh api graphql -f query='
{
  repository(owner: "<owner>", name: "<repo>") {
    pullRequest(number: <PR>) {
      reviewThreads(first: 100) {
        nodes {
          id
          isResolved
          comments(first: 1) { nodes { databaseId } }
        }
      }
    }
  }
}'

匹配 comments.nodes[0].databaseId 等于原始评论 id(不是回复的 ID)的线程。然后解决它:

gh api graphql -f query='
mutation {
  resolveReviewThread(input: { threadId: "<thread_node_id>" }) {
    thread { isResolved }
  }
}'

输出

确认:回复已发布到评论 <id> 位于 <file>:<line>,线程已解决。一句话即可。

不要做什么

  • 不要编造回答——从上下文推断或询问用户。
  • 不要在发布回复之前就解决线程。
  • 如果此分支上有多个打开的 PR,不要猜测——请询问用户。

Individual skills in this repo

This repo contains 4 individual skills — each has its own dedicated page.

duongphuhiep/dakubo-skills

Use when the user wants to respond to a code review remark by adding a clarifying comment to the source code — so the reviewer understands the reasoning and won't raise the same remark again. Triggers on "answer remark #N", "add comment to address reviewer concern", "document why we did X", or any request to resolve a review finding through in-code explanation rather than a code change.

duongphuhiep/dakubo-skills

Use when the user wants to see unresolved PR comments, review remarks, or outstanding feedback on a pull request.

duongphuhiep/dakubo-skills

Traces the full call chain from a given symbol or code location up to all entry points that can reach it (HTTP controllers, main functions, page components, routes, etc.). Works for any language indexed by CodeGraph. Use for blast-radius analysis before modifying a function, method, or class.

duongphuhiep/dakubo-skills

Consolidates multiple fragmented OpenSpec capability folders under openspec/specs/ into a single main feature spec, through a staged/approved workflow. Use this whenever the user says openspec/specs/ is cluttered, has too many similar or overlapping capability folders, asks to merge/consolidate/combine specs, wants to clean up specs split across several separate change archives (e.g. specs/user-show/, specs/user-detail/ that should really be one specs/user-management/), or asks to check/apply a pending merged spec under openspec/specs/.merged-specs/. Do NOT use this for a normal single /opsx:archive of one change — only for merging several already-archived, already-existing spec folders together.

相关技能