Skip to content

chore: add coderabbit review workflow#64

Merged
wasabeef merged 2 commits into
mainfrom
chore/coderabbit-review-workflow
May 9, 2026
Merged

chore: add coderabbit review workflow#64
wasabeef merged 2 commits into
mainfrom
chore/coderabbit-review-workflow

Conversation

@wasabeef
Copy link
Copy Markdown
Owner

@wasabeef wasabeef commented May 8, 2026

Summary

  • Add repo-local CodeRabbit fix commands for Claude, Codex, Cursor, and Gemini
  • Add matching CodeRabbit review skills that fetch unresolved CodeRabbit threads, triage them, verify fixes, and resolve only addressed threads
  • Document the English rationale reply path for feedback that should stay unresolved

Verification

  • Inspected the shared Codex skill instructions
  • Confirmed the branch diff only adds CodeRabbit workflow docs/skills

Notes

  • This PR intentionally avoids a helper script; the workflow uses gh directly so each Agent can identify the current PR or an explicit PR number.

🧑💬🤖 Agent Note

Total AI Ratio: ████████ 100%
Model: gpt-5.4

Commit AI Ratio Prompts Files
418605a chore: add coderabbit review workflow █████ 100% 11 coderabbit-fix.md 🤖, SKILL.md 🤖, coderabbit-fix.md 🤖, SKILL.md 🤖, coderabbit-fix.md 🤖, SKILL.md 🤖, coderabbit-fix.md 🤖, SKILL.md 🤖
4919a0a docs: fix coderabbit workflow guidance █████ 100% 2 coderabbit-fix.md 🤖, SKILL.md 🤖, coderabbit-fix.md 🤖, SKILL.md 🤖, coderabbit-fix.md 🤖, SKILL.md 🤖, coderabbit-fix.md 🤖, SKILL.md 🤖
💬 Prompts & Responses (12 shown / 13 total)

418605a chore: add coderabbit review workflow

📝 Context
skill-creator を使います。 今回の目的は repo-local な Agent 向け手順なので、汎用 skill として肥大化させず、CodeRabbit review 修正に必要な最小ワークフローと補助 script に寄せます。

🧑 Prompt
coderabbit の指摘事項を確認して修正するコマンドとスキルを作りたい

.claude/ .codex/ .cursor/ .gemini/ にそれぞれこのリポジトリローカルように作成して

🤖 Response
CodeRabbit の指摘確認 → 修正 → resolve を各 Agent から同じ手順で呼べる repo-local command / skill として揃えます。まず既存の .claude / .codex / .cursor / .gemini の構成を見て、各ツールのローカル拡張の置き方に合わせます。
skill-creator を使います。今回の目的は repo-local な Agent 向け手順なので、汎用 skill として肥大化させず、CodeRabbit review 修正に必要な最小ワークフローと補助 script に寄せます。
CodeRabbit 対応を各 Agent から同じ手順で呼べるように、共通の取得スクリプトを 1 つ置いて、その上に .claude / .codex / .cursor / .gemini 用の command と skill を薄く重ねます。いまの作業ブランチに混ぜないよう、まず main から専用ブランチを切ります。
main は最新でした。既存は Claude だけ ski…

📝 Context
あわせて、いま実通信で見つかった GraphQL の data wrapper 対応も直します。 実通信で #60 の CodeRabbit comment 取得まで通りました。

🧑 Prompt
修正が完了した指摘事項に関しては resolve するようにして

🤖 Response
了解です。skill 側の完了条件として「修正・検証済みの review thread は必ず resolve」を明示します。あわせて、いま実通信で見つかった GraphQL の data wrapper 対応も直します。
実通信で #60 の CodeRabbit comment 取得まで通りました。review thread がない PR では summary comment だけ出る状態で、修正済み thread の resolve は helper が出す GraphQL コマンドを skill 側で必須手順にしました。

🧑 Prompt
scripts/coderabbit-review.mjs を使わなくても現在のブランチで作成されたPRって特定できないか?

📝 Context
PR 番号の特定は gh pr view / gh pr list --head <current-branch> で十分できるので、Agent 側の skill には「明示された PR がなければ現在ブランチから判断する」手順を入れます。 script は CodeRabbit thread を GraphQL で集める共通 helper として残す、という分担が一番きれいです。

🧑 Prompt
AI Agent なら判断してくれそうだけど

🤖 Response
できます。PR 番号の特定は gh pr view / gh pr list --head <current-branch> で十分できるので、Agent 側の skill には「明示された PR がなければ現在ブランチから判断する」手順を入れます。script は CodeRabbit thread を GraphQL で集める共通 helper として残す、という分担が一番きれいです。
はい、現在ブランチの PR は Agent 側で判断できます。gh pr view --json number,url を第一候補にして、必要なら gh pr list --head "$(git branch --show-current)" で fallback する形にしました。

追加済み:

  • .claude/commands/coderabbit-fix.md
  • .codex/commands/coderabbit-fix.md
  • .cursor/commands/coderabbit-fix.md
  • `.gemini/commands/coderabb…

📝 Context
ただし scripts/coderabbit-review.mjs を置いた理由は PR 特定ではなく、CodeRabbit の指摘取得を安定化するためです。 CodeRabbit の review thread は GraphQL が必要で、毎回コマンドが長い resolved / unresolved の filter が必要 CodeRabbit author だけ拾う必要がある 修正完了後の resolveReviewThread コマンドを thread ごとに出せる .claude / .codex / .cursor / .gemini に同じ GraphQL を重複させずに済む なので位置づけとしては「PR を探す script」ではなく「CodeRabbit review items を正規化して Agent に渡す helper」です。

🧑 Prompt
scripts/coderabbit-review.mjs は必要ってことになったの?

🤖 Response
必須ではないです。PR の特定だけなら AI Agent が gh pr view / gh pr list --head ... で判断できます。

ただし scripts/coderabbit-review.mjs を置いた理由は PR 特定ではなく、CodeRabbit の指摘取得を安定化するためです。

  • CodeRabbit の review thread は GraphQL が必要で、毎回コマンドが長い
  • resolved / unresolved の filter が必要
  • CodeRabbit author だけ拾う必要がある
  • 修正完了後の resolveReviewThread コマンドを thread ごとに出せる
  • .claude / .codex / .cursor / .gemini に同じ GraphQL を重複させずに済む

なので位置づけとしては「PR を探す script」ではなく「CodeRabbit review items を正規化して Agent に渡す helper」です。

もし repo に `…

📝 Context
たしかに、この用途だと helper script は少し重いです。 Agent が gh を直接叩ける前提なら、repo-local command / skill に「PR 特定」「CodeRabbit thread 取得」「修正済み thread resolve」の手順を書けば十分なので、scripts/coderabbit-review.mjs は削除してシンプルにします。

🧑 Prompt
いらないんじゃない?

🤖 Response
たしかに、この用途だと helper script は少し重いです。Agent が gh を直接叩ける前提なら、repo-local command / skill に「PR 特定」「CodeRabbit thread 取得」「修正済み thread resolve」の手順を書けば十分なので、scripts/coderabbit-review.mjs は削除してシンプルにします。

🧑 Prompt
修正終わったら指摘コメントを resolve するようにして。
対応しない場合はコメントしてそのままにすること。

🤖 Response
その運用に寄せます。skill の Resolve セクションを「修正したら resolve」「対応しないなら rationale を返信して unresolved のまま」に明確化します。あと scripts/ は空ディレクトリだけ残っているので掃除します。

📝 Context
了解、CodeRabbit への返信コメントは English 固定にします。

🧑 Prompt
英語でコメント返信ね

🤖 Response
了解、CodeRabbit への返信コメントは English 固定にします。skill に「reply in English」を足しておきます。
scripts/coderabbit-review.mjs は削除して、command / skill だけにしました。

今の運用はこうです。

  • PR は Agent が gh pr view / gh pr list --head "$(git branch --show-current)" で判断する。
  • CodeRabbit の review thread は gh api graphql で直接取得する。
  • 修正して検証できた thread は resolveReviewThread で resolve する。
  • 対応しない thread は resolve せず、English で短い理由コメントを返す。
  • summary comment は context 扱いで、primary action list は unresolved review thread。

作成済みファイルは各 Agent …

🧑 Prompt
コミット前にレビューして

🤖 Response
common:pr-review を使って、コミット前の差分をレビューします。まず追加された command / skill の中身と、意図しないファイル混入がないかを確認します。
レビューで 2 点見つかりました。script を消したのに --include-resolved の記述が残っている点と、「対応しない場合に English で返信する」ための具体コマンドが不足している点です。コミット前にここは直します。
修正を入れました。次に、4 Agent 分が同じ内容になっているか、無効な古い記述が残っていないか、実際の GraphQL query が通るかを確認します。

🧑 Prompt
3回レビューと改善ループ

🤖 Response
3 回まわします。まず 1 回目は「各 Agent で同じ指示として読めるか」、2 回目は「GitHub API 手順が実際に成立するか」、3 回目は「運用ルールとして誤解されないか」を見る形で進めます。
1 回目レビューの結果、2 点直します。$ARGUMENTS は Claude には自然でも他 Agent には少し寄っているので汎用表現に変えます。さらに review comment 返信用 REST endpoint が PR 番号を含まない形になっていたので、ここは実害が出る前に直します。
2 回目は API 手順の実用性レビューに入ります。GraphQL query は実 PR で通ることを確認しつつ、command / skill の重複が完全一致しているかも見ます。
2 回目レビューは OK で、GraphQL query も実データで通りました。3 回目は運用上の取りこぼしを見ていて、CodeRabbit comment の選び方と comment pagination が少し曖昧だったので、そこだけ明文化します。
3 回目の修正を入れました。最後に、4 Agen…

4919a0a docs: fix coderabbit workflow guidance

📝 Context
PR #63 の CodeRabbit 対応を進めました。

実施済み:

  • 追加修正を commit / push
  • commit: 6708dba docs: clarify agentnoteignore visibility
  • 修正済み CodeRabbit thread 8 件を resolve
  • README.zh-CN / README.zh-TW の「英語に戻す」指摘 2 件は、localized README として意図的に各言語を維持する方針を英語で返信し、未 resolve のまま残しました

CodeRabbit 用 workflow のブランチに戻して、差分を確認してから PR 作成まで進めます。

🧑 Prompt
マージした。
coderabbit のスキルのブランチに移動して PR まで作成して

🤖 Response
CodeRabbit 用 workflow のブランチに戻して、差分を確認してから PR 作成まで進めます。ここは以前 push 済みの chore/coderabbit-review-workflow を使う想定で動きます。
作業ツリーは clean です。CodeRabbit workflow ブランチはローカルにあるので、そこへ切り替えて PR の有無と差分を確認します。
このブランチの PR はまだ存在しません。差分は各 Agent 用の CodeRabbit 修正 workflow 追加だけなので、PR 本文を作って作成します。
PR #64 を作成できました。最後に PR 状態と checks を軽く確認しておきます。
PR #64 を作成しました。

#64

状態:

  • Open PR
  • Draft: false
  • Base: main
  • Head: chore/coderabbit-review-workflow
  • Working tree clean

Check…

📝 Context
$coderabbit-review として、現在のブランチに紐づく PR の CodeRabbit 指摘を取得します。 PR #64 の review が進んでいるはずなので、未解決 thread を見て、直すものと残すものを切り分けます。

🧑 Prompt
$coderabbit-review

🤖 Response
$coderabbit-review として、現在のブランチに紐づく PR の CodeRabbit 指摘を取得します。PR #64 の review が進んでいるはずなので、未解決 thread を見て、直すものと残すものを切り分けます。
PR #64 を対象に確認します。まず unresolved review thread と summary comment を取って、CodeRabbit の実指摘だけに絞ります。
CodeRabbit は 8 件の未解決 thread を出しています。内容はすべて妥当で、4 つの command file に H1 追加、4 つの skill file の GraphQL query に $after pagination を追加すれば閉じられます。修正します。
指摘どおり H1 と pagination support を入れました。4 Agent 分が同一内容を保っているかと、markdown / GraphQL 例が崩れていないか確認します。
一点こちらで先回りして見直します。`-F after='<endCursor-or-nu…

Summary by CodeRabbit

  • New Features

    • Added an automated "CodeRabbit fix" workflow to detect CodeRabbit review feedback on a PR, apply minimal safe fixes, run targeted verification checks, and resolve only review threads that are fixed-and-verified.
    • Supports reporting of changes, verification results, and remaining unresolved threads.
  • Documentation

    • Added workflow/skill documentation describing triage, verification, resolution rules, and end-of-run reports.

Agentnote-Session: 019da962-23cc-7aa0-bbe3-a10f60fddada
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 8, 2026

Review Change Stack
No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: d622aeca-7e77-4032-9bc0-0d98c3522b24

📥 Commits

Reviewing files that changed from the base of the PR and between 418605a and 4919a0a.

📒 Files selected for processing (8)
  • .claude/commands/coderabbit-fix.md
  • .claude/skills/coderabbit-review/SKILL.md
  • .codex/commands/coderabbit-fix.md
  • .codex/skills/coderabbit-review/SKILL.md
  • .cursor/commands/coderabbit-fix.md
  • .cursor/skills/coderabbit-review/SKILL.md
  • .gemini/commands/coderabbit-fix.md
  • .gemini/skills/coderabbit-review/SKILL.md

📝 Walkthrough

Walkthrough

This PR introduces CodeRabbit review automation workflow specifications across four AI agent platforms: Claude, Codex, Cursor, and Gemini. Each platform receives a detailed skill definition and a brief command file that together enable fetching CodeRabbit review threads, triaging feedback, applying fixes, verifying changes, and resolving addressed threads with consistent behavior across all tools.

Changes

CodeRabbit Review-Fix Workflow

Layer / File(s) Summary
Skill Specification (Canonical Definition)
.claude/skills/coderabbit-review/SKILL.md
Defines complete CodeRabbit review workflow: PR identification, GraphQL fetching of unresolved review threads, triage categories, fix constraints (minimal changes, preserve Agent Note behavior), verification strategy (narrowest tests first, expand on output changes), and thread resolution via mutation with fallback to unresolved replies.
Command Wiring (All Platforms)
.claude/commands/coderabbit-fix.md, .codex/commands/coderabbit-fix.md, .cursor/commands/coderabbit-fix.md, .gemini/commands/coderabbit-fix.md
Command definitions for each platform accepting optional pr-number argument and orchestrating the review workflow, with final reporting of fixed threads, unresolved items, and verification results.
Parallel Platform Skills
.codex/skills/coderabbit-review/SKILL.md, .cursor/skills/coderabbit-review/SKILL.md, .gemini/skills/coderabbit-review/SKILL.md
Identical workflow specification replicated across Codex, Cursor, and Gemini platforms covering PR identification, thread fetching, triage, fix execution, verification, and resolution steps.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'chore: add coderabbit review workflow' accurately describes the main change: adding CodeRabbit review workflow documentation and commands across multiple AI tool configurations.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/coderabbit-review-workflow

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 8

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.claude/commands/coderabbit-fix.md:
- Line 6: Add a top-level H1 as the very first line of the markdown file to
satisfy markdownlint MD041; prepend a heading (for example "# CodeRabbit review"
or similar descriptive H1) before the existing text "Use the repo-local
CodeRabbit review skill." so the file begins with an H1 and the current plain
text becomes the following paragraph.

In @.claude/skills/coderabbit-review/SKILL.md:
- Line 23: The GraphQL query is missing the $after cursor variable and the after
argument on the reviewThreads call, which prevents cursor-based pagination;
update the query declaration to include $after:String (alongside $owner, $repo,
$number) and add after:$after to the reviewThreads(first:100, after:$after)
invocation (also apply the same change to the second occurrence referenced at
line 37) so the query supports paginated fetching using endCursor.

In @.codex/commands/coderabbit-fix.md:
- Line 6: Add a top-level H1 heading to the start of the markdown body to
satisfy MD041: insert a line like "# <Descriptive Title>" immediately before the
existing first line "Use the repo-local CodeRabbit review skill." so the file's
first non-empty line is an H1 heading and the rest of the content remains
unchanged.

In @.codex/skills/coderabbit-review/SKILL.md:
- Line 23: The GraphQL query string needs cursor pagination: add an optional
variable $after: String to the query variables, change the reviewThreads call
from reviewThreads(first:100) to reviewThreads(first:100, after: $after), and
update the example fetch command to include -F after=<endCursor> when paginating
so the endCursor is passed into the $after variable; locate the query definition
(the line containing query($owner:String!,$repo:String!,$number:Int!){...}) and
the reviewThreads(...) fragment to make these edits.

In @.cursor/commands/coderabbit-fix.md:
- Line 6: Add a top-level H1 heading as the very first line of the document so
Line 6’s body text is no longer the first content; edit the file containing the
text "Use the repo-local CodeRabbit review skill." and insert a markdown H1
(e.g., "# <title>") above that line to satisfy MD041.

In @.cursor/skills/coderabbit-review/SKILL.md:
- Line 23: The GraphQL query string is missing the optional $after variable and
doesn't pass it to reviewThreads, so add $after:String to the variables list for
the existing query and include after:$after in the reviewThreads(first:100) call
(the query that defines repository->pullRequest->reviewThreads), ensuring the
query accepts and uses $after for pagination as described in the instructions.

In @.gemini/commands/coderabbit-fix.md:
- Line 6: Add a top-level H1 heading before the existing body text "Use the
repo-local CodeRabbit review skill." so the file begins with a first-level
markdown heading (e.g., "# CodeRabbit review" or similar) to satisfy MD041;
ensure the H1 is the very first line above the current content.

In @.gemini/skills/coderabbit-review/SKILL.md:
- Line 23: The GraphQL query string needs to accept and use a pagination cursor:
add a new variable declaration for $after (String) and set reviewThreads(...,
after: $after) so the query can request subsequent pages; then update the gh api
invocation that calls this query to pass the cursor (e.g. add a -f/--field for
after using your runtime cursor variable like AFTER) so the repeated pagination
step on line 37 can supply endCursor back into the query. Ensure you modify the
query variable list and the reviewThreads call (the query string variable) and
the gh api call that sends variables to include the after parameter.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 4976d270-eafb-456d-9ddf-2f33bc713bd1

📥 Commits

Reviewing files that changed from the base of the PR and between 46bb2a4 and 418605a.

📒 Files selected for processing (8)
  • .claude/commands/coderabbit-fix.md
  • .claude/skills/coderabbit-review/SKILL.md
  • .codex/commands/coderabbit-fix.md
  • .codex/skills/coderabbit-review/SKILL.md
  • .cursor/commands/coderabbit-fix.md
  • .cursor/skills/coderabbit-review/SKILL.md
  • .gemini/commands/coderabbit-fix.md
  • .gemini/skills/coderabbit-review/SKILL.md

Comment thread .claude/commands/coderabbit-fix.md
Comment thread .claude/skills/coderabbit-review/SKILL.md Outdated
Comment thread .codex/commands/coderabbit-fix.md
Comment thread .codex/skills/coderabbit-review/SKILL.md Outdated
Comment thread .cursor/commands/coderabbit-fix.md
Comment thread .cursor/skills/coderabbit-review/SKILL.md Outdated
Comment thread .gemini/commands/coderabbit-fix.md
Comment thread .gemini/skills/coderabbit-review/SKILL.md Outdated
Agentnote-Session: 019da962-23cc-7aa0-bbe3-a10f60fddada
@wasabeef wasabeef merged commit 9685b17 into main May 9, 2026
11 checks passed
@wasabeef wasabeef deleted the chore/coderabbit-review-workflow branch May 9, 2026 03:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant