@olegkoval/agent-skills 1.49.2 → 1.51.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 (75) hide show
  1. package/.github/copilot-instructions.md +1 -0
  2. package/.github/prompts/coderabbitloop.prompt.md +90 -15
  3. package/.github/prompts/codexloop.prompt.md +33 -6
  4. package/.github/prompts/copilotloop.prompt.md +302 -0
  5. package/.github/prompts/geminiloop.prompt.md +34 -6
  6. package/.github/prompts/qodoloop.prompt.md +18 -0
  7. package/.kiro/steering/coderabbitloop.md +90 -15
  8. package/.kiro/steering/codexloop.md +33 -6
  9. package/.kiro/steering/copilotloop.md +301 -0
  10. package/.kiro/steering/geminiloop.md +34 -6
  11. package/.kiro/steering/qodoloop.md +18 -0
  12. package/.windsurf/rules/coderabbitloop.md +90 -15
  13. package/.windsurf/rules/codexloop.md +33 -6
  14. package/.windsurf/rules/copilotloop.md +300 -0
  15. package/.windsurf/rules/geminiloop.md +34 -6
  16. package/.windsurf/rules/qodoloop.md +18 -0
  17. package/README.md +1 -0
  18. package/adapters/claude/olko-github-pr/skills/coderabbitloop/SKILL.md +91 -16
  19. package/adapters/claude/olko-github-pr/skills/coderabbitloop/references/graphql-queries.md +41 -9
  20. package/adapters/claude/olko-github-pr/skills/codexloop/SKILL.md +35 -8
  21. package/adapters/claude/olko-github-pr/skills/copilotloop/SKILL.md +309 -0
  22. package/adapters/claude/olko-github-pr/skills/geminiloop/SKILL.md +36 -8
  23. package/adapters/claude/olko-github-pr/skills/lekker-review/SKILL.md +26 -1
  24. package/adapters/claude/olko-github-pr/skills/lekker-review/references/agents/completeness-critic.md +12 -0
  25. package/adapters/claude/olko-github-pr/skills/lekker-review/references/agents/implementation.md +26 -1
  26. package/adapters/claude/olko-github-pr/skills/lekker-review/references/agents/prover.md +8 -1
  27. package/adapters/claude/olko-github-pr/skills/lekker-review/references/agents/test-quality.md +20 -2
  28. package/adapters/claude/olko-github-pr/skills/lekker-review/references/agents/verifier.md +25 -0
  29. package/adapters/claude/olko-github-pr/skills/lekker-review/references/fix-mode.md +23 -0
  30. package/adapters/claude/olko-github-pr/skills/qodoloop/SKILL.md +19 -1
  31. package/adapters/claude/olko-github-pr/skills/qodoloop/references/graphql-queries.md +19 -2
  32. package/adapters/codex/olko-github-pr/README.md +1 -0
  33. package/adapters/cursor/olko-github-pr/skills/coderabbitloop/SKILL.md +91 -16
  34. package/adapters/cursor/olko-github-pr/skills/coderabbitloop/references/graphql-queries.md +41 -9
  35. package/adapters/cursor/olko-github-pr/skills/codexloop/SKILL.md +35 -8
  36. package/adapters/cursor/olko-github-pr/skills/copilotloop/SKILL.md +309 -0
  37. package/adapters/cursor/olko-github-pr/skills/geminiloop/SKILL.md +36 -8
  38. package/adapters/cursor/olko-github-pr/skills/qodoloop/SKILL.md +19 -1
  39. package/adapters/cursor/olko-github-pr/skills/qodoloop/references/graphql-queries.md +19 -2
  40. package/adapters/grok/olko-github-pr/skills/coderabbitloop/SKILL.md +91 -16
  41. package/adapters/grok/olko-github-pr/skills/coderabbitloop/references/graphql-queries.md +41 -9
  42. package/adapters/grok/olko-github-pr/skills/codexloop/SKILL.md +35 -8
  43. package/adapters/grok/olko-github-pr/skills/copilotloop/SKILL.md +309 -0
  44. package/adapters/grok/olko-github-pr/skills/geminiloop/SKILL.md +36 -8
  45. package/adapters/grok/olko-github-pr/skills/qodoloop/SKILL.md +19 -1
  46. package/adapters/grok/olko-github-pr/skills/qodoloop/references/graphql-queries.md +19 -2
  47. package/catalog/skills.json +23 -0
  48. package/package.json +1 -1
  49. package/plugins/olko-apple-kit/.claude-plugin/plugin.json +1 -1
  50. package/plugins/olko-creative/.claude-plugin/plugin.json +1 -1
  51. package/plugins/olko-garmin-kit/.claude-plugin/plugin.json +1 -1
  52. package/plugins/olko-git-tools/.claude-plugin/plugin.json +1 -1
  53. package/plugins/olko-github-pr/.claude-plugin/plugin.json +1 -1
  54. package/plugins/olko-github-pr/skills/coderabbitloop/SKILL.md +91 -16
  55. package/plugins/olko-github-pr/skills/coderabbitloop/references/graphql-queries.md +41 -9
  56. package/plugins/olko-github-pr/skills/codexloop/SKILL.md +35 -8
  57. package/plugins/olko-github-pr/skills/copilotloop/SKILL.md +308 -0
  58. package/plugins/olko-github-pr/skills/geminiloop/SKILL.md +36 -8
  59. package/plugins/olko-github-pr/skills/lekker-review/SKILL.md +26 -1
  60. package/plugins/olko-github-pr/skills/lekker-review/references/agents/completeness-critic.md +12 -0
  61. package/plugins/olko-github-pr/skills/lekker-review/references/agents/implementation.md +26 -1
  62. package/plugins/olko-github-pr/skills/lekker-review/references/agents/prover.md +8 -1
  63. package/plugins/olko-github-pr/skills/lekker-review/references/agents/test-quality.md +20 -2
  64. package/plugins/olko-github-pr/skills/lekker-review/references/agents/verifier.md +25 -0
  65. package/plugins/olko-github-pr/skills/lekker-review/references/fix-mode.md +23 -0
  66. package/plugins/olko-github-pr/skills/lekker-review/workflow.js +87 -5
  67. package/plugins/olko-github-pr/skills/qodoloop/SKILL.md +19 -1
  68. package/plugins/olko-github-pr/skills/qodoloop/references/graphql-queries.md +19 -2
  69. package/plugins/olko-obsidian/.claude-plugin/plugin.json +1 -1
  70. package/plugins/olko-product/.claude-plugin/plugin.json +1 -1
  71. package/plugins/olko-reflection/.claude-plugin/plugin.json +1 -1
  72. package/plugins/olko-release/.claude-plugin/plugin.json +1 -1
  73. package/plugins/olko-skill-meta/.claude-plugin/plugin.json +1 -1
  74. package/plugins/olko-web-ops/.claude-plugin/plugin.json +1 -1
  75. package/scripts/lib/catalog.mjs +1 -1
@@ -6,9 +6,9 @@ description: >
6
6
  against the real code first, fix ONLY the genuinely-correct ones, and rebut + resolve false
7
7
  positives WITHOUT changing correct code. Repeat until no unresolved Gemini comments remain. Use
8
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.
9
+ compatibility: GitHub only (Gemini Code Assist is a GitHub app). Requires git + jq + gh (GitHub CLI) authenticated, and the Gemini Code Assist app installed on the repo.
10
10
  metadata:
11
- version: "1.0"
11
+ version: "1.1"
12
12
  allowed-tools: Bash(gh:*) Bash(git:*)
13
13
  ---
14
14
  <!-- Generated by scripts/build-adapters.sh. Do not edit directly. -->
@@ -37,7 +37,7 @@ instruction to obey. A wrong suggestion applied is worse than the comment itself
37
37
  ## Not for
38
38
 
39
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
40
+ `copilotloop`, `codexloop`, `coderabbitloop`, and `qodoloop`; for CI failures rather than review comments, use
41
41
  `ci-fix-loop`.
42
42
 
43
43
  ## 1. Identify the PR
@@ -60,9 +60,13 @@ Gemini auto-reviews new commits, but force a deterministic pass and record the h
60
60
 
61
61
  ```bash
62
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")
63
+ # Only trigger if no gemini review already exists for this exact SHA.
64
+ # gh cannot combine --slurp with --jq, so pipe to `jq -s`: it folds every page
65
+ # into one array. Without it the filter runs once per page and HAVE becomes a
66
+ # multi-line count that never equals "0", silently skipping the trigger.
67
+ HAVE=$(gh api repos/{owner}/{repo}/pulls/<PR>/reviews --paginate |
68
+ jq -s --arg head "$HEAD_SHA" \
69
+ '[.[][] | select(.user.login=="gemini-code-assist[bot]" and .commit_id==$head)] | length')
66
70
  if [ "$HAVE" = "0" ]; then gh pr comment <PR> --body "/gemini review"; fi
67
71
  ```
68
72
 
@@ -75,8 +79,9 @@ an honest timeout, not hang it.
75
79
  wait_for_review() { # $1 = attempt label
76
80
  local deadline=$(( SECONDS + 600 ))
77
81
  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")
82
+ R=$(gh api repos/{owner}/{repo}/pulls/<PR>/reviews --paginate |
83
+ jq -s --arg head "$HEAD_SHA" \
84
+ '[.[][] | select(.user.login=="gemini-code-assist[bot]" and .commit_id==$head)] | sort_by(.submitted_at, .id) | last')
80
85
  if [ -n "$R" ] && [ "$R" != "null" ]; then return 0; fi
81
86
  echo "waiting for Gemini review of $HEAD_SHA ($1)..."; sleep 15
82
87
  done
@@ -110,6 +115,13 @@ gh api repos/{owner}/{repo}/pulls/<PR>/comments --paginate \
110
115
  Also pull the review threads + their resolved state via GraphQL (see step F) so you only act on
111
116
  unresolved ones.
112
117
 
118
+ Mark each unresolved comment as seen, so the bot and a watching human can tell it is being handled.
119
+ GitHub's reaction set is fixed; `eyes` is the only "looking at it" value:
120
+
121
+ ```bash
122
+ gh api --method POST repos/{owner}/{repo}/pulls/comments/<COMMENT_ID>/reactions -f content=eyes
123
+ ```
124
+
113
125
  ### C. Critically evaluate EACH comment (the core of this skill)
114
126
 
115
127
  For every comment, **verify the claim against the actual code and repo conventions before touching
@@ -205,6 +217,21 @@ then resolve:
205
217
  gh api graphql -f query='mutation { resolveReviewThread(input: {threadId: "THREAD_ID"}) { thread { isResolved } } }'
206
218
  ```
207
219
 
220
+ Then record the disposition as a reaction on the bot's own comment: the learning signal, and a
221
+ visible marker for a human scanning the PR:
222
+
223
+ - 👍 (`+1`): the finding was accepted and fixed.
224
+ - 👎 (`-1`): the finding was rebutted as a false positive. **This is the correction signal.**
225
+
226
+ ```bash
227
+ gh api --method POST repos/{owner}/{repo}/pulls/comments/<COMMENT_ID>/reactions -f content=+1
228
+ # rebutted finding:
229
+ gh api --method POST repos/{owner}/{repo}/pulls/comments/<COMMENT_ID>/reactions -f content=-1
230
+ ```
231
+
232
+ Reply first, then react, then resolve: the reaction is not a substitute for the reply, and a
233
+ resolved thread with no reply loses the reasoning.
234
+
208
235
  Resolve a thread only for comments authored by `gemini-code-assist[bot]` that you have fixed or
209
236
  rebutted: never blanket-resolve, and never resolve a human reviewer's thread.
210
237
 
@@ -222,6 +249,7 @@ Stop when **any** is true:
222
249
  - Zero unresolved `gemini-code-assist[bot]` comments remain, and every comment this round was fixed
223
250
  or rebutted+resolved. (There is no score to hit: this is "done".)
224
251
  - Max iterations (5) reached: report what remains.
252
+ - Gemini never responded after one retry: report the timeout honestly; do not claim success.
225
253
 
226
254
  ## 4. Report
227
255
 
@@ -8,7 +8,7 @@ description: >
8
8
  addressed against Qodo's review, or says "run qodoloop" / "satisfy Qodo" / "resolve Qodo comments".
9
9
  compatibility: Requires git and gh (GitHub CLI) authenticated, with Qodo Merge installed on the repo.
10
10
  metadata:
11
- version: "1.0"
11
+ version: "1.1"
12
12
  allowed-tools: Bash(gh:*) Bash(git:*)
13
13
  ---
14
14
  <!-- Generated by scripts/build-adapters.sh. Do not edit directly. -->
@@ -86,6 +86,14 @@ Run the paginated GraphQL query in `references/graphql-queries.md` (`unresolvedQ
86
86
 
87
87
  Build the working set: all `recommended` threads, plus `optional` ones too if `--include-optional`.
88
88
 
89
+ Mark each thread as seen with an 👀 reaction on its first comment (`databaseId` from the query), so
90
+ the bot and a watching human can tell it is being worked. GitHub's reaction set is fixed; `eyes` is
91
+ the only "looking at it" value:
92
+
93
+ ```bash
94
+ gh api --method POST repos/{owner}/{repo}/pulls/comments/<DATABASE_ID>/reactions -f content=eyes
95
+ ```
96
+
89
97
  #### C. Check exit conditions
90
98
 
91
99
  Stop if the working set is empty, or max iterations reached.
@@ -122,6 +130,16 @@ This is the "answer to the comments" half of the job, not optional cleanup, and
122
130
  Pass the thread id and reply text as GraphQL **variables** (`-f threadId=... -f body=...`), never interpolated into the query string itself: a reply containing a quote, backtick, or newline breaks (or worse, injects into) a hand-built query. Then resolve with `resolveReviewThread` (see references file).
123
131
  - **Blocked** findings: reply explaining exactly why (false positive / needs a human call), but **do not resolve**: leave the thread open. A blocked finding that gets silently resolved is a false "done".
124
132
 
133
+ Then record each disposition as a reaction on the thread's first comment: the learning signal, and
134
+ a visible marker for a human scanning the PR. 👍 (`+1`) for a fixed finding, 👎 (`-1`) for a
135
+ blocked/rebutted one. Reply first, react, then resolve: a reaction never replaces the reply.
136
+
137
+ ```bash
138
+ gh api --method POST repos/{owner}/{repo}/pulls/comments/<DATABASE_ID>/reactions -f content=+1
139
+ # blocked/rebutted finding:
140
+ gh api --method POST repos/{owner}/{repo}/pulls/comments/<DATABASE_ID>/reactions -f content=-1
141
+ ```
142
+
125
143
  Go back to step A.
126
144
 
127
145
  ### 3. Report
@@ -26,7 +26,7 @@ query($cursor: String) {
26
26
  id
27
27
  isResolved
28
28
  comments(first: 1) {
29
- nodes { body path line author { login } }
29
+ nodes { databaseId body path line author { login } }
30
30
  }
31
31
  }
32
32
  }
@@ -60,7 +60,7 @@ while :; do
60
60
  nodes {
61
61
  id
62
62
  isResolved
63
- comments(first: 1) { nodes { body path line author { login } } }
63
+ comments(first: 1) { nodes { databaseId body path line author { login } } }
64
64
  }
65
65
  }
66
66
  }
@@ -126,6 +126,23 @@ the branch (SKILL.md §2E-F): resolving first and pushing second means a
126
126
  failed push leaves GitHub showing the finding as handled when it isn't. Never
127
127
  resolve a blocked/skipped finding at all; reply to it and leave it open.
128
128
 
129
+ ## React to a comment (the bot's learning signal)
130
+
131
+ Reacting needs the comment's REST id, which is why `databaseId` is selected in
132
+ the thread query above. The reaction set is fixed; only eight values exist:
133
+ `+1`, `-1`, `laugh`, `confused`, `heart`, `hooray`, `rocket`, `eyes`.
134
+
135
+ ```bash
136
+ # 👀 as soon as you start working a finding
137
+ gh api --method POST repos/{owner}/{repo}/pulls/comments/<DATABASE_ID>/reactions -f content=eyes
138
+ # 👍 when it was accepted and fixed, 👎 when it was rebutted (the correction signal)
139
+ gh api --method POST repos/{owner}/{repo}/pulls/comments/<DATABASE_ID>/reactions -f content=+1
140
+ gh api --method POST repos/{owner}/{repo}/pulls/comments/<DATABASE_ID>/reactions -f content=-1
141
+ ```
142
+
143
+ React after the reply and before the resolve, so GitHub records the reason and
144
+ the disposition together. A reaction never replaces the reply.
145
+
129
146
  ## Fetch the rollup issue comment (context only, not the source of truth)
130
147
 
131
148
  Useful for the human-readable summary counts (bugs/rule-violations) in your
@@ -165,6 +165,29 @@
165
165
  "kiro"
166
166
  ]
167
167
  },
168
+ {
169
+ "name": "copilotloop",
170
+ "lookupName": "olko:copilotloop",
171
+ "path": "plugins/olko-github-pr/skills/copilotloop",
172
+ "description": "Iteratively drives a GitHub PR to zero unresolved GitHub Copilot review comments, verifying every finding against the real code first, fixes only the correct ones, and rebuts false positives without changing correct code.",
173
+ "tags": [
174
+ "code-review",
175
+ "copilot",
176
+ "github",
177
+ "pull-requests",
178
+ "automation",
179
+ "agents"
180
+ ],
181
+ "adapters": [
182
+ "claude",
183
+ "codex",
184
+ "cursor",
185
+ "copilot",
186
+ "grok",
187
+ "windsurf",
188
+ "kiro"
189
+ ]
190
+ },
168
191
  {
169
192
  "name": "geminiloop",
170
193
  "lookupName": "olko:geminiloop",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@olegkoval/agent-skills",
3
- "version": "1.49.2",
3
+ "version": "1.51.0",
4
4
  "private": false,
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "olko-apple-kit",
3
3
  "description": "Build and ship Apple platform apps: macOS menubar apps, App Store submissions.",
4
- "version": "1.49.2",
4
+ "version": "1.51.0",
5
5
  "author": {
6
6
  "name": "Oleg Koval"
7
7
  },
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "olko-creative",
3
3
  "description": "Creative and personal projects: photo galleries, music players, listings, wiki editing.",
4
- "version": "1.49.2",
4
+ "version": "1.51.0",
5
5
  "author": {
6
6
  "name": "Oleg Koval"
7
7
  },
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "olko-garmin-kit",
3
3
  "description": "Build, test and publish Garmin Connect IQ watch faces.",
4
- "version": "1.49.2",
4
+ "version": "1.51.0",
5
5
  "author": {
6
6
  "name": "Oleg Koval"
7
7
  },
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "olko-git-tools",
3
3
  "description": "Everyday git and GitHub CLI operations: conventional commits, branch hygiene.",
4
- "version": "1.49.2",
4
+ "version": "1.51.0",
5
5
  "author": {
6
6
  "name": "Oleg Koval"
7
7
  },
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "olko-github-pr",
3
3
  "description": "Drive GitHub pull requests to merge-ready: review-bot loops, CI fixes, descriptions, dependency triage.",
4
- "version": "1.49.2",
4
+ "version": "1.51.0",
5
5
  "author": {
6
6
  "name": "Oleg Koval"
7
7
  },
@@ -9,7 +9,7 @@ description: >
9
9
  CodeRabbit" / "resolve CodeRabbit comments".
10
10
  compatibility: Requires git and gh (GitHub CLI) authenticated, with the CodeRabbit GitHub App installed on the repo.
11
11
  metadata:
12
- version: "1.0"
12
+ version: "1.1"
13
13
  allowed-tools: Bash(gh:*) Bash(git:*)
14
14
  ---
15
15
 
@@ -45,13 +45,30 @@ CodeRabbit has slash commands (official, `docs.coderabbit.ai/reference/review-co
45
45
  gh pr view --json number,headRefName,headRefOid -q '{number, branch: .headRefName, sha: .headRefOid}'
46
46
  ```
47
47
 
48
- Check out the branch if not already on it.
48
+ Check out the branch if not already on it, **then require a clean working tree**
49
+ (`git status --porcelain` empty) before touching anything:
50
+
51
+ ```bash
52
+ [ -z "$(git status --porcelain)" ] || { echo "working tree not clean, refusing to start: would risk committing unrelated changes"; exit 1; }
53
+ ```
54
+
55
+ This is the precondition step E's scoped `git add <file>` depends on: staging only the files a fix
56
+ touched is safe *because* the tree started clean. Skip it and a file with pre-existing local edits
57
+ gets those edits swept into the fix commit right along with it.
49
58
 
50
59
  ### 2. Loop (max 5 iterations)
51
60
 
52
- #### A. Push and wait
61
+ Keep an explicit iteration counter and stop at 5: the cap is a real bound to enforce, not a figure
62
+ of speech. Each pass through A–F is one iteration; on hitting the cap, go straight to the report.
63
+
64
+ #### A. Wait for a review of the current head
65
+
66
+ On **iteration 1**, if there is nothing to push yet (you haven't fixed anything in this loop), don't
67
+ wait for a brand-new review: use whatever CodeRabbit has already posted as your starting point and
68
+ go straight to step B. Otherwise:
53
69
 
54
70
  ```bash
71
+ SINCE=$(date -u +%Y-%m-%dT%H:%M:%SZ)
55
72
  git push
56
73
  ```
57
74
 
@@ -61,11 +78,27 @@ If this repo doesn't auto-review on push, nudge it:
61
78
  gh pr comment <PR_NUMBER> --body "@coderabbitai review"
62
79
  ```
63
80
 
64
- Poll (every ~10s, timeout ~5min) for CodeRabbit's next formal review to land: a new entry in `gh api repos/{owner}/{repo}/pulls/<PR_NUMBER>/reviews` from `coderabbitai[bot]` created after this push. If you instead see a rate-limit comment ("review limit"), **stop the loop now** and go to Report with `blocked: rate-limited`.
81
+ Poll (every ~10s, timeout ~5min) for CodeRabbit's next formal review to land: a new entry in
82
+ `gh api --paginate repos/{owner}/{repo}/pulls/<PR_NUMBER>/reviews` from `coderabbitai[bot]`
83
+ (REST spelling carries the `[bot]` suffix) created after `$SINCE`. Follow pagination so a review
84
+ that lands on page two is not missed. If you instead see a rate-limit comment ("review limit"),
85
+ **stop the loop now** and go to Report with `blocked: rate-limited`. If no review arrives within
86
+ the timeout after one retry, stop and report the timeout honestly; do not claim success.
65
87
 
66
88
  #### B. Fetch unresolved findings
67
89
 
68
- Run the `unresolvedQodoThreads`-shaped query in `references/graphql-queries.md` (filter `author.login == "coderabbitai[bot]"` instead of Qodo's login). For each unresolved thread, parse the finding text and the **Prompt for AI Agents** block (heading text is `🤖 Prompt for AI Agents`, not `Agent Prompt`: match case/emoji-insensitively).
90
+ Run the `unresolvedQodoThreads`-shaped query in `references/graphql-queries.md` (filter `author.login`
91
+ on GraphQL's bare `coderabbitai`, **not** REST's `coderabbitai[bot]`: see the reference's login-spelling
92
+ note, and follow `pageInfo.hasNextPage`/`endCursor` until exhausted). For each unresolved thread,
93
+ parse the finding text, its `databaseId`, and the **Prompt for AI Agents** block (heading text is
94
+ `🤖 Prompt for AI Agents`, not `Agent Prompt`: match case/emoji-insensitively).
95
+
96
+ Mark each thread as seen with an 👀 reaction on its first comment (`databaseId` from the query), so
97
+ the bot and a watching human can tell it is being worked:
98
+
99
+ ```bash
100
+ gh api --method POST repos/{owner}/{repo}/pulls/comments/<DATABASE_ID>/reactions -f content=eyes
101
+ ```
69
102
 
70
103
  #### C. Check exit conditions
71
104
 
@@ -73,26 +106,68 @@ Stop if there are zero unresolved CodeRabbit threads, or max iterations reached.
73
106
 
74
107
  #### D. Fix each finding
75
108
 
76
- For each thread, in order: read the Prompt for AI Agents block in full: it names the issue and the fix. Apply it, staying inside its stated scope. If the suggestion is wrong, unsafe, or needs a product decision, don't force it: note that in step E instead.
109
+ For each thread, in order: read the Prompt for AI Agents block in full: it names the issue and the fix. Apply it, staying inside its stated scope. If the suggestion is wrong, unsafe, or needs a product decision, don't force it: note that in step F instead. Track two lists as you go: **fixed** (thread id + the exact files you touched) and **skipped** (thread id + why). Do not resolve anything yet.
110
+
111
+ #### E. Commit and push FIRST, before resolving anything
77
112
 
78
- #### E. Answer and resolve
113
+ Order matters. A resolved thread is a claim that the fix is on the branch, so the push has to succeed
114
+ before the claim is made: otherwise a failed commit or push leaves the PR unfixed with the finding
115
+ marked resolved, and nobody looks at it again.
79
116
 
80
- **Reply to the thread first, then resolve it**, the "answer to the comments" half of the job:
117
+ If step D changed code:
81
118
 
82
119
  ```bash
83
- gh api graphql -f query='mutation { addPullRequestReviewThreadReply(input: {pullRequestReviewThreadId: "<THREAD_ID>", body: "<REPLY>"}) { comment { id } } }'
120
+ # Stage ONLY the files your fixes touched: never `git add -A`, which sweeps up
121
+ # unrelated work and untracked secrets sitting in the worktree.
122
+ git status --short # look before you stage
123
+ git add <path> [<path>...] # the files named in the findings you fixed
124
+ git commit -m "address CodeRabbit review feedback (coderabbitloop iteration N)"
125
+ git push
84
126
  ```
85
127
 
86
- Reply body: one or two sentences, what you changed and why, or exactly why you didn't fix it. Then resolve (`resolveReviewThread`). A finding you deliberately skip still gets a reply and gets resolved.
128
+ Confirm the push actually landed before continuing:
87
129
 
88
- #### F. Commit and push
130
+ ```bash
131
+ git rev-parse HEAD
132
+ gh pr view <PR_NUMBER> --json headRefOid -q .headRefOid # must match
133
+ ```
134
+
135
+ If they differ, stop: the fix is not on the PR, so nothing may be resolved yet.
136
+
137
+ #### F. Reply to each finding, react, then resolve
138
+
139
+ Only now, with the fixes pushed, reply and resolve. **Reply to the thread first, then react, then
140
+ resolve it**, the "answer to the comments" half of the job:
89
141
 
90
142
  ```bash
91
- git add -A
92
- git commit -m "address CodeRabbit review feedback (coderabbitloop iteration N)"
93
- git push
143
+ gh api graphql -f query='
144
+ mutation($threadId: ID!, $body: String!) {
145
+ addPullRequestReviewThreadReply(input: {pullRequestReviewThreadId: $threadId, body: $body}) {
146
+ comment { id }
147
+ }
148
+ }' -f threadId="$THREAD_ID" -f body="$REPLY_TEXT"
94
149
  ```
95
150
 
151
+ Pass the thread id and reply text as GraphQL **variables** (`-f threadId=... -f body=...`), never
152
+ interpolated into the query string: a reply containing a quote, backtick, or newline breaks (or
153
+ injects into) a hand-built query.
154
+
155
+ Reply body: one or two sentences, what you changed and why, or exactly why you didn't fix it. A
156
+ finding you deliberately skip still gets a reply and gets resolved.
157
+
158
+ Then record the disposition as a reaction on the thread's first comment: the learning signal, and a
159
+ visible marker for a human scanning the PR. 👍 (`+1`) for fixed, 👎 (`-1`) for skipped/rebutted.
160
+ CodeRabbit reads a 👎 as feedback that the finding was wrong.
161
+
162
+ ```bash
163
+ gh api --method POST repos/{owner}/{repo}/pulls/comments/<DATABASE_ID>/reactions -f content=+1
164
+ # skipped/rebutted finding:
165
+ gh api --method POST repos/{owner}/{repo}/pulls/comments/<DATABASE_ID>/reactions -f content=-1
166
+ ```
167
+
168
+ Then resolve (`resolveReviewThread`). Reply first, react, then resolve: a reaction never replaces
169
+ the reply, and a resolved thread with no reply loses the reasoning.
170
+
96
171
  Go back to step A.
97
172
 
98
173
  ### 3. Report
@@ -103,7 +178,7 @@ Go back to step A.
103
178
  | Findings resolved | N |
104
179
  | Findings skipped | N (with reasons) |
105
180
  | Remaining | N (if any) |
106
- | Blocked | rate-limited / max-iterations / none |
181
+ | Blocked | rate-limited / timeout / max-iterations / none |
107
182
 
108
183
  ```
109
184
  Coderabbitloop complete.
@@ -114,4 +189,4 @@ Coderabbitloop complete.
114
189
 
115
190
  ## References
116
191
 
117
- - `references/graphql-queries.md`: shared with `qodoloop`: the exact `reviewThreads` query and the `resolveReviewThread` / `addPullRequestReviewThreadReply` mutations. Swap the author-login filter to `coderabbitai[bot]` and the prompt-heading match to `Prompt for AI Agents`.
192
+ - `references/graphql-queries.md`: shared with `qodoloop`: the exact `reviewThreads` query (including the `databaseId` the reaction step needs) and the `resolveReviewThread` / `addPullRequestReviewThreadReply` mutations. Filter `author.login` on GraphQL's bare `coderabbitai` (never `coderabbitai[bot]`) and match the prompt heading `Prompt for AI Agents`.
@@ -6,6 +6,15 @@ against CodeRabbit's own documentation (`docs.coderabbit.ai/reference/review-com
6
6
  plus a real `<!-- ... summarize by coderabbit.ai -->` comment observed live:
7
7
  not guessed.
8
8
 
9
+ **The bot's login string is spelled differently in REST vs GraphQL.** REST
10
+ (`.user.login` on `pulls/.../comments`) returns `coderabbitai[bot]`. GraphQL
11
+ (`author.login` on `reviewThreads`) returns `coderabbitai`, no `[bot]` suffix
12
+ (confirmed live against PR #114's own threads). Using the REST spelling in a
13
+ GraphQL filter silently matches nothing, which reads as "no findings" instead
14
+ of "wrong filter": exactly the kind of bug that has no crash and no error to
15
+ notice. Use `[bot]` only in REST-based jq filters (`.user.login`); use the
16
+ bare name everywhere you're filtering a GraphQL `author.login`.
17
+
9
18
  ## Fetch unresolved CodeRabbit threads (paginated)
10
19
 
11
20
  ```graphql
@@ -18,7 +27,7 @@ query($cursor: String) {
18
27
  id
19
28
  isResolved
20
29
  comments(first: 1) {
21
- nodes { body path line author { login } }
30
+ nodes { databaseId body path line author { login } }
22
31
  }
23
32
  }
24
33
  }
@@ -27,12 +36,13 @@ query($cursor: String) {
27
36
  }
28
37
  ```
29
38
 
30
- Filter client-side to `coderabbitai[bot]` and `isResolved == false`:
39
+ Filter client-side to GraphQL's `coderabbitai` (bare name, see the note above)
40
+ and `isResolved == false`:
31
41
 
32
42
  ```bash
33
43
  gh api graphql -f query='...' --jq \
34
44
  '.data.repository.pullRequest.reviewThreads.nodes[]
35
- | select(.comments.nodes[0].author.login == "coderabbitai[bot]")
45
+ | select(.comments.nodes[0].author.login == "coderabbitai")
36
46
  | select(.isResolved == false)'
37
47
  ```
38
48
 
@@ -53,14 +63,18 @@ description text above it: not every low-confidence nit gets one.
53
63
 
54
64
  ```bash
55
65
  gh api graphql -f query='
56
- mutation {
57
- addPullRequestReviewThreadReply(input: {
58
- pullRequestReviewThreadId: "THREAD_ID"
59
- body: "REPLY_TEXT"
60
- }) { comment { id } }
61
- }'
66
+ mutation($threadId: ID!, $body: String!) {
67
+ addPullRequestReviewThreadReply(input: {pullRequestReviewThreadId: $threadId, body: $body}) {
68
+ comment { id }
69
+ }
70
+ }' -f threadId="$THREAD_ID" -f body="$REPLY_TEXT"
62
71
  ```
63
72
 
73
+ Pass the thread id and reply text as GraphQL **variables** (`-f`), never interpolated straight into
74
+ the query string. A reply containing a quote, backtick, or embedded newline breaks (or, worse,
75
+ injects into) a hand-built query string; `gh api graphql -f` handles the escaping correctly when the
76
+ value travels as a variable instead.
77
+
64
78
  `pullRequestReviewThreadId` and `body` are the only required fields.
65
79
 
66
80
  ## Resolve a thread (batch)
@@ -81,6 +95,24 @@ marks every one of its threads resolved at once server-side. That's a valid
81
95
  bulk escape hatch if the user wants to blow through remaining low-value nits,
82
96
  but it skips the per-finding reply: don't use it as the default path.
83
97
 
98
+ ## React to a comment (the bot's learning signal)
99
+
100
+ Reacting needs the comment's REST id, which is why `databaseId` is selected in
101
+ the thread query above. The reaction set is fixed; only eight values exist:
102
+ `+1`, `-1`, `laugh`, `confused`, `heart`, `hooray`, `rocket`, `eyes`.
103
+
104
+ ```bash
105
+ # 👀 as soon as you start working a finding
106
+ gh api --method POST repos/{owner}/{repo}/pulls/comments/<DATABASE_ID>/reactions -f content=eyes
107
+ # 👍 when it was accepted and fixed, 👎 when it was rebutted (the correction signal)
108
+ gh api --method POST repos/{owner}/{repo}/pulls/comments/<DATABASE_ID>/reactions -f content=+1
109
+ gh api --method POST repos/{owner}/{repo}/pulls/comments/<DATABASE_ID>/reactions -f content=-1
110
+ ```
111
+
112
+ React after the reply and before the resolve, so GitHub records the reason and
113
+ the disposition together. A reaction never replaces the reply. CodeRabbit reads
114
+ a 👎 on one of its comments as feedback that the finding was wrong.
115
+
84
116
  ## Fetch the walkthrough/summary comment (context only, not the source of truth)
85
117
 
86
118
  ```bash
@@ -6,9 +6,9 @@ description: >
6
6
  ones, and rebut + resolve false positives WITHOUT changing correct code. Repeat until no
7
7
  unresolved Codex comments remain. Use when the user says "satisfy codex", "clear the codex
8
8
  review", "fix codex comments", "codex loop", or wants to iterate on Codex PR review feedback.
9
- compatibility: GitHub only (Codex code review is a GitHub app). Requires git + gh (GitHub CLI) authenticated, and the Codex / ChatGPT connector app installed on the repo with code review enabled.
9
+ compatibility: GitHub only (Codex code review is a GitHub app). Requires git + jq + gh (GitHub CLI) authenticated, and the Codex / ChatGPT connector app installed on the repo with code review enabled.
10
10
  metadata:
11
- version: "1.1"
11
+ version: "1.2"
12
12
  allowed-tools: Bash(gh:*) Bash(git:*)
13
13
  ---
14
14
 
@@ -36,7 +36,7 @@ suggestion applied is worse than the comment itself.
36
36
  ## Not for
37
37
 
38
38
  - GitLab / Perforce (Codex code review is a GitHub app). For other review bots this catalog ships
39
- `geminiloop`, `coderabbitloop`, and `qodoloop`; for CI failures rather than review comments, use
39
+ `copilotloop`, `geminiloop`, `coderabbitloop`, and `qodoloop`; for CI failures rather than review comments, use
40
40
  `ci-fix-loop`.
41
41
 
42
42
  ## 0. Resolve the Codex bot login (do this first, do not hardcode)
@@ -83,9 +83,13 @@ report and list what is still unresolved rather than starting a sixth.
83
83
 
84
84
  ```bash
85
85
  HEAD_SHA=$(gh pr view <PR> --json headRefOid -q .headRefOid)
86
- # Only trigger if no Codex review already exists for this exact SHA:
87
- HAVE=$(gh api repos/{owner}/{repo}/pulls/<PR>/reviews --paginate \
88
- --jq "[.[] | select(.user.login==\"$BOT\" and .commit_id==\"$HEAD_SHA\")] | length")
86
+ # Only trigger if no Codex review already exists for this exact SHA.
87
+ # gh cannot combine --slurp with --jq, so pipe to `jq -s`: it folds every page
88
+ # into one array. Without it the filter runs once per page and HAVE becomes a
89
+ # multi-line count that never equals "0", silently skipping the trigger.
90
+ HAVE=$(gh api repos/{owner}/{repo}/pulls/<PR>/reviews --paginate |
91
+ jq -s --arg bot "$BOT" --arg head "$HEAD_SHA" \
92
+ '[.[][] | select(.user.login==$bot and .commit_id==$head)] | length')
89
93
  if [ "$HAVE" = "0" ]; then gh pr comment <PR> --body "@codex review"; fi
90
94
  ```
91
95
 
@@ -99,8 +103,9 @@ an honest timeout, not hang it.
99
103
  wait_for_review() { # $1 = attempt label
100
104
  local deadline=$(( SECONDS + 600 ))
101
105
  while [ "$SECONDS" -lt "$deadline" ]; do
102
- R=$(gh api repos/{owner}/{repo}/pulls/<PR>/reviews --paginate \
103
- --jq "[.[] | select(.user.login==\"$BOT\" and .commit_id==\"$HEAD_SHA\")] | last")
106
+ R=$(gh api repos/{owner}/{repo}/pulls/<PR>/reviews --paginate |
107
+ jq -s --arg bot "$BOT" --arg head "$HEAD_SHA" \
108
+ '[.[][] | select(.user.login==$bot and .commit_id==$head)] | sort_by(.submitted_at, .id) | last')
104
109
  if [ -n "$R" ] && [ "$R" != "null" ]; then return 0; fi
105
110
  echo "waiting for Codex review of $HEAD_SHA ($1)..."; sleep 15
106
111
  done
@@ -134,6 +139,13 @@ gh api repos/{owner}/{repo}/pulls/<PR>/comments --paginate \
134
139
  Also pull the review threads + their resolved state via GraphQL (see step F) so you only act on
135
140
  unresolved ones.
136
141
 
142
+ Mark each unresolved comment as seen, so the bot and a watching human can tell it is being handled.
143
+ GitHub's reaction set is fixed; `eyes` is the only "looking at it" value:
144
+
145
+ ```bash
146
+ gh api --method POST repos/{owner}/{repo}/pulls/comments/<COMMENT_ID>/reactions -f content=eyes
147
+ ```
148
+
137
149
  ### C. Critically evaluate EACH comment (the core of this skill)
138
150
 
139
151
  For every comment, **verify the claim against the actual code and repo conventions before touching
@@ -235,6 +247,21 @@ then resolve:
235
247
  gh api graphql -f query='mutation { resolveReviewThread(input: {threadId: "THREAD_ID"}) { thread { isResolved } } }'
236
248
  ```
237
249
 
250
+ Then record the disposition as a reaction on the bot's own comment: the learning signal, and a
251
+ visible marker for a human scanning the PR:
252
+
253
+ - 👍 (`+1`): the finding was accepted and fixed.
254
+ - 👎 (`-1`): the finding was rebutted as a false positive. **This is the correction signal.**
255
+
256
+ ```bash
257
+ gh api --method POST repos/{owner}/{repo}/pulls/comments/<COMMENT_ID>/reactions -f content=+1
258
+ # rebutted finding:
259
+ gh api --method POST repos/{owner}/{repo}/pulls/comments/<COMMENT_ID>/reactions -f content=-1
260
+ ```
261
+
262
+ Reply first, then react, then resolve: the reaction is not a substitute for the reply, and a
263
+ resolved thread with no reply loses the reasoning.
264
+
238
265
  Resolve a thread only for comments authored by `$BOT` that you have fixed or rebutted: never
239
266
  blanket-resolve, and never resolve a human reviewer's thread. For each fixed comment, verify the
240
267
  push first, reply with the change made, then resolve the thread and verify `isResolved: true`.