@olegkoval/agent-skills 1.24.0 → 1.25.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.
@@ -0,0 +1,139 @@
1
+ <!-- Generated by scripts/build-adapters.sh. Do not edit directly. -->
2
+
3
+ ---
4
+ 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."
5
+ ---
6
+
7
+ # PR Finalize
8
+
9
+ 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.
10
+
11
+ ## Inputs
12
+
13
+ - **PR number or URL** (optional): detect from the current branch if not given.
14
+ - `--no-push` (optional): do everything except the final push. Use when the repo auto-merges and the user wants to eyeball first.
15
+
16
+ ## Non-negotiables
17
+
18
+ These are the failure modes this skill exists to prevent. Violating one makes the whole run worthless:
19
+
20
+ - **Never report a gate as passing without having run it.** Paste the real output. "Tests should pass" is not a result.
21
+ - **Never resolve or claim-fix a finding you didn't actually fix.** Blocked is an honest outcome; a false "done" is not.
22
+ - **Never `git add -A`.** Stage only the files your fixes touched. Start from a clean tree so that's safe.
23
+ - **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.
24
+ - **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.
25
+
26
+ ## Instructions
27
+
28
+ ### 1. Establish the ground truth
29
+
30
+ ```bash
31
+ gh pr view <PR> --json number,title,body,state,isDraft,headRefName,baseRefName,mergeable,mergeStateStatus,labels,reviewDecision,statusCheckRollup,url
32
+ ```
33
+
34
+ Record four things before touching code:
35
+
36
+ - **`mergeable`** — `CONFLICTING` means step 2 is mandatory.
37
+ - **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.
38
+ - **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.
39
+ - **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.
40
+
41
+ ### 2. Rebase onto the base branch
42
+
43
+ Require a clean tree first (`git status --porcelain` empty), then:
44
+
45
+ ```bash
46
+ git fetch origin <base>
47
+ git rebase origin/<base>
48
+ ```
49
+
50
+ 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.
51
+
52
+ After resolving, re-run the tests before continuing — a rebase that compiles is not a rebase that works.
53
+
54
+ ### 3. Sweep every review source
55
+
56
+ Collect findings from all of these; do not stop at the first:
57
+
58
+ ```bash
59
+ # inline review threads (all bots + humans), with resolution state
60
+ gh api repos/{owner}/{repo}/pulls/<PR>/comments --paginate
61
+ # rollup issue comments (where CodeRabbit/Qodo post summaries and rate-limit notices)
62
+ gh api repos/{owner}/{repo}/issues/<PR>/comments --paginate
63
+ # formal reviews
64
+ gh pr view <PR> --json reviews
65
+ ```
66
+
67
+ **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.
68
+
69
+ Triage every finding into exactly one bucket:
70
+
71
+ | Bucket | Action |
72
+ |---|---|
73
+ | **Real defect** | Fix it. This is the point of the exercise. |
74
+ | **Legitimate improvement** | Fix it if it's in scope for this PR. |
75
+ | **False positive** | Reply explaining *specifically* why the bot is wrong. Do not resolve silently. |
76
+ | **Needs a human call** | Reply, leave open, surface in the final report. |
77
+
78
+ 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.
79
+
80
+ ### 4. Close the coverage gap
81
+
82
+ Ask, for the change as a whole, what would catch a regression here — then check whether the PR actually has it.
83
+
84
+ - **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.
85
+ - **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:
86
+ - it has a reachable surface → add or extend the E2E spec;
87
+ - 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.
88
+
89
+ Silence here reads as an oversight. An explicit "not applicable, because X" reads as diligence — and is checkable.
90
+
91
+ ### 5. Run the real gates
92
+
93
+ Discover them from the repo (`Makefile`, `package.json` scripts, CI workflow) — do not guess target names. Run, at minimum, the equivalents of:
94
+
95
+ ```bash
96
+ <lint> # e.g. make lint / npm run lint
97
+ <format> # check mode first; only write if it reports drift
98
+ <tests> # the suite covering the changed package
99
+ ```
100
+
101
+ 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.
102
+
103
+ If a gate fails, fix it. Do not push red.
104
+
105
+ ### 6. Push and explain
106
+
107
+ Stage only the files you touched, commit, and push (`--force-with-lease` after a rebase — never bare `--force`).
108
+
109
+ Then post **one** PR comment that a reviewer can audit without re-reading the diff:
110
+
111
+ - what the rebase conflict was and which side won, with the reason;
112
+ - each finding, and what you did about it (including the ones you rejected, with the argument);
113
+ - the coverage decision from step 4, including the explicit not-applicable if that's the answer;
114
+ - **verbatim** gate output — real numbers (`# pass 480 / # fail 0`, `0 issues.`), not adjectives.
115
+
116
+ Re-trigger any bot that never actually reviewed (e.g. `@coderabbitai review`) so the PR gets the pass it was owed.
117
+
118
+ ### 7. Verify and report
119
+
120
+ 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.
121
+
122
+ ```text
123
+ PR #965 finalized.
124
+ Rebase: 1 conflict resolved (kept main's #834 D1-first ordering)
125
+ Findings: 2 addressed, 0 rejected, 0 blocked
126
+ Coverage: +5 unit tests; E2E not applicable (no browser surface) — stated on the PR
127
+ Gates: tests 480/480, lint 0 issues, format clean
128
+ State: MERGEABLE, checks green
129
+ Needs human: none
130
+ ```
131
+
132
+ If anything is left, say precisely what and why — an honest "blocked on X" is the deliverable when X is genuinely a human call.
133
+
134
+ ## Related skills
135
+
136
+ - `qodoloop` — full Qodo thread protocol (per-finding Agent Prompts, resolve mutations).
137
+ - `coderabbitloop` — full CodeRabbit protocol.
138
+ - `greploop` — drives a PR to a 5/5 Greptile confidence score.
139
+ - `ci-fix-loop` — when the blocker is a failing pipeline rather than review feedback.