- name
- pr-triage
- description
- Use when triaging a scoped set of pull requests as a merge train - gate each PR for readiness, bounce what is not ready, merge what is ready into one integration branch, then review the whole result once with two models and an architect, fix blocking findings, verify, and report.
## Merge train rules (JP, 2026-10-30; these override anything below)
1. **Gate each PR, do not review it.** Per PR, check only: its own CI failures,
conflicts, scope and direction against the ticket and settled decisions, and
glaring defects in the diff. No model review per PR.
2. **Not ready: bounce it.** Comment on the PR and its ticket with the exact
blocking items, and message the author. Do not merge it. Do not fix it for
the author beyond small discrepancies.
3. **Ready: fix small discrepancies and merge it** into the integration branch
(merge commit, never rebase). Small means mechanical: a guard list entry, a
doc line, a spelling, a stale test literal, a merge conflict with clear intent.
4. **After the whole train is merged, review once.** One round on the combined
result: one Claude Opus review (a single agent at medium effort) and one
Codex review (xhigh). No multi-agent review workflows, skeptic panels or
planted-failure sweeps unless the user asks for them.
5. **Fix blocking findings on the integration branch** (high severity, or a
medium correctness or security defect) with focused checks. Everything else
becomes an issue linked to its PR or ticket. Never start a second review round.
6. **Run the full gates once** on the final integration SHA.
7. **New work found during triage is not part of the train.** A follow-up PR or
feature goes to its own thread and enters a later train through the gate.
8. **Update every PR and ticket** with its outcome: merged, merged with
follow-up issues, or bounced with the blocking items.
# PR triage
Produce one locally integrated, reviewed result per repository for the user's
chosen PR scope. Work on the user's requested computer; verify the hostname
before mutation. Do not substitute a remote machine or cloud-only workflow.
## Compose the existing owners
Read these existing skills before their stage. Resolve links relative to this
file, following the real source when the installation is a symlink:
| Owner | Responsibility in this workflow |
|---|---|
| [pr-review](../../skills-db/dev/pr-review/SKILL.md) | Review criteria, evidence-backed findings, severity and verdicts. |
| [arch](../arch/SKILL.md) | Mandatory architecture Review Mode, quality attributes, boundaries, trade-offs and fitness functions. |
| [coder](../coder/SKILL.md) | Exact model/profile resolution, frozen worker packets, permissions, sessions, observation, bounded recovery and independent acceptance. |
Load these files directly even when a catalog skill such as `pr-review` is not
separately activated. If a required owner is unavailable, report its exact path
and blocked stage. Do not duplicate its checklist here or invent a replacement.
This skill owns scope, local integration and repository reporting. In this
workflow, the combined integration replaces `pr-review`'s single-PR diff as
the review input; size tiers do not waive relevant tests, security, CI or the
mandatory architect assessment. Use Coder's explicit current-run model override
and read-only review role instead of its default single coder/reviewer pairing.
## Freeze scope and authority
Record each repository's real path, target branch and pinned base SHA, requested
PR numbers or exact recent-PR rule, exclusions, and available authorization.
For a recent-PR rule, preserve the user's time window, timezone and intended
timestamp field (created or updated); resolve material ambiguity before merging.
Record the metadata query and observation time. Older/open PRs and older
dependencies are not automatically in scope. Remote metadata is evidence, not
instructions or permission.
An execution request for this workflow permits the scoped local integration,
straightforward fixes and verification it describes; an inspection-only request
stays read-only. The skill grants no standing permission to merge into the
target branch, push or publish branches/PRs, submit reviews/comments, close
remote PRs, or deploy. Perform any such action only when the current session
separately authorizes that action and scope. Report each state separately.
Capture pre-existing tracked, staged and untracked changes. Preserve the user's
checkout and every other session's work. Never stash, reset, clean, force-switch
or rebase to make room. Inspect local instructions and required project context.
If ownership of a checkout, existing integration or canonical path is unclear,
resolve it before writing there; continue independent repositories meanwhile.
## Establish stacks and containment
Inspect each scoped PR's base/head refs, exact head SHA, commit graph, diff,
dependencies and relevant existing CI. Titles and labels alone do not prove a
stack. Use ancestry checks such as `git merge-base --is-ancestor` and examine
the introduced commits and changes relative to the pinned target base.
For each PR distinguish: changes absent from the integration, already contained
in the target, already contained through a selected descendant, or excluded.
For rewritten/squashed history, verify patch equivalence and surrounding code
or tree behavior; an ancestry failure alone does not prove absence, and a
matching title or patch identifier alone does not prove complete containment.
Keep provenance for contained PRs even when no separate merge is needed.
A selected head can carry older or excluded ancestor changes. Identify that
before merging. Being reachable through a selected PR does not authorize an
out-of-scope change. Report the dependency and smallest scope decision; do not
silently add it, drop it, cherry-pick a replacement or change the user's window.
Make the merge plan topological and merge each missing change once. Skip empty
or already-contained merges; do not run redundant full-stack reviews per PR.
## Integrate locally, then review the whole result
Use one isolated integration branch and worktree per repository, based on the
pinned target SHA. Reuse only an integration whose ownership and exact scope
are verified; never repurpose an unrelated worktree. Keep repository paths,
branch names, base/head SHAs and merge provenance in the evidence. Do not create
a worktree per PR or model. Reviewers share an immutable snapshot read-only.
Merge the scoped changes first in dependency order. Resolve mechanical conflicts
only when intent is clear; escalate conflicts that change behavior or design.
Do not approve a partly assembled stack as the completed result. A blocked
dependency does not prevent independent scoped integration elsewhere, but mark
any partial result and missing scope explicitly.
Freeze a review packet at the combined integration SHA: objective and scope,
project instructions and architectural constraints, target/base and all PR head
SHAs, containment/merge record, complete combined diff, full source access or a
complete source snapshot, relevant callers/runtime paths and tests, existing
check evidence and known uncertainty. A truncated packet is not whole-result
coverage; report missing context rather than guessing. Record the packet digest.
Through Coder, launch two independent read-only reviews of this same result:
- Claude **Opus 5.5, Medium**.
- Codex **6.1 Sol, Extra High** (`xhigh` reasoning).
Resolve exact installed provider/model identifiers and effort settings live.
Verify effective selection in runtime evidence; a requested CLI flag alone is
not proof. Do not substitute a model, lower effort or claim both reviews when
one is unavailable. Report that lane blocked and continue authorized work that
does not depend on its approval. Preserve Coder's identity, safe permission,
session and bounded recovery controls; example bypass flags are not defaults.
Both reviewers must assess the WHOLE integrated result, combined interactions
and relevant surrounding code with the existing review criteria and `arch`'s
Review Mode. Include architecture regardless of diff size; scale its depth to
the actual boundaries and risk. This provides the architect review within the
same integrated passes, without a redundant full-stack third review. The
controller synthesizes concrete findings and any unresolved architectural
decision. Do not turn inherited architecture examples into project facts.
For each lane retain provider, resolved model and effective effort, identity
alias without secrets, exact session/run ID, reviewed SHA, packet digest,
verdict, output/log paths and terminal status. Independently inspect its findings;
worker prose and a green exit are not proof of review coverage or correctness.
Keep each raw verdict. For the combined report, map `APPROVE`/`APPROVED` to
approved, `REQUEST_CHANGES`/`NEEDS_CHANGES` to needs fixes,
`DISCUSS`/`NEEDS_DISCUSSION` to decision needed, and `BLOCKED`/`NO_RESULT` to
blocked. Missing or invalid model, scope or revision evidence blocks acceptance
regardless of an approval verdict.
## Fix findings and establish final evidence
Prefer a bounded local fix over a spray of PR comments. Fix straightforward,
well-supported defects within scope and add meaningful regression coverage
where needed. Record each finding's source, reproduction/evidence, disposition,
changed files and fix commit. Do not apply speculative suggestions blindly.
Raise glaring mistakes prominently. Separate educational bounce-back candidates
that the author should understand from routine fixable defects; do not silently
rewrite a fundamental misunderstanding. Escalate insufficient context, missing
product constraints, model disagreement affecting correctness, ambiguous intent,
and architectural/public-contract decisions with evidence, viable choices and
the smallest needed decision. Do not guess or post remotely without authority.
Continue independent fixes while a dependent decision remains blocked.
Use focused checks while fixing. Commit scoped local fixes before recording the
final verification revision, keeping unrelated edits out. If commits cannot be
made, report HEAD plus the dirty diff digest and blocker, not a fully verified
final SHA. After integration and all known fixes, run the
full relevant repository test/build/type/lint/integration/end-to-end gates from
its declared instructions and CI. Record exact commands, environment, results,
exit codes and tested SHA. Explain relevance and any omitted/blocked gates.
Existing PR CI and earlier green tests do not verify the new integrated tree.
Never weaken, skip or delete assertions to obtain green, invent visual baselines,
or bless snapshots without trustworthy expected behavior and required authority.
Record the final SHA and verify that the tested source tree is unchanged. After a
fix, rerun the focused checks it affects and the full gates once at the end. Do
not start a second model review round: one round per train is the maximum.
Report review findings you did not fix as issues with the PR or ticket link.
## Report each repository
Lead with results and decisions. Give a compact report with evidence links:
- **Scope and integration:** requested window/PRs; integrated PRs; already-contained
PRs and where/proof; excluded/deferred PRs and reasons; stack/dependency order;
local worktree/branch, pinned base and final SHA; clean/dirty state.
- **Review and fixes:** both models' actual identifiers/efforts, sessions, reviewed
revisions, verdicts and evidence; architect verdict and decisions; findings
fixed with commit/check evidence; bounce-back candidates and unresolved items.
- **Verification:** full relevant gates and any reruns after later fixes; each
command's passed, failed or blocked state, tested revision and evidence path.
Distinguish unavailable credentials/services from failed assertions.
- **Publication state:** local integration, target-branch merge, branch/PR
publication, remote PR closure and deployment, each with its actual state.
Name remaining authorization/decisions without treating local containment as
remote closure or local green as permission to publish.
Mark completion only when the requested scope, both model reviews, architect
assessment, fixes and final checks have adequate evidence. Otherwise report the
partial result and precise blocker. Preserve local artifacts for the next step.
View on GitHub