@olegkoval/agent-skills 1.25.0 → 1.26.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (66) hide show
  1. package/.claude-plugin/plugin.json +8 -2
  2. package/.cursor-plugin/index.json +30 -0
  3. package/.grok-plugin/index.json +30 -0
  4. package/.kiro/steering/codexloop.md +254 -0
  5. package/.kiro/steering/geminiloop.md +230 -0
  6. package/.kiro/steering/pr-finalize-complete.md +187 -0
  7. package/.windsurf/rules/codexloop.md +253 -0
  8. package/.windsurf/rules/geminiloop.md +229 -0
  9. package/.windsurf/rules/pr-finalize-complete.md +186 -0
  10. package/README.md +9 -3
  11. package/catalog/skills.json +146 -0
  12. package/package.json +1 -1
  13. package/packages/software-development/codexloop/SKILL.md +261 -0
  14. package/packages/software-development/codexloop/adapters/claude/plugin.json +5 -0
  15. package/packages/software-development/codexloop/adapters/claude/skills/codexloop/SKILL.md +262 -0
  16. package/packages/software-development/codexloop/adapters/codex/README.md +26 -0
  17. package/packages/software-development/codexloop/adapters/cursor/plugin.json +6 -0
  18. package/packages/software-development/codexloop/adapters/cursor/skills/codexloop/SKILL.md +263 -0
  19. package/packages/software-development/codexloop/adapters/grok/plugin.json +6 -0
  20. package/packages/software-development/codexloop/adapters/grok/skills/codexloop/SKILL.md +262 -0
  21. package/packages/software-development/codexloop/adapters/kiro/steering/codexloop.md +254 -0
  22. package/packages/software-development/codexloop/adapters/windsurf/rules/codexloop.md +253 -0
  23. package/packages/software-development/dependabot-triage/SKILL.md +150 -0
  24. package/packages/software-development/dependabot-triage/adapters/claude/plugin.json +5 -0
  25. package/packages/software-development/dependabot-triage/adapters/claude/skills/dependabot-triage/SKILL.md +151 -0
  26. package/packages/software-development/dependabot-triage/adapters/codex/README.md +19 -0
  27. package/packages/software-development/dependabot-triage/adapters/cursor/plugin.json +6 -0
  28. package/packages/software-development/dependabot-triage/adapters/cursor/skills/dependabot-triage/SKILL.md +151 -0
  29. package/packages/software-development/dependabot-triage/adapters/grok/plugin.json +6 -0
  30. package/packages/software-development/dependabot-triage/adapters/grok/skills/dependabot-triage/SKILL.md +151 -0
  31. package/packages/software-development/geminiloop/SKILL.md +237 -0
  32. package/packages/software-development/geminiloop/adapters/claude/plugin.json +5 -0
  33. package/packages/software-development/geminiloop/adapters/claude/skills/geminiloop/SKILL.md +238 -0
  34. package/packages/software-development/geminiloop/adapters/codex/README.md +25 -0
  35. package/packages/software-development/geminiloop/adapters/cursor/plugin.json +6 -0
  36. package/packages/software-development/geminiloop/adapters/cursor/skills/geminiloop/SKILL.md +239 -0
  37. package/packages/software-development/geminiloop/adapters/grok/plugin.json +6 -0
  38. package/packages/software-development/geminiloop/adapters/grok/skills/geminiloop/SKILL.md +238 -0
  39. package/packages/software-development/geminiloop/adapters/kiro/steering/geminiloop.md +230 -0
  40. package/packages/software-development/geminiloop/adapters/windsurf/rules/geminiloop.md +229 -0
  41. package/packages/software-development/pr-finalize-complete/SKILL.md +195 -0
  42. package/packages/software-development/pr-finalize-complete/adapters/claude/plugin.json +5 -0
  43. package/packages/software-development/pr-finalize-complete/adapters/claude/skills/pr-finalize-complete/SKILL.md +196 -0
  44. package/packages/software-development/pr-finalize-complete/adapters/codex/README.md +24 -0
  45. package/packages/software-development/pr-finalize-complete/adapters/cursor/plugin.json +6 -0
  46. package/packages/software-development/pr-finalize-complete/adapters/cursor/skills/pr-finalize-complete/SKILL.md +197 -0
  47. package/packages/software-development/pr-finalize-complete/adapters/grok/plugin.json +6 -0
  48. package/packages/software-development/pr-finalize-complete/adapters/grok/skills/pr-finalize-complete/SKILL.md +196 -0
  49. package/packages/software-development/pr-finalize-complete/adapters/kiro/steering/pr-finalize-complete.md +187 -0
  50. package/packages/software-development/pr-finalize-complete/adapters/windsurf/rules/pr-finalize-complete.md +186 -0
  51. package/packages/software-development/pr-to-green/SKILL.md +165 -0
  52. package/packages/software-development/pr-to-green/adapters/claude/plugin.json +5 -0
  53. package/packages/software-development/pr-to-green/adapters/claude/skills/pr-to-green/SKILL.md +166 -0
  54. package/packages/software-development/pr-to-green/adapters/codex/README.md +19 -0
  55. package/packages/software-development/pr-to-green/adapters/cursor/plugin.json +6 -0
  56. package/packages/software-development/pr-to-green/adapters/cursor/skills/pr-to-green/SKILL.md +166 -0
  57. package/packages/software-development/pr-to-green/adapters/grok/plugin.json +6 -0
  58. package/packages/software-development/pr-to-green/adapters/grok/skills/pr-to-green/SKILL.md +166 -0
  59. package/packages/software-development/store-listing-copy/SKILL.md +215 -0
  60. package/packages/software-development/store-listing-copy/adapters/claude/plugin.json +5 -0
  61. package/packages/software-development/store-listing-copy/adapters/claude/skills/store-listing-copy/SKILL.md +216 -0
  62. package/packages/software-development/store-listing-copy/adapters/codex/README.md +20 -0
  63. package/packages/software-development/store-listing-copy/adapters/cursor/plugin.json +6 -0
  64. package/packages/software-development/store-listing-copy/adapters/cursor/skills/store-listing-copy/SKILL.md +216 -0
  65. package/packages/software-development/store-listing-copy/adapters/grok/plugin.json +6 -0
  66. package/packages/software-development/store-listing-copy/adapters/grok/skills/store-listing-copy/SKILL.md +216 -0
@@ -0,0 +1,238 @@
1
+ ---
2
+ name: geminiloop
3
+ description: >
4
+ Iteratively satisfy Gemini Code Assist's review on a GitHub PR, but treat every Gemini comment
5
+ SKEPTICALLY (Gemini Code Assist is materially more error-prone than Greptile): verify each finding
6
+ against the real code first, fix ONLY the genuinely-correct ones, and rebut + resolve false
7
+ positives WITHOUT changing correct code. Repeat until no unresolved Gemini comments remain. Use
8
+ when the user wants to clear a PR's Gemini Code Assist review.
9
+ compatibility: GitHub only (Gemini Code Assist is a GitHub app). Requires git + gh (GitHub CLI) authenticated, and the Gemini Code Assist app installed on the repo.
10
+ metadata:
11
+ version: "1.0"
12
+ allowed-tools: Bash(gh:*) Bash(git:*)
13
+ ---
14
+ <!-- Generated by scripts/build-adapters.sh. Do not edit directly. -->
15
+
16
+ # Geminiloop
17
+
18
+ Drive a GitHub PR until Gemini Code Assist has no unresolved comments — **but do not cargo-cult
19
+ its suggestions.** Gemini is often confidently wrong. Every comment is a *claim to verify*, not an
20
+ instruction to obey. A wrong suggestion applied is worse than the comment itself.
21
+
22
+ ## How Gemini differs from other review bots
23
+
24
+ - **No check-run, no score.** Gemini does not publish a `X/5` confidence or a `greptile` check. It
25
+ posts a **PR review** (state `COMMENTED`) authored by `gemini-code-assist[bot]` with a
26
+ `## Code Review` summary body plus inline review comments. Detection is by polling the *reviews*
27
+ endpoint, not a check-run. "Satisfied" = zero unresolved comments (each either fixed or rebutted),
28
+ since there is no numeric target.
29
+ - **Auto-reviews on push/open.** It reviews automatically when a PR opens or gets new commits;
30
+ `/gemini review` forces a fresh pass.
31
+ - **Severity, not confidence.** Inline comments carry a priority badge (a `![critical]` /
32
+ `![high]` / `![medium]` / `![low]` shields image) at the top of the body. Weight `critical`/`high`
33
+ seriously; treat `medium`/`low` as usually-skippable nits unless clearly correct.
34
+ - **Higher false-positive rate.** This is the whole point of the skill: bias toward *rebut* over
35
+ *change*.
36
+
37
+ ## Not for
38
+
39
+ - GitLab / Perforce (Gemini Code Assist is GitHub-only). For other review bots this catalog ships
40
+ `codexloop`, `coderabbitloop`, and `qodoloop`; for CI failures rather than review comments, use
41
+ `ci-fix-loop`.
42
+
43
+ ## 1. Identify the PR
44
+
45
+ ```bash
46
+ gh pr view --json number,headRefName,headRefOid -q '{number,branch:.headRefName,head:.headRefOid}'
47
+ ```
48
+
49
+ Switch to the PR branch if not already on it. Capture `OWNER`/`REPO` (`gh repo view --json owner,name`).
50
+
51
+ ## 2. The loop (max 5 iterations)
52
+
53
+ Keep an explicit iteration counter and stop at 5 — the cap is a real bound to enforce, not a
54
+ figure of speech. Each pass through A–G is one iteration; on hitting the cap, go straight to the
55
+ report and list what is still unresolved rather than starting a sixth.
56
+
57
+ ### A. Ensure a fresh Gemini review on the current head
58
+
59
+ Gemini auto-reviews new commits, but force a deterministic pass and record the head SHA:
60
+
61
+ ```bash
62
+ HEAD_SHA=$(gh pr view <PR> --json headRefOid -q .headRefOid)
63
+ # Only trigger if no gemini review already exists for this exact SHA:
64
+ HAVE=$(gh api repos/{owner}/{repo}/pulls/<PR>/reviews --paginate \
65
+ --jq "[.[] | select(.user.login==\"gemini-code-assist[bot]\" and .commit_id==\"$HEAD_SHA\")] | length")
66
+ if [ "$HAVE" = "0" ]; then gh pr comment <PR> --body "/gemini review"; fi
67
+ ```
68
+
69
+ Poll for the review of THIS head to land. No check-run exists, so poll the reviews endpoint — and
70
+ poll it on a **deadline**, never `while true`: a review that never arrives must end the skill with
71
+ an honest timeout, not hang it.
72
+
73
+ ```bash
74
+ # 10-minute deadline, one retry, then give up.
75
+ wait_for_review() { # $1 = attempt label
76
+ local deadline=$(( SECONDS + 600 ))
77
+ while [ "$SECONDS" -lt "$deadline" ]; do
78
+ R=$(gh api repos/{owner}/{repo}/pulls/<PR>/reviews --paginate \
79
+ --jq "[.[] | select(.user.login==\"gemini-code-assist[bot]\" and .commit_id==\"$HEAD_SHA\")] | last")
80
+ if [ -n "$R" ] && [ "$R" != "null" ]; then return 0; fi
81
+ echo "waiting for Gemini review of $HEAD_SHA ($1)..."; sleep 15
82
+ done
83
+ return 1
84
+ }
85
+
86
+ if ! wait_for_review "first wait"; then
87
+ echo "no Gemini review after 10m — retrying once" # say the retry out loud
88
+ gh pr comment <PR> --body "/gemini review"
89
+ if ! wait_for_review "after retry"; then
90
+ echo "Gemini did not review $HEAD_SHA after a retry; stopping and reporting."
91
+ exit 1 # honest timeout, never a success claim
92
+ fi
93
+ fi
94
+ ```
95
+
96
+ Report the retry in the final summary; two silent timeouts are the failure mode this guard exists
97
+ to prevent.
98
+
99
+ ### B. Fetch the findings
100
+
101
+ - **Summary** (the `## Code Review` body): the review `.body` from the object above — read the
102
+ overall take and the severity spread.
103
+ - **Unresolved inline comments** on the current head:
104
+
105
+ ```bash
106
+ gh api repos/{owner}/{repo}/pulls/<PR>/comments --paginate \
107
+ --jq '.[] | select(.user.login=="gemini-code-assist[bot]") | {id, path, line, body}'
108
+ ```
109
+
110
+ Also pull the review threads + their resolved state via GraphQL (see step F) so you only act on
111
+ unresolved ones.
112
+
113
+ ### C. Critically evaluate EACH comment (the core of this skill)
114
+
115
+ For every comment, **verify the claim against the actual code and repo conventions before touching
116
+ anything.** Read the file, the surrounding code, the types, and any call sites. Then classify:
117
+
118
+ 1. **CORRECT + actionable** — the finding is real and the fix improves the code. → fix it (step D).
119
+ 2. **FALSE POSITIVE / technically wrong** — the claim doesn't hold. → do **NOT** change code; write a
120
+ specific, evidence-based reply (cite the exact code/line/behavior that disproves it), then resolve.
121
+ 3. **Valid but out-of-scope / stylistic nit** that conflicts with repo convention or the PR's intent
122
+ → briefly decline with a reason, then resolve. Do not expand the PR's scope to satisfy a nit.
123
+
124
+ **Hard rules:**
125
+ - **Never modify correct code just to silence Gemini.** Prefer a reasoned rebuttal.
126
+ - When uncertain whether a claim holds, **investigate** (read more code, run the type-checker / tests)
127
+ rather than assume Gemini is right. Default to skepticism.
128
+ - If a suggested change would break other call sites, alter public behavior, or contradict a verified
129
+ repo convention, it is a category-2 rebuttal, not a fix.
130
+ - Never fabricate identifiers to satisfy a comment (e.g. a Linear/ticket prefix). If Gemini asks for a
131
+ ticket reference and none exists, say so; do not invent one.
132
+
133
+ **Gemini's common failure modes to watch for (default these to category 2):**
134
+ - Hallucinated APIs, options, or framework behavior stated as fact.
135
+ - "Add a null/undefined check" where the type already guarantees presence.
136
+ - Suggestions that compile-break or break other callers.
137
+ - Security/perf warnings with no actual exploit path or measurable cost.
138
+ - Restating library/framework semantics incorrectly.
139
+ - Style demands that contradict the repo's existing, consistent pattern.
140
+
141
+ ### D. Apply fixes — category 1 only
142
+
143
+ Make the minimal correct change. Re-run the local gate if the repo has one (typecheck/tests) before
144
+ moving on.
145
+
146
+ ### E. Commit and push FIRST, before resolving anything
147
+
148
+ Order matters. A resolved thread is a claim that the fix is on the branch, so the push has to
149
+ succeed before the claim is made — otherwise a failed commit or push leaves the PR unfixed with the
150
+ finding marked resolved, and nobody looks at it again.
151
+
152
+ If step D changed code:
153
+
154
+ ```bash
155
+ # Stage ONLY the files your fixes touched — never `git add -A`, which sweeps up
156
+ # unrelated work and untracked secrets sitting in the worktree.
157
+ git status --short # look before you stage
158
+ git add <path> [<path>...] # the files named in the findings you fixed
159
+ git commit -m "address gemini review feedback (geminiloop iteration N)"
160
+ git push
161
+ ```
162
+
163
+ Author the commit per the repo's norms (e.g. the user's identity; no AI attribution if that is the
164
+ convention). Confirm the push actually landed before continuing:
165
+
166
+ ```bash
167
+ git rev-parse HEAD
168
+ gh pr view <PR> --json headRefOid -q .headRefOid # must match
169
+ ```
170
+
171
+ If they differ, stop: the fix is not on the PR, so nothing may be resolved yet.
172
+
173
+ ### F. Reply to and resolve every addressed thread
174
+
175
+ Only now, with the fixes pushed, reply and resolve. Fetch unresolved threads, **following
176
+ pagination** — a PR with more than 100 threads will otherwise look clean while unresolved findings
177
+ sit on page two:
178
+
179
+ ```bash
180
+ # Loop until hasNextPage is false, passing endCursor back in as $cursor.
181
+ CURSOR=null
182
+ while : ; do
183
+ PAGE=$(gh api graphql -F cursor="$CURSOR" -f query='
184
+ query($cursor: String) {
185
+ repository(owner: "OWNER", name: "REPO") {
186
+ pullRequest(number: PR_NUMBER) {
187
+ reviewThreads(first: 100, after: $cursor) {
188
+ pageInfo { hasNextPage endCursor }
189
+ nodes { id isResolved comments(first: 1) { nodes { databaseId author { login } path body } } }
190
+ }
191
+ }
192
+ }
193
+ }')
194
+ echo "$PAGE" # collect nodes from every page before deciding the PR is clean
195
+ PI='.data.repository.pullRequest.reviewThreads.pageInfo'
196
+ [ "$(echo "$PAGE" | jq -r "$PI.hasNextPage")" = "true" ] || break
197
+ CURSOR=$(echo "$PAGE" | jq -r "$PI.endCursor")
198
+ done
199
+ ```
200
+
201
+ Reply on a thread's comment via `gh api repos/{owner}/{repo}/pulls/<PR>/comments -f body="..." -F in_reply_to=<comment_id>`,
202
+ then resolve:
203
+
204
+ ```bash
205
+ gh api graphql -f query='mutation { resolveReviewThread(input: {threadId: "THREAD_ID"}) { thread { isResolved } } }'
206
+ ```
207
+
208
+ Resolve a thread only for comments authored by `gemini-code-assist[bot]` that you have fixed or
209
+ rebutted — never blanket-resolve, and never resolve a human reviewer's thread.
210
+
211
+ Threads you are **rebutting** need no push, so they may be replied to and resolved regardless of
212
+ whether step D changed code.
213
+
214
+ ### G. Re-review
215
+
216
+ Pushing re-triggers Gemini automatically; go back to **A** with the new head SHA. If step D changed
217
+ nothing (all comments were rebutted), skip the push, ensure all threads are resolved, and exit.
218
+
219
+ ## 3. Exit conditions
220
+
221
+ Stop when **any** is true:
222
+ - Zero unresolved `gemini-code-assist[bot]` comments remain, and every comment this round was fixed
223
+ or rebutted+resolved. (There is no score to hit — this is "done".)
224
+ - Max iterations (5) reached — report what remains.
225
+
226
+ ## 4. Report
227
+
228
+ ```text
229
+ Geminiloop complete.
230
+ PR: #<n>
231
+ Iterations: N
232
+ Comments fixed: N (genuinely-correct findings)
233
+ Comments rebutted: N (false positives / nits, resolved with rationale)
234
+ Remaining: 0
235
+ ```
236
+
237
+ If it stopped at max iterations, list the remaining threads with your current assessment
238
+ (fix-pending vs disputed) so a human can arbitrate.
@@ -0,0 +1,230 @@
1
+ <!-- Generated by scripts/build-adapters.sh. Do not edit directly. -->
2
+
3
+ ---
4
+ inclusion: manual
5
+ description: "Iteratively drives a GitHub PR to zero unresolved Gemini Code Assist comments — treats each one as a claim to verify, fixes only the genuinely-correct findings, and rebuts the rest with evidence instead of editing correct code."
6
+ ---
7
+
8
+ # Geminiloop
9
+
10
+ Drive a GitHub PR until Gemini Code Assist has no unresolved comments — **but do not cargo-cult
11
+ its suggestions.** Gemini is often confidently wrong. Every comment is a *claim to verify*, not an
12
+ instruction to obey. A wrong suggestion applied is worse than the comment itself.
13
+
14
+ ## How Gemini differs from other review bots
15
+
16
+ - **No check-run, no score.** Gemini does not publish a `X/5` confidence or a `greptile` check. It
17
+ posts a **PR review** (state `COMMENTED`) authored by `gemini-code-assist[bot]` with a
18
+ `## Code Review` summary body plus inline review comments. Detection is by polling the *reviews*
19
+ endpoint, not a check-run. "Satisfied" = zero unresolved comments (each either fixed or rebutted),
20
+ since there is no numeric target.
21
+ - **Auto-reviews on push/open.** It reviews automatically when a PR opens or gets new commits;
22
+ `/gemini review` forces a fresh pass.
23
+ - **Severity, not confidence.** Inline comments carry a priority badge (a `![critical]` /
24
+ `![high]` / `![medium]` / `![low]` shields image) at the top of the body. Weight `critical`/`high`
25
+ seriously; treat `medium`/`low` as usually-skippable nits unless clearly correct.
26
+ - **Higher false-positive rate.** This is the whole point of the skill: bias toward *rebut* over
27
+ *change*.
28
+
29
+ ## Not for
30
+
31
+ - GitLab / Perforce (Gemini Code Assist is GitHub-only). For other review bots this catalog ships
32
+ `codexloop`, `coderabbitloop`, and `qodoloop`; for CI failures rather than review comments, use
33
+ `ci-fix-loop`.
34
+
35
+ ## 1. Identify the PR
36
+
37
+ ```bash
38
+ gh pr view --json number,headRefName,headRefOid -q '{number,branch:.headRefName,head:.headRefOid}'
39
+ ```
40
+
41
+ Switch to the PR branch if not already on it. Capture `OWNER`/`REPO` (`gh repo view --json owner,name`).
42
+
43
+ ## 2. The loop (max 5 iterations)
44
+
45
+ Keep an explicit iteration counter and stop at 5 — the cap is a real bound to enforce, not a
46
+ figure of speech. Each pass through A–G is one iteration; on hitting the cap, go straight to the
47
+ report and list what is still unresolved rather than starting a sixth.
48
+
49
+ ### A. Ensure a fresh Gemini review on the current head
50
+
51
+ Gemini auto-reviews new commits, but force a deterministic pass and record the head SHA:
52
+
53
+ ```bash
54
+ HEAD_SHA=$(gh pr view <PR> --json headRefOid -q .headRefOid)
55
+ # Only trigger if no gemini review already exists for this exact SHA:
56
+ HAVE=$(gh api repos/{owner}/{repo}/pulls/<PR>/reviews --paginate \
57
+ --jq "[.[] | select(.user.login==\"gemini-code-assist[bot]\" and .commit_id==\"$HEAD_SHA\")] | length")
58
+ if [ "$HAVE" = "0" ]; then gh pr comment <PR> --body "/gemini review"; fi
59
+ ```
60
+
61
+ Poll for the review of THIS head to land. No check-run exists, so poll the reviews endpoint — and
62
+ poll it on a **deadline**, never `while true`: a review that never arrives must end the skill with
63
+ an honest timeout, not hang it.
64
+
65
+ ```bash
66
+ # 10-minute deadline, one retry, then give up.
67
+ wait_for_review() { # $1 = attempt label
68
+ local deadline=$(( SECONDS + 600 ))
69
+ while [ "$SECONDS" -lt "$deadline" ]; do
70
+ R=$(gh api repos/{owner}/{repo}/pulls/<PR>/reviews --paginate \
71
+ --jq "[.[] | select(.user.login==\"gemini-code-assist[bot]\" and .commit_id==\"$HEAD_SHA\")] | last")
72
+ if [ -n "$R" ] && [ "$R" != "null" ]; then return 0; fi
73
+ echo "waiting for Gemini review of $HEAD_SHA ($1)..."; sleep 15
74
+ done
75
+ return 1
76
+ }
77
+
78
+ if ! wait_for_review "first wait"; then
79
+ echo "no Gemini review after 10m — retrying once" # say the retry out loud
80
+ gh pr comment <PR> --body "/gemini review"
81
+ if ! wait_for_review "after retry"; then
82
+ echo "Gemini did not review $HEAD_SHA after a retry; stopping and reporting."
83
+ exit 1 # honest timeout, never a success claim
84
+ fi
85
+ fi
86
+ ```
87
+
88
+ Report the retry in the final summary; two silent timeouts are the failure mode this guard exists
89
+ to prevent.
90
+
91
+ ### B. Fetch the findings
92
+
93
+ - **Summary** (the `## Code Review` body): the review `.body` from the object above — read the
94
+ overall take and the severity spread.
95
+ - **Unresolved inline comments** on the current head:
96
+
97
+ ```bash
98
+ gh api repos/{owner}/{repo}/pulls/<PR>/comments --paginate \
99
+ --jq '.[] | select(.user.login=="gemini-code-assist[bot]") | {id, path, line, body}'
100
+ ```
101
+
102
+ Also pull the review threads + their resolved state via GraphQL (see step F) so you only act on
103
+ unresolved ones.
104
+
105
+ ### C. Critically evaluate EACH comment (the core of this skill)
106
+
107
+ For every comment, **verify the claim against the actual code and repo conventions before touching
108
+ anything.** Read the file, the surrounding code, the types, and any call sites. Then classify:
109
+
110
+ 1. **CORRECT + actionable** — the finding is real and the fix improves the code. → fix it (step D).
111
+ 2. **FALSE POSITIVE / technically wrong** — the claim doesn't hold. → do **NOT** change code; write a
112
+ specific, evidence-based reply (cite the exact code/line/behavior that disproves it), then resolve.
113
+ 3. **Valid but out-of-scope / stylistic nit** that conflicts with repo convention or the PR's intent
114
+ → briefly decline with a reason, then resolve. Do not expand the PR's scope to satisfy a nit.
115
+
116
+ **Hard rules:**
117
+ - **Never modify correct code just to silence Gemini.** Prefer a reasoned rebuttal.
118
+ - When uncertain whether a claim holds, **investigate** (read more code, run the type-checker / tests)
119
+ rather than assume Gemini is right. Default to skepticism.
120
+ - If a suggested change would break other call sites, alter public behavior, or contradict a verified
121
+ repo convention, it is a category-2 rebuttal, not a fix.
122
+ - Never fabricate identifiers to satisfy a comment (e.g. a Linear/ticket prefix). If Gemini asks for a
123
+ ticket reference and none exists, say so; do not invent one.
124
+
125
+ **Gemini's common failure modes to watch for (default these to category 2):**
126
+ - Hallucinated APIs, options, or framework behavior stated as fact.
127
+ - "Add a null/undefined check" where the type already guarantees presence.
128
+ - Suggestions that compile-break or break other callers.
129
+ - Security/perf warnings with no actual exploit path or measurable cost.
130
+ - Restating library/framework semantics incorrectly.
131
+ - Style demands that contradict the repo's existing, consistent pattern.
132
+
133
+ ### D. Apply fixes — category 1 only
134
+
135
+ Make the minimal correct change. Re-run the local gate if the repo has one (typecheck/tests) before
136
+ moving on.
137
+
138
+ ### E. Commit and push FIRST, before resolving anything
139
+
140
+ Order matters. A resolved thread is a claim that the fix is on the branch, so the push has to
141
+ succeed before the claim is made — otherwise a failed commit or push leaves the PR unfixed with the
142
+ finding marked resolved, and nobody looks at it again.
143
+
144
+ If step D changed code:
145
+
146
+ ```bash
147
+ # Stage ONLY the files your fixes touched — never `git add -A`, which sweeps up
148
+ # unrelated work and untracked secrets sitting in the worktree.
149
+ git status --short # look before you stage
150
+ git add <path> [<path>...] # the files named in the findings you fixed
151
+ git commit -m "address gemini review feedback (geminiloop iteration N)"
152
+ git push
153
+ ```
154
+
155
+ Author the commit per the repo's norms (e.g. the user's identity; no AI attribution if that is the
156
+ convention). Confirm the push actually landed before continuing:
157
+
158
+ ```bash
159
+ git rev-parse HEAD
160
+ gh pr view <PR> --json headRefOid -q .headRefOid # must match
161
+ ```
162
+
163
+ If they differ, stop: the fix is not on the PR, so nothing may be resolved yet.
164
+
165
+ ### F. Reply to and resolve every addressed thread
166
+
167
+ Only now, with the fixes pushed, reply and resolve. Fetch unresolved threads, **following
168
+ pagination** — a PR with more than 100 threads will otherwise look clean while unresolved findings
169
+ sit on page two:
170
+
171
+ ```bash
172
+ # Loop until hasNextPage is false, passing endCursor back in as $cursor.
173
+ CURSOR=null
174
+ while : ; do
175
+ PAGE=$(gh api graphql -F cursor="$CURSOR" -f query='
176
+ query($cursor: String) {
177
+ repository(owner: "OWNER", name: "REPO") {
178
+ pullRequest(number: PR_NUMBER) {
179
+ reviewThreads(first: 100, after: $cursor) {
180
+ pageInfo { hasNextPage endCursor }
181
+ nodes { id isResolved comments(first: 1) { nodes { databaseId author { login } path body } } }
182
+ }
183
+ }
184
+ }
185
+ }')
186
+ echo "$PAGE" # collect nodes from every page before deciding the PR is clean
187
+ PI='.data.repository.pullRequest.reviewThreads.pageInfo'
188
+ [ "$(echo "$PAGE" | jq -r "$PI.hasNextPage")" = "true" ] || break
189
+ CURSOR=$(echo "$PAGE" | jq -r "$PI.endCursor")
190
+ done
191
+ ```
192
+
193
+ Reply on a thread's comment via `gh api repos/{owner}/{repo}/pulls/<PR>/comments -f body="..." -F in_reply_to=<comment_id>`,
194
+ then resolve:
195
+
196
+ ```bash
197
+ gh api graphql -f query='mutation { resolveReviewThread(input: {threadId: "THREAD_ID"}) { thread { isResolved } } }'
198
+ ```
199
+
200
+ Resolve a thread only for comments authored by `gemini-code-assist[bot]` that you have fixed or
201
+ rebutted — never blanket-resolve, and never resolve a human reviewer's thread.
202
+
203
+ Threads you are **rebutting** need no push, so they may be replied to and resolved regardless of
204
+ whether step D changed code.
205
+
206
+ ### G. Re-review
207
+
208
+ Pushing re-triggers Gemini automatically; go back to **A** with the new head SHA. If step D changed
209
+ nothing (all comments were rebutted), skip the push, ensure all threads are resolved, and exit.
210
+
211
+ ## 3. Exit conditions
212
+
213
+ Stop when **any** is true:
214
+ - Zero unresolved `gemini-code-assist[bot]` comments remain, and every comment this round was fixed
215
+ or rebutted+resolved. (There is no score to hit — this is "done".)
216
+ - Max iterations (5) reached — report what remains.
217
+
218
+ ## 4. Report
219
+
220
+ ```text
221
+ Geminiloop complete.
222
+ PR: #<n>
223
+ Iterations: N
224
+ Comments fixed: N (genuinely-correct findings)
225
+ Comments rebutted: N (false positives / nits, resolved with rationale)
226
+ Remaining: 0
227
+ ```
228
+
229
+ If it stopped at max iterations, list the remaining threads with your current assessment
230
+ (fix-pending vs disputed) so a human can arbitrate.