kramme-cc-workflow/skills/kramme:pr:code-review/SKILL.md
Analyze code quality of branch changes using specialized review agents (tests, errors, types, security, performance, slop). Outputs REVIEW_OVERVIEW.md with actionable findings, or replies inline with --inline. Use --team for multi-agent cross-validation. Not for UX, visual, or accessibility review -- use kramme:pr:ux-review for those.
npx skillsauth add abildtoft/kramme-cc-workflow kramme:pr:code-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.
Run a comprehensive pull request review using multiple specialized agents, each focusing on a different aspect of code quality.
Review Aspects (optional): "$ARGUMENTS"
If $ARGUMENTS contains --team, remove that flag, read references/team-mode.md, and follow that workflow instead of the standard workflow below. Pass the remaining arguments through as the team-mode arguments.
Determine Review Scope
--base <branch> flag → store as BASE_BRANCH_OVERRIDE--inline flag → set INLINE_MODE=true and remove it from the aspect list--team flag → use Team Mode and remove it from the aspect list--parallel appears anywhere in $ARGUMENTS → set LAUNCH_MODE=parallel and remove it from the aspect list. Default is LAUNCH_MODE=sequential.parallel appears anywhere in $ARGUMENTS → set LAUNCH_MODE=parallel, remove it from the aspect list, and treat it as a deprecated alias for --parallel.--emphasize <dim>... flag → store dimension names in EMPHASIZED_DIMENSIONS list and remove from aspect list. Consume all tokens after --emphasize until the next -- flag, --parallel, parallel, or end of arguments. Each token must be a valid aspect name (comments, tests, errors, types, code, slop, security, performance, removal, simplify). Reject --emphasize all (emphasizing everything is a no-op).all. If any token is not a recognized aspect, stop with an error naming the unrecognized token and listing valid aspects. Do not silently fall through to "run all applicable reviews."all, every emphasized dimension must also appear in that list. If any emphasized dimension was excluded by the user's aspect filter, stop with an error instead of re-ranking unrelated findings.all): Run all applicable reviews except simplify. The simplifier is opt-in only -- it runs only when simplify is explicitly listed (see Step 6).Resolve Base Branch and Collect Review Diff
Use the shared plugin script to resolve the base branch and build the unified change scope (committed PR diff + staged + unstaged + untracked). It uses the same 3-tier strategy: explicit --base, PR target branch, then origin/HEAD/origin/main/origin/master. It runs in strict mode, so fetch failures stop the workflow with the script's stderr message.
COLLECT_ARGS=(--strict)
[ -n "${BASE_BRANCH_OVERRIDE:-}" ] && COLLECT_ARGS+=(--base "$BASE_BRANCH_OVERRIDE")
RESOLVED=$(${CLAUDE_PLUGIN_ROOT}/scripts/collect-review-diff.sh "${COLLECT_ARGS[@]}") || {
echo "Base/diff collection failed; see the message above and stop." >&2
exit 1
}
eval "$RESOLVED"
The script exports BASE_REF, BASE_BRANCH, MERGE_BASE, and newline-delimited CHANGED_FILES. Use BASE_REF/MERGE_BASE for committed diff commands and BASE_BRANCH for display or when invoking sibling review skills.
Available Review Aspects:
all)simplify (default)Identify Changed Files and PR Description
CHANGED_FILES exported by Step 2 as the unified change scope.CHANGED_FILES is empty, stop with: No changes detected against $BASE_REF. If this is wrong, re-run with --base <branch>. Do not launch reviewers against an empty scope.PR_CONTEXT_JSON=$(gh pr view --json number,url,title,body,baseRefName,headRefName 2> /dev/null || printf '{}')
PR_CONTEXT_JSON without special-casing empty strings.PR description.Check for Previous Review Responses
If REVIEW_OVERVIEW.md exists in the project root:
file:line, review-scope, or PR description), issue description, action taken- Location: field, **Location:**, and legacy **File:** labels when parsing existing entries, and normalize any of them to the same location fieldPreviously addressed findings have the format:
- Location: path/to/file.ts:123, review-scope, or PR description**Location:** path/to/file.ts:123 and **File:** path/to/file.ts:123 should be treated the same as the structured Location fieldDetermine Applicable Reviews
Select reviewers with this taxonomy. The taxonomy applies to default all reviews; explicit aspect filters still narrow the active set to the requested dimensions.
Always-on reviewers (run for default all because they catch broad regressions across stack types):
kramme:code-reviewer — general quality, project instruction compliance, and PR-description driftkramme:silent-failure-hunter — swallowed errors, weak propagation, and misleading fallback behaviorkramme:deslop-reviewer — AI slop patterns, unnecessary defensive noise, and weak type workaroundsCross-cutting conditional reviewers (activate when the changed files or diff semantics match):
kramme:pr-test-analyzer — if test files changed, new behavior was added, or coverage claims appear in the PR descriptionkramme:comment-analyzer — if comments, docstrings, docs, or explanation-heavy inline text changedkramme:type-design-analyzer — if types, schemas, interfaces, data models, or invariants changedkramme:removal-planner — if code was deleted, deprecated, consolidated, or refactored enough that safe removal needs verificationkramme:code-simplifier — only when simplify is explicitly listed in the aspect arguments. The simplifier never runs as part of all, because simplification suggestions can conflict with unresolved Critical/Important findings. Run the review first, resolve those, then re-run with simplify.Stack-specific conditional reviewers (activate only when the touched stack has the relevant risk surface):
performance-oracle — data-heavy paths, loops over large collections, DB queries, caching, hot paths, rendering bottlenecks, or expensive client bundleskramme:injection-reviewer, kramme:auth-reviewer, kramme:data-reviewer, and kramme:logic-reviewer together.Build ACTIVE_REVIEW_DIMENSIONS from the agents that will actually run after aspect filtering and applicability checks. If any emphasized dimension has no active agent in this set, stop with an error telling the user which emphasized dimensions are inactive. Do not cap unrelated findings when the emphasized review never ran.
Launch Review Agents
Pass the resolved BASE_BRANCH, BASE_REF, MERGE_BASE, and PR context from Steps 2 and 4 to all agents so they use the correct diff scope and understand the stated intent of the change. Instruct each agent to review the same unified scope:
git diff "$MERGE_BASE"...HEADgit diff --cachedgit diffgit ls-files --others --exclude-standardPR_CONTEXT_JSON, if presentInstruct agents to use the PR description in two ways:
PR description and a concrete correction.Instruct every reviewer to apply this Codebase Calibration Rule before making a finding or recommending a fix:
NOTICED BUT NOT TOUCHING instead of making it a required finding.UNVERIFIED or CONFUSION and keep the recommendation optional.Instruct each spawned reviewer to label findings with the output markers documented in references/review-discipline.md (UNVERIFIED, NOTICED BUT NOT TOUCHING, CONFUSION, MISSING REQUIREMENT) so the aggregated report is parseable.
Instruct every reviewer to return these fields for each finding:
CR-001, CR-002, ... IDs after dedupereferences/review-discipline.mdpath/to/file:line, review-scope, or PR description{0-100}. During the transition, if a reviewer returns high, medium, or low, map it before aggregation as high=90, medium=60, low=30. Remove this mapping shim once all bundled review agents emit numeric 0-100 confidence natively.gated_auto, manual, or advisory from references/review-discipline.md; Critical/Important findings may use only gated_auto or manual, while Suggestions/FYI use advisoryUNVERIFIEDLaunch the agents resolved in Step 6 using LAUNCH_MODE from Step 1:
LAUNCH_MODE=sequential (default): launch one agent, wait for its report, then launch the next. Use this for interactive review where each report should be readable before the next runs.LAUNCH_MODE=parallel: launch all applicable agents simultaneously and collect results together. Use this when the user passed --parallel or the deprecated bare parallel alias.Agent failure handling. If a selected reviewer agent is unavailable, times out, or returns output that cannot be parsed as findings, record the failed agent name, review dimension, and what was attempted. Continue only if at least one selected reviewer succeeded, and include a degraded-coverage banner in the final report: Coverage degraded: <agent names> failed; findings below exclude <dimensions>. If all selected reviewers fail, or if the relevance validator fails, stop without writing REVIEW_OVERVIEW.md. Do not fabricate findings or present a partial review as complete. If the slop meta-review fails after primary reviewers succeeded, continue with a degraded-coverage banner that names the failed meta-review and notes that slop warnings may be incomplete.
Validate Relevance
After collecting findings from all agents:
BASE_BRANCH, and PR_CONTEXT_JSON if presentSlop Meta-Review
After relevance validation, review agent suggestions for slop:
Operate in meta-review mode. and pass the list of validated findings/suggestions as the only input -- do not pass a diff. The agent's description documents both modes; the input shape and this directive together select meta-review mode.Filter Previously Addressed Findings
If REVIEW_OVERVIEW.md was found in Step 5:
review-scope findings: both findings use location review-scopePR descriptionAfter validation, slop meta-review, and previous-response filtering, dedupe and merge findings before applying emphasis:
manual; if the contradiction blocks approval, place it in Critical or Important based on impact.UNVERIFIED can be retained, but they must keep confidence below 60 and use manual or advisory unless the concrete risk is separately proven.After validation, slop meta-review, and previous-response filtering, apply emphasis adjustments if EMPHASIZED_DIMENSIONS is non-empty. Only use findings from agents that actually ran in Step 7 when deciding what is emphasized vs non-emphasized.
Dimension-to-agent mapping: security → injection-reviewer, auth-reviewer, data-reviewer, logic-reviewer | errors → silent-failure-hunter | tests → pr-test-analyzer | comments → comment-analyzer | types → type-design-analyzer | code → code-reviewer | slop → deslop-reviewer | performance → performance-oracle | removal → removal-planner | simplify → code-simplifier
Promotion rules (per finding, based on source agent):
Track the count of promoted findings for the report.
Assign stable Finding ID values to every active finding after dedupe, filtering, and emphasis are complete:
CR-001, CR-002, etc. in final report order, starting with Critical, then Important, then Suggestions.REVIEW_OVERVIEW.md and still describes the same root cause./kramme:pr:finalize can pass exact findings to /kramme:pr:resolve-review.Then summarize:
Every active finding must include its finding ID, location, confidence, action class, owner, and evidence in the final report:
gated_auto — code-backed Critical/Important finding with a concrete file/line, a clear fix, and enough confidence for /kramme:pr:resolve-review to attempt it.manual — requires a human decision, product/process judgment, PR-description update, cross-team ownership, or more context before a fix is safe.advisory — optional suggestion, FYI, low-confidence observation, or quality improvement that should not block merge. Do not use this class for Critical or Important findings.PR description findings should use the same severity rules as code findings. A materially false claim that would mislead merge approval, release notes, rollback planning, or QA is Important or Critical depending on impact. Minor missing detail is at most a Suggestion and should usually be omitted.
The recommended fix for a PR description finding is always to update the title/body to match the diff. The diff is the source of truth; the description is the suspect (PR descriptions drift, get written ahead of the final code, or are copied from earlier iterations). If a reviewer believes the code itself is wrong because it does not match the description's stated intent, raise that as a separate code-level finding with a file:line location.
Severity prefix grammar and dead-code ask shape — label every finding within each bucket using the severity prefix grammar, and emit removal-planner findings using the verbatim dead-code ask shape; both are defined in references/review-discipline.md. The section headers (## Critical Issues, ## Important Issues, ## Suggestions) remain — the prefix is the finer-grained label inside each section.
If INLINE_MODE=true:
references/output-template.md verbatimREVIEW_OVERVIEW.md/kramme:pr:resolve-review will need the user to save or paste the review content if they want to resolve it later without re-running the reviewOtherwise:
REVIEW_OVERVIEW.md in the project root, using the template in references/output-template.md/kramme:workflow-artifacts:cleanupIf eligible gated_auto Critical or Important code-backed issues were found, include a suggestion to run /kramme:pr:resolve-review to automatically address them. Manual and advisory findings must remain human follow-up in the report. The template in references/output-template.md already includes the Recommended Action block and the Approval Standard line; do not omit either.
Before posting (whether to REVIEW_OVERVIEW.md or inline), run the pre-posting verification checklist in references/review-discipline.md (severity prefixes, dead-code ask shape, Approval Standard line, NOTICED BUT NOT TOUCHING labels on out-of-scope notes, emphasized-dimension coverage, UNVERIFIED labels on untraced findings).
Full review (default):
/kramme:pr:code-review
Specific aspects:
/kramme:pr:code-review tests errors
# Reviews only test coverage and error handling
/kramme:pr:code-review comments
# Reviews only code comments
/kramme:pr:code-review performance
# Performance and scalability review only
/kramme:pr:code-review simplify
# Opt-in simplifier pass. Run after the main review is clean.
Parallel review:
/kramme:pr:code-review all parallel
# Deprecated alias for --parallel
/kramme:pr:code-review all --parallel
# LAUNCH_MODE=parallel; spawns all applicable agents simultaneously
Emphasize specific dimensions:
/kramme:pr:code-review --emphasize security
# Run all applicable agents, elevating security findings without downgrading other validated issues
/kramme:pr:code-review --emphasize security errors
# Elevate both security and error-handling findings
/kramme:pr:code-review tests errors --emphasize errors
# Run only test+error agents, elevate error findings
/kramme:pr:code-review comments --emphasize security
# Invalid: security is not in the active review set, so the command should stop with an error
Custom base branch (for PRs targeting non-default branches):
/kramme:pr:code-review --base develop
# Diffs against develop instead of auto-detecting the base
Inline report (no markdown file):
/kramme:pr:code-review --inline
# Replies with the full report instead of writing REVIEW_OVERVIEW.md
references/review-discipline.md holds the reviewer-craft conventions used by every spawned reviewer and by the orchestrator's final-check pass: the output markers (UNVERIFIED, NOTICED BUT NOT TOUCHING, CONFUSION, MISSING REQUIREMENT), the common rationalizations to watch for, the red-flag stop list, and the pre-posting verification checklist.
development
Runs kramme:pr:code-review as a closeout review loop for local or PR branch changes before commit, ship, or final response. Use when the user asks for autoreview, second-model review, or a final code-review pass after non-trivial edits. Not for UX, visual, accessibility, or product review.
development
Guides topic-level understanding verification for a PR, branch, feature, document, spec, design decision, bug fix, or other concrete subject. Use when the user asks to confirm, quiz, drill, teach-and-check, or verify that they understand a topic. Maintains a topic-specific checklist artifact and requires demonstrated understanding before marking the topic complete. Not for ordinary explanations without verification, end-of-session summaries, or code/test correctness checks.
testing
Design a CI/CD pipeline with quality gates, a <10-minute budget, feature-flag lifecycle, and an exit checklist. Use when adding a new CI pipeline, changing gate configuration, or planning a rollout for a new service. Complementary to kramme:pr:fix-ci (which fixes failures in an existing pipeline). Covers gate ordering, secrets storage, branch protection, rollback mechanism, and staged-rollout guardrails — not a rollout-execution runbook.
tools
--- name: kramme:visual:demo-reel description: Capture local demo evidence for observable product behavior: screenshots, before/after image sets, browser reels, terminal recordings, and short GIF/video proof. Use when shipping UI changes, CLI features, or any change where PR reviewers would benefit from visual or behavioral evidence. argument-hint: "[what to capture] [--url <url>|auto] [--tier static|before-after|browser-reel|terminal-recording]" disable-model-invocation: true user-invocable: tr