pr-checklist

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

PR Checklist

PR 检查清单

Independently analyze changes and generate a report. Do not post or edit code unless explicitly requested.
独立分析变更并生成报告。除非明确要求,否则请勿发布或编辑代码。

Scope

范围

Default: current branch's GitHub PR. Explicit targets take precedence:
  • pr <number-or-url>
  • branch <branch> [base <base>]
  • range <base>..<head>
    or
    range <base>...<head>
  • commit <sha>
    ,
    staged
    , or
    working-tree
  • self-check
    (no review target)
Paths or natural-language focus/exclusions restrict the target.
PR uses GitHub's diff; branch uses
base...branch
(infer default base or ask); explicit ranges preserve supplied semantics; commit compares its parent; staged means index only; working-tree means its diff only. Without an explicit target or current PR, ask. Ignore untracked files in the review diff unless included or overlapping a staged file; mention overlaps. Configuration resolution is exempt.
Use GitHub only for PR identity, base/head, paths, and diff — not body, comments, reviews, checks, coverage, issues, or other metadata.
默认:当前分支的GitHub PR。明确指定的目标优先级更高:
  • pr <编号或URL>
  • branch <分支名> [base <基准分支>]
  • range <基准>..<头部>
    range <基准>...<头部>
  • commit <哈希值>
    staged
    working-tree
  • self-check
    (无审核目标)
可通过路径或自然语言指定的重点/排除项来限制目标范围。
PR 使用GitHub的差异对比;branch 使用
base...branch
(自动推断默认基准分支或询问用户);明确指定的范围保留其语义;commit 与其父提交对比;staged 仅指索引内容;working-tree 仅指其差异。若无明确目标或当前PR,需询问用户。除非被包含或与已暂存文件重叠,否则忽略审核差异中的未跟踪文件;若存在重叠需提及。配置解析不受此限制。
仅使用GitHub获取PR标识、基准/头部分支、路径和差异信息——不使用PR正文、评论、审核记录、检查结果、覆盖率数据、问题或其他元数据。

Self-check

自我检查

For
self-check
, read and follow references/self-check.md, then stop. Do not enter the normal review workflow.
对于
self-check
,请阅读并遵循 references/self-check.md,然后停止操作。请勿进入常规审核流程。

Configuration

配置

For normal reviews, before loading the diff, read and follow references/configuration.md. Resolve
.pr-checklist.yml
from the target state and validate it with
scripts/parse-config.ts
. A missing file uses the defaults; an invalid file fails.
If configuration enables no analysis, print
PR checklist: nothing enabled to analyze.
and stop successfully.
对于常规审核,在加载差异前,请阅读并遵循 references/configuration.md。从目标状态中读取
.pr-checklist.yml
并使用
scripts/parse-config.ts
验证其有效性。若文件缺失则使用默认配置;若文件无效则审核失败。
若配置未启用任何分析项,请打印
PR checklist: nothing enabled to analyze.
并成功终止。

Workflow

工作流程

  1. Resolve target identity; use field-limited
    gh pr view
    .
  2. Load, normalize, and validate configuration from the resolved target. Exit early when nothing is enabled.
  3. Inspect the resolved diff, applicable instructions, and context at its head. Prefer
    git show <head>:<path>
    ; use a temporary worktree for broad work, never an unrelated dirty checkout.
  4. For staged scope, use
    git show :<path>
    or
    git checkout-index
    ; exclude unstaged content. Working-tree scope uses the checkout.
  5. Run useful local checks; independently derive and deduplicate findings.
  6. Run only enabled analysis passes. For configured checks, pass the normalized items and verify that the result preserves their IDs, titles, and order.
  7. Merge the exact normalized
    plan
    , enabled outputs, and
    source
    . Set disabled
    antiSlop
    and
    changes
    sections to
    null
    ; set disabled or empty
    checks
    to
    []
    . Validate against
    prChecklistSchema
    , which enforces section enablement and configured check identity, title, and order.
  8. In this skill directory, render to a unique temporary path:
bash
TMP_ROOT="${TMPDIR:-/tmp}"
REPORT_DIR=$(mktemp -d "${TMP_ROOT%/}/pr-checklist.XXXXXX")
REPORT="$REPORT_DIR/pr-checklist.md"

if ! printf '%s' "$PR_CHECKLIST_JSON" | npx --yes deno@2.5.4 run \
    --allow-net=zenquotes.io \
    scripts/render.ts \
    > "$REPORT"
then
  rm -f "$REPORT"
  rmdir "$REPORT_DIR" 2>/dev/null || true
  exit 1
fi

printf '<pr_checklist>%s</pr_checklist>\n' "$REPORT"
JSON enters stdin; Markdown exits stdout. Report the path; change destination only when requested.
  1. 确定目标标识;使用字段受限的
    gh pr view
    命令。
  2. 从已确定的目标中加载、标准化并验证配置。若未启用任何项则提前退出。
  3. 检查已解析的差异、适用的说明及其头部的上下文。优先使用
    git show <head>:<path>
    ;如需处理大量内容,使用临时工作树,切勿使用无关的脏检出。
  4. 对于staged范围,使用
    git show :<path>
    git checkout-index
    ;排除未暂存内容。Working-tree范围使用当前检出内容。
  5. 运行有用的本地检查;独立推导并去重发现的问题。
  6. 仅运行已启用的分析流程。对于配置的检查项,传入标准化后的条目并验证结果保留其ID、标题和顺序。
  7. 合并标准化后的
    plan
    、已启用的输出和
    source
    。将禁用的
    antiSlop
    changes
    部分设为
    null
    ;将禁用或为空的
    checks
    设为
    []
    。根据
    prChecklistSchema
    进行验证,该模式强制要求部分启用状态以及配置检查项的标识、标题和顺序。
  8. 在当前技能目录中,渲染到唯一的临时路径:
bash
TMP_ROOT="${TMPDIR:-/tmp}"
REPORT_DIR=$(mktemp -d "${TMP_ROOT%/}/pr-checklist.XXXXXX")
REPORT="$REPORT_DIR/pr-checklist.md"

if ! printf '%s' "$PR_CHECKLIST_JSON" | npx --yes deno@2.5.4 run \
    --allow-net=zenquotes.io \
    scripts/render.ts \
    > "$REPORT"
then
  rm -f "$REPORT"
  rmdir "$REPORT_DIR" 2>/dev/null || true
  exit 1
fi

printf '<pr_checklist>%s</pr_checklist>\n' "$REPORT"
JSON从标准输入传入;Markdown从标准输出输出。报告路径;仅在被要求时更改目标位置。

Analysis

分析

Anti-slop

Anti-slop(冗余代码检查)

When enabled, read and follow references/anti-slop-review.md. When subagents or task delegation are available, use that prompt as an independent delegated pass. Verify its result and score.
Use engineering judgment when verifying the score against the findings.
启用时,请阅读并遵循 references/anti-slop-review.md。若有子代理或任务委托可用,将该提示作为独立的委托流程使用。验证其结果和评分。
验证评分与发现问题时需运用工程判断。

Configured checks

配置检查项

When enabled with non-empty items, read and follow references/configured-checks-review.md. When subagents or task delegation are available, use that prompt as an independent delegated pass. Verify every configured item is represented exactly once.
启用且条目非空时,请阅读并遵循 references/configured-checks-review.md。若有子代理或任务委托可用,将该提示作为独立的委托流程使用。验证每个配置条目都被精确呈现一次。

Changes

变更分析

When enabled, read and follow references/changes-review.md. When subagents or task delegation are available, use that prompt as an independent delegated pass. Verify its results.
启用时,请阅读并遵循 references/changes-review.md。若有子代理或任务委托可用,将该提示作为独立的委托流程使用。验证其结果。