plugins/specweave/skills/pr-review/SKILL.md
AI-powered pull request review against spec acceptance criteria. Use for "review PR", "check PR against spec", "review pull request". Enterprise feature.
npx skillsauth add anton-abyzov/specweave plugins/specweave/skills/pr-reviewInstall 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.
Reviews a pull request against the increment's spec.md acceptance criteria. Posts structured review comments on the PR via gh pr review.
This is an enterprise feature — optional, not part of the default flow. Invoke explicitly or configure for automatic invocation.
Do activate:
sw:pr creates a PRDo NOT activate:
If given an increment ID:
# Read PR refs from metadata
PR_URL=$(jq -r '.prRefs[0].prUrl // empty' .specweave/increments/{id}/metadata.json)
PR_NUMBER=$(jq -r '.prRefs[0].prNumber // empty' .specweave/increments/{id}/metadata.json)
If given a PR URL or number:
# Extract PR number from URL
PR_NUMBER=$(echo "$PR_URL" | grep -oE '[0-9]+$')
# Find increment by searching metadata for matching prRefs
If neither: Check current branch for an associated PR:
CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD)
PR_NUMBER=$(gh pr list --head "$CURRENT_BRANCH" --json number -q '.[0].number')
Read the increment spec.md to extract:
Build a review checklist from ACs.
gh pr diff ${PR_NUMBER} > /tmpsw-pr-diff-${PR_NUMBER}.diff
Also get the list of changed files:
gh pr view ${PR_NUMBER} --json files -q '.files[].path'
For each AC in spec.md, analyze the diff to determine:
Build a structured review:
## SpecWeave AC Review — Increment {INCREMENT_ID}
### Acceptance Criteria Coverage
| AC | Status | Evidence |
|----|--------|----------|
| AC-US1-01: User can log in | SATISFIED | `src/auth/login.ts` implements full flow |
| AC-US1-02: Invalid creds show error | PARTIALLY | Error handling exists but no user-facing message |
| AC-US2-01: Session persists | NOT SATISFIED | No session storage implementation found |
### Code Quality Observations
{List any code quality issues found in the diff — not bugs, but patterns that deviate from the spec or best practices}
### Summary
{Overall assessment: ready to merge / needs changes / needs discussion}
- {X}/{Y} ACs satisfied
- {Z} observations
Determine review action based on AC coverage:
--approve--request-changes--commentgh pr review ${PR_NUMBER} \
--body-file /tmpsw-pr-review-${PR_NUMBER}.md \
--{approve|request-changes|comment}
Clean up:
rm -f /tmpsw-pr-diff-${PR_NUMBER}.diff /tmpsw-pr-review-${PR_NUMBER}.md
For specific issues found in the diff, post inline comments on the relevant lines:
# For each finding with a specific file + line:
gh api repos/{owner}/{repo}/pulls/${PR_NUMBER}/comments \
-f body="**AC-US1-02**: Error message is logged but not displayed to the user. The spec requires a user-facing error toast." \
-f commit_id="{latest_commit_sha}" \
-f path="src/auth/login.ts" \
-F line=42 \
-f side="RIGHT"
For teams that want automated PR reviews, this skill can be triggered via Claude Code scheduled tasks:
// .claude/scheduled-tasks.json
{
"tasks": [{
"schedule": "*/30 * * * *",
"command": "sw:pr-review --all-open",
"description": "Review all open PRs every 30 minutes"
}]
}
When invoked with --all-open:
gh pr list --state open --json number,headRefNameFor PRs spanning multiple domains (frontend + backend + infrastructure), consider using sw:team-build with the review preset to spawn domain-specialized review agents in parallel.
| Error | Action |
|-------|--------|
| No spec.md found | Warn: "No increment spec found for this PR. Cannot perform AC review." |
| PR already merged | Skip: "PR #{N} is already merged." |
| gh auth issues | Warn: "Run: gh auth login" |
| Large diff (>5000 lines) | Summarize by file instead of line-by-line review |
tools
Generate AI videos from text prompts or images. Supports Google Veo 3.1 and Pollinations.ai (free). Use when generating video, creating animations, text-to-video, AI video, video generation, make clip, animate.
tools
Validate increment with rule-based checks and AI quality assessment. Use when saying "validate", "check quality", or "verify increment".
tools
Create and manage umbrella workspaces for multi-repo projects. Activate when the user wants to: create umbrella, umbrella init, wrap in umbrella, create workspace, setup multi-repo, migrate repos to umbrella, umbrella create, new workspace, restructure into umbrella, "wrap this repo", "create umbrella for these repos", "setup workspace with repos", "move repos into umbrella". Do NOT activate for: add a repo to existing umbrella (use sw:get), add a feature, add an increment, clone a repo (use sw:get).
tools
--- description: Merge completed parallel agent work and trigger GitHub sync per increment. Activates for: team merge, merge agents, combine work, team finish. --- # Team Merge **Verify all teammates completed, run quality gates, close increments, and trigger sync.** ## Usage ```bash sw:team-merge sw:team-merge --dry-run # Preview merge plan sw:team-merge --skip-sync # Merge without GitHub/JIRA sync ``` ## What This Skill Does 1. **Verify all teammates completed** -- bl