@olegkoval/agent-skills 1.24.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.
- package/.claude-plugin/plugin.json +9 -2
- package/.cursor-plugin/index.json +35 -0
- package/.grok-plugin/index.json +35 -0
- package/.kiro/steering/codexloop.md +254 -0
- package/.kiro/steering/geminiloop.md +230 -0
- package/.kiro/steering/pr-finalize-complete.md +187 -0
- package/.kiro/steering/pr-finalize.md +140 -0
- package/.windsurf/rules/codexloop.md +253 -0
- package/.windsurf/rules/geminiloop.md +229 -0
- package/.windsurf/rules/pr-finalize-complete.md +186 -0
- package/.windsurf/rules/pr-finalize.md +139 -0
- package/README.md +10 -3
- package/catalog/skills.json +176 -6
- package/package.json +1 -1
- package/packages/software-development/codexloop/SKILL.md +261 -0
- package/packages/software-development/codexloop/adapters/claude/plugin.json +5 -0
- package/packages/software-development/codexloop/adapters/claude/skills/codexloop/SKILL.md +262 -0
- package/packages/software-development/codexloop/adapters/codex/README.md +26 -0
- package/packages/software-development/codexloop/adapters/cursor/plugin.json +6 -0
- package/packages/software-development/codexloop/adapters/cursor/skills/codexloop/SKILL.md +263 -0
- package/packages/software-development/codexloop/adapters/grok/plugin.json +6 -0
- package/packages/software-development/codexloop/adapters/grok/skills/codexloop/SKILL.md +262 -0
- package/packages/software-development/codexloop/adapters/kiro/steering/codexloop.md +254 -0
- package/packages/software-development/codexloop/adapters/windsurf/rules/codexloop.md +253 -0
- package/packages/software-development/dependabot-triage/SKILL.md +150 -0
- package/packages/software-development/dependabot-triage/adapters/claude/plugin.json +5 -0
- package/packages/software-development/dependabot-triage/adapters/claude/skills/dependabot-triage/SKILL.md +151 -0
- package/packages/software-development/dependabot-triage/adapters/codex/README.md +19 -0
- package/packages/software-development/dependabot-triage/adapters/cursor/plugin.json +6 -0
- package/packages/software-development/dependabot-triage/adapters/cursor/skills/dependabot-triage/SKILL.md +151 -0
- package/packages/software-development/dependabot-triage/adapters/grok/plugin.json +6 -0
- package/packages/software-development/dependabot-triage/adapters/grok/skills/dependabot-triage/SKILL.md +151 -0
- package/packages/software-development/geminiloop/SKILL.md +237 -0
- package/packages/software-development/geminiloop/adapters/claude/plugin.json +5 -0
- package/packages/software-development/geminiloop/adapters/claude/skills/geminiloop/SKILL.md +238 -0
- package/packages/software-development/geminiloop/adapters/codex/README.md +25 -0
- package/packages/software-development/geminiloop/adapters/cursor/plugin.json +6 -0
- package/packages/software-development/geminiloop/adapters/cursor/skills/geminiloop/SKILL.md +239 -0
- package/packages/software-development/geminiloop/adapters/grok/plugin.json +6 -0
- package/packages/software-development/geminiloop/adapters/grok/skills/geminiloop/SKILL.md +238 -0
- package/packages/software-development/geminiloop/adapters/kiro/steering/geminiloop.md +230 -0
- package/packages/software-development/geminiloop/adapters/windsurf/rules/geminiloop.md +229 -0
- package/packages/software-development/pr-finalize/SKILL.md +149 -0
- package/packages/software-development/pr-finalize/adapters/claude/plugin.json +5 -0
- package/packages/software-development/pr-finalize/adapters/claude/skills/pr-finalize/SKILL.md +150 -0
- package/packages/software-development/pr-finalize/adapters/codex/README.md +26 -0
- package/packages/software-development/pr-finalize/adapters/cursor/plugin.json +6 -0
- package/packages/software-development/pr-finalize/adapters/cursor/skills/pr-finalize/SKILL.md +151 -0
- package/packages/software-development/pr-finalize/adapters/grok/plugin.json +6 -0
- package/packages/software-development/pr-finalize/adapters/grok/skills/pr-finalize/SKILL.md +150 -0
- package/packages/software-development/pr-finalize/adapters/kiro/steering/pr-finalize.md +140 -0
- package/packages/software-development/pr-finalize/adapters/windsurf/rules/pr-finalize.md +139 -0
- package/packages/software-development/pr-finalize-complete/SKILL.md +195 -0
- package/packages/software-development/pr-finalize-complete/adapters/claude/plugin.json +5 -0
- package/packages/software-development/pr-finalize-complete/adapters/claude/skills/pr-finalize-complete/SKILL.md +196 -0
- package/packages/software-development/pr-finalize-complete/adapters/codex/README.md +24 -0
- package/packages/software-development/pr-finalize-complete/adapters/cursor/plugin.json +6 -0
- package/packages/software-development/pr-finalize-complete/adapters/cursor/skills/pr-finalize-complete/SKILL.md +197 -0
- package/packages/software-development/pr-finalize-complete/adapters/grok/plugin.json +6 -0
- package/packages/software-development/pr-finalize-complete/adapters/grok/skills/pr-finalize-complete/SKILL.md +196 -0
- package/packages/software-development/pr-finalize-complete/adapters/kiro/steering/pr-finalize-complete.md +187 -0
- package/packages/software-development/pr-finalize-complete/adapters/windsurf/rules/pr-finalize-complete.md +186 -0
- package/packages/software-development/pr-to-green/SKILL.md +165 -0
- package/packages/software-development/pr-to-green/adapters/claude/plugin.json +5 -0
- package/packages/software-development/pr-to-green/adapters/claude/skills/pr-to-green/SKILL.md +166 -0
- package/packages/software-development/pr-to-green/adapters/codex/README.md +19 -0
- package/packages/software-development/pr-to-green/adapters/cursor/plugin.json +6 -0
- package/packages/software-development/pr-to-green/adapters/cursor/skills/pr-to-green/SKILL.md +166 -0
- package/packages/software-development/pr-to-green/adapters/grok/plugin.json +6 -0
- package/packages/software-development/pr-to-green/adapters/grok/skills/pr-to-green/SKILL.md +166 -0
- package/packages/software-development/store-listing-copy/SKILL.md +215 -0
- package/packages/software-development/store-listing-copy/adapters/claude/plugin.json +5 -0
- package/packages/software-development/store-listing-copy/adapters/claude/skills/store-listing-copy/SKILL.md +216 -0
- package/packages/software-development/store-listing-copy/adapters/codex/README.md +20 -0
- package/packages/software-development/store-listing-copy/adapters/cursor/plugin.json +6 -0
- package/packages/software-development/store-listing-copy/adapters/cursor/skills/store-listing-copy/SKILL.md +216 -0
- package/packages/software-development/store-listing-copy/adapters/grok/plugin.json +6 -0
- package/packages/software-development/store-listing-copy/adapters/grok/skills/store-listing-copy/SKILL.md +216 -0
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
<!-- Generated by scripts/build-adapters.sh. Do not edit directly. -->
|
|
2
|
+
|
|
3
|
+
---
|
|
4
|
+
inclusion: manual
|
|
5
|
+
description: "Confirms a PR is genuinely merge-ready when the work is already believed done: re-checks every review-bot and human finding against the current code, separates stale comments from fixed ones, runs the repo's real lint and test gates, and reports the evidence rather than the assumption."
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# PR Finalize Complete
|
|
9
|
+
|
|
10
|
+
Confirm a PR is genuinely merge-ready -- even when all issues were already addressed -- by verifying the evidence, not trusting the assumption.
|
|
11
|
+
|
|
12
|
+
## When to use this vs pr-finalize
|
|
13
|
+
|
|
14
|
+
Use pr-finalize-complete when:
|
|
15
|
+
- The branch owner says "it should be fixed already" and you need to confirm
|
|
16
|
+
- Review bot findings may be stale (comments on old file paths, already-changed code)
|
|
17
|
+
- You need to produce a verification report, not just drive fixes
|
|
18
|
+
-- CI was green before but you need to re-confirm after a rebase
|
|
19
|
+
|
|
20
|
+
Use pr-finalize when starting from scratch on an unaddressed PR.
|
|
21
|
+
|
|
22
|
+
## Inputs
|
|
23
|
+
|
|
24
|
+
- **PR number or URL** (optional): detect from the current branch if not given.
|
|
25
|
+
- `--no-push` (optional): run all verification steps but skip the final push.
|
|
26
|
+
|
|
27
|
+
## Non-negotiables
|
|
28
|
+
|
|
29
|
+
- **Never claim a test passed without running it.** Report the actual exit code and test count.
|
|
30
|
+
- **Never resolve a bot comment without checking whether the issue still exists in the current code.** Stale comments are common and silently resolving them is wrong.
|
|
31
|
+
- **Never git add -A.** Start with a clean tree; stage only files your fixes actually touched.
|
|
32
|
+
- **Stale comments are not done -- they are no longer applicable.** Distinguish the two in your report.
|
|
33
|
+
|
|
34
|
+
## Instructions
|
|
35
|
+
|
|
36
|
+
### 1. Establish ground truth
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
gh pr view <PR> --json number,title,body,state,isDraft,headRefName,baseRefName,mergeable,mergeStateStatus,reviews,statusCheckRollup,url
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
Record before touching anything:
|
|
43
|
+
|
|
44
|
+
- Is the branch **clean** (`git status --porcelain` empty)?
|
|
45
|
+
- Is the branch **behind** `origin/<base>`?
|
|
46
|
+
- What **checks are currently failing**, and which are required?
|
|
47
|
+
- Which bots have actually posted (completed, not just triggered)?
|
|
48
|
+
|
|
49
|
+
### 2. Rebase only if needed
|
|
50
|
+
|
|
51
|
+
If mergeable is CONFLICTING or the branch is behind its base:
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
git fetch origin <base>
|
|
55
|
+
git rebase origin/<base>
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
Resolve conflicts by understanding both sides. After resolving, run tests before continuing.
|
|
59
|
+
If there is no conflict, skip this step -- do not rebase speculatively.
|
|
60
|
+
|
|
61
|
+
### 3. Triage existing review comments
|
|
62
|
+
|
|
63
|
+
Collect all findings:
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
gh api repos/{owner}/{repo}/pulls/<PR>/comments --paginate
|
|
67
|
+
gh api repos/{owner}/{repo}/issues/<PR>/comments --paginate
|
|
68
|
+
gh pr view <PR> --json reviews
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
For each unresolved finding, determine its actual current status in the code:
|
|
72
|
+
|
|
73
|
+
| Status | Meaning | Action |
|
|
74
|
+
|---|---|---|
|
|
75
|
+
| Already fixed | Code the comment targets has been changed and issue no longer exists | Verify in code, reply confirming fix, resolve |
|
|
76
|
+
| Stale | Comment targets a file/line/symbol that no longer exists | Verify, reply noting it is stale, resolve |
|
|
77
|
+
| Still present | Issue exists in current code | Fix it, commit, reply, resolve |
|
|
78
|
+
| False positive | Bot diagnosis is wrong for this codebase | Reply with specific rebuttal, leave open |
|
|
79
|
+
| Needs human | Product/architecture decision required | Reply, leave open, surface in report |
|
|
80
|
+
|
|
81
|
+
A comment is stale if the file it targets has been deleted or
|
|
82
|
+
renamed, the function or class it names no longer exists, or the
|
|
83
|
+
issue was flagged on an old line that has since been rewritten.
|
|
84
|
+
|
|
85
|
+
Check for staleness before any fix attempt:
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
gh api repos/{owner}/{repo}/pulls/<PR>/files --paginate
|
|
89
|
+
git diff origin/<base>...HEAD =- <file>
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
For stale comments: verify in current HEAD, reply explaining what changed, then resolve.
|
|
93
|
+
|
|
94
|
+
### 4. Verify test coverage
|
|
95
|
+
|
|
96
|
+
Find changed files:
|
|
97
|
+
|
|
98
|
+
```bash
|
|
99
|
+
gh pr view <PR> --json files -q '.files[].path'
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
For each changed module: check for a direct unit test file, confirm
|
|
103
|
+
it exercises the specific code paths changed, and run it to verify
|
|
104
|
+
impasses.
|
|
105
|
+
|
|
106
|
+
If a module has no direct unit tests but is only indirectly covered,
|
|
107
|
+
that is a real gap. Add direct tests unless the coverage gap is
|
|
108
|
+
explicitly justified.
|
|
109
|
+
|
|
110
|
+
### 5. Run the real gates
|
|
111
|
+
|
|
112
|
+
Discover from the repo -- do not guess target names:
|
|
113
|
+
|
|
114
|
+
```bash
|
|
115
|
+
cat package.json | jq '.scripts'
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
Run in order: lint, format check, full test suite. Capture the actual
|
|
119
|
+
exit code and output. Do not push if any required gate is red.
|
|
120
|
+
|
|
121
|
+
### 6. Push and report
|
|
122
|
+
|
|
123
|
+
If there were changes to commit:
|
|
124
|
+
|
|
125
|
+
```bash
|
|
126
|
+
git add <only files you touched>
|
|
127
|
+
git commit -m "address review feedback and verify tests"
|
|
128
|
+
git push --force-with-lease
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
Post one PR comment with a verifiable summary: rebase status, each
|
|
132
|
+
finding and its disposition, test coverage decision, and verbatim
|
|
133
|
+
gate output with real numbers.
|
|
134
|
+
|
|
135
|
+
### 7. Verify final state
|
|
136
|
+
|
|
137
|
+
```bash
|
|
138
|
+
gh pr view <PR> --json mergeable,mergeStateStatus,statusCheckRollup
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
Poll until checks complete. If anything that was green went red,
|
|
142
|
+
diagnose and fix before declaring done.
|
|
143
|
+
|
|
144
|
+
## Common patterns
|
|
145
|
+
|
|
146
|
+
### Pattern: All issues already fixed
|
|
147
|
+
|
|
148
|
+
When a bot shows open findings but the branch owner believes they
|
|
149
|
+
are all resolved:
|
|
150
|
+
1. Do not trust the assertion -- verify each one in the current code.
|
|
151
|
+
2. Stale comments are the most common case: the code was refactored
|
|
152
|
+
and the bot finding path no longer exists.
|
|
153
|
+
3. Distinguish "already fixed before bot ran" from "fixed in a later
|
|
154
|
+
commit the bot has not re-reviewed yet".
|
|
155
|
+
4. Re-trigger the bot if it has not reviewed current HEAD.
|
|
156
|
+
|
|
157
|
+
### Pattern: Direct unit tests missing
|
|
158
|
+
|
|
159
|
+
Bots frequently flag helper functions exercised only through callers.
|
|
160
|
+
Add a direct test for the helper itself -- do not rely on indirect
|
|
161
|
+
coverage through a caller integration test.
|
|
162
|
+
|
|
163
|
+
### Pattern: Branch conflict with rewritten shared file
|
|
164
|
+
|
|
165
|
+
When rebase hits a conflict in a file both branches modified:
|
|
166
|
+
1. Run git log to understand what main changed and why.
|
|
167
|
+
2. Read the purpose of the main-side hunk -- it is usually an invariant
|
|
168
|
+
your branch is unaware of.
|
|
169
|
+
3. Apply main's change to your version of the file, then re-run
|
|
170
|
+
the affected tests.
|
|
171
|
+
4. Document which invariant you preserved in your PR comment.
|
|
172
|
+
|
|
173
|
+
### Pattern: CI flaky on first push
|
|
174
|
+
|
|
175
|
+
Before declaring a gate failure real:
|
|
176
|
+
1. Check if the failure is in a known flaky test.
|
|
177
|
+
2. Check if the failure is in a linter with a stale cache from a
|
|
178
|
+
different worktree.
|
|
179
|
+
3. Re-run the specific failing check once before fixing.
|
|
180
|
+
4. Only fix if the failure reproduces on re-run.
|
|
181
|
+
|
|
182
|
+
## Related skills
|
|
183
|
+
|
|
184
|
+
- pr-finalize -- drive a PR from scratch to merge-ready when comments are unaddressed.
|
|
185
|
+
- qodoloop -- full Qodo thread protocol (per-finding Agent Prompts, resolve mutations).
|
|
186
|
+
- coderabbitloop -- full CodeRabbit thread protocol.
|
|
187
|
+
- ci-fix-loop -- when the blocker is a failing CI pipeline, not review feedback.
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
<!-- Generated by scripts/build-adapters.sh. Do not edit directly. -->
|
|
2
|
+
|
|
3
|
+
---
|
|
4
|
+
inclusion: manual
|
|
5
|
+
description: "Drives one GitHub PR to genuinely merge-ready: rebases and resolves conflicts, sweeps every review bot and human comment to zero unaddressed findings, verifies unit and E2E coverage actually exists, runs the repo's real lint/format/test gates before pushing, and reports what still needs a human."
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# PR Finalize
|
|
9
|
+
|
|
10
|
+
One PR, taken all the way to merge-ready. The job is not "make the bots stop talking" — it is **land the change in a state a careful reviewer would sign off on**, with evidence for every claim.
|
|
11
|
+
|
|
12
|
+
## Inputs
|
|
13
|
+
|
|
14
|
+
- **PR number or URL** (optional): detect from the current branch if not given.
|
|
15
|
+
- `--no-push` (optional): do everything except the final push. Use when the repo auto-merges and the user wants to eyeball first.
|
|
16
|
+
|
|
17
|
+
## Non-negotiables
|
|
18
|
+
|
|
19
|
+
These are the failure modes this skill exists to prevent. Violating one makes the whole run worthless:
|
|
20
|
+
|
|
21
|
+
- **Never report a gate as passing without having run it.** Paste the real output. "Tests should pass" is not a result.
|
|
22
|
+
- **Never resolve or claim-fix a finding you didn't actually fix.** Blocked is an honest outcome; a false "done" is not.
|
|
23
|
+
- **Never `git add -A`.** Stage only the files your fixes touched. Start from a clean tree so that's safe.
|
|
24
|
+
- **Never invent test coverage.** If the change has no browser-reachable surface, say so explicitly and name the suite that *is* the real gate. Do not add a hollow E2E test to look thorough.
|
|
25
|
+
- **A green CI badge is not proof.** Many repos split their required check from the full suite (browser-free half only, etc.). Find out what the required check actually runs.
|
|
26
|
+
|
|
27
|
+
## Instructions
|
|
28
|
+
|
|
29
|
+
### 1. Establish the ground truth
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
gh pr view <PR> --json number,title,body,state,isDraft,headRefName,baseRefName,mergeable,mergeStateStatus,labels,reviewDecision,statusCheckRollup,url
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
Record four things before touching code:
|
|
36
|
+
|
|
37
|
+
- **`mergeable`** — `CONFLICTING` means step 2 is mandatory.
|
|
38
|
+
- **Which checks are failing**, and for each, whether it is *required*. Check branch protection (`gh api repos/{owner}/{repo}/branches/<base>/protection`) rather than assuming — a red optional job (a flaky bot-review runner, a nightly) is not a blocker, and burning the run waiting on one is a classic waste.
|
|
39
|
+
- **Whether the repo auto-merges.** Look for a shepherd/automerge workflow in `.github/workflows/` and read its *gating conditions* (required labels, required checks). If pushing could trigger an immediate merge, decide deliberately: either satisfy the review sweep first, or tell the user before you push. Never let an auto-merge race a review you were asked to complete.
|
|
40
|
+
- **Whether a bot review actually ran.** A `SUCCESS` status from a review bot can still mean "rate-limited, never reviewed" — read its comment body, not just the check state.
|
|
41
|
+
|
|
42
|
+
### 2. Rebase onto the base branch
|
|
43
|
+
|
|
44
|
+
Require a clean tree first (`git status --porcelain` empty), then:
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
git fetch origin <base>
|
|
48
|
+
git rebase origin/<base>
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
Resolve conflicts by **understanding both sides**, not by picking one. Read the base-side commit that introduced the conflicting hunk (`git log -1 --format=%s <base> -- <file>`, then the diff) — a conflict usually means main changed an invariant your branch is unaware of, and blindly keeping "your" side silently reverts it. State in the PR comment which invariant you preserved and why.
|
|
52
|
+
|
|
53
|
+
After resolving, re-run the tests before continuing — a rebase that compiles is not a rebase that works.
|
|
54
|
+
|
|
55
|
+
### 3. Sweep every review source
|
|
56
|
+
|
|
57
|
+
Collect findings from all of these; do not stop at the first:
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
# inline review threads (all bots + humans), with resolution state
|
|
61
|
+
gh api repos/{owner}/{repo}/pulls/<PR>/comments --paginate
|
|
62
|
+
# rollup issue comments (where CodeRabbit/Qodo post summaries and rate-limit notices)
|
|
63
|
+
gh api repos/{owner}/{repo}/issues/<PR>/comments --paginate
|
|
64
|
+
# formal reviews
|
|
65
|
+
gh pr view <PR> --json reviews
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
**Delegate to the dedicated loop skill when one exists** rather than reimplementing its bot's protocol — `qodoloop` for Qodo, `coderabbitloop` for CodeRabbit, `greploop` for Greptile. Each already encodes that bot's posting shape, its ready-made per-finding fix prompt, and its real terminal states. Use this skill's own sweep for human comments and for bots without a dedicated loop.
|
|
69
|
+
|
|
70
|
+
Triage every finding into exactly one bucket:
|
|
71
|
+
|
|
72
|
+
| Bucket | Action |
|
|
73
|
+
|---|---|
|
|
74
|
+
| **Real defect** | Fix it. This is the point of the exercise. |
|
|
75
|
+
| **Legitimate improvement** | Fix it if it's in scope for this PR. |
|
|
76
|
+
| **False positive** | Reply explaining *specifically* why the bot is wrong. Do not resolve silently. |
|
|
77
|
+
| **Needs a human call** | Reply, leave open, surface in the final report. |
|
|
78
|
+
|
|
79
|
+
Bot findings are suggestions from something that has not run the code. A "🐞 Bug" label is a hypothesis — verify it against the actual source before fixing, and against the actual behavior before dismissing.
|
|
80
|
+
|
|
81
|
+
### 4. Close the coverage gap
|
|
82
|
+
|
|
83
|
+
Ask, for the change as a whole, what would catch a regression here — then check whether the PR actually has it.
|
|
84
|
+
|
|
85
|
+
- **Unit / integration tests:** does every new branch have a test that fails if you invert it? Bots frequently and correctly flag helper functions exercised only *indirectly* through a caller. A direct test per branch is cheap and is usually the right response.
|
|
86
|
+
- **Browser / E2E tests:** determine whether the repo supports them (`playwright.config.*`, `cypress.config.*`, a `test:e2e` script) **and** whether this change has any surface they can reach. Then do one of exactly two things:
|
|
87
|
+
- it has a reachable surface → add or extend the E2E spec;
|
|
88
|
+
- it does not → **say so explicitly in the PR comment**, name why (e.g. "this is entirely inside a Durable Object alarm loop; the E2E harness only serves static assets"), and name the suite that is the real gate.
|
|
89
|
+
|
|
90
|
+
Silence here reads as an oversight. An explicit "not applicable, because X" reads as diligence — and is checkable.
|
|
91
|
+
|
|
92
|
+
### 5. Run the real gates
|
|
93
|
+
|
|
94
|
+
Discover them from the repo (`Makefile`, `package.json` scripts, CI workflow) — do not guess target names. Run, at minimum, the equivalents of:
|
|
95
|
+
|
|
96
|
+
```bash
|
|
97
|
+
<lint> # e.g. make lint / npm run lint
|
|
98
|
+
<format> # check mode first; only write if it reports drift
|
|
99
|
+
<tests> # the suite covering the changed package
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
Capture exit codes, not just output. Repo-specific traps worth checking for before you burn a cycle: linters whose cache replays findings from deleted sibling worktrees, formatters whose local toolchain version outruns CI's (churning unrelated files), and test runners that hang when two runs overlap.
|
|
103
|
+
|
|
104
|
+
If a gate fails, fix it. Do not push red.
|
|
105
|
+
|
|
106
|
+
### 6. Push and explain
|
|
107
|
+
|
|
108
|
+
Stage only the files you touched, commit, and push (`--force-with-lease` after a rebase — never bare `--force`).
|
|
109
|
+
|
|
110
|
+
Then post **one** PR comment that a reviewer can audit without re-reading the diff:
|
|
111
|
+
|
|
112
|
+
- what the rebase conflict was and which side won, with the reason;
|
|
113
|
+
- each finding, and what you did about it (including the ones you rejected, with the argument);
|
|
114
|
+
- the coverage decision from step 4, including the explicit not-applicable if that's the answer;
|
|
115
|
+
- **verbatim** gate output — real numbers (`# pass 480 / # fail 0`, `0 issues.`), not adjectives.
|
|
116
|
+
|
|
117
|
+
Re-trigger any bot that never actually reviewed (e.g. `@coderabbitai review`) so the PR gets the pass it was owed.
|
|
118
|
+
|
|
119
|
+
### 7. Verify and report
|
|
120
|
+
|
|
121
|
+
Re-read the PR state after the push — confirm `mergeable` flipped, checks went green, and clear now-stale labels (`needs-rebase`, etc.). Poll re-triggered bots for their new pass and handle anything it raises.
|
|
122
|
+
|
|
123
|
+
```text
|
|
124
|
+
PR #965 finalized.
|
|
125
|
+
Rebase: 1 conflict resolved (kept main's #834 D1-first ordering)
|
|
126
|
+
Findings: 2 addressed, 0 rejected, 0 blocked
|
|
127
|
+
Coverage: +5 unit tests; E2E not applicable (no browser surface) — stated on the PR
|
|
128
|
+
Gates: tests 480/480, lint 0 issues, format clean
|
|
129
|
+
State: MERGEABLE, checks green
|
|
130
|
+
Needs human: none
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
If anything is left, say precisely what and why — an honest "blocked on X" is the deliverable when X is genuinely a human call.
|
|
134
|
+
|
|
135
|
+
## Related skills
|
|
136
|
+
|
|
137
|
+
- `qodoloop` — full Qodo thread protocol (per-finding Agent Prompts, resolve mutations).
|
|
138
|
+
- `coderabbitloop` — full CodeRabbit protocol.
|
|
139
|
+
- `greploop` — drives a PR to a 5/5 Greptile confidence score.
|
|
140
|
+
- `ci-fix-loop` — when the blocker is a failing pipeline rather than review feedback.
|
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
<!-- Generated by scripts/build-adapters.sh. Do not edit directly. -->
|
|
2
|
+
|
|
3
|
+
---
|
|
4
|
+
description: "Iteratively drives a GitHub PR to zero unresolved OpenAI Codex review comments — but verifies every finding against the real code first, fixes only the correct ones, and rebuts false positives without changing correct code."
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Codexloop
|
|
8
|
+
|
|
9
|
+
Drive a GitHub PR until Codex has no unresolved review comments — **but do not cargo-cult its
|
|
10
|
+
suggestions.** Every comment is a *claim to verify*, not an instruction to obey. A wrong
|
|
11
|
+
suggestion applied is worse than the comment itself.
|
|
12
|
+
|
|
13
|
+
## How Codex differs from Greptile / Gemini
|
|
14
|
+
|
|
15
|
+
- **No check-run, no score.** Codex does not publish an `X/5` confidence or a named check. It posts
|
|
16
|
+
a **PR review** (state `COMMENTED`) plus inline review comments. Detection is by polling the
|
|
17
|
+
*reviews* endpoint. "Satisfied" = zero unresolved comments (each either fixed or rebutted).
|
|
18
|
+
- **Trigger phrase is `@codex review`.** Codex reviews automatically when a PR opens or gets new
|
|
19
|
+
commits if auto-review is enabled on the repo; the mention forces a fresh pass. Other useful
|
|
20
|
+
mentions: `@codex review focus on <area>` for a scoped re-review.
|
|
21
|
+
- **Priority, not confidence.** Codex findings usually lead with a severity/priority word (`P1`,
|
|
22
|
+
`P2`, `P3` or `critical`/`major`/`minor`) or a short titled heading. Weight the top tier
|
|
23
|
+
seriously; treat the bottom tier as usually-skippable nits unless clearly correct.
|
|
24
|
+
- **Codex is terse and often reasons from the diff alone.** Its characteristic failure is
|
|
25
|
+
confidently asserting a bug based only on the changed hunk, without the surrounding file or the
|
|
26
|
+
call sites. That makes "read the whole file before believing it" the single highest-value check.
|
|
27
|
+
|
|
28
|
+
## Not for
|
|
29
|
+
|
|
30
|
+
- GitLab / Perforce (Codex code review is a GitHub app). For other review bots this catalog ships
|
|
31
|
+
`geminiloop`, `coderabbitloop`, and `qodoloop`; for CI failures rather than review comments, use
|
|
32
|
+
`ci-fix-loop`.
|
|
33
|
+
|
|
34
|
+
## 0. Resolve the Codex bot login (do this first, do not hardcode)
|
|
35
|
+
|
|
36
|
+
The connector's bot login varies by installation, so discover it from the PR rather than
|
|
37
|
+
assuming it:
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
gh api repos/{owner}/{repo}/pulls/<PR>/reviews --paginate --jq '.[].user.login' | sort -u
|
|
41
|
+
gh api repos/{owner}/{repo}/pulls/<PR>/comments --paginate --jq '.[].user.login' | sort -u
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Pick the login matching `*codex*` (commonly `chatgpt-codex-connector[bot]`, sometimes
|
|
45
|
+
`codex[bot]`) and export it as `BOT`.
|
|
46
|
+
|
|
47
|
+
**Finding nothing here is NOT a stop condition.** On a PR Codex has never reviewed there is no bot
|
|
48
|
+
login to find yet — that is the normal starting state, not a missing app. When the probe comes back
|
|
49
|
+
empty, fall through to step 2A, post `@codex review`, and re-run this probe once a review lands;
|
|
50
|
+
until then match any login containing `codex` when polling. Only conclude the app is absent after
|
|
51
|
+
step 2A's bounded wait has expired with no review and no codex-like login anywhere on the PR — and
|
|
52
|
+
then say so and stop, rather than looping against nothing.
|
|
53
|
+
|
|
54
|
+
## 1. Identify the PR
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
gh pr view --json number,headRefName,headRefOid -q '{number,branch:.headRefName,head:.headRefOid}'
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
Switch to the PR branch if not already on it. Capture `OWNER`/`REPO` (`gh repo view --json owner,name`).
|
|
61
|
+
|
|
62
|
+
## 2. The loop (max 5 iterations)
|
|
63
|
+
|
|
64
|
+
Keep an explicit iteration counter and stop at 5 — the cap is a real bound to enforce, not a
|
|
65
|
+
figure of speech. Each pass through A–G is one iteration; on hitting the cap, go straight to the
|
|
66
|
+
report and list what is still unresolved rather than starting a sixth.
|
|
67
|
+
|
|
68
|
+
### A. Ensure a fresh Codex review on the current head
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
HEAD_SHA=$(gh pr view <PR> --json headRefOid -q .headRefOid)
|
|
72
|
+
# Only trigger if no Codex review already exists for this exact SHA:
|
|
73
|
+
HAVE=$(gh api repos/{owner}/{repo}/pulls/<PR>/reviews --paginate \
|
|
74
|
+
--jq "[.[] | select(.user.login==\"$BOT\" and .commit_id==\"$HEAD_SHA\")] | length")
|
|
75
|
+
if [ "$HAVE" = "0" ]; then gh pr comment <PR> --body "@codex review"; fi
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
Poll for the review of THIS head to land. No check-run exists, so poll the reviews endpoint — and
|
|
79
|
+
poll it on a **deadline**, never `while true`: a review that never arrives must end the skill with
|
|
80
|
+
an honest timeout, not hang it.
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
# 10-minute deadline, one retry, then give up. DEADLINE/RETRIES are the
|
|
84
|
+
# enforcement of the bounds this skill claims — do not drop them.
|
|
85
|
+
wait_for_review() { # $1 = attempt label
|
|
86
|
+
local deadline=$(( SECONDS + 600 ))
|
|
87
|
+
while [ "$SECONDS" -lt "$deadline" ]; do
|
|
88
|
+
R=$(gh api repos/{owner}/{repo}/pulls/<PR>/reviews --paginate \
|
|
89
|
+
--jq "[.[] | select(.user.login==\"$BOT\" and .commit_id==\"$HEAD_SHA\")] | last")
|
|
90
|
+
if [ -n "$R" ] && [ "$R" != "null" ]; then return 0; fi
|
|
91
|
+
echo "waiting for Codex review of $HEAD_SHA ($1)..."; sleep 15
|
|
92
|
+
done
|
|
93
|
+
return 1
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
if ! wait_for_review "first wait"; then
|
|
97
|
+
echo "no Codex review after 10m — retrying once" # say the retry out loud
|
|
98
|
+
gh pr comment <PR> --body "@codex review"
|
|
99
|
+
if ! wait_for_review "after retry"; then
|
|
100
|
+
echo "Codex did not review $HEAD_SHA after a retry; stopping and reporting."
|
|
101
|
+
exit 1 # honest timeout, never a success claim
|
|
102
|
+
fi
|
|
103
|
+
fi
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
Codex can take several minutes on a large diff, which is why the deadline is generous. Report the
|
|
107
|
+
retry in the final summary; two silent timeouts are the failure mode this guard exists to prevent.
|
|
108
|
+
|
|
109
|
+
### B. Fetch the findings
|
|
110
|
+
|
|
111
|
+
- **Summary**: the review `.body` from the object above — read the overall take and the priority
|
|
112
|
+
spread.
|
|
113
|
+
- **Unresolved inline comments** on the current head:
|
|
114
|
+
|
|
115
|
+
```bash
|
|
116
|
+
gh api repos/{owner}/{repo}/pulls/<PR>/comments --paginate \
|
|
117
|
+
--jq ".[] | select(.user.login==\"$BOT\") | {id, path, line, body}"
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
Also pull the review threads + their resolved state via GraphQL (see step F) so you only act on
|
|
121
|
+
unresolved ones.
|
|
122
|
+
|
|
123
|
+
### C. Critically evaluate EACH comment (the core of this skill)
|
|
124
|
+
|
|
125
|
+
For every comment, **verify the claim against the actual code and repo conventions before touching
|
|
126
|
+
anything.** Read the whole file — not just the diff hunk Codex saw — plus the types and the call
|
|
127
|
+
sites. Then classify:
|
|
128
|
+
|
|
129
|
+
1. **CORRECT + actionable** — the finding is real and the fix improves the code. → fix it (step D).
|
|
130
|
+
2. **FALSE POSITIVE / technically wrong** — the claim doesn't hold. → do **NOT** change code; write a
|
|
131
|
+
specific, evidence-based reply (cite the exact code/line/behavior that disproves it), then resolve.
|
|
132
|
+
3. **Valid but out-of-scope / stylistic nit** that conflicts with repo convention or the PR's intent
|
|
133
|
+
→ briefly decline with a reason, then resolve. Do not expand the PR's scope to satisfy a nit.
|
|
134
|
+
|
|
135
|
+
**Hard rules:**
|
|
136
|
+
- **Never modify correct code just to silence Codex.** Prefer a reasoned rebuttal.
|
|
137
|
+
- When uncertain whether a claim holds, **investigate** (read more code, run the type-checker / tests)
|
|
138
|
+
rather than assume Codex is right. Default to skepticism.
|
|
139
|
+
- If a suggested change would break other call sites, alter public behavior, or contradict a verified
|
|
140
|
+
repo convention, it is a category-2 rebuttal, not a fix.
|
|
141
|
+
- Never fabricate identifiers to satisfy a comment (e.g. a Linear/ticket prefix). If Codex asks for a
|
|
142
|
+
ticket reference and none exists, say so; do not invent one.
|
|
143
|
+
|
|
144
|
+
**Codex's common failure modes to watch for (default these to category 2):**
|
|
145
|
+
- Diff-local reasoning: asserts a bug that the unchanged surrounding code already handles.
|
|
146
|
+
- "This can be null/undefined here" where the type or an earlier guard already rules it out.
|
|
147
|
+
- Invented race conditions or error paths with no actual trigger.
|
|
148
|
+
- Suggestions that compile-break or break other callers.
|
|
149
|
+
- Security/perf warnings with no exploit path or measurable cost.
|
|
150
|
+
- Restating library/framework semantics incorrectly.
|
|
151
|
+
- Style demands that contradict the repo's existing, consistent pattern.
|
|
152
|
+
|
|
153
|
+
### D. Apply fixes — category 1 only
|
|
154
|
+
|
|
155
|
+
Make the minimal correct change. Re-run the local gate if the repo has one (typecheck/tests) before
|
|
156
|
+
moving on.
|
|
157
|
+
|
|
158
|
+
### E. Commit and push FIRST, before resolving anything
|
|
159
|
+
|
|
160
|
+
Order matters. A resolved thread is a claim that the fix is on the branch, so the push has to
|
|
161
|
+
succeed before the claim is made — otherwise a failed commit or push leaves the PR unfixed with the
|
|
162
|
+
finding marked resolved, and nobody looks at it again.
|
|
163
|
+
|
|
164
|
+
If step D changed code:
|
|
165
|
+
|
|
166
|
+
```bash
|
|
167
|
+
# Stage ONLY the files your fixes touched — never `git add -A`, which sweeps up
|
|
168
|
+
# unrelated work and untracked secrets sitting in the worktree.
|
|
169
|
+
git status --short # look before you stage
|
|
170
|
+
git add <path> [<path>...] # the files named in the findings you fixed
|
|
171
|
+
git commit -m "address codex review feedback (codexloop iteration N)"
|
|
172
|
+
git push
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
Author the commit per the repo's norms (e.g. the user's identity; no AI attribution if that is the
|
|
176
|
+
convention). Confirm the push actually landed before continuing:
|
|
177
|
+
|
|
178
|
+
```bash
|
|
179
|
+
git rev-parse HEAD
|
|
180
|
+
gh pr view <PR> --json headRefOid -q .headRefOid # must match
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
If they differ, stop: the fix is not on the PR, so nothing may be resolved yet.
|
|
184
|
+
|
|
185
|
+
### F. Reply to and resolve every addressed thread
|
|
186
|
+
|
|
187
|
+
Only now, with the fixes pushed, reply and resolve. Fetch unresolved threads, **following
|
|
188
|
+
pagination** — a PR with more than 100 threads will otherwise look clean while unresolved findings
|
|
189
|
+
sit on page two:
|
|
190
|
+
|
|
191
|
+
```bash
|
|
192
|
+
# Loop until hasNextPage is false, passing endCursor back in as $cursor.
|
|
193
|
+
CURSOR=null
|
|
194
|
+
while : ; do
|
|
195
|
+
PAGE=$(gh api graphql -F cursor="$CURSOR" -f query='
|
|
196
|
+
query($cursor: String) {
|
|
197
|
+
repository(owner: "OWNER", name: "REPO") {
|
|
198
|
+
pullRequest(number: PR_NUMBER) {
|
|
199
|
+
reviewThreads(first: 100, after: $cursor) {
|
|
200
|
+
pageInfo { hasNextPage endCursor }
|
|
201
|
+
nodes { id isResolved comments(first: 1) { nodes { databaseId author { login } path body } } }
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
}')
|
|
206
|
+
echo "$PAGE" # collect nodes from every page before deciding the PR is clean
|
|
207
|
+
PI='.data.repository.pullRequest.reviewThreads.pageInfo'
|
|
208
|
+
[ "$(echo "$PAGE" | jq -r "$PI.hasNextPage")" = "true" ] || break
|
|
209
|
+
CURSOR=$(echo "$PAGE" | jq -r "$PI.endCursor")
|
|
210
|
+
done
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
Reply on a thread's comment via `gh api repos/{owner}/{repo}/pulls/<PR>/comments -f body="..." -F in_reply_to=<comment_id>`,
|
|
214
|
+
then resolve:
|
|
215
|
+
|
|
216
|
+
```bash
|
|
217
|
+
gh api graphql -f query='mutation { resolveReviewThread(input: {threadId: "THREAD_ID"}) { thread { isResolved } } }'
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
Resolve a thread only for comments authored by `$BOT` that you have fixed or rebutted — never
|
|
221
|
+
blanket-resolve, and never resolve a human reviewer's thread.
|
|
222
|
+
|
|
223
|
+
Threads you are **rebutting** need no push, so they may be replied to and resolved regardless of
|
|
224
|
+
whether step D changed code.
|
|
225
|
+
|
|
226
|
+
### G. Re-review
|
|
227
|
+
|
|
228
|
+
Pushing re-triggers Codex when auto-review is on; otherwise post `@codex review`. Go back to **A**
|
|
229
|
+
with the new head SHA. If step D changed nothing (all comments were rebutted), skip the push,
|
|
230
|
+
ensure all threads are resolved, and exit.
|
|
231
|
+
|
|
232
|
+
## 3. Exit conditions
|
|
233
|
+
|
|
234
|
+
Stop when **any** is true:
|
|
235
|
+
- Zero unresolved `$BOT` comments remain, and every comment this round was fixed or
|
|
236
|
+
rebutted+resolved. (There is no score to hit — this is "done".)
|
|
237
|
+
- Max iterations (5) reached — report what remains.
|
|
238
|
+
- Codex never responded after one retry — report the timeout honestly; do not claim success.
|
|
239
|
+
|
|
240
|
+
## 4. Report
|
|
241
|
+
|
|
242
|
+
```text
|
|
243
|
+
Codexloop complete.
|
|
244
|
+
PR: #<n>
|
|
245
|
+
Bot login: <resolved $BOT>
|
|
246
|
+
Iterations: N
|
|
247
|
+
Comments fixed: N (genuinely-correct findings)
|
|
248
|
+
Comments rebutted: N (false positives / nits, resolved with rationale)
|
|
249
|
+
Remaining: 0
|
|
250
|
+
```
|
|
251
|
+
|
|
252
|
+
If it stopped at max iterations, list the remaining threads with your current assessment
|
|
253
|
+
(fix-pending vs disputed) so a human can arbitrate.
|