✨ Add resolve-coderabbit plugin#5
Conversation
|
Warning Rate limit exceeded
Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 20 minutes and 30 seconds. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (15)
📝 WalkthroughWalkthroughThis pull request adds a new Changes
Sequence Diagram(s)sequenceDiagram
actor User
participant Skill as resolve-coderabbit<br/>Skill
participant Scripts as Shell<br/>Scripts
participant Git as Git/Local<br/>Filesystem
participant GitHub as GitHub API<br/>(REST & GraphQL)
User->>Skill: Invoke skill (PR number optional)
Skill->>Scripts: Run self-check.sh
Scripts->>Git: Verify git repo, check git/gh/jq
Scripts->>GitHub: gh auth status
Scripts-->>Skill: ✓ dependencies OK
Skill->>Scripts: Run fetch-comments.sh (detect/use PR)
Scripts->>GitHub: GraphQL query: reviewThreads (unresolved, coderabbitai)
GitHub-->>Scripts: JSON array of comment threads
Scripts-->>Skill: [thread objects with id, comment body, path, line]
loop For each CodeRabbit comment (batched)
Skill->>User: Display comment + extract severity/claim/suggestion
Skill->>Git: Read referenced code context
User->>User: Choose FIX / REJECT / SKIP
alt FIX
Skill->>Git: Apply suggested fix to file(s)
Skill->>Scripts: Run unit test suite
Scripts->>Git: Execute tests
Git-->>Scripts: ✓/✗ test result
alt Tests Pass
Skill->>Git: Commit changes
Skill->>Skill: Queue reply metadata
else Tests Fail
Skill->>User: Prompt to revise or skip
end
else REJECT
Skill->>Scripts: Run resolve-comment.sh
Scripts->>GitHub: POST reply (rejection reason)
Scripts->>GitHub: GraphQL mutation: resolveReviewThread
GitHub-->>Scripts: ✓ resolved
else SKIP
Skill->>Skill: Leave thread open
end
end
Skill->>Scripts: Run full test suite on HEAD
Scripts->>Git: Execute unit + optional E2E/integration tests
Git-->>Scripts: test results
Skill->>User: Confirm before push?
User->>Skill: ✓ approved
Skill->>Git: Push commit(s)
loop Replay queued replies
Skill->>Scripts: Run resolve-comment.sh (per FIX thread)
Scripts->>GitHub: POST reply + resolveReviewThread
GitHub-->>Scripts: ✓ posted & resolved
end
Skill-->>User: Report success/failures + remaining open threads
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~22 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 6
🧹 Nitpick comments (2)
docs/plugin-catalog/git-plugin.md (1)
25-36: Add an explicit “Available Skills” section (even if empty).This page lists commands but not skills; the catalog template requires an available-skills section for each plugin page.
As per coding guidelines:
docs/plugin-catalog/*.mdpages should include “available skills.”🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@docs/plugin-catalog/git-plugin.md` around lines 25 - 36, Add an explicit "Available Skills" section to this plugin README: insert an "## Available Skills" heading (even if there are none) directly under the top-level metadata or just below the "Features" heading and include either an empty note like "None" or an empty bullet list; ensure the section follows the same format used in other docs/plugin-catalog/*.md pages so the catalog template recognizes the available-skills field.docs/plugin-catalog/docs-plugin.md (1)
218-292: Please add a “Configuration Details” section to this catalog page.The page is strong on commands/skills, but it’s still missing an explicit configuration details section required for plugin-catalog docs.
As per coding guidelines:
docs/plugin-catalog/*.mdpages should include “configuration details.”🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@docs/plugin-catalog/docs-plugin.md` around lines 218 - 292, Add a new "Configuration Details" section to the Documentation Loader (skill: `docs-loader`) page describing required configuration keys, default values, and example settings; specifically list config options for enabling the skill, doc search paths (`docs/`, `documentation/`, `.docs/`), index filenames (`index.md`, `README.md`), max documents to load (2-4), and any feature flags/environment variables used by the skill, include a short YAML/JSON example and a note linking to the SKILL.md reference; place this section after "When it Activates" and before "Example Usage" so it follows the page structure.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@docs/plugin-catalog/resolve-coderabbit-plugin.md`:
- Around line 36-48: The doc is missing explicit "Available commands" and
"Configuration" sections required by the catalog contract; update the Resolve
CodeRabbit Comments page (skill name/ID: resolve-coderabbit, heading "Resolve
CodeRabbit Comments") to add an "Available commands" subsection showing any
slash/CLI commands or, if none exist, a clear statement like "No slash
commands—invoked via model/skill only" plus usage examples (e.g., example
invocation: "resolve the CodeRabbit comments on PR `#42`"), and add a
"Configuration" subsection that lists required external tools/auth (git, gh, jq,
GitHub auth, clean working tree) or plugin-specific knobs (or explicitly state
"No plugin-specific configuration required"); also ensure the page includes the
mandated sections: overview, installation instructions, available commands with
examples, available skills, and configuration details.
- Around line 1-120: The catalog page filename doesn't match the plugin name;
rename the documentation file from resolve-coderabbit-plugin.md to
resolve-coderabbit.md and update the page title/heading to match the plugin id
"resolve-coderabbit" (ensure any internal references or links that pointed to
resolve-coderabbit-plugin.md are updated to the new filename and that the plugin
name appears consistently in the top-level heading).
- Around line 95-102: The fenced code block showing the example commit message
is missing a language tag which triggers markdownlint; update the fenced block
(the triple-backtick block containing "fix(scope): short imperative summary ...
Co-Authored-By: ...") to include a language specifier—e.g., change ``` to
```text—so the commit-message example is treated as plain text by the linter.
In
`@plugins/resolve-coderabbit/skills/resolve-coderabbit/scripts/fetch-comments.sh`:
- Around line 63-93: The query currently uses reviewThreads(first:100) so it
silently misses threads past the first page; modify the GraphQL query used by
fetch-comments.sh to request pageInfo { hasNextPage endCursor } alongside nodes,
then implement a loop around the query that supplies a cursor variable ($cursor)
and keeps fetching while pageInfo.hasNextPage is true, appending each page's
reviewThreads.nodes to a single collection before running the existing jq
projection that filters for .isResolved == false and
comments.nodes[0].author.login == "coderabbitai"; ensure the loop updates
$cursor with endCursor between requests and merges nodes so the final jq
operates on the full list.
In
`@plugins/resolve-coderabbit/skills/resolve-coderabbit/scripts/resolve-comment.sh`:
- Around line 6-18: The script resolve-comment.sh currently always auto-detects
the PR from the current branch and ignores an explicit PR argument in
$ARGUMENTS; update the script to parse and expose a resolved PR number (e.g.,
set PR_NUMBER from a positional argument or from existing detection logic) and
ensure every call to the related helper scripts/skills (notably
fetch-comments.sh and any subsequent commands that post or resolve comments)
includes that PR_NUMBER when $ARGUMENTS supplied one, falling back to the
existing auto-detected PR when none is provided; update calls that currently
omit the PR (inside resolve-comment.sh) to append the resolved PR parameter so
replies and resolveReviewThread actions operate against the intended PR.
In `@plugins/resolve-coderabbit/skills/resolve-coderabbit/SKILL.md`:
- Around line 67-70: The instruction in SKILL.md uses the wrong tool name
"TaskCreate"; update the documentation and any examples to use the correct tool
name "Task" when instructing how to launch specialized agents (replace all
occurrences of TaskCreate with Task in the "Seed a task list" section and any
related examples or command snippets), and verify the subject format (e.g. "🟠
C1: CHANGELOG.md:15") remains unchanged.
---
Nitpick comments:
In `@docs/plugin-catalog/docs-plugin.md`:
- Around line 218-292: Add a new "Configuration Details" section to the
Documentation Loader (skill: `docs-loader`) page describing required
configuration keys, default values, and example settings; specifically list
config options for enabling the skill, doc search paths (`docs/`,
`documentation/`, `.docs/`), index filenames (`index.md`, `README.md`), max
documents to load (2-4), and any feature flags/environment variables used by the
skill, include a short YAML/JSON example and a note linking to the SKILL.md
reference; place this section after "When it Activates" and before "Example
Usage" so it follows the page structure.
In `@docs/plugin-catalog/git-plugin.md`:
- Around line 25-36: Add an explicit "Available Skills" section to this plugin
README: insert an "## Available Skills" heading (even if there are none)
directly under the top-level metadata or just below the "Features" heading and
include either an empty note like "None" or an empty bullet list; ensure the
section follows the same format used in other docs/plugin-catalog/*.md pages so
the catalog template recognizes the available-skills field.
🪄 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: defaults
Review profile: CHILL
Plan: Pro
Run ID: 74547c69-3823-4489-8335-2c43398772aa
📒 Files selected for processing (15)
.claude-plugin/marketplace.jsonCLAUDE.mddocs/contribution/api-reference.mddocs/plugin-catalog/docs-plugin.mddocs/plugin-catalog/git-plugin.mddocs/plugin-catalog/index.mddocs/plugin-catalog/resolve-coderabbit-plugin.mdplugins/docs/.claude-plugin/plugin.jsonplugins/git/.claude-plugin/plugin.jsonplugins/resolve-coderabbit/.claude-plugin/plugin.jsonplugins/resolve-coderabbit/skills/resolve-coderabbit/SKILL.mdplugins/resolve-coderabbit/skills/resolve-coderabbit/docs/setup-dependencies.mdplugins/resolve-coderabbit/skills/resolve-coderabbit/scripts/fetch-comments.shplugins/resolve-coderabbit/skills/resolve-coderabbit/scripts/resolve-comment.shplugins/resolve-coderabbit/skills/resolve-coderabbit/scripts/self-check.sh
Per CodeRabbit PR review on #5: the catalog page listed only Skills under Features, skipping the Commands and Configuration subsections that sibling pages (docs-plugin.md, git-plugin.md) include. Added a Commands subsection stating the plugin is skill-only and how to invoke it, and a Configuration subsection noting no plugin-specific config plus a pointer to Requirements and self-check.sh. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Per CodeRabbit PR review on #5: the fenced code block showing the example commit message had no language specifier, tripping markdownlint MD040 (fenced-code-language). Marked it as `text`. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Per CodeRabbit PR review on #5: the GraphQL query used reviewThreads (first:100) with no cursor, silently dropping every thread beyond the first page on large PRs. Switched to `gh api graphql --paginate` with pageInfo { hasNextPage endCursor } and an $endCursor variable; gh now walks every page until hasNextPage is false. The per-page --jq filter emits an NDJSON stream of matching threads, and a final `jq -s '.'` slurps the multi-page stream back into a single JSON array so the output shape and consumers stay identical. Verified against PR #5 (currently 4 unresolved CodeRabbit threads, well under the page limit, still returned correctly). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Per CodeRabbit PR review on #5: resolve-comment.sh always auto-detected the PR from the current branch, ignoring any PR the skill was invoked with. If the user ran the skill as "resolve PR 42" from a different branch, fetch-comments.sh pulled PR 42 but resolve-comment.sh posted replies against whichever PR the checked-out branch happened to be on. Added an optional 4th argument <pr_number>; if given, used verbatim, else the previous `gh pr view --json number` auto-detect kicks in as a fallback. The error message now makes it clear that both paths failed. Updated SKILL.md to hold onto $PR from step 1 and pass it explicitly to every resolve-comment.sh invocation (REJECT path in 3d, batched replay in 5.4, and the standalone example in section 4). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Introduce the resolve-coderabbit plugin with its user-invocable skill that walks through unresolved CodeRabbit inline PR comments one by one, verifies each claim against the current code with user approval, commits fixes locally, and batches the final push + reply + thread-resolve so every reply references a pushed SHA. The skill is language-agnostic — it auto-detects the unit-test command from the project's own manifests rather than hard- coding yarn/npm. Bump marketplace metadata to 0.1.0 for the new plugin, unify the author email to flopspm@gmail.com across all plugin.json files and docs, and add the new plugin to CLAUDE.md, the plugin catalog index, and a dedicated catalog page. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Introduce a pre-flight step 0 that runs before the PR comment loop:
scripts/self-check.sh verifies git, gh, jq, a valid gh auth session, and
that the current directory is inside a git working tree, printing a
tagged ✅/❌ report. When it exits non-zero, the skill loads
docs/setup-dependencies.md and walks the user through per-tag install
instructions for macOS, Debian/Ubuntu, Fedora/RHEL, Arch, and Windows
before touching the PR.
The skill currently references the self-check and setup guide via
${CLAUDE_PLUGIN_ROOT}; that variable is known to be unreliable in
skill/command markdown (anthropics/claude-code#9354) and will need a
follow-up workaround.
Also drop the remaining Russian trigger phrase from the skill
description and catalog page so all user-facing text is English.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…SKILL_DIR
Move scripts/self-check.sh and docs/setup-dependencies.md from the plugin
root into the skill directory (skills/resolve-coderabbit/scripts and
skills/resolve-coderabbit/docs), and switch every reference from
${CLAUDE_PLUGIN_ROOT} to ${CLAUDE_SKILL_DIR}. ${CLAUDE_SKILL_DIR} is the
officially documented variable that resolves to the skill's own
directory and is reliably expanded by Claude Code's Bash tool from
within SKILL.md, unlike ${CLAUDE_PLUGIN_ROOT} which is known to be
unexpanded in skill/command markdown (anthropics/claude-code#9354) and
has regressed several times upstream.
Also document this convention in CLAUDE.md so future plugins in this
repo default to the skill-local layout for bundled scripts and
supporting files, with a link to the official skills docs at
https://code.claude.com/docs/en/skills and the tracking issue.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Add a bundled helper script that handles the REST reply + GraphQL
thread-resolve pair in one call, so the skill (and any manual user)
doesn't repeat the two-API dance for every comment. Usage:
bash "${CLAUDE_SKILL_DIR}/scripts/resolve-comment.sh" \
<comment_id> <thread_id> <reply_body>
The script auto-detects the repo and PR number, posts the reply via
REST, then marks the thread resolved via GraphQL with a proper
resolveReviewThread mutation (input as object, passed via a typed
GraphQL variable rather than string interpolation).
Failure semantics: if the reply fails, the thread stays open — we
refuse to resolve a thread without a posted explanation. If the resolve
fails after a successful reply, the script exits non-zero and reports
which thread still needs manual resolution; the reply itself stays.
SKILL.md now calls the helper from the REJECT path (step 3d) and the
batched final step (step 5.4), instead of describing the raw REST +
GraphQL sequence. The raw sequence is kept in step 4 as a debugging
reference with the two classic traps called out (object-shaped
GraphQL input, apostrophe-in-HEREDOC quoting).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Replace the REST + GraphQL dual-query dance in step 1 with a single
GraphQL-only helper. GitHub's GraphQL reviewThreads query already
carries the comment body on each thread's first comment, so the
separate REST /pulls/<pr>/comments round-trip was dead weight.
Usage:
bash "${CLAUDE_SKILL_DIR}/scripts/fetch-comments.sh" [<pr_number>]
Output is a JSON array of unresolved CodeRabbit threads, each shaped
{thread_id, comment_id, path, line, body}, printed straight to stdout
— no /tmp/*.json detour. The skill reads it directly into context and
iterates. Empty array on stdout means nothing to do (no bot review, or
everything already resolved), exit code 0.
The query uses typed GraphQL variables ($owner:String!, $repo:String!,
$pr:Int!) instead of string interpolation, so the call is quote-safe.
Verified against the live PR #10 we originally used to design this
skill — GraphQL returns all 12 CodeRabbit threads, all resolved, so
the filter produces [] as expected.
SKILL.md step 1 and the catalog page are updated to call the helper.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Two improvements to the comment loop: 1) Step 3c (present decision): switch from a plain-text y/n/s block to native AskUserQuestion. Each comment becomes one single-select question with FIX / REJECT / SKIP options and a side-by-side preview pane showing the real surrounding code plus the bot's proposed diff on the FIX option. Batches of up to 4 questions per call (tool cap), so a 15-comment PR turns into 4 back-to-back dialogs instead of 15 text prompts. The plain-text block is kept as a fallback for headless / non-interactive sessions. 2) Step 5 (final gates): add a full-unit-suite run on HEAD before E2E. Per-commit runs skip docs-only fixes by design, so the combined batch on HEAD wasn't actually unit-validated before. Cheap to run, symmetric with the E2E gate, and catches interaction regressions between fixes. The "don't push if a gate fails" rule now covers both unit and E2E failures. Catalog page updated to reflect both changes. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Per CodeRabbit PR review on #5: the catalog page listed only Skills under Features, skipping the Commands and Configuration subsections that sibling pages (docs-plugin.md, git-plugin.md) include. Added a Commands subsection stating the plugin is skill-only and how to invoke it, and a Configuration subsection noting no plugin-specific config plus a pointer to Requirements and self-check.sh. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Per CodeRabbit PR review on #5: the fenced code block showing the example commit message had no language specifier, tripping markdownlint MD040 (fenced-code-language). Marked it as `text`. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Per CodeRabbit PR review on #5: the GraphQL query used reviewThreads (first:100) with no cursor, silently dropping every thread beyond the first page on large PRs. Switched to `gh api graphql --paginate` with pageInfo { hasNextPage endCursor } and an $endCursor variable; gh now walks every page until hasNextPage is false. The per-page --jq filter emits an NDJSON stream of matching threads, and a final `jq -s '.'` slurps the multi-page stream back into a single JSON array so the output shape and consumers stay identical. Verified against PR #5 (currently 4 unresolved CodeRabbit threads, well under the page limit, still returned correctly). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Per CodeRabbit PR review on #5: resolve-comment.sh always auto-detected the PR from the current branch, ignoring any PR the skill was invoked with. If the user ran the skill as "resolve PR 42" from a different branch, fetch-comments.sh pulled PR 42 but resolve-comment.sh posted replies against whichever PR the checked-out branch happened to be on. Added an optional 4th argument <pr_number>; if given, used verbatim, else the previous `gh pr view --json number` auto-detect kicks in as a fallback. The error message now makes it clear that both paths failed. Updated SKILL.md to hold onto $PR from step 1 and pass it explicitly to every resolve-comment.sh invocation (REJECT path in 3d, batched replay in 5.4, and the standalone example in section 4). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Summary
resolve-coderabbitplugin to the flugins marketplace — a language-agnostic skill that walks through unresolved CodeRabbit inline PR comments one by one, verifies each claim against the current code, and batches the final push + reply + thread-resolve so every reply references a pushed SHA.${CLAUDE_SKILL_DIR}, not${CLAUDE_PLUGIN_ROOT}— see anthropics/claude-code#9354):self-check.sh— step 0 dependency preflight (git,gh,jq,gh auth, git-worktree), withdocs/setup-dependencies.mdas the per-OS install guide.fetch-comments.sh— step 1, one GraphQLreviewThreadsquery with typed variables, returns a JSON array of unresolved CodeRabbit threads straight to stdout.resolve-comment.sh— step 4, one call to REST reply + GraphQLresolveReviewThread, with fail-safe semantics (no resolve without a posted reply).AskUserQuestionfor per-comment FIX/REJECT/SKIP triage with a code + diff preview pane, batching by 4 (tool cap). Plain-texty/n/skept as headless fallback.${CLAUDE_SKILL_DIR}convention inCLAUDE.mdfor future plugins, unifies the author email toflopspm@gmail.comacross all plugin.json files and docs, and bumps the marketplace to 0.1.0.Test plan
claude --plugin-dir ./plugins/resolve-coderabbitloads the plugin without errors/plugin marketplace add .then/plugin install resolve-coderabbit@fluginsbash plugins/resolve-coderabbit/skills/resolve-coderabbit/scripts/self-check.shexits 0 on a machine with deps, non-zero on a machine missing any of themfetch-comments.sh <pr>against a live PR with CodeRabbit comments returns a well-formed JSON arrayfetch-comments.shagainst a PR with only resolved CodeRabbit threads returns[](verified locally against ksef-client-ts PR #10)mkdocs buildproduces the newresolve-coderabbit-plugin.mdcatalog page and working nav linksGenerated with Claude Code (https://claude.com/claude-code)
Summary by CodeRabbit
New Features
Documentation