review-pr
Skill45 starsChanged 4 days agoMITView on GitHub
Review a GitHub PR using multi-agent verification. Usage /groundwork:review-pr [PR number or URL]. Pass --no-interactive to skip all prompts and auto-publish.
- Deletes or force-pushes
185 other projects use a version of this.
Adopted by
Most recently taken up by
- data-privacy-stack/presidiotheir own version, first seen Nov 9, 2026
- pgmpy/pgmpytheir own version, first seen Nov 9, 2026
- enes-alatas/spooltheir own version, first seen Nov 8, 2026
- microsoft/presidiotheir own version, first seen Nov 8, 2026
- domengabrovsek/agent-configtheir own version, first seen Nov 8, 2026
- domengabrovsek/claudetheir own version, first seen Nov 8, 2026
Used with
Projects with it also use diagnose-ci-failures, docs-loop and 10 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
zerx-labSkilldiagnose-ci-failures
Diagnose CI failures for a PR using the GitHub CLI, extract error logs, and generate a plan to fix them. Use when the user asks to check CI status, pull CI issues, triage test failures, or investigate PR build failures.
Also in 3 projects that use this
GeiserXSkilldocs-loop
Use when the user asks to audit docs, check documentation for stale claims, or verify docs against the code.
Also in 3 projects that use this
GeiserXSkillfull-loop
Drive a repository to done with sergio-loop, then keep improving it with refine-loop at a descending theta. Use only when the user explicitly invokes full-loop.
Also in 3 projects that use this
n24q02mSkillreview-delta
Review only changes since last commit using impact analysis. Token-efficient delta review with automatic blast-radius detection.
Also in 3 projects that use this
n24q02mSkillbuild-graph
Build or update the code review knowledge graph. Run this first to initialize, or let hooks keep it updated automatically.
Also in 3 projects that use this
- +7 more from GeiserX
Other versions185 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 185
- denoland/deno★ 109ksame name
- ToolJet/ToolJet★ 41ksame name
- remix-run/remix★ 33ksame name
- tirth8205/code-review-graph★ 33ksame name
- alpinejs/alpine★ 32ksame name
- nrwl/nx★ 29ksame name
- PrefectHQ/fastmcp★ 28ksame name
- jlowin/fastmcp★ 28ksame name
- livewire/livewire★ 24ksame name
- microsoft/fluentui★ 20ksame name
175 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository43 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- build-unplannedSkill
- check-specs-alignmentSkill
- create-tasksSkill
- debugSkill
- design-architectureSkill
- design-it-twiceSkill
- design-productSkill
- domain-modelingSkill
- doubt-driven-developmentSkill
- finalize-taskSkill
- groundwork-checkSkill
- groundwork-helpSkill
- handoffSkill
- implement-taskSkill
- instrument-observabilitySkill
- just-do-itSkill
- just-do-it-swarmingSkill
- plan-taskSkill
- select-projectSkill
- setup-repoSkill
- shipSkill
- skillsSkill
- source-architecture-from-codeSkill
- source-product-specs-from-codeSkill
- source-ux-design-from-codeSkill
- split-architectureSkill
- split-specsSkill
- staged-rolloutSkill
- statuslineSkill
- swarm-debugSkill
- swarm-design-architectureSkill
- task-validation-loopSkill
- test-driven-developmentSkill
- understanding-feature-requestsSkill
- use-git-worktreeSkill
- using-groundworkSkill
- ux-designSkill
- validateSkill
- vertical-sliceSkill
- work-on-next-taskSkill
- work-onSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
29 rules. 0 are common, 9 are distinctive, and 20 are very specific to this project.
0
Common
Most of the 178 edited versions we read keep these.
9
Distinctive
This author's own choices. Worth a look.
20
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 15
Check for non-interactive mode from either source:
- Very specific: line 16
If the argument string contains --no-interactive → strip it from the argument before PR number parsing, set non_interactive = true
- Very specific: line 17
If session context contains GROUNDWORK_BATCH_MODE=true → set non_interactive = true
- Very specific: line 19
If either condition is met, all AskUserQuestion prompts below are replaced with their documented auto-decision — except the pre-flight …
- Very specific: line 26
If effort is low or medium (i.e.
- Distinctive: line 27
If you are not Sonnet or Opus, you MUST show the recommendation prompt - regardless of effort level.
- Distinctive: line 45
If the user selects "Cancel — I'll switch first": output the switching commands above and stop.
- Distinctive: line 54
If no PR identifier was provided:
- Very specific: line 56
Interactive mode: Use AskUserQuestion to ask for one (free-text input, no options).
- Very specific: line 67
Run all of these gh commands in parallel using the Bash tool:
- Very specific: line 105
If the PR state is not OPEN:
- Very specific: line 107
Interactive mode: Use AskUserQuestion:
- Very specific: line 122
If isCrossRepository is true, run gh pr checkout <pr_number> to fetch the fork's branch.
- Very specific: line 131
Search existing_reviews for reviews whose body contains the marker <!-- groundwork-review -->.
- Very specific: line 152
If "Fresh review" → proceed normally.
- Very specific: line 153
If "Incremental review" → store previous groundwork findings to exclude duplicates in Step 6.
- Very specific: line 158
If non-groundwork reviews or review comments exist, produce a brief summary as existing_human_feedback.
- Very specific: line 166
If existing_comments contain replies to previous groundwork-authored comments (detected by <!-- groundwork-review --> marker or matching …
- Distinctive: line 189
Check for architecture and design docs:
- Very specific: line 197
CRITICAL — Context budget: Do NOT read file contents, full diffs, or docs into this orchestrating context.
- Distinctive: line 258
Keep the higher severity
- Very specific: line 262
If running in incremental mode (from Step 3a), also exclude findings that match previous groundwork review comments.
- Very specific: line 291
If "Show full preview" → display the full aggregation table plus all findings with their file/line/severity, then re-ask:
- Distinctive: line 307
If "Cancel" at either prompt → stop.
- Very specific: line 313
If ALL agents approved AND no critical or major findings → event: APPROVE
- Very specific: line 314
If any agent returned request-changes OR any critical/major findings exist → event: REQUEST_CHANGES
- Very specific: line 383
Fallback: If the API call fails due to an invalid line position, remove the offending comment from comments[], append it to the review body …
- Distinctive: line 391
If a temporary branch was created during checkout, delete it:
- Distinctive: line 395
If the branch already existed when you started (another review of the same PR in this clone), you reused it — still safe to delete it here, …
“Common” is measured: kept by at least 6 in 10 of the 178 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
PR Review Skill
Multi-agent PR review that runs specialized agents against PR changes and posts structured feedback to GitHub.
Non-Interactive Mode Detection
Check for non-interactive mode from either source:
- If the argument string contains
--no-interactive→ strip it from the argument before PR number parsing, setnon_interactive = true - If session context contains
GROUNDWORK_BATCH_MODE=true→ setnon_interactive = true
If either condition is met, all AskUserQuestion prompts below are replaced with their documented auto-decision — except the pre-flight model check, which always prompts.
Pre-flight: Model Recommendation
Your current effort level is {{effort_level}}.
Skip this step silently if effort is high, xhigh, or max (the scale is low < medium < high < xhigh < max, so xhigh and max are already above high) AND you are Sonnet or Opus.
If effort is low or medium (i.e. below high), you MUST show the recommendation prompt — regardless of model.
If you are not Sonnet or Opus, you MUST show the recommendation prompt - regardless of effort level.
Otherwise → always prompt (even in non-interactive mode) using AskUserQuestion:
{
"questions": [{
"question": "Do you want to switch? Multi-agent orchestration and deduplication judgment across 6-8 agents benefits from consistent reasoning.\n\nTo switch: cancel, run `/effort high` (and `/model sonnet` if on Haiku), then re-invoke this skill.",
"header": "Recommended: Sonnet or Opus at high effort",
"options": [
{ "label": "Continue" },
{ "label": "Cancel — I'll switch first" }
],
"multiSelect": false
}]
}If the user selects "Cancel — I'll switch first": output the switching commands above and stop. Do not proceed with the skill.
Step 1: Parse PR Identifier
Extract the PR number from the user's input. Accept any of these formats:
- Numeric:
42 - With hash:
#42 - Full URL:
https://github.com/owner/repo/pull/42
If no PR identifier was provided:
- Non-interactive mode: Output an error: "No PR identifier provided. Cannot proceed in non-interactive mode." and stop.
- Interactive mode: Use
AskUserQuestionto ask for one (free-text input, no options).
Extract owner/repo by running:
gh repo view --json nameWithOwner --jq '.nameWithOwner'Store the PR number as pr_number and the owner/repo as repo_slug.
Step 2: Fetch PR Context
Run all of these gh commands in parallel using the Bash tool:
- PR metadata:
gh pr view <pr_number> --json title,body,baseRefName,headRefName,headRefOid,author,state,url,isCrossRepository,additions,deletions,changedFiles - PR diff:
Store asgh pr diff <pr_number>pr_diff. - Changed file paths:
Store asgh pr view <pr_number> --json files --jq '.files[].path'changed_file_paths. - Diff stat:
Store asgh pr diff <pr_number> --statdiff_stat. - Existing reviews:
Store asgh api repos/<repo_slug>/pulls/<pr_number>/reviewsexisting_reviews. - Existing review comments:
Store asgh api repos/<repo_slug>/pulls/<pr_number>/commentsexisting_comments.
Validate state:
- If the PR state is not
OPEN:- Non-interactive mode: Log a warning ("PR is [state] — continuing anyway") and proceed.
- Interactive mode: Use
AskUserQuestion:
If "Cancel" → stop.{ "questions": [{ "question": "This PR is **[state]**. Continue reviewing anyway?", "header": "PR is not open", "options": [ { "label": "Yes, continue" }, { "label": "Cancel" } ], "multiSelect": false }] }
- If
isCrossRepositoryis true, rungh pr checkout <pr_number>to fetch the fork's branch. - Otherwise, checkout the PR branch:
gh pr checkout <pr_number>.
Concurrent same-PR reviews in one clone: if a local pr-<pr_number>-review branch already exists (a previous or concurrent review), reuse it idempotently instead of fighting over it — fetch, then reset it to the PR's current headRefOid (git checkout pr-<pr_number>-review && git reset --hard <headRefOid>), and note in your output that an existing review branch was reused.
Step 3: Handle Existing Feedback
3a: Detect Previous Groundwork Reviews
Search existing_reviews for reviews whose body contains the marker <!-- groundwork-review -->.
If groundwork reviews exist:
- Non-interactive mode: Proceed with a fresh review (default).
- Interactive mode: Use
AskUserQuestion:{ "questions": [{ "question": "Previous groundwork review(s) found on this PR. How would you like to proceed?", "header": "Existing groundwork reviews detected", "options": [ { "label": "Fresh review", "description": "Post a fresh review (dismisses previous)" }, { "label": "Incremental review", "description": "Only new findings since last groundwork review" }, { "label": "Cancel" } ], "multiSelect": false }] }
If "Fresh review" → proceed normally. If "Incremental review" → store previous groundwork findings to exclude duplicates in Step 6. If "Cancel" → stop.
3b: Summarize Non-Groundwork Feedback
If non-groundwork reviews or review comments exist, produce a brief summary as existing_human_feedback. Include:
- Reviewer name and verdict (APPROVED, CHANGES_REQUESTED, COMMENTED)
- Key points raised
This summary will be passed to agents so they avoid restating already-raised points.
3c: Handle Replies on Previous Groundwork Comments
If existing_comments contain replies to previous groundwork-authored comments (detected by <!-- groundwork-review --> marker or matching author):
- Present these reply threads to the user
- Recommend responses and paths forward before proceeding with the new review
Step 4: Determine Active Agents
Parse changed_file_paths to determine which conditional agents to enable:
| Agent | Active | Skip when |
code-quality-reviewer | Always | -- |
test-quality-reviewer | Always | -- |
security-reviewer | Always | -- |
performance-reviewer | Always | -- |
code-simplifier | Always | -- |
housekeeper | Always | -- |
architecture-alignment-checker | Conditional | No architecture docs found at {{specs_dir}}/ |
design-consistency-checker | Conditional | No design system docs AND no CSS/styling files in changed_file_paths |
cloud-infrastructure-reviewer | Conditional | No IaC/config files in changed_file_paths |
conventions-reviewer | Conditional | No CLAUDE.md files found in the repo |
Skip spec-alignment-checker — it performs internal EARS requirement tracing which is not relevant to PR review.
Check for architecture and design docs:
- Architecture: look for
{{specs_dir}}/architecture.mdor{{specs_dir}}/architecture/ - Design system: look for
{{specs_dir}}/design_system.mdor{{specs_dir}}/design_system/
Record skipped agents with reason in the aggregation table (verdict: skipped).
Step 5: Launch Agents in Parallel
CRITICAL — Context budget: Do NOT read file contents, full diffs, or docs into this orchestrating context. Collect only file paths and metadata. Agents have Read/Grep/Glob tools and will read files in their own context windows.
Spawn all active agents in parallel using the Agent tool with subagent_type. Each agent receives:
Agent (subagent_type) | Context to Provide |
groundwork:code-quality-reviewer:code-quality-reviewer | changed_file_paths, diff_stat, pr_description, existing_human_feedback |
groundwork:test-quality-reviewer:test-quality-reviewer | changed_file_paths, diff_stat, pr_description, existing_human_feedback |
groundwork:security-reviewer:security-reviewer | changed_file_paths, diff_stat, pr_description, existing_human_feedback |
groundwork:performance-reviewer:performance-reviewer | changed_file_paths, diff_stat, pr_description, existing_human_feedback |
groundwork:code-simplifier:code-simplifier | changed_file_paths, diff_stat, pr_description, existing_human_feedback |
groundwork:housekeeper:housekeeper | changed_file_paths, diff_stat, pr_description, existing_human_feedback |
groundwork:architecture-alignment-checker:architecture-alignment-checker | changed_file_paths, diff_stat, pr_description, architecture_path, existing_human_feedback |
groundwork:design-consistency-checker:design-consistency-checker | changed_file_paths, diff_stat, pr_description, design_system_path, existing_human_feedback |
groundwork:cloud-infrastructure-reviewer:cloud-infrastructure-reviewer | changed_file_paths, diff_stat, pr_description, architecture_path, existing_human_feedback |
groundwork:conventions-reviewer:conventions-reviewer | changed_file_paths, diff_stat, pr_description, existing_human_feedback |
In each agent prompt, include these instructions:
Use the Read tool to examine these files. Do NOT expect file contents in this prompt — read them yourself.
PR Review context: You are reviewing a pull request, not a local task implementation. The
pr_descriptionbelow replacestask_definition. Focus ONLY on code within the PR diff. Do not flag issues in unchanged code unless the change directly impacts it.Existing feedback: Other reviewers have already raised the points summarized below. Do not restate these — focus on issues not yet covered.
Where pr_description is the PR title + body concatenated.
Each agent returns standard JSON:
{
"summary": "One-sentence assessment",
"score": 0-100,
"findings": [{"severity": "critical|major|minor", "category": "...", "file": "...", "line": N, "finding": "...", "recommendation": "..."}],
"verdict": "approve|request-changes"
}Step 6: Aggregate & Deduplicate
6a: Build Aggregation Table
## PR Review — Multi-Agent Report
| Agent | Score | Verdict | Critical | Major | Minor |
|-------|-------|---------|----------|-------|-------|
| Code Quality | 85 | approve | 0 | 1 | 2 |
| Test Quality | 88 | approve | 0 | 1 | 0 |
| Security | 95 | approve | 0 | 0 | 1 |
| Performance | 82 | approve | 0 | 1 | 1 |
| Code Simplifier | 92 | approve | 0 | 0 | 2 |
| Housekeeper | 90 | approve | 0 | 1 | 0 |
| Architecture | -- | skipped | -- | -- | -- |
| Design | -- | skipped | -- | -- | -- |
| Conventions | 95 | approve | 0 | 0 | 1 |6b: Deduplication Pass (LLM-driven)
Group all findings by file. For findings within 3 lines of each other with semantically similar text:
- Merge into a single finding
- Keep the higher severity
- Attribute all source agents (e.g., "from: code-quality-reviewer, security-reviewer")
- Combine recommendations
If running in incremental mode (from Step 3a), also exclude findings that match previous groundwork review comments.
6c: Diff Mapping
Parse pr_diff to determine which finding lines fall within diff hunks. Use the @@ hunk headers to map original/new line numbers.
- Findings whose
linefalls within a diff hunk on the RIGHT side →inline_findings[](will be posted as inline review comments) - Findings whose
linefalls outside any diff hunk →general_findings[](will be included in review body)
Step 7: Confirm with User
- Non-interactive mode: Log the summary below, then proceed directly to Step 8 (post review).
- Interactive mode: Show a preview via
AskUserQuestion:
{
"questions": [{
"question": "- **Inline comments**: [N]\n- **General findings**: [N]\n- **Verdict**: [APPROVE / REQUEST_CHANGES / COMMENT]\n- **Agents run**: [N] ([N] skipped)",
"header": "PR Review Summary for [PR title] (#[pr_number])",
"options": [
{ "label": "Post review" },
{ "label": "Show full preview", "description": "Display all findings before posting" },
{ "label": "Cancel" }
],
"multiSelect": false
}]
}If "Show full preview" → display the full aggregation table plus all findings with their file/line/severity, then re-ask:
{
"questions": [{
"question": "Review the findings above. Ready to post?",
"header": "Post review?",
"options": [
{ "label": "Post review" },
{ "label": "Cancel" }
],
"multiSelect": false
}]
}If "Cancel" at either prompt → stop.
Step 8: Post Review to GitHub
8a: Determine Review Event
- If ALL agents approved AND no critical or major findings →
event: APPROVE - If any agent returned
request-changesOR any critical/major findings exist →event: REQUEST_CHANGES - Otherwise →
event: COMMENT
8b: Format Inline Comments
Each inline finding becomes a review comment:
**[severity]** [category] *(from: agent1, agent2)*
[finding]
**Recommendation:** [recommendation]Map each to the GitHub review comment format:
path: file path relative to repo rootline: line number on the RIGHT side of the diffside:RIGHT
8c: Format Review Body
Build the review body:
## Groundwork PR Review
[Aggregation table from 6a]
### General Findings
[List of general_findings not attached to inline comments]
---
*Reviewed by [N] agents | [N] findings ([N] inline, [N] general)*
<!-- groundwork-review -->The <!-- groundwork-review --> marker at the end enables future identification of groundwork-authored reviews.
8d: Post Atomic Review
Post a single review using the GitHub API to avoid multiple notifications. Use --input - with a single-quoted heredoc to pass the JSON payload via stdin — this avoids shell interpolation issues with complex markdown bodies.
Do NOT generate Python, Node, or any helper scripts to post the review. Use the gh api --input - approach below directly.
cat <<'REVIEW_PAYLOAD' | gh api repos/<repo_slug>/pulls/<pr_number>/reviews --method POST --input -
{
"event": "<EVENT>",
"body": "<review_body>",
"comments": [
{
"path": "src/example.ts",
"line": 42,
"side": "RIGHT",
"body": "This condition doesn't handle the edge case where `input` is empty.\n\n```suggestion\nif (!input || input.length === 0) {\n return defaultValue;\n}\n```"
}
]
}
REVIEW_PAYLOADJSON escaping rules — inside the heredoc, the JSON must be valid:
- Escape double quotes as
\" - Escape newlines in string values as
\n - Escape backslashes as
\\ - The single-quoted heredoc (
<<'REVIEW_PAYLOAD') prevents shell expansion, so$,`, and\are passed literally togh
Fallback: If the API call fails due to an invalid line position, remove the offending comment from comments[], append it to the review body under a "Could not attach inline" heading, and retry using the same cat <<'REVIEW_PAYLOAD' | gh api --input - approach.
Step 9: Cleanup
- Return to the original branch:
git checkout - - If a temporary branch was created during checkout, delete it:
If the branch already existed when you started (another review of the same PR in this clone), you reused it — still safe to delete it here, since a later review recreates it from the PR HEAD.git branch -D pr-<pr_number>-review 2>/dev/null || true - Display final summary:
## PR Review Posted **[PR title]** (#[pr_number]) — [url] - Event: [APPROVE / REQUEST_CHANGES / COMMENT] - Inline comments: [N] - General findings: [N] - Agents: [N] run, [N] skipped
Key Design Notes
- Read-only: Unlike validate, PR review does not fix issues — it only reports findings.
- Agent context adaptation: Agents receive
pr_description(PR title + body) instead oftask_definition. They are prompted to focus on diff scope only. - Deduplication is LLM-driven: The orchestrating LLM compares findings by proximity and similarity — no external code needed.
- Diff position mapping: Uses GitHub's
line+side=RIGHTAPI. Parses diff hunk headers (@@ -a,b +c,d @@) to determine which lines are in scope. - Atomic review posting: Single API call posts both inline comments and summary, avoiding noisy multiple notifications.
- Groundwork marker:
<!-- groundwork-review -->HTML comment in review body enables identifying previous groundwork reviews for incremental mode.
Severity Reference
| Level | Meaning |
| critical | Serious defect — security vulnerability, data loss, crash |
| major | Significant issue — logic error, missing edge case, poor design |
| minor | Improvement opportunity — style, naming, minor optimization |
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

