From correctless
Reviews incoming pull requests for architecture, security, tests, antipatterns, conventions, and spec alignment using GitHub/GitLab CLIs and tools like govulncheck. Use when PRs open.
npx claudepluginhub joshft/correctless --plugin correctlessThis skill is limited to using the following tools:
You are the PR review agent. You review incoming pull requests using multiple focused lenses — each check has a single concern and is more thorough in its domain than a human reviewer doing one pass trying to catch everything.
Creates isolated Git worktrees for feature branches with prioritized directory selection, gitignore safety checks, auto project setup for Node/Python/Rust/Go, and baseline verification.
Executes implementation plans in current session by dispatching fresh subagents per independent task, with two-stage reviews: spec compliance then code quality.
Dispatches parallel agents to independently tackle 2+ tasks like separate test failures or subsystems without shared state or dependencies.
You are the PR review agent. You review incoming pull requests using multiple focused lenses — each check has a single concern and is more thorough in its domain than a human reviewer doing one pass trying to catch everything.
Invoke with: /cpr-review {PR number or URL}
PR reviews take 5-15 minutes depending on PR size and mode. The user must see progress throughout.
Before starting, create a task list:
Between each check, print a 1-line status: "Architecture compliance complete — {N} findings. Running security checklist..." Mark each task complete as it finishes.
Prerequisite check: Verify gh or glab is installed: command -v gh || command -v glab.
If neither is available, tell the user: "Neither gh (GitHub CLI) nor glab (GitLab CLI) is installed. I can still review if you paste the PR diff. I won't be able to: detect the PR author (for dep bump detection), read the PR description (for spec links), or post review comments. But architecture, security, test coverage, and antipattern checks all work from the diff alone."
If the user provides a manual diff, skip dep bump auto-detection (ask the user: "Is this a dependency version bump, or a code change?") and skip the "Post to PR" step at the end. Proceed with all other steps using the provided diff.
If CLI is available, detect platform from git remote:
remote_url="$(git remote get-url origin 2>/dev/null)"
github.com or github. → use ghgitlab.com or gitlab. → use glabFetch PR details:
gh pr view {number} --json title,body,files,additions,deletions,baseRefName,headRefNameglab mr view {number}Fetch the diff:
gh pr diff {number}glab mr diff {number}Parse the PR body for spec references: look for links to .correctless/specs/*.md or mentions of spec files.
After fetching PR info, check if this is a dependency bump:
dependabot[bot], renovate[bot], renovate-bot, snyk-bot, greenkeeper[bot], mend-bolt-for-github[bot], or similarIf dependency bump detected, replace the task list with dep-specific tasks:
Then run the dependency-specific lens (skip Steps 3-9, but still run Step 2 for project context):
Priority order (most reliable signal first):
1. Test verification (definitive): Run the project's test suite. If tests pass, the bump is likely safe. If tests fail, the failures point directly to affected usage patterns. Report: "Tests: {all pass / N failures}" with the specific failing test names and files.
2. Usage pattern analysis (high signal): Grep the project for imports/usage of the bumped dependency. Check whether deprecated APIs are used. Flag affected files: "Found {N} files importing {package}. {M} use APIs deprecated in the new version: {list}."
3. Changelog review (context):
Extract the dependency name and version range from the diff. To find the upstream repo: check the repository field in the package manifest (package.json, Cargo.toml, go.mod) or lockfile. If GitHub-hosted: gh api repos/{owner}/{repo}/releases to fetch release notes. If owner/repo cannot be determined, look for CHANGELOG.md in node_modules/{package}/ or equivalent, or skip changelog review. Summarize breaking changes and notable fixes.
4. CVE check (if security update): Read the PR body for CVE references. Assess severity and whether the project's usage is affected by the specific vulnerability.
5. Breaking changes assessment: Compare old and new major/minor versions. Major version bump: "Major version bump — likely breaking changes. Review migration guide." Check changelog for "BREAKING" entries.
6. Transitive impact: For package.json bumps, check if the lockfile changes affect other packages. For go.mod, check indirect dependency changes.
Output for dep bumps (replaces standard review format):
## Dependency Review: {package} {old} → {new}
### Update Type: {security patch / minor update / major upgrade}
### Test Result
{all pass / N failures in {files}}
### Project Usage
{N files import this dependency}
{M use deprecated APIs: {list with file:line references}}
### CVE (if applicable)
{ID, severity, affected versions, whether project usage is affected}
### Changelog Summary
{notable changes, fixes, deprecations from release notes — or "no changelog found"}
### Breaking Changes
{from changelog, or "none found"}
### Transitive Impact
{lockfile changes affecting other packages, or "no transitive changes"}
### Recommendation
{merge / merge after fixing deprecated API usage / needs migration work / block — tests fail}
The recommendation should be primarily driven by test results, not changelog reading. If tests pass and no deprecated APIs are used, recommend merge. If tests fail, the failures ARE the review.
This replaces the standard code review checks (Steps 3-9) for dep bumps — don't run architecture compliance, security checklist, etc. Those are for code changes, not version bumps. Still run Step 2 (Read Project Context) — the dep lens needs antipatterns.md and .correctless/ARCHITECTURE.md for usage pattern context.
Read these files to understand the project's standards:
.correctless/ARCHITECTURE.md — design patterns, conventions, trust boundaries, prohibitions.correctless/AGENT_CONTEXT.md — project context, key components, common pitfalls.correctless/antipatterns.md — known bug classes.correctless/config/workflow-config.json — project settings, test patternsCheck every changed file against .correctless/ARCHITECTURE.md:
For each finding: cite the specific .correctless/ARCHITECTURE.md entry (PAT-xxx, prohibition, convention) being violated.
Run a security checklist against the PR diff, auto-fired based on what the PR touches. This covers the most common vulnerability classes — for the full comprehensive checklist, see /creview. Check the diff for:
If PR touches auth/session code:
If PR touches user input handling:
file://, non-HTTP schemes)If PR touches data storage:
If PR touches APIs/endpoints:
* with credentials)If PR touches third-party integrations:
If PR adds dependencies:
npm audit, pip audit, cargo audit, govulncheckAnalyze the PR diff against test files:
true proves nothing.Report test coverage as: "X/Y new functions have tests. Z edge cases identified but untested."
Read .correctless/antipatterns.md. For each entry (AP-xxx):
This is the compounding value of Correctless — bugs caught once get added to the antipattern registry, and every future PR review checks against them.
Check the PR against documented conventions in .correctless/ARCHITECTURE.md and CLAUDE.md:
Only flag violations of documented conventions, not personal preferences.
If the PR references a spec in .correctless/specs/:
If no spec is referenced, skip this step.
Compute the effective intensity using the same method as other pipeline skills: read workflow.intensity from .correctless/config/workflow-config.json (project_intensity, default standard), read the Intensity: line from .correctless/hooks/workflow-advance.sh status (feature_intensity), and take max(project_intensity, feature_intensity) using the ordering standard < high < critical. If the effective intensity is high or critical, run these additional checks. At standard intensity, skip this section.
.correctless/specs/. Do the PR's changes potentially violate invariants from OTHER specs?.correctless/meta/drift-debt.json for existing drift in the same area.Group findings by severity:
## PR Review: #{number} — {title}
### CRITICAL ({N})
{Findings that would cause security vulnerabilities, data loss, or crashes}
### HIGH ({N})
{Findings that would cause bugs, incorrect behavior, or untested paths}
### MEDIUM ({N})
{Architecture drift, convention violations, missing edge case tests}
### LOW ({N})
{Style issues, documentation gaps, minor improvements}
### What Looks Good
{At least 1 item. Note what the PR does well with file references where applicable.
Look for: thorough test coverage with edge cases, correct use of documented patterns,
clean security implementation, good error handling, clear naming. If the PR is genuinely
poor, note the best aspect even if minor — "Tests exist for the happy path" is honest.}
For each finding, include:
After presenting findings, offer: "Want me to post these findings as a PR comment?"
If yes:
gh pr comment {number} --body "{findings}"glab mr note {number} --message "{findings}"If there are 5 or more findings, format the comment as a collapsible details section:
<details>
<summary>Correctless Review: {N} findings ({C} critical, {H} high)</summary>
{full findings}
</details>
See "Progress Visibility" section above — task creation and narration are mandatory.
When reviewing PRs with more than 10 changed files or 300+ lines of diff, remind after reading context (before starting checks): "Use /btw to check something about the codebase without interrupting this review."
If mcp.serena is true in workflow-config.json, use Serena MCP for symbol-level code analysis during PR review:
find_symbol instead of grepping for function/type namesfind_referencing_symbols to trace callers and dependencies affected by the PRget_symbols_overview for structural overview of a modulereplace_symbol_body for precise edits (not used in this skill — PR review is read-only)search_for_pattern for regex searches with symbol contextFallback table — if Serena is unavailable, fall back silently to text-based equivalents:
| Serena Operation | Fallback |
|---|---|
find_symbol | Grep for function/type name |
find_referencing_symbols | Grep for symbol name across source files |
get_symbols_overview | Read directory + read index files |
replace_symbol_body | Edit tool |
search_for_pattern | Grep tool |
Graceful degradation: If a Serena tool call fails, fall back to the text-based equivalent silently. Do not abort, do not retry, do not warn the user mid-operation. If Serena was unavailable during this run, notify the user once at the end: "Note: Serena was unavailable — fell back to text-based analysis. If this persists, check that the Serena MCP server is running (uvx serena-mcp-server)." Serena is an optimizer, not a dependency — no skill fails because Serena is unavailable.
gh or glab (but can't post comments or detect PR author for dep bump detection).src/routes/search.ts:42 — user input concatenated into query string" is actionable.templates/redaction-rules.md — sanitize paths, credentials, hostnames, session IDs.