一键导入
pr-walkthrough
Generate an evidence-grounded markdown walkthrough for a pull request.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Generate an evidence-grounded markdown walkthrough for a pull request.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Agent-only canonical output templates for rp1 artifacts. Load when producing structured markdown to ensure format consistency and routing metadata.
Ask about rp1 capabilities, discover skills, and get workflow guidance.
Evidence-gated tech debt and bloat detection. Scouts signals, ranks by materiality, validates by refutation, reports up to 5 findings with actions.
Synchronizes user-facing documentation with the current knowledge base through validate -> stale gate -> scan -> approval -> process orchestration.
Orchestrates parallel KB generation using spatial analysis and a map-reduce architecture with incremental and feature-learning modes.
Analyzes systems holistically to provide strategic recommendations balancing cost, quality, performance, complexity, and business objectives with quantified trade-offs.
| name | pr-walkthrough |
| description | Generate an evidence-grounded markdown walkthrough for a pull request. |
| allowed-tools | Bash(echo *), Bash(rp1 *), Bash(git *), Bash(gh *) |
| metadata | {"category":"review","is_workflow":true,"workflow":{"run_policy":"fresh","identity_args":[]},"version":"1.0.0","tags":["pr","review","walkthrough","markdown"],"created":"2026-04-26T00:00:00.000Z","updated":"2026-04-26T00:00:00.000Z","author":"cloud-on-prem/rp1","arguments":[{"name":"TARGET","type":"string","required":false,"description":"PR number, PR URL, branch name, or empty for the current branch"},{"name":"BASE_BRANCH","type":"string","required":false,"default":"main","description":"Diff base branch used when no remote PR is available"}],"sub_agents":["rp1-dev:pr-walkthrough-reporter"]} |
Generate a slide-ready markdown walkthrough from direct pull request evidence. The output is a reviewer-orientation artifact with plain markdown fallback, not a review verdict or rendered slide reader.
Use the pre-resolved projectRoot, kbRoot, workRoot, and codeRoot values from the generated Workflow Bootstrap section. Run all source-control commands from codeRoot, and write generated artifacts only under workRoot.
Do not read .rp1/work/pr-reviews/ or any existing pr-review artifacts as source material. The walkthrough source of truth is the target PR metadata, changed files, diffs, and commit summaries gathered in this workflow.
stateDiagram-v2
[*] --> collecting
collecting --> publishing : evidence_ready
publishing --> [*] : done
On each phase transition, report via:
rp1 agent-tools emit \
--workflow pr-walkthrough \
--type status_change \
--run-id {RUN_ID} \
--step {CURRENT_STATE} \
--data '{"status": "running"}'
RUN_ID comes from the generated Workflow Bootstrap section.RUN_NAME from the resolved target: use "PR Walkthrough: PR #{number}" when a PR number is available, otherwise "PR Walkthrough: {branch_name}".--name "{RUN_NAME}".Example sequence:
rp1 agent-tools emit --workflow pr-walkthrough --type status_change --run-id {RUN_ID} --name "PR Walkthrough: PR #42" --step collecting --data '{"status": "running"}'
rp1 agent-tools emit --workflow pr-walkthrough --type status_change --run-id {RUN_ID} --step publishing --data '{"status": "running"}'
rp1 agent-tools emit --workflow pr-walkthrough --type status_change --run-id {RUN_ID} --step publishing --data '{"status": "completed"}'
On a blocking error, emit the current step with {"status":"failed","reason":"..."} and stop without dispatching the reporter or registering an artifact.
Execute immediately. Do not ask for clarification. Fail clearly during collecting when the target cannot identify one PR or one local diff.
Emit collecting running before command execution.
Normalize inputs:
| Input | Resolution |
|---|---|
Empty TARGET | Use the PR associated with the current branch via gh pr view; if none exists, use git diff BASE_BRANCH...current_branch |
| Numeric target | Use gh pr view {TARGET} and gh pr diff {TARGET} |
| PR URL | Use gh pr view {TARGET} and gh pr diff {TARGET} |
| Branch name | Use gh pr view {TARGET} if available; otherwise use git diff BASE_BRANCH...{TARGET} |
Implementation guidance:
target from {TARGET} and base_branch from {BASE_BRANCH}.current_branch with git -C {codeRoot} branch --show-current.^[0-9]+$./pull/.gh pr view from {codeRoot}. If that fails, validate that both base and head refs exist locally before using the git-only fallback.If no PR exists and the local fallback cannot produce a diff, fail with a message that includes the attempted target and base branch.
For a resolved GitHub PR target, collect:
gh pr view {resolved_pr_target} \
--json number,title,body,url,author,baseRefName,headRefName,headRefOid,baseRefOid,additions,deletions,changedFiles,files,commits
gh pr diff {resolved_pr_target} --name-only
gh pr diff {resolved_pr_target} --patch
For a git-only target, collect:
git -C {codeRoot} diff --name-only {base_branch}...{head_ref}
git -C {codeRoot} diff --patch {base_branch}...{head_ref}
git -C {codeRoot} diff --stat {base_branch}...{head_ref}
git -C {codeRoot} log --oneline --no-decorate {base_branch}..{head_ref}
For PR targets, attempt a local stat with git -C {codeRoot} diff --stat {baseRefName}...{headRefName} when refs exist. If local refs are unavailable, use PR JSON additions, deletions, and changedFiles as the stats source.
Required failure behavior:
gh is unavailable for a numeric or URL target, fail during collecting; do not silently switch to an unrelated local diff.BASE_BRANCH, fail during collecting.collecting.Build one EVIDENCE_JSON object from direct evidence only:
{
"source": "github_pr | git_diff",
"target": "{TARGET}",
"base_branch": "{base_branch}",
"head_ref": "{head_ref}",
"review_id": "{review_id}",
"pr": {},
"file_names": [],
"patch": "",
"stats": "",
"commit_summaries": [],
"evidence_index": []
}
Assign evidence IDs before dispatch:
| ID Pattern | Source |
|---|---|
E-PR-001 | PR metadata, title, body, URL, author, base/head refs, or git-only branch metadata |
E-FILE-### | Changed-file entries from gh pr diff --name-only, PR JSON files, or git diff --name-only |
E-DIFF-### | Meaningful diff hunks or patch excerpts selected for walkthrough grounding |
E-COMMIT-### | Commit summaries from PR JSON commits or git log |
Keep patch data concise enough for the reporter to process, but preserve the file path and hunk headers for every included diff excerpt. The evidence index entries must include id, kind, source, and summary.
Derive review_id as pr-{number} for PR targets. For branch-only targets, sanitize the head ref by lowercasing and replacing characters outside [a-z0-9._-] with -.
After evidence collection succeeds, emit publishing running and dispatch the reporter:
{% dispatch_agent "rp1-dev:pr-walkthrough-reporter" %} Generate an evidence-grounded slide-ready markdown PR walkthrough with plain markdown fallback. EVIDENCE_JSON: {{stringify(EVIDENCE_JSON)}} KB_ROOT: {kbRoot} WORK_ROOT: {workRoot} CODE_ROOT: {codeRoot} REVIEW_ID: {{review_id}} Return single-line JSON with path. {% enddispatch_agent %}
Wait for completion. Parse the reporter output as single-line JSON:
{"path":"pr-walkthroughs/{REVIEW_ID}-walkthrough-{NNN}.md"}
If the reporter fails or the output cannot be parsed, emit publishing with {"status":"failed","reason":"reporter failed"} and stop.
Validate the returned path before registration:
pr-walkthroughs/..md....Do not reject an otherwise valid reporter artifact because it contains the canonical slide-ready markdown contract fields, reserved <!-- rp1-slide: ... --> markers, slide metadata blocks, or <!-- rp1-notes --> speaker-note sections.
Register the reporter output during publishing:
rp1 agent-tools emit \
--workflow pr-walkthrough \
--type artifact_registered \
--run-id {RUN_ID} \
--step publishing \
--data '{"path": "{ARTIFACT_RELATIVE_PATH}", "feature": "{review_id}", "storageRoot": "work_dir", "format": "markdown"}'
Then emit publishing completed:
rp1 agent-tools emit \
--workflow pr-walkthrough \
--type status_change \
--run-id {RUN_ID} \
--step publishing \
--data '{"status": "completed"}'
Output only:
## PR Walkthrough Complete
**Target**: {target_description}
**Artifact**: {ARTIFACT_RELATIVE_PATH}
**Evidence**: {changed_file_count} files, {commit_count} commits
{% include_shared "anti-loop.md" %}
File-specific constraints:
pr-review artifacts