/review:analyzefrom review
Analyze PR changes to detect languages, frameworks, test setup, impact areas, and risk classes. Use when starting a PR review and you need to understand what changed before deeper analysis.
Ships in review. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Analyze a pull request: what changed, which languages/frameworks involved, how to test it, what impact areas need review, which risk classes should gate deeper passes.
Foundation for other review skills — produces structured analysis driving test recommendations, security scanning, documentation validation, and quality-review pass routing (shared/risk-class-routing.md).
https://github.com/org/repo/pull/123)mktemp -d.Writes analysis to <OUTPUT_DIR>/pr-analysis-<PR_NUMBER>.json:
{
"pr": {
"number": 123,
"title": "Add user authentication",
"url": "https://github.com/org/repo/pull/123",
"base_branch": "main",
"head_branch": "feature/auth",
"author": "username",
"state": "open"
},
"changes": {
"files_changed": 15,
"additions": 450,
"deletions": 120,
"files": ["src/auth.py", "tests/test_auth.py", "README.md"]
},
"languages": {
"primary": "python",
"detected": ["python", "javascript", "shell"],
"confidence": {
"python": 0.85,
"javascript": 0.10,
"shell": 0.05
}
},
"frameworks": {
"detected": ["django", "pytest", "npm"],
"confidence": "high"
},
"test_setup": {
"framework": "pytest",
"test_command": "pytest",
"test_files": ["tests/test_auth.py"],
"config_files": ["pytest.ini", "setup.py"],
"can_run_safely": true,
"safety_notes": "Uses pytest with standard config"
},
"build_system": {
"type": "python",
"files": ["setup.py", "requirements.txt", "pyproject.toml"],
"commands": {
"install": "pip install -r requirements.txt",
"test": "pytest",
"lint": "flake8"
}
},
"change_categories": {
"code": ["src/auth.py", "src/api.py"],
"tests": ["tests/test_auth.py"],
"docs": ["README.md", "docs/auth.md"],
"config": ["setup.py"],
"infra": []
},
"impact_analysis": {
"high_impact": ["authentication", "security"],
"medium_impact": ["API endpoints"],
"low_impact": ["documentation"],
"breaking_changes": false
},
"security_sensitive": true,
"needs_security_review": true,
"uses_mac_ui": false,
"mac_ui_ref_repo": "owner/mac-ui",
"risk_class": ["domain", "auth", "api"]
}
risk_class is an array of zero or more of: domain, auth, data, api, concurrency, ops.
The orchestrator uses it to gate QR passes (see shared/risk-class-routing.md).
uses_mac_ui (see Step 4) tells security-scan and docs-drift
to fetch mac-ui's live authority docs. mac_ui_ref_repo is the repo they fetch
from, taken from $MAC_UI_REF_REPO. Downstream skills read both from this JSON.
Extract PR URL and output dir from arguments:
PR_URL="$1"
# Default to a private per-run temp dir when run standalone (no OUTPUT_DIR passed)
OUTPUT_DIR="${2:-$(mktemp -d -t pr-review-XXXXXX)}"
# Create output dir if missing
mkdir -p "$OUTPUT_DIR"
# Extract PR number for filename
PR_NUMBER=$(echo "$PR_URL" | grep -oE 'pull/[0-9]+' | grep -oE '[0-9]+')
echo "Output directory: $OUTPUT_DIR" >&2
echo "PR number: $PR_NUMBER" >&2
/review:review captures the PR once into $OUTPUT_DIR before this skill
runs. Read $OUTPUT_DIR/pr-view.json and $OUTPUT_DIR/pr.files; fetch only
when they are absent (standalone run):
if [ ! -s "$OUTPUT_DIR/pr.files" ]; then
gh pr view "$PR_URL" --json number,title,url,baseRefName,headRefName,author,state,additions,deletions,body \
> "$OUTPUT_DIR/pr-view.json"
gh pr diff "$PR_URL" --name-only > "$OUTPUT_DIR/pr.files"
fi
Store in variables for later use.
cat "$OUTPUT_DIR/pr.files"
Count files and categorize by type:
.py, .js, .go, .java, .rb, .php, .ts, .tsx, .jsxtest_*.py, *.test.js, *_test.go, Test*.java*.md, *.rst, *.txt, docs/, README**.json, *.yaml, *.yml, *.toml, *.ini, Makefile, Dockerfile.github/, terraform/, k8s/, .circleci/, .gitlab-ci.ymlAnalyze file extensions and count:
sed 's/.*\.//' "$OUTPUT_DIR/pr.files" | sort | uniq -c | sort -rn
Primary language: extension with most files Secondary languages: extensions with >10% of files
Language mapping:
.py → Python.js, .jsx, .ts, .tsx → JavaScript/TypeScript.go → Go.java → Java.rb → Ruby.rs → Rust.php → PHP.c, .cpp, .cc → C/C++Look for framework indicators in changed files or project root.
Python:
django in requirements.txt, manage.py existsflask in requirements.txt, app.py patternfastapi in requirements.txtpytest in requirements.txt or pytest.ini existsJavaScript:
package.json contains "react"package.json contains "vue"package.json contains "@angular"package.json contains "express"package.json contains "jest"package.json contains "mocha"Go:
go.mod exists → Go modulesJava:
pom.xml or build.gradle contains springpom.xml contains junitRust:
Cargo.toml exists (a [workspace] root marks a multi-crate workspace).cargo-nextest if .config/nextest.toml exists or a justfile
recipe runs nextest; else plain cargo test.cargo-llvm-cov if a just coverage/llvm-cov recipe or
cargo-llvm-cov in CI. Note any --fail-under-lines threshold (a hard gate).cargo-audit, cargo-deny (deny.toml), cargo-machete.justfile — its fmt/clippy/test/coverage/ci
recipes are what CI runs; record exact recipes, don't guess.mac-ui / Web Components ($MAC_UI_PACKAGE):
$MAC_UI_PACKAGE (npm name, e.g. @scope/mac-ui) and
$MAC_UI_REF_REPO (owner/repo) are set; otherwise leave uses_mac_ui: false.uses_mac_ui: true when any of: package.json (root or a workspace
package) depends on $MAC_UI_PACKAGE or its -react/-utils siblings; a changed
file registers or consumes a mac-* custom element (customElements.define,
a <mac-…> tag, or an import from $MAC_UI_PACKAGE).lerna.json + packages/ → lerna workspace; biome.json → Biome
lint/format; vite.config.ts/web-dev-server-config.js → Vite/WTR.package.json test script is authoritative
(web-test-runner / vitest / jsdom); don't assume.Look for:
pytest.ini, tox.ini, setup.py with test_suitejest.config.js, package.json "test" script*_test.go files (standard testing)pom.xml with surefire plugin, JUnitInfer from config: Python → pytest / python setup.py test / make test; JS → npm test; Go → go test ./...; Rust → just recipes or cargo nextest / cargo test. Prefer the command CI actually runs.
can_run_safely when: standard framework, no external deps, no destructive ops, reasonable runtime (<5min).
Mark unsafe for integration/e2e, DB/docker requirements, or tests that hit live network. Rust: unsafe when gated on PGURL / Kafka / compose; unit-only nextest filter is usually safe. mac-ui: default unsafe unless package test is jsdom/vitest-only (needs Chromium otherwise).
Look for build config files.
Python:
setup.py → setuptoolspyproject.toml → modern Python (poetry, flit, hatch)requirements.txt → pipPipfile → pipenvMakefile → makeJavaScript:
package.json → npm/yarnyarn.lock → yarnpackage-lock.json → npmGo:
go.mod → Go modulesMakefile → makeJava:
pom.xml → Mavenbuild.gradle → GradleRust:
Cargo.toml → cargo (workspace if [workspace])justfile → task runner; its recipes are the source of truth for
install/test/lint/build (mirror them into the commands map below)JS monorepo:
lerna.json/pnpm-workspace.yaml/package.json workspaces → monorepo;
commands run per-package (npm -w <pkg> test)Record install / test / lint / build commands in the build_system JSON (prefer justfile / package scripts over guesses).
Look for changes in sensitive files/patterns.
Authentication/Security:
*auth*, *security*, *login*, *password*, *token*Database:
*migration*, *schema*, *model*, *db*API:
*api*, *endpoint*, *route*, *handler*Configuration:
config/*, .env*, *.yaml, *.json (in root or config dirs)Infrastructure:
Dockerfile, docker-compose.yml, k8s/*, terraform/*Indicators:
Keywords in commits/PR title:
Determine if PR needs extra security scrutiny.
High security sensitivity:
Markers:
security_sensitive = (
affects_auth OR
affects_database OR
affects_api OR
affects_crypto OR
updates_security_deps
)
risk_class arraySet RISK_CLASS_JSON to a JSON array of applicable classes ([] is valid). Include a class when the diff/title/body/paths strongly suggest it — prefer false-positive inclusion over missing a QR pass.
| Class | Include when |
|---|---|
domain | Domain model, aggregates, bounded-context, ownership/CODEOWNERS cross-boundary, layering/hex/ports changes |
auth | Authn/z, sessions, tokens, IDOR-prone ID lookups, permission/role changes |
data | Migrations, schema, serializers, caches as SoT, dual-write, retention/delete |
api | Public/internal HTTP/RPC/event/webhook contracts, OpenAPI/Protobuf/Avro, versioning |
concurrency | Locks, atomics, shared mutable state, async cancel, queues/consumers, idempotent handlers |
ops | Timeouts, retries, circuit breakers, metrics/traces on new paths, pools, pagination limits, hot-path perf |
Map from impact_analysis + path heuristics. Example: auth+API endpoint change → ["auth","api"] (and often domain if model touched).
Combine all findings into structured JSON, write to $OUTPUT_DIR/pr-analysis-<PR_NUMBER>.json.
Build JSON with jq -n so every PR-derived value is safely escaped — pass strings with --arg, numbers/booleans/arrays/objects with --argjson. Never interpolate untrusted text into a heredoc.
jq -n \
--argjson pr "$PR_JSON" \
--argjson changes "$CHANGES_JSON" \
--argjson languages "$LANGUAGES_JSON" \
--argjson frameworks "$FRAMEWORKS_JSON" \
--argjson test_setup "$TEST_SETUP_JSON" \
--argjson build_system "$BUILD_SYSTEM_JSON" \
--argjson change_categories "$CHANGE_CATEGORIES_JSON" \
--argjson impact_analysis "$IMPACT_ANALYSIS_JSON" \
--argjson security_sensitive "$SECURITY_SENSITIVE" \
--argjson needs_security_review "$NEEDS_SECURITY_REVIEW" \
--argjson uses_mac_ui "${USES_MAC_UI:-false}" \
--arg mac_ui_ref_repo "${MAC_UI_REF_REPO:-}" \
--argjson risk_class "${RISK_CLASS_JSON:-[]}" \
'{
pr: $pr,
changes: $changes,
languages: $languages,
frameworks: $frameworks,
test_setup: $test_setup,
build_system: $build_system,
change_categories: $change_categories,
impact_analysis: $impact_analysis,
security_sensitive: $security_sensitive,
needs_security_review: $needs_security_review,
uses_mac_ui: $uses_mac_ui,
mac_ui_ref_repo: $mac_ui_ref_repo,
risk_class: $risk_class
}' > "$OUTPUT_DIR/pr-analysis-${PR_NUMBER}.json"
Display human-readable summary.
✅ PR Analysis Complete
PR: #123 - Add user authentication
Files changed: 15 (+450, -120)
Languages:
- Python (85%)
- JavaScript (10%)
- Shell (5%)
Frameworks:
- Django
- Pytest
Test Setup:
- Framework: pytest
- Command: pytest
- Can run safely: ✅
- Test files: 1
Impact Areas:
- 🔴 High: authentication, security
- 🟡 Medium: API endpoints
- 🟢 Low: documentation
Risk classes: domain, auth, api
Security: ⚠️ Requires security review
Analysis saved to: $OUTPUT_DIR/pr-analysis-123.json
If gh CLI fails:
Error: Could not fetch PR. Check:
- gh is installed and authenticated
- PR URL is valid and accessible
- You have permissions to view this PR
If analysis is incomplete:
nullrisk_class: [] over omitting the keyshared/risk-class-routing.mdWhat SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub ozzycodes2/claudellum --plugin review11 skills in this plugin
/change-evolutionReviews PR diffs for CD readiness, reversibility, and design-quality risks such as YAGNI, deep modules, and complexity budget. Use when a PR is large, mixes refactor with behavior, or introduces flags/migrations/stranglers./codegenGenerates simple tests, docstrings, and documentation updates for PR changes. Use when reviewing a PR and you want draft tests, docstrings, or CHANGELOG entries to fill the gaps it surfaced (human review required before committing)./data-contractsReviews PR diffs for data consistency, schema/migration safety, and API/event contract compatibility. Use when analyze risk_class includes data or api, or when a PR changes schemas, migrations, public APIs, or event payloads.