一键导入
canon-pr-review
Use when you need a governed Canon review of a real diff or pull-request range instead of a loose chat summary.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Use when you need a governed Canon review of a real diff or pull-request range instead of a loose chat summary.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Use when a repository does not have Canon runtime state yet and you need to initialize .canon before any governed workflow.
Use when you need a governed Canon policy-shaping run to shape a new or modified policy with mandatory impact evaluation.
Use when you need a governed backlog run that decomposes bounded upstream decisions into delivery epics and slices.
Use when you need a governed Canon architecture run to record decisions, tradeoffs, and risk-gated approvals.
Use when you need a governed change run in a live codebase where invariants and existing behavior matter.
Use when you need a governed domain-language packet that stabilizes the shared vocabulary of a product area before downstream design or change work.
| name | canon-pr-review |
| description | Use when you need a governed Canon review of a real diff or pull-request range instead of a loose chat summary. |
available-nowdefault visibility: discoverable-standardExpose the delivered Canon pr-review workflow as a governed run started from your AI assistant.
canon-review workflow instead of a diff-backed review.RISKZONEWORKTREE to review uncommitted changes)Optional:
OWNER when the user wants to override Git-derived ownership explicitlycanon is on PATH. If missing, point to the install guide..canon/ exists. If missing, point to $canon-init..canon/ artifacts, or any file-backed input path.pr-review does not auto-bind from canon-input/; it requires explicit base/head refs or WORKTREE.origin/<default-branch> -> HEAD, <default-branch> -> HEAD, <base-ref> -> WORKTREE, or a custom base/head pair.OWNER is optional. If omitted, Canon should try repository-local or global Git identity before asking for explicit owner input.origin/main.git status --porcelain. If uncommitted changes exist, ask with a guided choice whether to review them by using WORKTREE as the head ref or to provide a different head ref. If no uncommitted changes exist, report that the ref pair has no diff.WORKTREE is a valid head ref value — it tells Canon to diff the working tree against the base ref.canon inspect risk-zone --mode pr-review --input <BASE_REF> --input <HEAD_REF> to infer a provisional pair, explain the Canon rationale and confidence, and ask the user to confirm or override before invoking Canon.low confidence, present it as provisional and invite override rather than treating it as final.low-impact, bounded-impact, or systemic-impact.green, yellow, or red.The pr-review workflow uses the onion-layer actionable review pipeline:
canon pr-review prepare --base <BASE_REF> --head <HEAD_REF>
# → LLM agent fills the 7 layer outputs under .canon/runs/<RUN_ID>/pr-review/layers/
canon pr-review accept --run <RUN_ID>
# → validates reviewer output, enforces layer coverage
canon pr-review finalize --run <RUN_ID>
# → renders final artifacts, derives recommendation, enforces coverage accounting
When reviewing uncommitted changes, use WORKTREE as the head ref.
canon run --mode pr-review is no longer supported.
Use canon pr-review prepare instead.
Author the packet as a code reviewer writing bounded findings and disposition for maintainers.
The recommended pr-review workflow is prepare → LLM fills layers → accept → finalize.
After prepare succeeds, the assistant is responsible for turning the layer
instructions into grounded, reviewable output files.
BASE_REF and HEAD_REF (or between BASE_REF and the working tree when WORKTREE is the head ref) before generation.canon pr-review prepare --base <BASE_REF> --head <HEAD_REF> first so .canon/runs/<RUN_ID>/pr-review/ exists with all layer directories and instructions.output.md under .canon/runs/<RUN_ID>/pr-review/layers/<NN>-<slug>/output.md following the corresponding instructions.md.review-summary.md as the primary status artifact and conventional-comments.md as the reviewer-facing companion artifact.conventional-comments.md carries an explicit scope annotation derived deterministically from the finding's changed surfaces.canon pr-review prepare --base <BASE> --head <HEAD>. This generates the 7 layer directories under .canon/runs/<RUN_ID>/pr-review/layers/ with per-layer instructions.md files.instructions.md, perform the review, and write findings into output.md.deferral.toml inside the layer directory.canon pr-review accept --run <RUN_ID> to validate layer coverage and output quality.canon pr-review finalize --run <RUN_ID> to render final artifacts and derive the recommendation.When the diff is structurally bounded but materially ambiguous on points that would force the assistant to invent content, ask targeted clarification questions before generation rather than papering over the gap.
and, or, or comma-separated sub-questions.Each question must follow this shape:
- Question: <one-sentence question>
- Affects: <artifact or section it changes>
- Why it matters: <one short line on what changes if unanswered>
- Context: <≤2 lines from the diff or touched file, or `no diff coverage`>
- Options:
a) <concrete option>
b) <concrete option>
c) <concrete option>
d) Other (free-form)
- Default if skipped: <explicit default>
- Status: Required | Optional
Question line as the main prompt and surface Why it matters and Context as secondary or tooltip text rather than dumping the full block inline.Write .canon/artifacts/<RUN_ID>/pr-review/ai-provenance.md describing how the
review packet was produced. It must include:
WORKTREE), and the touched files that were read.Clarification Loop section with: number of questions presented, number of Required questions answered, number of Required questions left unresolved, number of Optional questions answered or deferred, and the number of substantive clarifications that drove material changes per artifact section..canon/artifacts/... review packet paths when available, especially review-summary.md and conventional-comments.md.canon/artifacts/<RUN_ID>/pr-review/ and .canon/artifacts/<RUN_ID>/pr-review/ai-provenance.md, never as in-place edits to the working tree or to any source file in the diff.canon/ is missing, point to $canon-init.RISK, use guided fixed choices with the exact allowed values low-impact, bounded-impact, and systemic-impact.ZONE, use guided fixed choices with the exact allowed values green, yellow, and red.origin/main or refs/remotes/origin/main, and normalizes them before invocation.WORKTREE and providing a different head ref.AwaitingApproval, surface the exact gate target, typically gate:review-disposition, and do not simulate a review packet beyond Canon output.$canon-inspect-artifacts as drill-down into review-summary.md, conventional-comments.md, and the detailed findings.$canon-inspect-evidence when the user needs the lineage, request history, or policy rationale behind the review packet.$canon-approve only after the user has reviewed the packet or explicitly wants to record disposition.$canon-status first and use $canon-resume only if Canon still leaves the run incomplete.$canon-status$canon-inspect-evidence$canon-inspect-artifacts$canon-approve$canon-resume