LoopX PR Review
This skill is a thin host adapter. The built-in pull-request-review
capability owns review depth, evidence requirements, completeness, and verdict
policy through the CLI packet. Do not copy those rules into this skill or
replace them with a host-specific checklist.
Route
Use this skill for /loopx-pr-review, explicit PR reviews, or review queues by
state or time window. Route approval, merge, self-merge, and admin bypass to
loopx-pr-merge (optional repo-kept workflow, not installed by default) after
the evidence review is complete; it never replaces this skill's exact-head gate.
Run loopx --format json pr-review --state all before ad hoc GitHub reads.
Translate only explicit filters:
--repo owner/repo--since ISO--state open|merged|all--limit N--review-priority other-developers-first|owner-first(defaultother-developers-first; useowner-firstto opt into owner priority) When omitted, the CLI resolvespull_request_reviewfrom the standard machine capability editor; an absent namespace keeps the defaultother-developers-first. Words such astoday,open, ormergedare filters, not permission to return a table only. Stats-only output requires an explicit opt-out such as只统计,只列出,stats only, or不要 review.
Preserve The Packet
Save the full first JSON packet before printing a compact projection. Keep all
paths named by agent_response_contract.required_packet_fields_to_preserve,
especially:
agent_response_contract.review_execution_contractresult_completenessandscheduling_policyreview_groupspull_requests[review_action_kind!=null].review_planpull_requests[review_action_kind!=null].review_templatepull_requests[review_action_kind!=null].evidence_commands
Do not pipe the only copy through jq. When an exhaustive request has
result_completeness.complete=false, rerun with its recommended_limit before
reviewing.
Require execution policy_revision == 3; a schema name alone is insufficient.
If missing or unequal, do not publish APPROVE. A conservative REQUEST_CHANGES
may be published only when it explicitly names the incompatible-policy evidence
gap; regenerate with current installed LoopX before any later approval. Do not retain
expired temporary worktree overrides. Honor explicit runtime pins, but
report incompatible policy instead of silently downgrading the review. The repository
smoke binds this number to the canonical revision; this is not a freshness claim.
Execute One Review Plan
Follow scheduling_policy and its ranked actionable review_sequence; explicit current-request PR selection may override ordering only, never pull_requests[].review_action_kind or exact-head idempotency. Generic re-review, 重新review, and 复审 wording selects the named PR; it is not a force-refresh token. Todo/monitor prose may not select work.
When review_action_kind is null, the row stays in pull_requests inventory but must not appear in review_sequence; its review_plan and review_template are null and evidence_commands is empty. Do one compact exact-head conclusion readback and report the existing verdict or bounded invalid/missing reason. Run a fresh audit only when the user explicitly requests fresh evidence despite that no-action result, or supplies a concrete new concern/evidence invalidation; regenerate with --fresh-audit-exact-head NUMBER@HEAD_OID, then execute the complete current plan and never inherit the earlier approval. For every actionable PR:
Record the packet's exact head. Start with the capability's
review_execution_contract.decision_procedure, including on re-review; then runevidence_commandsand relevant repository-native validation.Fill
review_plan.result_templatefrom the shared execution contract; preserve missing evidence asunverified. Execute its repository-reuse, default-off, authority and real-path counterfactual requirements rather than repeating them as prose. Never inferverifiedfrom metadata or CI.Apply
completion_gateliterally. Save the filled result and check it before publication:loopx --format json pr-review --check-result review-result.json --packet review-packet.jsonFix contradictory verdicts, not evidence labels to obtain a pass. This local check cannot verify evidence truth, architecture judgment, or remote freshness. Preserve the template's
review_policy_revision; do not relabel an old result without executing the current evidence plan. Verified rows must fill their declared structured fields; validation rows bind typedcase_idcoverage, and a generic “reviewed” note is insufficient. Missing material evidence needs a concrete hold/request-changes explanation, not an invented bug or approval inherited from the previous round.Render the verified result through
review_template. The five sections are output structure, while the execution contract is the evidence authority.Re-read the remote head immediately before verdict and publication. Restart the evidence pass if it changed.
Each PR gets an independent evidence pass and standalone card; a queue table is only a preface. Finish fewer complete cards rather than metadata-only reviews.
Publish And Read Back
For an open PR, publish validated actionable findings by default unless the user explicitly requested local-only/dry-run output or the finding contains private or security-sensitive material.
- Remaining blocker: formal
REQUEST_CHANGES; for an author-owned PR, use aCOMMENTEDreview titledRequest changes conclusion (author-owned PR; GitHub blocks formal self-review). - Non-blocking finding with no blockers: formal
APPROVE, not a bare comment. When the GitHub account is the PR author and GitHub rejects self-approval, record the same approval conclusion as aCOMMENTEDreview titledApproval conclusion (author-owned PR; GitHub blocks formal self-approval)so the verdict remains public and machine-visible. - Non-blocking finding with only P2 suggestions: still
APPROVE; keep the P2 items in the review body rather than downgrading the verdict. - Merged PR: publish a post-merge audit comment only for a new actionable finding; avoid duplicating an equivalent exact-head result.
Build public text from the exact reviewed head. Remove local paths, private
context, raw logs, credentials, and internal-only links. Read the published
review back, verify its state and rendered body, and return its URL. Merge
still routes through loopx-pr-merge; an APPROVE is not merge authority.
Do not leave a public blocker only in chat.
Immediately before every merge, run loopx --format json pr-review --repo OWNER/REPO --check-merge-readiness NUMBER@HEAD_OID. Merge only when it returns
ready=true for that unchanged head. A rebase/update restarts review; admin
bypass never overrides this gate. Author-owned fallback still needs explicit
user merge authority.
Full PR Review And Bilingual Format
Every review must cover the whole PR, not only the top finding. Read the full diff/checks, then explain motivation, architecture, changed files/symbols, positive and negative paths, risk across the whole diff, validation, and overall judgment. A findings-only or blocker-only body is incomplete.
Publish two artifacts:
- 详细中文评审 - a standalone Chinese full-PR review with the exact head
and five sections:
动机,改动思路,具体改动,对主干的风险,我的整体评价. Cover every changed surface and key symbols, not just the main finding. - 英文简短结论 - start with exactly
English verdict:and include the verdict, exact head, key finding, and validation.
Do not publish before the Chinese section covers the entire PR. Read both artifacts back.
Example / Walkthrough / Smoke-Only PRs
When the review plan marks smoke_or_example_only, the durable_smoke_value
evidence is mandatory before approval. The essence is real, durable value to
the repository and product: running, deterministic, and public-safe are
necessary but not enough.
- Name the shipped behavior, boundary, or maintenance cost this artifact guards. "Demonstrates something that already works" is not durable value.
- Scan existing coverage (
rg -l '<behavior|module>' examples tests) and the same-author batch (gh pr list ... --author <author>/gh search prs); flag same-shape batches opened within minutes as PR farming. - Apply the repo smoke policy: thin + durable, guard shipped behavior or a real boundary, compress rather than append, consolidate same-shape walkthroughs into one PR or focused tests.
- Verdict:
REQUEST_CHANGESfor duplicative, oversized, or value-less scaffolding; name the consolidation or thinning repair in the body. - Repeat offenders: after a REQUEST_CHANGES warning, further low-value same-shape PRs from the same author escalate to a contribution-restriction recommendation (owner blocks the account from further PR submissions); the warning must name this consequence.
Autonomous Queue
For recurring observation, keep one ignored checkpoint and use loopx --format json pr-review --repo owner/repo --state open --autonomous-observation --observation-state-file .local/pr-review-monitor.json with the projected or
handled exact-head flags when their corresponding durable receipts exist.
Treat candidate as a preview, not a durable projection. Follow this order: durable
Todo target-key readback -> --projected-exact-head -> exact-head review/comment
readback -> --handled-exact-head. Never send the projection ACK before the Todo
exists, or the handled ACK before readback at that head. Observation states remain literal;
the checkpoint grants no authority. Stateless callers may use --previous-observation-json instead.
Failure
If loopx pr-review is unavailable, repair the LoopX install or use the
intended checked-out CLI. Do not reconstruct the queue manually and call it a
successful /loopx-pr-review run.