From 07513e64523e061e51c63fc9e71c952cb1a7322e Mon Sep 17 00:00:00 2001 From: Zhongwei Li Date: Sun, 30 Nov 2025 09:07:18 +0800 Subject: [PATCH] Initial commit --- .claude-plugin/plugin.json | 11 ++++++++++ README.md | 3 +++ commands/fix-pr-reviews.md | 37 +++++++++++++++++++++++++++++++ plugin.lock.json | 45 ++++++++++++++++++++++++++++++++++++++ 4 files changed, 96 insertions(+) create mode 100644 .claude-plugin/plugin.json create mode 100644 README.md create mode 100644 commands/fix-pr-reviews.md create mode 100644 plugin.lock.json diff --git a/.claude-plugin/plugin.json b/.claude-plugin/plugin.json new file mode 100644 index 0000000..7bed6c0 --- /dev/null +++ b/.claude-plugin/plugin.json @@ -0,0 +1,11 @@ +{ + "name": "coderabbit", + "description": "Code Rabbit 関連", + "version": "1.0.0", + "author": { + "name": "yaakaito" + }, + "commands": [ + "./commands" + ] +} \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..28df536 --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# coderabbit + +Code Rabbit 関連 diff --git a/commands/fix-pr-reviews.md b/commands/fix-pr-reviews.md new file mode 100644 index 0000000..980424c --- /dev/null +++ b/commands/fix-pr-reviews.md @@ -0,0 +1,37 @@ +GitHub 上の PR から対応が必要なレビューコメントを取得し、修正を行います。 + +1. gh を使って、現在のリポジトリの owner reponame pr-number を取得します。 +2. 以下のコマンドを実行して、未解決のレビューコメントを取得してください、$ONWER $REPO $PR_NUMBER は 1. で取得したものに置き換えてください。 + +```bash +gh api graphql -f query=' +query($owner: String!, $repo: String!, $number: Int!) { + repository(owner: $owner, name: $repo) { + pullRequest(number: $number) { + reviewThreads(first: 100) { + nodes { + isResolved + isOutdated + comments(first: 10) { + nodes { + author { login } + body + path + line + } + } + } + } + } + } +}' -f owner="$OWNER" -f repo="$REPO" -F number=$PR_NUMBER | jq -r '.data.repository.pullRequest.reviewThreads.nodes + | map(select(.isResolved == false)) + | .[] + | "\n \(.comments.nodes[0].path)\n \(.comments.nodes[0].line)\n +\(.comments.nodes[0].author.login)\n \(.comments.nodes[0].body)\n\n"' +``` + +3. 取得した review-comments を一つづつ確認してすべて修正してください。未解決のレビューがなければ終了してください。 +4. 一つ修正を行う事にその内容を commit してください。 +5. すべての修正が完了するまで繰り返します。 +6. すべての修正が完了したら、ブランチを remote へ push してください。 diff --git a/plugin.lock.json b/plugin.lock.json new file mode 100644 index 0000000..668a4fa --- /dev/null +++ b/plugin.lock.json @@ -0,0 +1,45 @@ +{ + "$schema": "internal://schemas/plugin.lock.v1.json", + "pluginId": "gh:yaakaito/env:cc-plugins/coderabbit", + "normalized": { + "repo": null, + "ref": "refs/tags/v20251128.0", + "commit": "a466cdd998df5eb5756b230162400982959b6f88", + "treeHash": "42d1ac04094fd428dea75816c668fdcc8c3c07b0ab44204888ddff1a7a136c74", + "generatedAt": "2025-11-28T10:29:07.743413Z", + "toolVersion": "publish_plugins.py@0.2.0" + }, + "origin": { + "remote": "git@github.com:zhongweili/42plugin-data.git", + "branch": "master", + "commit": "aa1497ed0949fd50e99e70d6324a29c5b34f9390", + "repoRoot": "/Users/zhongweili/projects/openmind/42plugin-data" + }, + "manifest": { + "name": "coderabbit", + "description": "Code Rabbit 関連", + "version": "1.0.0" + }, + "content": { + "files": [ + { + "path": "README.md", + "sha256": "4a0246b32e70bab6633f85cd36413e32d978267bf5388cb8c9151d60fe419fd5" + }, + { + "path": ".claude-plugin/plugin.json", + "sha256": "ecc560bf571c784d9133b3dd86a4741ade531a8b9bffb1074c3f9502721e935f" + }, + { + "path": "commands/fix-pr-reviews.md", + "sha256": "63dd2e1b7f1fead341c0d2acbf13201c3a2e7e782d24b29795a2ccffd41f5f13" + } + ], + "dirSha256": "42d1ac04094fd428dea75816c668fdcc8c3c07b0ab44204888ddff1a7a136c74" + }, + "security": { + "scannedAt": null, + "scannerVersion": null, + "flags": [] + } +} \ No newline at end of file