Skip to content

Upgrade pr-finisher skill with agent-merge patterns#37905

Merged
pelikhan merged 3 commits into
mainfrom
pelikhan/pr-finisher-skill-upgrade
Jun 8, 2026
Merged

Upgrade pr-finisher skill with agent-merge patterns#37905
pelikhan merged 3 commits into
mainfrom
pelikhan/pr-finisher-skill-upgrade

Conversation

@pelikhan

@pelikhan pelikhan commented Jun 8, 2026

Copy link
Copy Markdown
Collaborator

Upgrade pr-finisher skill with agent-merge patterns

Summary

Rewrites .github/skills/pr-finisher/SKILL.md to make the skill accurate and safe for use inside a GitHub Copilot cloud agent — an execution context where the agent's own pushes do not trigger CI, making the old "wait for checks" pattern actively harmful. Two commits land the change: the first introduces agent-merge structural patterns; the second reframes the entire skill around cloud-agent constraints.


What changed

File: .github/skills/pr-finisher/SKILL.md
Net diff: +183 / −100 lines across two commits.

New: Execution context section

Explains the cloud-agent constraints that govern every decision in the skill:

  • Agent pushes do not trigger CI; any statusCheckRollup goes stale the moment the agent commits.
  • Local make targets are the only authoritative correctness signal before push.
  • Re-running CI is a hand-off to a human — not something the agent can do.
  • No sleep, no --watch, no re-check loops; one pass, then stop.

New: Three-condition merge-ready model (concurrent)

Replaces an implicit ad-hoc checklist with an explicit table of three conditions worked in parallel:

Condition Gate
Reviews Every unresolved thread addressed, replied to, and resolved via copilot-review + GraphQL reviewThreads
Checks Local make fmt / lint / test-unit / test green; prior CI failures root-caused at log level
Mergeable PR open, not draft, mergeable: MERGEABLE, not BEHIND where up-to-date is required

New: Mergeable condition handling

  • CONFLICTING → resolve using repo conventions; ask_user if resolution is ambiguous.
  • mergeStateStatus: BEHIND → update branch from base, then scan for tooling drift (lockfiles, toolchains, lint configs) and flag any drift in the summary.

New: CI-fix anti-pattern guardrails

Hard-forbidden actions the agent must never take:

  • Disabling or neutering shared tooling (caches, lint rules, type checks, required checks).
  • "Temporary" disables with TODO re-enable notes.
  • Lowering coverage thresholds or removing assertions to make a test pass.
  • Bundling a workaround with a real fix ("belt and suspenders").
  • Special-casing one OS/runner to hide a platform failure.

Adds an explicit anti-pattern test: if the change would make the failure invisible on future PRs without solving it, stop and escalate via ask_user.

Changed: Local vs prior-CI split for Checks

  • Local make run = gate; must be green before any push.
  • Prior CI failures = root-cause signal only; inspected via gh run view --log-failed; fixes reproduced locally where possible; not-locally-reproducible failures flagged explicitly in the summary.
  • Removed: post-push gh pr checks re-check loop; Only Checks pending wait state.

New: Hard rules block

Consolidated, strengthened, and promoted to a top-level section:

  • Never run gh pr merge or enable auto-merge.
  • No standalone PR comments — reply only to existing threads.
  • Always prefix gh with GH_PAGER="" for non-interactive shells.
  • Never wait for CI after push.
  • Smallest fix that works; fix lint before tests.

New: Structured summary format

Required stopping-point output using ✅ / ❌ / ⏳ / ❓ status vocabulary, with:

  • Explicit Hand-off: CI must be re-triggered by a maintainer line.
  • Plain-language translation of each status (no bare labels).
  • Still needed: field for anything requiring human action.

New: Completion standard

An explicit multi-point checklist defining when the task is truly done (local targets, review threads, mergeable, CI inspection, single push, summary printed, no merge run).


Impact

Dimension Assessment
Scope Single skill file — no Go code, no CI pipelines, no other files
Breaking No — consumers of this skill gain new guardrails and a clearer contract
Risk Low — documentation/prompt change only; worst case is a skill invocation that behaves as it did before
Urgency Medium-high — the old skill's post-push CI-wait pattern is a footgun in cloud-agent context

Checklist for reviewers

  • The three-condition table accurately reflects the repo's merge requirements.
  • The CI anti-pattern list is complete for this codebase (no local tooling pattern missing).
  • The summary format's Hand-off wording matches how maintainers actually re-trigger CI (close/reopen, workflow_dispatch, or push).
  • The GH_PAGER="" requirement is consistent with how other skills invoke gh.

Generated by PR Description Updater for issue #37905 · 130.1 AIC · ⌖ 13.1 AIC · ⊞ 19.6K ·

Adopts agent-merge concepts adapted for the pre-merge scope:

- Three-condition framing (Reviews/Checks/Mergeable) worked concurrently

- Mergeable condition (CONFLICTING, BEHIND) now explicit

- CI anti-pattern guardrails (no disabling shared tooling, no temp

  disables, no workaround+fix bundling, anti-pattern test)

- Root-cause framing with gh run view --log-failed

- Never block on CI (no sleep, no --watch, no gh run watch)

- GH_PAGER='' required for non-interactive shells

- No stand-alone PR comments; reply-only

- Structured stopping-point summary with status emoji vocabulary

- Tooling drift scan after BEHIND branch updates

- Hard rule: never merge (gh pr merge forbidden)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings June 8, 2026 19:10

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the pr-finisher skill documentation to use a three-condition “merge-ready” framework (Reviews / Checks / Mergeable) with explicit guardrails (notably: never merge) and a structured stop/summarize flow, aligned with patterns from agent-merge but scoped to pre-merge preparation.

Changes:

  • Reframes the skill around concurrently satisfying Reviews, Checks, and Mergeable conditions (including CONFLICTING / BEHIND handling).
  • Adds hard rules and CI anti-pattern guidance (no waiting/polling CI, no disabling checks/tooling, require root-cause investigation).
  • Introduces a structured stopping-point summary template with bounded status vocabulary (✅/❌/⏳/❓).
Show a summary per file
File Description
.github/skills/pr-finisher/SKILL.md Rewrites the skill guide to adopt the three-condition merge-ready model, guardrails, and a structured workflow/summary format.

Copilot's findings

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 1/1 changed files
  • Comments generated: 3

Comment thread .github/skills/pr-finisher/SKILL.md Outdated
# PR Finisher

Use this skill when asked to get a pull request to a merge-ready state.
Drive an open PR for the current branch to a merge-ready state. **Do not merge.** When all conditions are satisfied, report ready-for-human-merge and stop.
- Use GitHub tools to inspect the current pull request status and check runs.
- When the user mentions CI, build, test, or workflow failures, fetch the failing job logs before deciding on a fix.
- Distinguish between failures already covered by local commands (`fmt`, `lint`, `test-unit`, `test`) and unrelated external failures.
- **Do not merge.** Never run `gh pr merge`, enable auto-merge, or enqueue. This skill stops at "ready for merge."
Comment thread .github/skills/pr-finisher/SKILL.md Outdated
8. If wasm golden tests fail, or a test fix changes the expected wasm compiler output, run `make update-wasm-golden`.
9. Re-run the affected local validation until it passes.
10. Push the final changes.
Top-level PR comments and review bodies are useful feedback but are **not** a merge gate (GitHub has no resolve state for them). Read and action useful ones; do not block on them.
pelikhan and others added 2 commits June 8, 2026 12:14
The skill runs inside a cloud agent whose pushes do not trigger CI.

Local make targets are the only authoritative correctness signal

before push; CI is observational and goes stale at the moment the

agent commits. Re-running CI is a hand-off to a human.

- New Execution context section spelling out the constraints

- Checks split into local (gate) vs prior CI (root-cause only)

- Removed post-push re-check loop and 'Only Checks pending' wait

  state; agent runs once and stops

- Summary adds explicit 'Hand-off: CI must be re-triggered' line

- Stronger 'reproduce locally where possible' for CI fixes; flag

  not-locally-reproducible failures explicitly

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@pelikhan pelikhan merged commit 306733e into main Jun 8, 2026
@pelikhan pelikhan deleted the pelikhan/pr-finisher-skill-upgrade branch June 8, 2026 19:18
@github-actions

github-actions Bot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

✅ smoke-ci: safeoutputs CLI comment + comment-memory run (27161179157)

Generated by 🧪 Smoke CI for issue #37905 ·

@github-actions

github-actions Bot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Comment Memory

CI lights the path
Green checks bloom at dawn
Quiet bots still sing

Note

This comment is managed by comment memory.

It stores persistent context for this thread in the code block at the top of this comment.
Edit only the text inside the backtick fences; workflow metadata and the footer are regenerated automatically.

Learn more about comment memory

Generated by 🧪 Smoke CI for issue #37905 ·

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants