gemini-review-integrator
Original:🇺🇸 English
Translated
This skill should be used when the user asks to "integrate Gemini review", "merge Gemini suggestions", "add Gemini comments to PR review", "sync Gemini code assist", "combine Gemini feedback", or mentions integrating gemini-code-assist suggestions into the PR review comment. Fetches Gemini Code Assist review comments and integrates non-duplicate, non-outdated suggestions into the pr-review-and-document PR comment.
2installs
Added on
NPX Install
npx skill4agent add marxbiotech/pr-review-toolkit gemini-review-integratorTags
Translated version includes tags in frontmatterSKILL.md Content
View Translation Comparison →Gemini Review Integrator
Integrate Gemini Code Assist review suggestions into the pr-review-and-document PR comment.
When to Use
Invoke this skill when:
- A PR has both Gemini Code Assist reviews and a pr-review-and-document comment
- Need to consolidate all review feedback into a single location
- Want to track Gemini suggestions alongside Claude's PR review
Workflow
Step 1: Get PR Number and Verify Prerequisites (Cache-Aware)
bash
PR_NUMBER=$("${CLAUDE_PLUGIN_ROOT}/scripts/get-pr-number.sh")This uses the branch-to-PR-number cache () with 1-hour TTL, falling back to GitHub API on cache miss.
branch-map.jsonIf no PR exists, inform the user and stop.
Verify pr-review-and-document comment exists:
bash
${CLAUDE_PLUGIN_ROOT}/scripts/find-review-comment.sh "$PR_NUMBER"If no review comment exists, inform the user to run skill first.
pr-review-and-documentStep 2: Fetch Gemini Code Assist Comments
Fetch all PR review comments (inline code comments):
bash
${CLAUDE_PLUGIN_ROOT}/scripts/fetch-gemini-comments.sh "$PR_NUMBER"The script returns JSON with Gemini suggestions, including:
- : Comment ID for deduplication
id - : high, medium, or low
priority - : Whether it's a security issue
is_security - : Whether the comment is outdated (code changed)
is_outdated - : File path
file - : Line number (null if file-level)
line - : Full comment body
body - : Extracted code suggestion (if any)
suggestion
Step 3: Filter and Deduplicate
Apply filters to Gemini suggestions:
- Exclude outdated comments: Skip comments where
is_outdated: true - Check existing integration: Parse pr-review-and-document comment metadata for
gemini_integrated_ids - Skip already integrated: Exclude comments whose IDs are in
gemini_integrated_ids
Step 4: Categorize Suggestions
Map Gemini priorities to pr-review-and-document categories:
| Gemini Priority | PR Review Category |
|---|---|
| 🔴 Critical Issues |
| 🟡 Important Issues |
| 🟡 Important Issues |
| 💡 Suggestions |
| 💡 Suggestions |
Step 5: Format Integrated Suggestions
For each new Gemini suggestion, format as:
markdown
<details>
<summary><b>N. ⚠️ [Gemini] Issue Title</b></summary>
**Source:** Gemini Code Assist
**File:** `path/to/file.ts:line`
**Problem:** Description from Gemini comment.
**Suggested Fix:**
```suggestion
code hereKey formatting rules:
- Prefix title with to identify source
[Gemini] - Use status indicator (pending review)
⚠️ - Include line
**Source:** Gemini Code Assist - Preserve Gemini's suggestion code block if present
Step 6: Update PR Review Comment
- Fetch existing pr-review-and-document comment body
- Parse metadata JSON from block
<!-- pr-review-metadata ... --> - Update metadata:
- Add array with newly integrated comment IDs
gemini_integrated_ids - Increment issue counts in object
issues - Update timestamp
updated_at
- Add
- Insert new Gemini issues into appropriate sections (Critical, Important, Suggestions)
- Renumber existing issues to accommodate new entries
Pipe updated content to via :
cache-write-comment.sh--stdinbash
echo "$UPDATED_CONTENT" | ${CLAUDE_PLUGIN_ROOT}/scripts/cache-write-comment.sh --stdin "$PR_NUMBER"This updates local cache and syncs to GitHub in one step, without temp files.
Step 7: Report Integration Results
Summarize what was integrated:
Gemini Review Integration Complete:
- Found: X Gemini comments
- Outdated (skipped): Y
- Already integrated (skipped): Z
- Newly integrated: W
- Critical: A
- Important: B
- Suggestions: CMetadata Schema Extension
The pr-review-and-document metadata is extended with:
json
{
"gemini_integrated_ids": [2726014213, 2726014217, ...],
"gemini_integration_date": "2026-01-26T12:00:00Z"
}This enables:
- Tracking which Gemini comments have been integrated
- Preventing duplicate integration across multiple runs
- Audit trail for integrated suggestions
Gemini Comment Structure
Gemini Code Assist comments have these characteristics:
Priority Indicators (in body):
- - High priority
 - - Medium priority
 - or
- Security-related
Outdated Detection:
- GitHub API field indicates the code has changed
position: null - These comments should be skipped as they may no longer apply
Code Suggestions:
- Enclosed in ````suggestion` blocks
- Should be preserved in integration
Handling Multiple Gemini Review Rounds
Gemini may perform multiple review rounds on a PR. The integration handles this by:
- ID-based deduplication: Each comment has a unique ID
- Cumulative tracking: grows with each integration
gemini_integrated_ids - New comments only: Only comments not in are processed
gemini_integrated_ids
To re-integrate after Gemini runs another review:
- Run this skill again
- Only new comments will be added
- Previously integrated comments remain unchanged
Status Indicators for Gemini Issues
| Indicator | Meaning |
|---|---|
| ⚠️ | Pending review (newly integrated from Gemini) |
| ✅ | Fixed / Resolved |
| ⏭️ | Deferred / Not applicable |
| 🔴 | Escalated to blocking |
Initial status for all Gemini integrations is (pending review).
⚠️Example Integration
Before (pr-review-and-document comment):
markdown
### 🟡 Important Issues
<details>
<summary><b>1. ✅ Some Claude-found issue</b></summary>
...
</details>After integration:
markdown
### 🟡 Important Issues
<details>
<summary><b>1. ✅ Some Claude-found issue</b></summary>
...
</details>
<details>
<summary><b>2. ⚠️ [Gemini] Suppress stderr hides errors</b></summary>
**Source:** Gemini Code Assist
**File:** `.claude/skills/pr-review-and-document/scripts/find-review-comment.sh:19`
**Problem:** Suppressing stderr with `2>/dev/null` can hide important underlying errors.
**Suggested Fix:**
```suggestion
PR_NUMBER=$(gh pr view --json number -q '.number' || echo "")Validation Checklist
Before completing integration:
- PR number correctly identified
- pr-review-and-document comment exists
- Gemini comments fetched successfully
- Outdated comments filtered out
- Previously integrated comments skipped
- New comments categorized correctly
- Metadata updated with integrated IDs
- Issue counts updated accurately
- Comment posted successfully
Error Handling
| Error | Action |
|---|---|
| No PR found | Inform user, stop |
| No review comment | Suggest running pr-review-and-document first |
| No Gemini comments | Inform user, nothing to integrate |
| API failure | Report error with details |
| All comments outdated | Inform user, nothing to integrate |
| All comments already integrated | Inform user, up to date |