plugins/dev/skills/pr-walkthrough/SKILL.md
Generate an evidence-grounded markdown walkthrough for a pull request.
npx skillsauth add rp1-run/rp1 pr-walkthroughInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
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
Single pass. Do not:
pr-review artifacts.data-ai
Capture session context as a structured, frontmatter-rich markdown note under .rp1/work/notes/ with auto-maintained index and log.
tools
Plan and execute splitting a large PR or branch into a reviewable stacked PR sequence.
development
Write maximally terse agent prompts from scratch. Use when creating new agent specs, command prompts, or instruction sets. Teaches structure-first composition with compression-by-default patterns. Extended with constitutional governance, epistemic stance selection, and a six-stage prompt pipeline.
development
Interactive speedrun loop for small, low-risk changes. Delegates each request to a general sub-agent. Redirects larger work to /build-fast or /build.