/sanctum:pr-review runs instead · from sanctum
Reviews pull requests with scope validation, requirements compliance, and line comments. Automatically detects GitHub/GitLab platforms and routes out-of-scope findings to issues.
This skill never runs in Claude Code
It ships in sanctum at skills/, but /sanctum:pr-review (a command, or a skill Claude Code finds first) has the same name: typing it, or Claude choosing it, runs that one instead.
Review pull/merge requests with discipline: validate against original requirements, prevent scope creep, and route out-of-scope findings to issues on the detected platform.
Platform detection is automatic via leyline:git-platform. Use gh for GitHub, glab for GitLab. Check session context for git_platform:.
A PR review validates scope compliance, not code perfection.
The goal is to validate the implementation meets its stated requirements without introducing regressions. Improvements beyond the scope belong in future PRs.
How each finding is classified against the PR's stated scope:
modules/scope-classification.md.
Before looking at ANY code, understand what this PR is supposed to accomplish.
Note: Version validation (Phase 1.5) runs AFTER scope establishment but BEFORE code review. See modules/version-validation.md for details.
Search for scope artifacts in order:
Plan file: Most authoritative (check spec-kit locations first, then root)
# Spec-kit feature plans (preferred - structured implementation blueprints)
find specs -name "plan.md" -type f 2>/dev/null | head -1 | xargs cat 2>/dev/null | head -100
# Legacy/alternative locations
ls docs/plans/ 2>/dev/null
# Root plan.md (may be Claude Plan Mode artifact from v2.0.51+)
cat plan.md 2>/dev/null | head -100
Verification: Run the command with --help flag to verify availability.
Spec file: Requirements definition (check spec-kit locations first)
find specs -name "spec.md" -type f 2>/dev/null | head -1 | xargs cat 2>/dev/null | head -100
cat spec.md 2>/dev/null | head -100
Verification: Run the command with --help flag to verify availability.
Tasks file: Implementation checklist (check spec-kit locations first)
find specs -name "tasks.md" -type f 2>/dev/null | head -1 | xargs cat 2>/dev/null
cat tasks.md 2>/dev/null
Verification: Run the command with --help flag to verify availability.
PR/MR description: Author's intent
# GitHub
gh pr view <number> --json body --jq '.body'
# GitLab
glab mr view <number> --json description --jq '.description'
Verification: Run the command with --help flag to verify availability.
Commit messages: Incremental decisions
# GitHub
gh pr view <number> --json commits --jq '.commits[].messageHeadline'
# GitLab
glab mr view <number> --json commits
Verification: Run the command with --help flag to verify availability.
Output: A clear statement of scope:
"This PR implements [feature X] as specified in plan.md. The requirements are:
- [requirement]
- [requirement]
- [requirement]"
If no scope artifacts exist, flag this as a process issue but continue with PR description as the baseline.
# GitHub
gh pr diff <number> --name-only
gh pr diff <number>
gh pr view <number> --json additions,deletions,changedFiles,commits
# GitLab
glab mr diff <number>
glab mr view <number>
Verification: Run the command with --help flag to verify availability.
Before detailed code review, check scope coverage:
Run version validation checks BEFORE code review.
See modules/version-validation.md for detailed validation procedures.
Quick reference:
--skip-version-check, label, or PR marker)All version mismatches are BLOCKING unless explicitly waived by maintainer.
Before diving into code, run the atomicity, agent-curation and
self-review checks from modules/pr-hygiene.md, and classify findings
per its severity tables.
Use pensive:unified-review on the changed files. For comment quality assessment, see modules/comment-guidelines.md.
Critical: Evaluate each finding against the scope baseline:
**Verification:** Run the command with `--help` flag to verify availability.
Finding: "Function X lacks input validation"
Scope check: Is input validation mentioned in requirements?
- YES → IN-SCOPE
- NO, but it's a security issue → BLOCKING
- NO, and it's a nice-to-have → BACKLOG
Verification: Run the command with --help flag to verify availability.
Run Skill(imbue:justify) on the PR changes to detect
AI additive bias, test-logic tampering, and unnecessary
complexity.
Key checks:
Classify justify findings using the scope framework:
| Justify Signal | Likely Classification |
|---|---|
| Test logic tampered | BLOCKING |
| High additive bias, no justification | IN-SCOPE |
| Premature abstraction | SUGGESTION |
| Compatibility shim | BACKLOG |
Include the additive bias score and Iron Law status in the Phase 6 report.
Load modules/invariant-conflicts.md and run its checks on the diff
before Phase 5.
For each BACKLOG item, create an issue on the detected platform:
# GitHub
gh issue create \
--title "[Tech Debt] Brief description" \
--body "## Context
Identified during PR #<number> review.
..." \
--label "tech-debt"
# GitLab
glab issue create \
--title "[Tech Debt] Brief description" \
--description "## Context
Identified during MR !<number> review.
..." \
--label "tech-debt"
Verification: Run the command with --help flag to verify availability.
Ask user before creating: "I found N backlog items. Create issues? [y/n/select]"
Structure the report by classification. Every BLOCKING and
IN-SCOPE finding MUST include educational insights per
modules/educational-insights.md: Why (the principle),
Proof (link to best practice), and a Teachable Moment
(generalized lesson). SUGGESTION findings include Why and
optionally Proof. BACKLOG items need only a brief rationale.
With --concise, none of those paragraphs is posted. Each finding
on a diff line becomes a suggestion block the author can apply,
with a short explanation beside it only for clarification purposes.
Findings with no line to anchor to appear in the summary as one
line each. The full report with its educational content is still
written locally, to the --local path, so nothing is lost. It is
only kept off the MR. Posting patterns: modules/suggestion-comments.md.
## PR #X: Title
### Scope Compliance
**Requirements:** (from plan/spec)
1. [x] Requirement A - Implemented
2. [x] Requirement B - Implemented
3. [ ] Requirement C - **Missing**
### Blocking (1)
1. [B1] SQL injection via string concatenation
- **Location**: `db/queries.py:89`
- **Anchor**: `cursor.execute("SELECT * FROM t WHERE id = " + uid)`
- **Issue**: User input interpolated directly into SQL
- **Why**: String-interpolated SQL allows attackers to
execute arbitrary queries (CWE-89). This is the #1
web application vulnerability per OWASP Top 10.
- **Proof**: [OWASP SQL Injection](https://owasp.org/www-community/attacks/SQL_Injection)
- **Teachable Moment**: Always use parameterized queries
or an ORM. This applies everywhere user input reaches
a database, cache, or search engine query.
- **Fix**: Use parameterized query:
`cursor.execute("SELECT * FROM t WHERE id = ?", (uid,))`
### In-Scope (1)
1. [S1] Missing validation for edge case
- **Location**: `api.py:45`
- **Anchor**: `def handle_request(payload):`
- **Issue**: Empty input not handled per requirement
- **Why**: Defensive validation at API boundaries
prevents cascading failures in downstream logic.
- **Proof**: [Postel's Law](https://en.wikipedia.org/wiki/Robustness_principle)
- **Teachable Moment**: Validate inputs at system
boundaries (API handlers, CLI args, file parsers)
but trust internal function contracts.
### Suggestions (1)
1. [G1] Consider extracting helper function
- **Why**: The repeated pattern on lines 30-35 and
72-77 violates DRY. Extracting it reduces future
bug surface.
- Author's discretion
### Backlog → GitHub Issues (3)
1. #142 - Refactor authentication module
2. #143 - Add caching layer
3. #144 - Update deprecated dependency
### Recommendation
**APPROVE WITH CHANGES**
Address B1 and S1 before merge.
--local)When --local [path] is passed, write the Phase 6 report to a
local .md file instead of posting via API. Default path:
.pr-review/pr-<number>-review.md. The file includes the
review summary, test plan, and backlog items in a single
document. Issue creation and PR description updates are skipped.
Knowledge capture (Phase 7) still runs.
After generating the report, findings scoring ≥60 are captured to the
project's review chamber (decisions/, patterns/, standards/,
lessons/) and listed in a Knowledge Captured section of the report.
See modules/knowledge-capture.md for full workflow.
--interactive)Opt-in. Skip this phase unless the reviewer passed --interactive.
A socratic loop over the diff: each exchange is graded pass,
partial, or fail and recorded to gauntlet's shared progress store.
Probe results never change the merge recommendation. They add a
Comprehension section to the report from Phase 6.
Full turn order, scoring table, category mapping, and the recording
contract: modules/interactive-review.md.
A PR should be approved when:
pr-review:findings-verified)Write findings to .review/findings.json, run the citation verifier
(Skill(imbue:review-core) Step 5), and drop or label UNVERIFIED any
the verifier rejects.
Scope creep, perfectionism, blocking on style, reviewing unchanged
code, tests that only prove the old code was bad, bundled unrelated
changes, and merging code you cannot explain. Each one, with what to do
instead: modules/anti-patterns.md.
/fix-pr: After review identifies issues, use this to address them/prepare-pr: To prepare a PR before reviewpensive:unified-review: For the actual code analysispensive:bug-review: For deeper bug hunting if neededscribe:slop-detector: For documentation AND commit message quality analysisscribe:doc-generator: For PR description writing guidelines (slop-free)How PR prose and changed docs are checked for AI-generated patterns:
modules/slop-detection.md.
Location (file:line)
and verbatim Anchor, and citation_verifier.py exits 0 or the
unverified findings are dropped or labeled UNVERIFIED--interactive: every hunk carrying a blocking or high-risk
finding was probed, or the reviewer ended the session--interactive: each graded exchange appears in
.gauntlet/progress/<developer>.json, and the report carries a
Comprehension section whose row count matches the probes recorded--concise: every finding on a diff line was posted as a
suggestion block, the summary review exists, and no test plan
comment or description update was posted--hold-insights: every direction or architecture finding was
shown in chat before posting, and only the selected ones appear
on the PRgh api patterns for inline and summary PR comments--concise posting rulemodules/anti-patterns.md (opens in a new tab)modules/comment-guidelines.md (opens in a new tab)modules/educational-insights.md (opens in a new tab)modules/github-comments.md (opens in a new tab)modules/insight-generation.md (opens in a new tab)modules/interactive-review.md (opens in a new tab)modules/invariant-conflicts.md (opens in a new tab)modules/knowledge-capture.md (opens in a new tab)modules/pr-hygiene.md (opens in a new tab)modules/scope-classification.md (opens in a new tab)modules/slop-detection.md (opens in a new tab)modules/suggestion-comments.md (opens in a new tab)modules/version-validation.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
18 skills in this plugin
/commit-messagesGenerates conventional commit messages from staged changes. Use when committing and needing a well-formatted message. For full PR prep, use pr-prep./doc-consolidationMerges ephemeral report and analysis artifacts into permanent documentation. Use when LLM-generated markdown files have accumulated and need consolidation./doc-updatesUpdates documentation after code changes with quality gates, slop detection, and accuracy checks. Use when code changes require corresponding doc updates./do-issueImplements GitHub or GitLab issues via parallel subagents with review gates between task batches. Use when resolving multi-step issues end-to-end./git-workspace-reviewVerifies workspace state and staged changes as a read-only preflight. Use before commits or PRs to confirm staged set is clean and correct./pr-prepPrepares pull requests by running quality gates, drafting descriptions, and validating tests. Use when completing a feature and ready for review.npx claudepluginhub athola/claude-night-market --plugin sanctumOther plugins' skills for the same job