Skip to content

✨ Add resolve-coderabbit plugin#5

Merged
Fl0p merged 10 commits into
mainfrom
new_plugin
Apr 19, 2026
Merged

✨ Add resolve-coderabbit plugin#5
Fl0p merged 10 commits into
mainfrom
new_plugin

Conversation

@Fl0p

@Fl0p Fl0p commented Apr 19, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Adds a new resolve-coderabbit plugin 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.
  • Ships three bundled scripts inside the skill directory (resolved via ${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), with docs/setup-dependencies.md as the per-OS install guide.
    • fetch-comments.sh — step 1, one GraphQL reviewThreads query with typed variables, returns a JSON array of unresolved CodeRabbit threads straight to stdout.
    • resolve-comment.sh — step 4, one call to REST reply + GraphQL resolveReviewThread, with fail-safe semantics (no resolve without a posted reply).
  • Uses native AskUserQuestion for per-comment FIX/REJECT/SKIP triage with a code + diff preview pane, batching by 4 (tool cap). Plain-text y/n/s kept as headless fallback.
  • Step 5 final gates cover both a full unit run on HEAD (covers combined-batch regressions that per-commit runs skipped for docs-only fixes) and E2E / integration when the batch touches integration boundaries.
  • Also documents the ${CLAUDE_SKILL_DIR} convention in CLAUDE.md for future plugins, unifies the author email to flopspm@gmail.com across all plugin.json files and docs, and bumps the marketplace to 0.1.0.

Test plan

  • claude --plugin-dir ./plugins/resolve-coderabbit loads the plugin without errors
  • Install via local marketplace: /plugin marketplace add . then /plugin install resolve-coderabbit@flugins
  • Plain invocation: bash plugins/resolve-coderabbit/skills/resolve-coderabbit/scripts/self-check.sh exits 0 on a machine with deps, non-zero on a machine missing any of them
  • fetch-comments.sh <pr> against a live PR with CodeRabbit comments returns a well-formed JSON array
  • fetch-comments.sh against a PR with only resolved CodeRabbit threads returns [] (verified locally against ksef-client-ts PR #10)
  • Trigger the skill on a live PR with unresolved CodeRabbit comments — verify AskUserQuestion dialogs appear with preview panes, per-comment commits land locally, and final batched replies post against pushed SHAs
  • mkdocs build produces the new resolve-coderabbit-plugin.md catalog page and working nav links

Generated with Claude Code (https://claude.com/claude-code)

Summary by CodeRabbit

  • New Features

    • Introduced the Resolve CodeRabbit plugin for processing inline CodeRabbit PR review comments with guided verification, fix, or skip workflows, featuring batched commit and reply control.
  • Documentation

    • Added comprehensive plugin documentation covering installation, prerequisites, setup, and end-to-end workflow guidance for resolving CodeRabbit review threads.

@coderabbitai

coderabbitai Bot commented Apr 19, 2026

Copy link
Copy Markdown

Warning

Rate limit exceeded

@Fl0p has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 20 minutes and 30 seconds before requesting another review.

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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: f9a5e519-65d3-40df-aeeb-f9f3ae5ea3c9

📥 Commits

Reviewing files that changed from the base of the PR and between 9d5764a and fa5bece.

📒 Files selected for processing (15)
  • .claude-plugin/marketplace.json
  • CLAUDE.md
  • docs/contribution/api-reference.md
  • docs/plugin-catalog/docs-plugin.md
  • docs/plugin-catalog/git-plugin.md
  • docs/plugin-catalog/index.md
  • docs/plugin-catalog/resolve-coderabbit-plugin.md
  • plugins/docs/.claude-plugin/plugin.json
  • plugins/git/.claude-plugin/plugin.json
  • plugins/resolve-coderabbit/.claude-plugin/plugin.json
  • plugins/resolve-coderabbit/skills/resolve-coderabbit/SKILL.md
  • plugins/resolve-coderabbit/skills/resolve-coderabbit/docs/setup-dependencies.md
  • plugins/resolve-coderabbit/skills/resolve-coderabbit/scripts/fetch-comments.sh
  • plugins/resolve-coderabbit/skills/resolve-coderabbit/scripts/resolve-comment.sh
  • plugins/resolve-coderabbit/skills/resolve-coderabbit/scripts/self-check.sh
📝 Walkthrough

Walkthrough

This pull request adds a new resolve-coderabbit Claude Code plugin for managing CodeRabbit PR review comments, updates author contact information across multiple files, bumps marketplace metadata to version 0.1.0, and extends documentation with skill directory guidance and plugin catalog entries.

Changes

Cohort / File(s) Summary
Author Email Updates
docs/contribution/api-reference.md, docs/plugin-catalog/docs-plugin.md, docs/plugin-catalog/git-plugin.md, plugins/docs/.claude-plugin/plugin.json, plugins/git/.claude-plugin/plugin.json
Updated author email from flop@hackerspace.by to flopspm@gmail.com consistently across documentation and plugin metadata files.
Marketplace & Metadata
.claude-plugin/marketplace.json
Bumped marketplace version from 0.0.1 to 0.1.0, updated author emails for existing plugins, and registered new resolve-coderabbit plugin with metadata.
Documentation & Plugin Catalog
CLAUDE.md, docs/plugin-catalog/index.md, docs/plugin-catalog/resolve-coderabbit-plugin.md
Added skill directory documentation guidance in CLAUDE.md; added resolve-coderabbit entry to plugin index; created comprehensive plugin documentation describing workflow, prerequisites, and batched resolution behavior.
New resolve-coderabbit Plugin
plugins/resolve-coderabbit/.claude-plugin/plugin.json, plugins/resolve-coderabbit/skills/resolve-coderabbit/SKILL.md, plugins/resolve-coderabbit/skills/resolve-coderabbit/docs/setup-dependencies.md, plugins/resolve-coderabbit/skills/resolve-coderabbit/scripts/self-check.sh, plugins/resolve-coderabbit/skills/resolve-coderabbit/scripts/fetch-comments.sh, plugins/resolve-coderabbit/skills/resolve-coderabbit/scripts/resolve-comment.sh
Introduced complete plugin implementation with manifest, detailed skill specification, dependency setup guide, and three orchestration scripts for dependency validation, fetching unresolved CodeRabbit review threads via GraphQL, and batched comment/thread resolution via GitHub API.

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
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

Poem

🐰 A new plugin hops into the warren,
Resolving CodeRabbit comments with GitHub API charm,
Self-checks and scripts dance in harmony,
Batching wisdom and wary commits with care—
Flop's email now flies true, faster mail for the crew!

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Add resolve-coderabbit plugin' accurately summarizes the main change: introducing a new plugin for handling CodeRabbit PR comments, which is the central purpose of this PR.

✏️ 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 new_plugin

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.

❤️ Share

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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/*.md pages 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/*.md pages 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

📥 Commits

Reviewing files that changed from the base of the PR and between bf35619 and 9d5764a.

📒 Files selected for processing (15)
  • .claude-plugin/marketplace.json
  • CLAUDE.md
  • docs/contribution/api-reference.md
  • docs/plugin-catalog/docs-plugin.md
  • docs/plugin-catalog/git-plugin.md
  • docs/plugin-catalog/index.md
  • docs/plugin-catalog/resolve-coderabbit-plugin.md
  • plugins/docs/.claude-plugin/plugin.json
  • plugins/git/.claude-plugin/plugin.json
  • plugins/resolve-coderabbit/.claude-plugin/plugin.json
  • plugins/resolve-coderabbit/skills/resolve-coderabbit/SKILL.md
  • plugins/resolve-coderabbit/skills/resolve-coderabbit/docs/setup-dependencies.md
  • plugins/resolve-coderabbit/skills/resolve-coderabbit/scripts/fetch-comments.sh
  • plugins/resolve-coderabbit/skills/resolve-coderabbit/scripts/resolve-comment.sh
  • plugins/resolve-coderabbit/skills/resolve-coderabbit/scripts/self-check.sh

Comment thread docs/plugin-catalog/resolve-coderabbit-plugin.md
Comment thread docs/plugin-catalog/resolve-coderabbit-plugin.md
Comment thread docs/plugin-catalog/resolve-coderabbit-plugin.md Outdated
Comment thread plugins/resolve-coderabbit/skills/resolve-coderabbit/scripts/fetch-comments.sh Outdated
Comment thread plugins/resolve-coderabbit/skills/resolve-coderabbit/SKILL.md
Fl0p added a commit that referenced this pull request Apr 19, 2026
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>
Fl0p added a commit that referenced this pull request Apr 19, 2026
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>
Fl0p added a commit that referenced this pull request Apr 19, 2026
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>
Fl0p added a commit that referenced this pull request Apr 19, 2026
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>
Fl0p and others added 10 commits April 19, 2026 13:36
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>
@Fl0p Fl0p merged commit 00b4b16 into main Apr 19, 2026
18 checks passed
@Fl0p Fl0p deleted the new_plugin branch April 19, 2026 11:47
@coderabbitai coderabbitai Bot mentioned this pull request Jul 9, 2026
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