@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.
- package/.github/copilot-instructions.md +1 -0
- package/.github/prompts/coderabbitloop.prompt.md +90 -15
- package/.github/prompts/codexloop.prompt.md +33 -6
- package/.github/prompts/copilotloop.prompt.md +302 -0
- package/.github/prompts/geminiloop.prompt.md +34 -6
- package/.github/prompts/qodoloop.prompt.md +18 -0
- package/.kiro/steering/coderabbitloop.md +90 -15
- package/.kiro/steering/codexloop.md +33 -6
- package/.kiro/steering/copilotloop.md +301 -0
- package/.kiro/steering/geminiloop.md +34 -6
- package/.kiro/steering/qodoloop.md +18 -0
- package/.windsurf/rules/coderabbitloop.md +90 -15
- package/.windsurf/rules/codexloop.md +33 -6
- package/.windsurf/rules/copilotloop.md +300 -0
- package/.windsurf/rules/geminiloop.md +34 -6
- package/.windsurf/rules/qodoloop.md +18 -0
- package/README.md +1 -0
- package/adapters/claude/olko-github-pr/skills/coderabbitloop/SKILL.md +91 -16
- package/adapters/claude/olko-github-pr/skills/coderabbitloop/references/graphql-queries.md +41 -9
- package/adapters/claude/olko-github-pr/skills/codexloop/SKILL.md +35 -8
- package/adapters/claude/olko-github-pr/skills/copilotloop/SKILL.md +309 -0
- package/adapters/claude/olko-github-pr/skills/geminiloop/SKILL.md +36 -8
- package/adapters/claude/olko-github-pr/skills/lekker-review/SKILL.md +26 -1
- package/adapters/claude/olko-github-pr/skills/lekker-review/references/agents/completeness-critic.md +12 -0
- package/adapters/claude/olko-github-pr/skills/lekker-review/references/agents/implementation.md +26 -1
- package/adapters/claude/olko-github-pr/skills/lekker-review/references/agents/prover.md +8 -1
- package/adapters/claude/olko-github-pr/skills/lekker-review/references/agents/test-quality.md +20 -2
- package/adapters/claude/olko-github-pr/skills/lekker-review/references/agents/verifier.md +25 -0
- package/adapters/claude/olko-github-pr/skills/lekker-review/references/fix-mode.md +23 -0
- package/adapters/claude/olko-github-pr/skills/qodoloop/SKILL.md +19 -1
- package/adapters/claude/olko-github-pr/skills/qodoloop/references/graphql-queries.md +19 -2
- package/adapters/codex/olko-github-pr/README.md +1 -0
- package/adapters/cursor/olko-github-pr/skills/coderabbitloop/SKILL.md +91 -16
- package/adapters/cursor/olko-github-pr/skills/coderabbitloop/references/graphql-queries.md +41 -9
- package/adapters/cursor/olko-github-pr/skills/codexloop/SKILL.md +35 -8
- package/adapters/cursor/olko-github-pr/skills/copilotloop/SKILL.md +309 -0
- package/adapters/cursor/olko-github-pr/skills/geminiloop/SKILL.md +36 -8
- package/adapters/cursor/olko-github-pr/skills/qodoloop/SKILL.md +19 -1
- package/adapters/cursor/olko-github-pr/skills/qodoloop/references/graphql-queries.md +19 -2
- package/adapters/grok/olko-github-pr/skills/coderabbitloop/SKILL.md +91 -16
- package/adapters/grok/olko-github-pr/skills/coderabbitloop/references/graphql-queries.md +41 -9
- package/adapters/grok/olko-github-pr/skills/codexloop/SKILL.md +35 -8
- package/adapters/grok/olko-github-pr/skills/copilotloop/SKILL.md +309 -0
- package/adapters/grok/olko-github-pr/skills/geminiloop/SKILL.md +36 -8
- package/adapters/grok/olko-github-pr/skills/qodoloop/SKILL.md +19 -1
- package/adapters/grok/olko-github-pr/skills/qodoloop/references/graphql-queries.md +19 -2
- package/catalog/skills.json +23 -0
- package/package.json +1 -1
- package/plugins/olko-apple-kit/.claude-plugin/plugin.json +1 -1
- package/plugins/olko-creative/.claude-plugin/plugin.json +1 -1
- package/plugins/olko-garmin-kit/.claude-plugin/plugin.json +1 -1
- package/plugins/olko-git-tools/.claude-plugin/plugin.json +1 -1
- package/plugins/olko-github-pr/.claude-plugin/plugin.json +1 -1
- package/plugins/olko-github-pr/skills/coderabbitloop/SKILL.md +91 -16
- package/plugins/olko-github-pr/skills/coderabbitloop/references/graphql-queries.md +41 -9
- package/plugins/olko-github-pr/skills/codexloop/SKILL.md +35 -8
- package/plugins/olko-github-pr/skills/copilotloop/SKILL.md +308 -0
- package/plugins/olko-github-pr/skills/geminiloop/SKILL.md +36 -8
- package/plugins/olko-github-pr/skills/lekker-review/SKILL.md +26 -1
- package/plugins/olko-github-pr/skills/lekker-review/references/agents/completeness-critic.md +12 -0
- package/plugins/olko-github-pr/skills/lekker-review/references/agents/implementation.md +26 -1
- package/plugins/olko-github-pr/skills/lekker-review/references/agents/prover.md +8 -1
- package/plugins/olko-github-pr/skills/lekker-review/references/agents/test-quality.md +20 -2
- package/plugins/olko-github-pr/skills/lekker-review/references/agents/verifier.md +25 -0
- package/plugins/olko-github-pr/skills/lekker-review/references/fix-mode.md +23 -0
- package/plugins/olko-github-pr/skills/lekker-review/workflow.js +87 -5
- package/plugins/olko-github-pr/skills/qodoloop/SKILL.md +19 -1
- package/plugins/olko-github-pr/skills/qodoloop/references/graphql-queries.md +19 -2
- package/plugins/olko-obsidian/.claude-plugin/plugin.json +1 -1
- package/plugins/olko-product/.claude-plugin/plugin.json +1 -1
- package/plugins/olko-reflection/.claude-plugin/plugin.json +1 -1
- package/plugins/olko-release/.claude-plugin/plugin.json +1 -1
- package/plugins/olko-skill-meta/.claude-plugin/plugin.json +1 -1
- package/plugins/olko-web-ops/.claude-plugin/plugin.json +1 -1
- package/scripts/lib/catalog.mjs +1 -1
|
@@ -0,0 +1,308 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: copilotloop
|
|
3
|
+
description: >
|
|
4
|
+
Iteratively satisfy GitHub Copilot's code review on a GitHub PR, but treat every Copilot comment
|
|
5
|
+
SKEPTICALLY: verify each finding against the real code first, fix ONLY the genuinely-correct
|
|
6
|
+
ones, and rebut + resolve false positives WITHOUT changing correct code. Repeat until no
|
|
7
|
+
unresolved Copilot comments remain. Use when the user says "satisfy Copilot", "clear the Copilot
|
|
8
|
+
review", "fix Copilot comments", "Copilot loop", or wants to iterate on Copilot PR feedback.
|
|
9
|
+
compatibility: GitHub only (Copilot code review is a GitHub feature). Requires git + jq + gh (GitHub CLI) authenticated, Copilot code review enabled, and permission to request reviewers on the repository.
|
|
10
|
+
metadata:
|
|
11
|
+
version: "1.1"
|
|
12
|
+
allowed-tools: Bash(gh:*) Bash(git:*)
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
# Copilotloop
|
|
16
|
+
|
|
17
|
+
Drive a GitHub PR until Copilot has no unresolved review comments, **but do not cargo-cult its
|
|
18
|
+
suggestions.** Every comment is a *claim to verify*, not an instruction to obey. A wrong
|
|
19
|
+
suggestion applied is worse than the comment itself.
|
|
20
|
+
|
|
21
|
+
## How Copilot differs from other review bots
|
|
22
|
+
|
|
23
|
+
- **No check-run, no score.** Copilot posts an overview comment and a PR review with inline review
|
|
24
|
+
comments. Detection is by polling the reviews endpoint and paginated review threads. "Satisfied"
|
|
25
|
+
means zero unresolved Copilot threads and zero unaddressed body findings after each finding is
|
|
26
|
+
fixed or rebutted with a recorded reply.
|
|
27
|
+
- **Request through the reviewers API.** Copilot does not use a reliable slash-command trigger.
|
|
28
|
+
Request `copilot-pull-request-reviewer[bot]` through the pull request reviewers endpoint. A
|
|
29
|
+
repository may also be configured to review new pushes automatically.
|
|
30
|
+
- **Copilot may repeat comments.** A re-review can repeat comments that were resolved or downvoted,
|
|
31
|
+
so match findings to the current head and prior replies before reopening work, including body
|
|
32
|
+
findings that have no inline thread.
|
|
33
|
+
- **Copilot is concise and can reason from the diff alone.** Its characteristic failure is
|
|
34
|
+
confidently asserting a bug based only on the changed hunk, without the surrounding file or the
|
|
35
|
+
call sites. That makes "read the whole file before believing it" the single highest-value check.
|
|
36
|
+
|
|
37
|
+
## Not for
|
|
38
|
+
|
|
39
|
+
- GitLab / Perforce. For other review bots this catalog ships `codexloop`, `geminiloop`,
|
|
40
|
+
`coderabbitloop`, and `qodoloop`; for CI failures rather than review comments, use
|
|
41
|
+
`ci-fix-loop`.
|
|
42
|
+
|
|
43
|
+
## 0. Resolve the Copilot bot login (do this first)
|
|
44
|
+
|
|
45
|
+
The bot login is normally stable, but confirm it from the PR rather than assuming it:
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
gh api repos/{owner}/{repo}/pulls/<PR>/reviews --paginate --jq '.[].user.login' | sort -u
|
|
49
|
+
gh api repos/{owner}/{repo}/pulls/<PR>/comments --paginate --jq '.[].user.login' | sort -u
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
Use `copilot-pull-request-reviewer[bot]` as `BOT`. Confirm it appears after the first requested
|
|
53
|
+
review; if GitHub uses a different login for the installation, use the exact Copilot-looking login
|
|
54
|
+
returned by the probe rather than guessing.
|
|
55
|
+
|
|
56
|
+
**Finding nothing here is NOT a stop condition.** On a PR Copilot has never reviewed there is no bot
|
|
57
|
+
login to find yet. Fall through to step 2A, request the reviewer, and re-run this probe once a
|
|
58
|
+
review lands. Only conclude Copilot is unavailable after the bounded wait expires with no review.
|
|
59
|
+
|
|
60
|
+
## 1. Identify the PR
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
gh pr view --json number,headRefName,headRefOid -q '{number,branch:.headRefName,head:.headRefOid}'
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
Switch to the PR branch if not already on it. Capture `OWNER`/`REPO` (`gh repo view --json owner,name`).
|
|
67
|
+
|
|
68
|
+
## 2. The loop (max 5 iterations)
|
|
69
|
+
|
|
70
|
+
Keep an explicit iteration counter and stop at 5: the cap is a real bound to enforce, not a
|
|
71
|
+
figure of speech. Each pass through A–G is one iteration; on hitting the cap, go straight to the
|
|
72
|
+
report and list what is still unresolved rather than starting a sixth.
|
|
73
|
+
|
|
74
|
+
### A. Ensure a fresh Copilot review on the current head
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
HEAD_SHA=$(gh pr view <PR> --json headRefOid -q .headRefOid)
|
|
78
|
+
# Only trigger if no Copilot review exists for this exact SHA:
|
|
79
|
+
HAVE=$(gh api repos/{owner}/{repo}/pulls/<PR>/reviews --paginate |
|
|
80
|
+
jq -s --arg bot "$BOT" --arg head "$HEAD_SHA" \
|
|
81
|
+
'[.[][] | select(.user.login==$bot and .commit_id==$head)] | length')
|
|
82
|
+
if [ "$HAVE" = "0" ]; then
|
|
83
|
+
gh api --method POST repos/{owner}/{repo}/pulls/<PR>/requested_reviewers \
|
|
84
|
+
-f 'reviewers[]=copilot-pull-request-reviewer[bot]'
|
|
85
|
+
fi
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
Poll for the review of THIS head to land. No check-run exists, so poll the reviews endpoint, and
|
|
89
|
+
poll it on a **deadline**, never `while true`: a review that never arrives must end the skill with
|
|
90
|
+
an honest timeout, not hang it.
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
# 10-minute deadline, one retry, then give up. DEADLINE/RETRIES are the
|
|
94
|
+
# enforcement of the bounds this skill claims: do not drop them.
|
|
95
|
+
wait_for_review() { # $1 = attempt label
|
|
96
|
+
local deadline=$(( SECONDS + 600 ))
|
|
97
|
+
while [ "$SECONDS" -lt "$deadline" ]; do
|
|
98
|
+
R=$(gh api repos/{owner}/{repo}/pulls/<PR>/reviews --paginate |
|
|
99
|
+
jq -s --arg bot "$BOT" --arg head "$HEAD_SHA" \
|
|
100
|
+
'[.[][] | select(.user.login==$bot and .commit_id==$head)] | sort_by(.submitted_at, .id) | last')
|
|
101
|
+
if [ -n "$R" ] && [ "$R" != "null" ]; then return 0; fi
|
|
102
|
+
echo "waiting for Copilot review of $HEAD_SHA ($1)..."; sleep 15
|
|
103
|
+
done
|
|
104
|
+
return 1
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
if ! wait_for_review "first wait"; then
|
|
108
|
+
echo "no Copilot review after 10m, retrying once" # say the retry out loud
|
|
109
|
+
gh api --method POST repos/{owner}/{repo}/pulls/<PR>/requested_reviewers \
|
|
110
|
+
-f 'reviewers[]=copilot-pull-request-reviewer[bot]'
|
|
111
|
+
if ! wait_for_review "after retry"; then
|
|
112
|
+
echo "Copilot did not review $HEAD_SHA after a retry; stopping and reporting."
|
|
113
|
+
exit 1 # honest timeout, never a success claim
|
|
114
|
+
fi
|
|
115
|
+
fi
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
Copilot usually reviews quickly, but large diffs can take longer; the deadline is bounded. Report the
|
|
119
|
+
retry in the final summary; two silent timeouts are the failure mode this guard exists to prevent.
|
|
120
|
+
|
|
121
|
+
### B. Fetch the findings
|
|
122
|
+
|
|
123
|
+
- **Summary**: read the Copilot overview comment and review `.body`, including all matching reviews
|
|
124
|
+
for the current head. Extract and classify actionable claims even when they have no inline thread;
|
|
125
|
+
an approval assessment or lack of inline comments does not make those findings complete.
|
|
126
|
+
Track each body finding across iterations by source review/comment ID and item, with its
|
|
127
|
+
classification, fix commit or evidence-based rebuttal, PR-level reply URL, and completion status.
|
|
128
|
+
Link duplicates to the same finding so they are counted once; retain pending findings after a push.
|
|
129
|
+
- **Unresolved inline comments** on the current head:
|
|
130
|
+
|
|
131
|
+
```bash
|
|
132
|
+
gh api repos/{owner}/{repo}/pulls/<PR>/comments --paginate \
|
|
133
|
+
--jq ".[] | select(.user.login==\"$BOT\") | {id, path, line, body}"
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
Also pull the review threads + their resolved state via GraphQL (see step F) so you only act on
|
|
137
|
+
unresolved ones.
|
|
138
|
+
|
|
139
|
+
Mark each unresolved inline comment as seen, so the bot and a watching human can tell it is being
|
|
140
|
+
handled. GitHub's reaction set is fixed; `eyes` is the only "looking at it" value:
|
|
141
|
+
|
|
142
|
+
```bash
|
|
143
|
+
gh api --method POST repos/{owner}/{repo}/pulls/comments/<COMMENT_ID>/reactions -f content=eyes
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
Body findings (no inline thread) have no comment to react to; track them in step B's register and
|
|
147
|
+
give each a PR-level reply in step F instead.
|
|
148
|
+
|
|
149
|
+
### C. Critically evaluate EACH finding (the core of this skill)
|
|
150
|
+
|
|
151
|
+
For every inline or body finding, **verify the claim against the actual code and repo conventions
|
|
152
|
+
before touching anything.** Read the whole file, not just the diff hunk Copilot saw, plus the types
|
|
153
|
+
and the call sites. Then classify:
|
|
154
|
+
|
|
155
|
+
1. **CORRECT + actionable**: the finding is real and the fix improves the code. → fix it (step D).
|
|
156
|
+
2. **FALSE POSITIVE / technically wrong**: the claim doesn't hold. → do **NOT** change code; write a
|
|
157
|
+
specific, evidence-based reply (cite the exact code/line/behavior that disproves it), then resolve
|
|
158
|
+
its thread or record completion for a body finding (step F).
|
|
159
|
+
3. **Valid but out-of-scope / stylistic nit** that conflicts with repo convention or the PR's intent
|
|
160
|
+
→ briefly decline with evidence of that convention or scope, then resolve its thread or record
|
|
161
|
+
completion for a body finding (step F). Do not expand the PR's scope to satisfy a nit.
|
|
162
|
+
|
|
163
|
+
**Hard rules:**
|
|
164
|
+
- **Never modify correct code just to silence Copilot.** Prefer a reasoned rebuttal.
|
|
165
|
+
- When uncertain whether a claim holds, **investigate** (read more code, run the type-checker / tests)
|
|
166
|
+
rather than assume Copilot is right. Default to skepticism.
|
|
167
|
+
- If a suggested change would break other call sites, alter public behavior, or contradict a verified
|
|
168
|
+
repo convention, it is a category-2 rebuttal, not a fix.
|
|
169
|
+
- Never fabricate identifiers to satisfy a comment (e.g. a Linear/ticket prefix). If Copilot asks for a
|
|
170
|
+
ticket reference and none exists, say so; do not invent one.
|
|
171
|
+
|
|
172
|
+
**Copilot's common failure modes to watch for (default these to category 2):**
|
|
173
|
+
- Diff-local reasoning: asserts a bug that the unchanged surrounding code already handles.
|
|
174
|
+
- "This can be null/undefined here" where the type or an earlier guard already rules it out.
|
|
175
|
+
- Invented race conditions or error paths with no actual trigger.
|
|
176
|
+
- Suggestions that compile-break or break other callers.
|
|
177
|
+
- Security/perf warnings with no exploit path or measurable cost.
|
|
178
|
+
- Restating library/framework semantics incorrectly.
|
|
179
|
+
- Style demands that contradict the repo's existing, consistent pattern.
|
|
180
|
+
|
|
181
|
+
### D. Apply fixes: category 1 only
|
|
182
|
+
|
|
183
|
+
Make the minimal correct change. Re-run the local gate if the repo has one (typecheck/tests) before
|
|
184
|
+
moving on.
|
|
185
|
+
|
|
186
|
+
### E. Commit and push FIRST, before resolving anything
|
|
187
|
+
|
|
188
|
+
Order matters. A resolved thread is a claim that the fix is on the branch, so the push has to
|
|
189
|
+
succeed before the claim is made: otherwise a failed commit or push leaves the PR unfixed with the
|
|
190
|
+
finding marked resolved, and nobody looks at it again.
|
|
191
|
+
|
|
192
|
+
If step D changed code:
|
|
193
|
+
|
|
194
|
+
```bash
|
|
195
|
+
# Stage ONLY the files your fixes touched: never `git add -A`, which sweeps up
|
|
196
|
+
# unrelated work and untracked secrets sitting in the worktree.
|
|
197
|
+
git status --short # look before you stage
|
|
198
|
+
git add <path> [<path>...] # the files named in the findings you fixed
|
|
199
|
+
git commit -m "address Copilot review feedback (copilotloop iteration N)"
|
|
200
|
+
git push
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
Author the commit per the repo's norms (e.g. the user's identity; no AI attribution if that is the
|
|
204
|
+
convention). Confirm the push actually landed before continuing:
|
|
205
|
+
|
|
206
|
+
```bash
|
|
207
|
+
git rev-parse HEAD
|
|
208
|
+
gh pr view <PR> --json headRefOid -q .headRefOid # must match
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
If they differ, stop: the fix is not on the PR, so nothing may be resolved yet.
|
|
212
|
+
|
|
213
|
+
### F. Reply to every addressed finding and resolve its inline threads
|
|
214
|
+
|
|
215
|
+
Only now, with the fixes pushed, reply and resolve. Fetch unresolved threads, **following
|
|
216
|
+
pagination**: a PR with more than 100 threads will otherwise look clean while unresolved findings
|
|
217
|
+
sit on page two:
|
|
218
|
+
|
|
219
|
+
```bash
|
|
220
|
+
# Loop until hasNextPage is false, passing endCursor back in as $cursor.
|
|
221
|
+
CURSOR=null
|
|
222
|
+
while : ; do
|
|
223
|
+
PAGE=$(gh api graphql -F cursor="$CURSOR" -f query='
|
|
224
|
+
query($cursor: String) {
|
|
225
|
+
repository(owner: "OWNER", name: "REPO") {
|
|
226
|
+
pullRequest(number: PR_NUMBER) {
|
|
227
|
+
reviewThreads(first: 100, after: $cursor) {
|
|
228
|
+
pageInfo { hasNextPage endCursor }
|
|
229
|
+
nodes { id isResolved comments(first: 1) { nodes { databaseId author { login } path body } } }
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
}')
|
|
234
|
+
echo "$PAGE" # collect nodes from every page before deciding the PR is clean
|
|
235
|
+
PI='.data.repository.pullRequest.reviewThreads.pageInfo'
|
|
236
|
+
[ "$(echo "$PAGE" | jq -r "$PI.hasNextPage")" = "true" ] || break
|
|
237
|
+
CURSOR=$(echo "$PAGE" | jq -r "$PI.endCursor")
|
|
238
|
+
done
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
Reply on a thread's comment via `gh api repos/{owner}/{repo}/pulls/<PR>/comments -f body="..." -F in_reply_to=<comment_id>`,
|
|
242
|
+
then resolve:
|
|
243
|
+
|
|
244
|
+
```bash
|
|
245
|
+
gh api graphql -f query='mutation { resolveReviewThread(input: {threadId: "THREAD_ID"}) { thread { isResolved } } }'
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
Then record the disposition of each inline finding as a reaction on Copilot's own comment: the
|
|
249
|
+
learning signal, and a visible marker for a human scanning the PR:
|
|
250
|
+
|
|
251
|
+
- 👍 (`+1`): the finding was accepted and fixed.
|
|
252
|
+
- 👎 (`-1`): the finding was rebutted as a false positive. **This is the correction signal.**
|
|
253
|
+
|
|
254
|
+
```bash
|
|
255
|
+
gh api --method POST repos/{owner}/{repo}/pulls/comments/<COMMENT_ID>/reactions -f content=+1
|
|
256
|
+
# rebutted finding:
|
|
257
|
+
gh api --method POST repos/{owner}/{repo}/pulls/comments/<COMMENT_ID>/reactions -f content=-1
|
|
258
|
+
```
|
|
259
|
+
|
|
260
|
+
Reply first, then react, then resolve: the reaction is not a substitute for the reply, and a
|
|
261
|
+
resolved thread with no reply loses the reasoning.
|
|
262
|
+
|
|
263
|
+
Resolve a thread only for comments authored by `$BOT` that you have fixed or rebutted: never
|
|
264
|
+
blanket-resolve, and never resolve a human reviewer's thread.
|
|
265
|
+
|
|
266
|
+
Threads you are **rebutting** need no push, so they may be replied to and resolved regardless of
|
|
267
|
+
whether step D changed code.
|
|
268
|
+
|
|
269
|
+
For each body finding, post a PR-level reply (for example, using
|
|
270
|
+
`gh pr comment <PR> --body-file <reply-file>`) identifying the source review/comment and item.
|
|
271
|
+
Record the pushed fix commit and validation, or an evidence-based rebuttal, including the reason
|
|
272
|
+
for declining an out-of-scope finding. Record the reply URL in the tracking entry before marking
|
|
273
|
+
it complete. One reply may cover multiple explicitly identified findings. Fixed body findings
|
|
274
|
+
require the same successful push check as fixed threads; rebuttals need no push. If a finding also
|
|
275
|
+
has an inline thread, that thread still requires a reply and resolution.
|
|
276
|
+
|
|
277
|
+
### G. Re-review
|
|
278
|
+
|
|
279
|
+
Pushing re-triggers Copilot when automatic review of new pushes is on; otherwise request Copilot again
|
|
280
|
+
through the reviewers endpoint. Go back to **A**
|
|
281
|
+
with the new head SHA. If step D changed nothing (all comments were rebutted), skip the push,
|
|
282
|
+
ensure all Copilot threads are resolved and all tracked body findings have recorded PR-level
|
|
283
|
+
replies and are complete, then exit.
|
|
284
|
+
|
|
285
|
+
## 3. Exit conditions
|
|
286
|
+
|
|
287
|
+
Stop when **any** is true:
|
|
288
|
+
- Zero unresolved `$BOT` threads and zero pending body findings remain across iterations. Every
|
|
289
|
+
finding was fixed or rebutted with evidence, every inline thread was replied to and resolved,
|
|
290
|
+
and every body finding has a recorded PR-level reply. (There is no score to hit:
|
|
291
|
+
this is "done".)
|
|
292
|
+
- Max iterations (5) reached: report what remains.
|
|
293
|
+
- Copilot never responded after one retry: report the timeout honestly; do not claim success.
|
|
294
|
+
|
|
295
|
+
## 4. Report
|
|
296
|
+
|
|
297
|
+
```text
|
|
298
|
+
Copilotloop complete.
|
|
299
|
+
PR: #<n>
|
|
300
|
+
Bot login: <resolved $BOT>
|
|
301
|
+
Iterations: N
|
|
302
|
+
Findings fixed: N (inline + body findings, deduplicated)
|
|
303
|
+
Findings rebutted: N (inline + body findings, with recorded evidence-based replies)
|
|
304
|
+
Remaining: 0 (unresolved inline + pending body findings, deduplicated)
|
|
305
|
+
```
|
|
306
|
+
|
|
307
|
+
If it stopped at max iterations, list the remaining threads and body findings with your current
|
|
308
|
+
assessment (fix-pending vs disputed) so a human can arbitrate.
|
|
@@ -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.
|
|
11
|
+
version: "1.1"
|
|
12
12
|
allowed-tools: Bash(gh:*) Bash(git:*)
|
|
13
13
|
---
|
|
14
14
|
|
|
@@ -36,7 +36,7 @@ instruction to obey. A wrong suggestion applied is worse than the comment itself
|
|
|
36
36
|
## Not for
|
|
37
37
|
|
|
38
38
|
- GitLab / Perforce (Gemini Code Assist is GitHub-only). For other review bots this catalog ships
|
|
39
|
-
`codexloop`, `coderabbitloop`, and `qodoloop`; for CI failures rather than review comments, use
|
|
39
|
+
`copilotloop`, `codexloop`, `coderabbitloop`, and `qodoloop`; for CI failures rather than review comments, use
|
|
40
40
|
`ci-fix-loop`.
|
|
41
41
|
|
|
42
42
|
## 1. Identify the PR
|
|
@@ -59,9 +59,13 @@ Gemini auto-reviews new commits, but force a deterministic pass and record the h
|
|
|
59
59
|
|
|
60
60
|
```bash
|
|
61
61
|
HEAD_SHA=$(gh pr view <PR> --json headRefOid -q .headRefOid)
|
|
62
|
-
# Only trigger if no gemini review already exists for this exact SHA
|
|
63
|
-
|
|
64
|
-
|
|
62
|
+
# Only trigger if no gemini review already exists for this exact SHA.
|
|
63
|
+
# gh cannot combine --slurp with --jq, so pipe to `jq -s`: it folds every page
|
|
64
|
+
# into one array. Without it the filter runs once per page and HAVE becomes a
|
|
65
|
+
# multi-line count that never equals "0", silently skipping the trigger.
|
|
66
|
+
HAVE=$(gh api repos/{owner}/{repo}/pulls/<PR>/reviews --paginate |
|
|
67
|
+
jq -s --arg head "$HEAD_SHA" \
|
|
68
|
+
'[.[][] | select(.user.login=="gemini-code-assist[bot]" and .commit_id==$head)] | length')
|
|
65
69
|
if [ "$HAVE" = "0" ]; then gh pr comment <PR> --body "/gemini review"; fi
|
|
66
70
|
```
|
|
67
71
|
|
|
@@ -74,8 +78,9 @@ an honest timeout, not hang it.
|
|
|
74
78
|
wait_for_review() { # $1 = attempt label
|
|
75
79
|
local deadline=$(( SECONDS + 600 ))
|
|
76
80
|
while [ "$SECONDS" -lt "$deadline" ]; do
|
|
77
|
-
R=$(gh api repos/{owner}/{repo}/pulls/<PR>/reviews --paginate
|
|
78
|
-
|
|
81
|
+
R=$(gh api repos/{owner}/{repo}/pulls/<PR>/reviews --paginate |
|
|
82
|
+
jq -s --arg head "$HEAD_SHA" \
|
|
83
|
+
'[.[][] | select(.user.login=="gemini-code-assist[bot]" and .commit_id==$head)] | sort_by(.submitted_at, .id) | last')
|
|
79
84
|
if [ -n "$R" ] && [ "$R" != "null" ]; then return 0; fi
|
|
80
85
|
echo "waiting for Gemini review of $HEAD_SHA ($1)..."; sleep 15
|
|
81
86
|
done
|
|
@@ -109,6 +114,13 @@ gh api repos/{owner}/{repo}/pulls/<PR>/comments --paginate \
|
|
|
109
114
|
Also pull the review threads + their resolved state via GraphQL (see step F) so you only act on
|
|
110
115
|
unresolved ones.
|
|
111
116
|
|
|
117
|
+
Mark each unresolved comment as seen, so the bot and a watching human can tell it is being handled.
|
|
118
|
+
GitHub's reaction set is fixed; `eyes` is the only "looking at it" value:
|
|
119
|
+
|
|
120
|
+
```bash
|
|
121
|
+
gh api --method POST repos/{owner}/{repo}/pulls/comments/<COMMENT_ID>/reactions -f content=eyes
|
|
122
|
+
```
|
|
123
|
+
|
|
112
124
|
### C. Critically evaluate EACH comment (the core of this skill)
|
|
113
125
|
|
|
114
126
|
For every comment, **verify the claim against the actual code and repo conventions before touching
|
|
@@ -204,6 +216,21 @@ then resolve:
|
|
|
204
216
|
gh api graphql -f query='mutation { resolveReviewThread(input: {threadId: "THREAD_ID"}) { thread { isResolved } } }'
|
|
205
217
|
```
|
|
206
218
|
|
|
219
|
+
Then record the disposition as a reaction on the bot's own comment: the learning signal, and a
|
|
220
|
+
visible marker for a human scanning the PR:
|
|
221
|
+
|
|
222
|
+
- 👍 (`+1`): the finding was accepted and fixed.
|
|
223
|
+
- 👎 (`-1`): the finding was rebutted as a false positive. **This is the correction signal.**
|
|
224
|
+
|
|
225
|
+
```bash
|
|
226
|
+
gh api --method POST repos/{owner}/{repo}/pulls/comments/<COMMENT_ID>/reactions -f content=+1
|
|
227
|
+
# rebutted finding:
|
|
228
|
+
gh api --method POST repos/{owner}/{repo}/pulls/comments/<COMMENT_ID>/reactions -f content=-1
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
Reply first, then react, then resolve: the reaction is not a substitute for the reply, and a
|
|
232
|
+
resolved thread with no reply loses the reasoning.
|
|
233
|
+
|
|
207
234
|
Resolve a thread only for comments authored by `gemini-code-assist[bot]` that you have fixed or
|
|
208
235
|
rebutted: never blanket-resolve, and never resolve a human reviewer's thread.
|
|
209
236
|
|
|
@@ -221,6 +248,7 @@ Stop when **any** is true:
|
|
|
221
248
|
- Zero unresolved `gemini-code-assist[bot]` comments remain, and every comment this round was fixed
|
|
222
249
|
or rebutted+resolved. (There is no score to hit: this is "done".)
|
|
223
250
|
- Max iterations (5) reached: report what remains.
|
|
251
|
+
- Gemini never responded after one retry: report the timeout honestly; do not claim success.
|
|
224
252
|
|
|
225
253
|
## 4. Report
|
|
226
254
|
|
|
@@ -86,6 +86,31 @@ No nitpicking. Critical and Important findings are reserved for things that
|
|
|
86
86
|
could cause bugs, outages, data loss, security incidents, or real performance
|
|
87
87
|
problems at scale.
|
|
88
88
|
|
|
89
|
+
**Boundary-first review rule:** for stateful or integration-heavy changes,
|
|
90
|
+
review the complete behavioral chain rather than the changed helper alone:
|
|
91
|
+
|
|
92
|
+
```text
|
|
93
|
+
production entry point
|
|
94
|
+
→ decision point
|
|
95
|
+
→ runtime realization
|
|
96
|
+
→ downstream consumer
|
|
97
|
+
→ persistence/cache/cleanup owner
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
Require the review to distinguish logical identity from physical/runtime
|
|
101
|
+
identity, and to test the relevant transition matrix: success, `null`, `undefined`,
|
|
102
|
+
exception, retry, fallback, rotation, cache reuse/eviction, proxy parity, and
|
|
103
|
+
quoted/history input where applicable. A copied helper test is isolated
|
|
104
|
+
evidence, not proof that the production boundary works.
|
|
105
|
+
|
|
106
|
+
Every verdict-affecting finding should carry a boundary map and an evidence
|
|
107
|
+
class. The report must distinguish source inspection, isolated tests,
|
|
108
|
+
repository tests, composed production-entry probes, production probes, and
|
|
109
|
+
hosted CI. Never upgrade one evidence class into another in the wording.
|
|
110
|
+
|
|
111
|
+
After a fix, re-run the original proof *and* audit the newly changed lifecycle
|
|
112
|
+
boundary for regressions. A green reproduction is necessary, not sufficient.
|
|
113
|
+
|
|
89
114
|
**HARD RULE: the `## 💰 Review Cost` block is mandatory.** Every review MUST
|
|
90
115
|
end with an evidence-backed cost block and no `<N>` placeholders. Use real
|
|
91
116
|
numbers for measurements the host exposes; follow `references/output-format.md`
|
|
@@ -289,7 +314,7 @@ page for this PR.
|
|
|
289
314
|
| Review agents | 2 triage (haiku) | 5 specialists (sonnet) | 5 specialists (sonnet) |
|
|
290
315
|
| Per-finding verification | Criticals + Importants | Criticals + Importants | Criticals + Importants |
|
|
291
316
|
| Completeness critic | skip | skip | included |
|
|
292
|
-
| Proof-of-bug (failing test per Critical) | skip | included (max 5) | included (max 5) |
|
|
317
|
+
| Proof-of-bug (failing test per Critical or composed-boundary Important) | skip | included (max 5) | included (max 5) |
|
|
293
318
|
| Living review artifact | included | included | included |
|
|
294
319
|
| Housekeeping (optional memory/notes writeback) | skip | included | included |
|
|
295
320
|
| `--post` | supported | supported | supported |
|
package/plugins/olko-github-pr/skills/lekker-review/references/agents/completeness-critic.md
CHANGED
|
@@ -14,6 +14,18 @@ were declared "no findings" too quickly. For each angle:
|
|
|
14
14
|
Be concrete: cite diff lines, not vibes. If you genuinely cannot find a missed
|
|
15
15
|
angle, return "No gaps found."
|
|
16
16
|
|
|
17
|
+
Always consider these maintainer-grade gaps before returning no gaps:
|
|
18
|
+
- the real production entry point and downstream consumer were not exercised;
|
|
19
|
+
- the selected value was not traced through runtime realization, persistence,
|
|
20
|
+
cleanup, cache reuse, or fallback;
|
|
21
|
+
- logical identity was conflated with physical/runtime identity;
|
|
22
|
+
- a state-transition matrix is missing for `None`, exceptions, retries,
|
|
23
|
+
rotation, proxying, or alternate transport;
|
|
24
|
+
- the fix was checked only against the original symptom, not for a new defect
|
|
25
|
+
introduced at the changed ordering or lifecycle boundary;
|
|
26
|
+
- the evidence is an isolated harness or local test but the review claims
|
|
27
|
+
composed behavior or hosted-CI acceptance.
|
|
28
|
+
|
|
17
29
|
Agent findings:
|
|
18
30
|
<AGENT_FINDINGS_SUMMARY>
|
|
19
31
|
|
|
@@ -37,7 +37,32 @@ Axes to cover:
|
|
|
37
37
|
sort/dedup on large arrays that could be done at DB level.
|
|
38
38
|
- Integration Contracts: Shopify API misuse, BC API assumptions, webhook
|
|
39
39
|
idempotency, external API pagination not handled.
|
|
40
|
-
|
|
40
|
+
|
|
41
|
+
Boundary contract and lifecycle map (required for every Critical/Important
|
|
42
|
+
finding involving routing, persistence, caching, fallback, proxying, or an
|
|
43
|
+
external integration):
|
|
44
|
+
- `entryPoint`: identify the real production trigger that reaches the changed
|
|
45
|
+
code (HTTP route, webhook, CLI command, queue consumer, gateway ingress, etc.).
|
|
46
|
+
- `decisionPoint`: identify where the behavior is selected or transformed.
|
|
47
|
+
- `realizationPoint`: identify where the selected behavior becomes runtime state.
|
|
48
|
+
- `consumer`: identify the downstream consumer that actually relies on the
|
|
49
|
+
contract, not merely the helper that constructs it.
|
|
50
|
+
- `stateOwner`: identify the durable/session/cache owner when state crosses a
|
|
51
|
+
turn, request, retry, or process boundary.
|
|
52
|
+
- `identityDimensions`: list every identity that must remain distinct, such as
|
|
53
|
+
logical session key, physical session id, provider alias, resolved provider,
|
|
54
|
+
model, and API mode.
|
|
55
|
+
- `transitions`: list the relevant success, `null`, `undefined`, exception, retry, fallback,
|
|
56
|
+
session-rotation, cache-reuse, and proxy/alternate-transport transitions.
|
|
57
|
+
- `evidenceClass`: label the strongest evidence actually checked: `source`,
|
|
58
|
+
`isolated-test`, `repository-test`, `composed-test`, `production-probe`, or
|
|
59
|
+
`hosted-ci`. Never call an isolated harness a production-path proof.
|
|
60
|
+
|
|
61
|
+
Do not report a stateful/integration finding without this boundary object. If
|
|
62
|
+
the production entry point or downstream consumer cannot be identified, mark
|
|
63
|
+
the claim as unverified rather than inferring behavior from a helper alone.
|
|
64
|
+
|
|
65
|
+
GraphQL pagination (GQL-1): for every GraphQL query in the diff that uses a
|
|
41
66
|
nodes connection (`nodes { ... }`):
|
|
42
67
|
(a) Check that `pageInfo { hasNextPage endCursor }` is present alongside nodes: if missing, Critical.
|
|
43
68
|
(b) Check that all pages are fetched (a loop or recursion using endCursor): a single-page fetch is a bug, Critical.
|
|
@@ -4,11 +4,18 @@
|
|
|
4
4
|
|
|
5
5
|
## Mission
|
|
6
6
|
|
|
7
|
-
A Critical finding
|
|
7
|
+
A Critical finding, or an Important finding with a composed boundary map, is an
|
|
8
|
+
argument until someone runs it. Your job is to turn it
|
|
8
9
|
into a demonstration: write ONE test that asserts the CORRECT behavior of the
|
|
9
10
|
code the finding targets, run it in the real worktree, and capture it failing
|
|
10
11
|
for the exact reason the finding claims.
|
|
11
12
|
|
|
13
|
+
For a finding with `boundary`, prefer entering through the recorded production
|
|
14
|
+
entry point and reaching the recorded downstream consumer. Do not replace a
|
|
15
|
+
composed proof with a copied helper test just because the helper is easier to
|
|
16
|
+
import. If full composition is impossible, report the strongest lower evidence
|
|
17
|
+
class honestly.
|
|
18
|
+
|
|
12
19
|
Write the test as if the bug were already fixed. It must fail today precisely
|
|
13
20
|
*because* it isn't fixed. **Never write a test that asserts the buggy behavior
|
|
14
21
|
just to have something red** -- a proof that asserts wrongness is worthless and
|
|
@@ -128,8 +128,26 @@ g) Mock smell: test the behavior, not the way it's built
|
|
|
128
128
|
(time, randomness, injected network failure), or a dependency that genuinely
|
|
129
129
|
cannot run in the test environment. The tell for a good mock: the behavior
|
|
130
130
|
under test only exists because the boundary did something (e.g. a retry
|
|
131
|
-
|
|
132
|
-
|
|
131
|
+
banner that appears only when the fetch rejects). Even then, prefer an
|
|
132
|
+
injected simple fake over a module-level spy, and assert what the user sees.
|
|
133
|
+
|
|
134
|
+
h) Composed boundary and transition coverage
|
|
135
|
+
For every stateful or integration-heavy change, do not stop at testing the
|
|
136
|
+
helper. Trace the real entry point through the decision point, runtime
|
|
137
|
+
realization, downstream consumer, and persistence/cleanup owner. Require a
|
|
138
|
+
test or explicit evidence for the relevant transition matrix:
|
|
139
|
+
- success, `None`, exception, and disabled-feature paths;
|
|
140
|
+
- retry and fallback behavior;
|
|
141
|
+
- session/request rotation and cache reuse or eviction;
|
|
142
|
+
- proxy or alternate transport parity;
|
|
143
|
+
- quoted/history input versus newly authored input;
|
|
144
|
+
- provider/model/API-mode identity when routing is involved.
|
|
145
|
+
|
|
146
|
+
A test that only asserts a helper return value is `isolated-test` evidence,
|
|
147
|
+
not `composed-test` evidence. Flag a Critical/Important finding when the
|
|
148
|
+
changed contract is consumed through a different path than the test covers,
|
|
149
|
+
or when the test can pass while the stateful consumer still receives the
|
|
150
|
+
wrong identity or ordering.
|
|
133
151
|
|
|
134
152
|
Report each per-line issue as:
|
|
135
153
|
`test-file:line, <concise description of the gap or weakness>`
|
|
@@ -123,6 +123,31 @@ convention finding with no verifiable precedent does not ship.
|
|
|
123
123
|
|
|
124
124
|
---
|
|
125
125
|
|
|
126
|
+
## Step 4b -- Boundary contract and evidence check
|
|
127
|
+
|
|
128
|
+
For any Critical/Important finding involving routing, persistence, caching,
|
|
129
|
+
fallback, proxying, quoted input, or an external integration, read the
|
|
130
|
+
finding's `boundary` object. It should identify the real production entry
|
|
131
|
+
point, decision point, runtime realization point, downstream consumer, state
|
|
132
|
+
owner, and relevant identity dimensions/transitions.
|
|
133
|
+
|
|
134
|
+
Reconstruct the path in `WORKTREE_PATH` from entry point to consumer. A copied
|
|
135
|
+
helper test or a mock that never reaches the consumer is only isolated
|
|
136
|
+
evidence. Do not confirm a verdict-affecting finding as production-path proof
|
|
137
|
+
unless the claimed failure reaches the stateful consumer or the review clearly
|
|
138
|
+
labels the evidence as isolated.
|
|
139
|
+
|
|
140
|
+
If the finding has no boundary object or no usable production entry point or
|
|
141
|
+
consumer, keep it unverified and non-blocking; drop it when the missing boundary
|
|
142
|
+
is the crux of the claim. The workflow enforces this as an unverified observation
|
|
143
|
+
even if a verifier confirms it. Record the strongest evidence class actually checked
|
|
144
|
+
(`source`, `isolated-test`, `repository-test`, `composed-test`,
|
|
145
|
+
`production-probe`, or `hosted-ci`) in the reasoning.
|
|
146
|
+
|
|
147
|
+
Build a small transition matrix for the affected contract. At minimum check
|
|
148
|
+
success, `null`, `undefined`, exception, retry/fallback, state rotation, cache reuse or
|
|
149
|
+
eviction, and proxy/alternate transport whenever those transitions exist.
|
|
150
|
+
|
|
126
151
|
## Step 5 -- Fix validation
|
|
127
152
|
|
|
128
153
|
Before confirming the finding, identify the callers and consumers of the changed
|
|
@@ -210,6 +210,29 @@ check after any revert triggered here before moving on.
|
|
|
210
210
|
|
|
211
211
|
---
|
|
212
212
|
|
|
213
|
+
## Step 5c -- Fix delta audit
|
|
214
|
+
|
|
215
|
+
After the original proof flips red → green, audit the *new* boundary created by
|
|
216
|
+
the fix. Do not assume that making the original assertion pass makes the
|
|
217
|
+
lifecycle safe.
|
|
218
|
+
|
|
219
|
+
For each fixed Critical/Important finding involving state, routing, ordering,
|
|
220
|
+
proxying, persistence, caching, fallback, or quoted input:
|
|
221
|
+
|
|
222
|
+
1. Re-read the entire changed path from the production entry point to the
|
|
223
|
+
downstream consumer.
|
|
224
|
+
2. Re-run the relevant transition matrix: success, `None`, exception, retry,
|
|
225
|
+
fallback, rotation, cache reuse/eviction, and alternate transport where
|
|
226
|
+
applicable.
|
|
227
|
+
3. Check that logical identity, runtime identity, provider/API identity, and
|
|
228
|
+
durable identity are still distinct where the contract requires it.
|
|
229
|
+
4. Add a focused regression probe when the fix moved work across an ordering or
|
|
230
|
+
lifecycle boundary. The probe must enter through the real path when feasible.
|
|
231
|
+
|
|
232
|
+
If the audit finds a new failure, revert the whole group and mark it
|
|
233
|
+
`failed: fix-delta-regression`. A green original proof is not sufficient to
|
|
234
|
+
commit a fix that breaks a neighboring transition.
|
|
235
|
+
|
|
213
236
|
## Step 6 -- Commit (local only)
|
|
214
237
|
|
|
215
238
|
One commit per file group, in group order. Stage explicitly -- never `git add -A`,
|