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