Review and merge a PR with quality gates. Verifies AC coverage and spec alignment before merge. Used in subagent context.
Review a PR linked to a kspec task, verify quality gates, and merge. This skill runs in subagent context (spawned by ralph) and focuses on getting the PR merged with proper quality verification.
/pr-review @task-ref
Task reference is required. This skill needs to know which task's PR to review.
# Validate inputs first
kspec task get @task-ref # Verify task exists
gh pr list --search "Task: @task-ref" # Find linked PR
# Start the workflow
kspec workflow start @pr-review-loop
If no task ref provided, error immediately:
Error: Task reference required.
Usage: /pr-review @task-ref
Find the PR linked to this task:
# Check task for vcs_refs
kspec task get @task-ref --json | jq '.vcs_refs'
# Or search PR body/commits for task reference
gh pr list --search "Task: @task-ref" --json number,url,title
If no PR found:
Error: No PR found for task @task-ref.
Create a PR first with /pr, then run /pr-review @task-ref.
This skill emphasizes two key quality gates beyond just "tests pass":
Every acceptance criterion in the linked spec MUST have test coverage:
// AC: @spec-ref ac-1
it('should validate task ref is provided', () => { ... });
// AC: @spec-ref ac-2
it('should error when no PR exists', () => { ... });
Check for gaps:
kspec task get @task-ref// AC: @spec-ref ac-N annotationsImplementation must match spec intent, not just pass tests:
This is NOT just "do tests pass" - it's verifying the implementation actually does what the spec says.
This skill delegates all behavior to @pr-review-loop workflow:
kspec workflow start @pr-review-loop
The workflow handles:
/local-review)After ANY push, you MUST re-verify CI from the beginning. Prior CI checks are invalidated by new commits. Never merge without fresh CI verification on the current HEAD.
If you push fixes during review:
This skill runs in ACP subagent context:
Post review summary as PR comment (AC-3):
gh pr comment $PR_NUMBER --body "$(cat <<'EOF'
## PR Review Summary
### AC Coverage
- [x] ac-1: Covered by test X
- [x] ac-2: Covered by test Y
- [x] ac-3: Covered by test Z
### Spec Alignment
Implementation matches spec requirements.
### Issues Found
None - all quality gates pass.
### Verdict
Ready to merge.
EOF
)"
If issues found:
## PR Review Summary
### AC Coverage
- [x] ac-1: Covered
- [ ] ac-2: MISSING
### Issues Found
1. **MUST-FIX**: Missing test coverage for ac-2
### Verdict
Not ready to merge - see issues above.
CRITICAL: You MUST complete the task after merging the PR.
The @pr-review-loop workflow includes task completion as the final step. After the PR is merged:
kspec task complete @task-ref --reason "Merged in PR #N. <summary>"
Include in the reason:
Do NOT exit after merge without completing the task.
/pr-review @task-reflect-loop-skill
[Validates task exists]
[Finds PR #234 linked to task]
[Starts @pr-review-loop workflow]
[Runs local review - checks AC coverage]
[Verifies spec alignment]
[Posts review comment to PR]
[Waits for CI]
[Merges PR]
PR #234 merged successfully.
Task @task-reflect-loop-skill ready for completion.