pr-review-check

Kurogoma4D 的头像作者 Kurogoma4D

检查当前分支的拉取请求,并获取未解决的审查评论。需要使用`gh`命令。当用户被指示进行`PR review comment`、`PR レビューコメント`等操作时使用。

📖 中文导读:检查当前分支的拉取请求,并获取未解决的审查评论。需要使用`gh`命令。当用户被指示进行`PR review comment`、`PR レビューコメント`等操作时使用。 以下正文为该技能的原始 SKILL.md 内容(英文),上方安装命令可直接使用。

name: pr-review-check description: Check Pull Request on current branch, and obtain unresolved review comments. gh command is required. Use this when user instructed with PR review comment PR レビューコメント etc. allowed-tools: Read, Bash(cat:), Bash(gh:), Bash(jq:*)

Get Unresolved Review Comments for Current Branch's PR

# Save query to a temp file
cat > /tmp/query.graphql << 'EOF'
query($owner: String!, $repo: String!, $number: Int!) {
  repository(owner: $owner, name: $repo) {
    pullRequest(number: $number) {
      reviewThreads(first: 100) {
        nodes {
          isResolved
          comments(first: 10) {
            nodes {
              body
              author { login }
              path
              line
            }
          }
        }
      }
    }
  }
}
EOF

# Execute
gh api graphql \
  -f query="$(cat /tmp/query.graphql)" \
  -f owner="$(gh repo view --json owner --jq '.owner.login')" \
  -f repo="$(gh repo view --json name --jq '.name')" \
  -F number="$(gh pr view --json number --jq '.number')" \
  | jq '.data.repository.pullRequest.reviewThreads.nodes | map(select(.isResolved == false))'