Community程式設計與開發github.com

duongphuhiep/dakubo-skills

用於回覆 GitHub Pull Request 上的程式碼審查意見並解決討論串。觸發詞為「回答 PR 中的 #N 意見」、「回覆審查者」或「解決此審查意見」。

dakubo-skills 是什麼?

此技能用於自動化回覆 GitHub Pull Request 中的程式碼審查意見(Review Remark),並將該討論串標記為已解決。開發者只需下達如「回答 PR 中的 #2 意見」或「解決此審查意見」等指令,技能便會從對話上下文推斷 PR 編號、目標意見內容以及回覆內容。若無明確資訊,技能會主動詢問或嘗試使用 `dakubo-display-pr-remarks` 技能顯示意見列表。支援的平台包括 GitHub CLI(`gh`)與 GraphQL API,適用於 Claude Code、Cursor 或 Codex 等 AI 輔助開發工具。工作流程包含三個步驟:首先透過 REST API 取得該 PR 的所有內聯審查意見,並比對出目標意見的 ID;接著使用 `gh api` 發送回覆;最後透過 GraphQL 找到對應的審查討論串(Review Thread)並執行解決操作。輸出為一句確認訊息,並明確禁止憑空捏造回覆內容或在未回覆前直接解決討論串。

相容平台~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。 要處理的 pull request。從上下文推斷(例如先前顯示的 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(而不是回覆)的討論串。然後解決它:

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

輸出

確認:回覆已發布至意見 <id> 於 <file>:<line>,討論串已解決。一句話。

不該做的事

  • 不要憑空編造回答——從上下文推導或詢問。
  • 不要在發布回覆之前解決討論串。
  • 如果此分支上有多個 PR 處於開啟狀態,不要猜測是哪個 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.

相關技能