pr-review-submit
Post a single GitHub PR review carrying both a verdict and a body — supplied inline or as a file — in one call, handling the self-review constraint that leaves an author only a comment.
- License 许可
- GPL-3.0
- 最近更新
- 2026-11-14
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- pr-review-submit
- description
- Post a single GitHub PR review carrying both a verdict and a body — supplied inline or as a file — in one call, handling the self-review constraint that leaves an author only a comment.
03 SKILL.md 正文
PR Review Submit
Post a single pull-request review on a GitHub PR, carrying both a
verdict and a review body in one call. This is the review-submission
the /sdlc:orchestrate flow previously performed as a raw review call
of its own; the skill now owns it, and
sdlc:theorem-based-pr-reviewer is the caller that posts through it.
Posting the verdict and body in a single call is deliberate: a separate comment followed by an approval or a change request would create two notifications for one review. This skill always emits exactly one review.
This skill is GitHub-only by design. Its script posts through
gh; there is no CodeCommit (or other source-control) branch, and
none is planned here — CodeCommit is deliberately out of scope for
this plugin.
Invocation
/pr-review-submit <PR> --verdict <approve|request_changes|comment> <body>
/pr-review-submit <PR> --verdict <approve|request_changes|comment> --body-file <path>
<PR>(required): the pull request, in any formskills/lib/pr-reference.mdlists.--verdict <value>(required, exactly once): one ofapprove,request_changes, orcomment. These are GitHub's own review actions, in the skill's spelling; nothing else is a verdict here.approve— the change is good to merge.request_changes— the change needs work before merge.comment— a verdict-less note (e.g. only Medium/Low findings, no approve/block yet).
- The review text, in exactly one of the forms below — supplying
both, or neither, is an error the skill aborts on rather than
guessing:
<body>— the text inline. The caller supplies the full review body; this skill does not author findings.--body-file <path>— a file holding that same text. This is the form a caller uses when the body would not survive being spelled inline on a command line, where the shell reads every backtick and$in it:sdlc:theorem-based-pr-reviewerstages the review summary it posts under.claude/tmp/<task-slug>/and posts it by path, and that summary carries a backticked state-relative detail path on every theorem and finding line, under the${XDG_STATE_HOME:-$HOME/.local/state}root it names once. GitHub caps a review body at 64 KB, which bounds what either form can carry.
Both forms work for every verdict.
Repo-config
This skill reads no repo-config. The PR, verdict, and body are all
supplied by the caller. (The source-control value a caller would
previously have read to choose between gh and CodeCommit is not
consulted — this plugin is GitHub-only, so there is nothing to branch
on.)
Execution
Run the bundled script, spelled as a bare name, with the arguments you
were given. Pass an inline body as a single-quoted argument, or — when
it holds a single quote, a backtick or a $ — write it to a file with
the Write tool and pass that path instead:
pr-review-submit <PR> --verdict <verdict> '<body>'
pr-review-submit <PR> --verdict <verdict> --body-file <path>
The script checks its arguments before posting anything, and every refusal posts no review rather than guessing what the caller meant. Each is a usage error, and stderr names which of these it is:
- No
--verdict. - More than one
--verdict; the message names the first two values. - A
--verdictvalue other thanapprove,request_changes, orcomment; the message names the value. - Both body forms supplied.
- Neither body form supplied.
The verdict then decides, at once, the review action, the line the body
opens with, and the GitHub review state the call creates. The
verdict-line column holds unconditionally; the review state is what it
says here only when the action goes through, and the self-review
constraint below — the one case that replaces the action — lands
commented instead:
--verdict |
Review action | Body's first line | Review state |
|---|---|---|---|
approve |
approve | APPROVED |
approved |
request_changes |
request changes | CHANGES_REQUESTED |
changes_requested |
comment |
comment | COMMENTED |
commented |
The verdict line goes at the head of the body on every post,
downgraded or not, followed by a blank line and the caller's text, so a
reader of the body never has to work out whether the self-review
constraint below fired. It is the bare verdict word and nothing else: a
reader can already see on the PR whether the round arrived as a review
or as a comment, and a commented state dressed up as meaning
changes_requested is worse than the plain word. In the file form the
script composes the posted body itself and leaves the caller's file
untouched.
Self-review constraint (an author may post only a comment)
Both verdict actions are refused when the reviewer is the PR
author. The refusal is GitHub's, not a client-side check: the server
returns it on the addPullRequestReview mutation, and gh prints it
as, for example:
GraphQL: Review Can not approve your own pull request (addPullRequestReview)
The script reads no login to predict this. It posts with the verdict's
own action, and only when that call fails with the refusal for that
action — Can not approve your own pull request for approve,
Can not request changes on your own pull request for
request_changes — does it post again as a comment. The refused call
leaves nothing on the PR, so the comment is the only review. Everything
else about the second call, the verdict line included, is unchanged,
which is what carries the verdict the refused action would have
carried. comment is never refused this way. Any other failure of the
first call stays a failure: nothing is reposted, and it exits 1.
Handling the downgrade here is why sdlc:theorem-based-pr-reviewer
can hand this skill any verdict unconditionally: reviewer and author
are frequently the same identity in the orchestrate flow, so a
blocking verdict has to travel in the comment body.
Output and exit status
After posting, the script re-reads the newest review on the PR, whoever left it, and checks it is not the one that was newest before the post, and that it carries the expected state and the body it posted. A review someone else leaves in between fails that check.
- Exit 0 — stdout is one line: the PR, the verdict
requested, the GitHub review state the call actually created
(
approved,changes_requested, orcommented), and which body form carried it. Report it back. The state is what a caller gating on the platform's view of the PR needs: a downgraded review carries statecommented, so GitHub sees no blocking review whatever the body says. - Exit 1 — a command the script ran failed, such as a
ghcall, and its own error is on stderr above the script's line. Surface it verbatim. - Exit 2 — a usage error, one of the refusals above; nothing was posted.
- Exit 3 — the review did not land as posted: no new review appeared, or it carries another state or another body. Stderr says which. Report the failure rather than posting again.
04 同仓库更多 Skills
mask-inappropriate-language
Replace inappropriate language (profanity, slurs, strong insults) in provided text or a file with asterisks, character-for-character, preserving everything else.
theorem-agents-interface
The interface between the sdlc reviewer and the theorem agents it spawns — what each double-dash brief parameter means, and what each consequence class means. Preloaded into every theorem agent (sdlc:theorem-generator, the disprover, and the verifier) via its skills frontmatter, and read by name by the sdlc:theorem-based-pr-reviewer agent for what its briefs' parameters mean; not invoked from the user's slash menu.
sdlc-config-user
Interactively create or merge-update the repo user sdlc config, `<repo-root>/.sdlc/user-config.yml` (tier 3 — this user, this repo, never committed), and add it to the repo's tracked `.gitignore`.
sdlc-config-repo
Interactively create or merge-update the shared repo sdlc config, `<repo-root>/.sdlc/repo-config.yml` (tier 2 — tracked, every user of this repo).
sdlc-config-global
Interactively create or merge-update the global user sdlc config, `$XDG_CONFIG_HOME/sdlc/user-config.yml` (tier 1 — this user, every repo on this machine).
pr-read-cli-interface
The contract for sdlc's PR-read CLIs — sdlc-pr-round, sdlc-pr-adjustments, sdlc-fixer-brief and sdlc-records-chain — their arguments, exit codes and output grammar. Preloaded into sdlc:theorem-based-pr-reviewer, sdlc:issue-fixer, sdlc:docs-writer and sdlc:pr-finalizer via their skills frontmatter; not invoked from the user's slash menu.