[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7ASKJE34CW8GKZT4YFTQTEM":3,"skill-same:01M7ASKJE34CW8GKZT4YFTQTEM":47},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":25,"commitSha":26,"skillDirectory":27,"forksCount":28,"repositoryHtmlUrl":29,"repositoryHomepageUrl":6,"ownerHtmlUrl":30,"ownerBlogUrl":6,"ownerDescription":31,"updatedAt":32,"install":33,"resources":46},"01M7ASKJE34CW8GKZT4YFTQTEM","analyze",null,"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.","ozzycodes2\u002Fclaudellum","ozzycodes2","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F21285094?v=4","01M7ASJ57KTP519F96S4QGM7C5","Osniel Quintana","01M7ASJ589JS8S075AA92Y08S4",1,"MIT","https:\u002F\u002Fgithub.com\u002Fozzycodes2\u002Fclaudellum\u002Fblob\u002Fmain\u002Freview\u002Fskills\u002Fanalyze\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: analyze\ndescription: 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.\nallowed-tools: Bash Read Grep Glob\n---\n\n# Analyze PR Changes\n\nAnalyze a pull request: what changed, which languages\u002Fframeworks involved, how to test it, what impact areas need review, which **risk classes** should gate deeper passes.\n\n**Foundation** for other review skills — produces structured analysis driving test recommendations, security scanning, documentation validation, and quality-review pass routing (`shared\u002Frisk-class-routing.md`).\n\n## Inputs\n\n- **PR URL**: Full GitHub\u002FEnterprise PR URL (e.g., `https:\u002F\u002Fgithub.com\u002Forg\u002Frepo\u002Fpull\u002F123`)\n- **OUTPUT_DIR** (optional): Output dir. Defaults to private `mktemp -d`.\n\n## Outputs\n\nWrites analysis to `\u003COUTPUT_DIR>\u002Fpr-analysis-\u003CPR_NUMBER>.json`:\n```json\n{\n  \"pr\": {\n    \"number\": 123,\n    \"title\": \"Add user authentication\",\n    \"url\": \"https:\u002F\u002Fgithub.com\u002Forg\u002Frepo\u002Fpull\u002F123\",\n    \"base_branch\": \"main\",\n    \"head_branch\": \"feature\u002Fauth\",\n    \"author\": \"username\",\n    \"state\": \"open\"\n  },\n  \"changes\": {\n    \"files_changed\": 15,\n    \"additions\": 450,\n    \"deletions\": 120,\n    \"files\": [\"src\u002Fauth.py\", \"tests\u002Ftest_auth.py\", \"README.md\"]\n  },\n  \"languages\": {\n    \"primary\": \"python\",\n    \"detected\": [\"python\", \"javascript\", \"shell\"],\n    \"confidence\": {\n      \"python\": 0.85,\n      \"javascript\": 0.10,\n      \"shell\": 0.05\n    }\n  },\n  \"frameworks\": {\n    \"detected\": [\"django\", \"pytest\", \"npm\"],\n    \"confidence\": \"high\"\n  },\n  \"test_setup\": {\n    \"framework\": \"pytest\",\n    \"test_command\": \"pytest\",\n    \"test_files\": [\"tests\u002Ftest_auth.py\"],\n    \"config_files\": [\"pytest.ini\", \"setup.py\"],\n    \"can_run_safely\": true,\n    \"safety_notes\": \"Uses pytest with standard config\"\n  },\n  \"build_system\": {\n    \"type\": \"python\",\n    \"files\": [\"setup.py\", \"requirements.txt\", \"pyproject.toml\"],\n    \"commands\": {\n      \"install\": \"pip install -r requirements.txt\",\n      \"test\": \"pytest\",\n      \"lint\": \"flake8\"\n    }\n  },\n  \"change_categories\": {\n    \"code\": [\"src\u002Fauth.py\", \"src\u002Fapi.py\"],\n    \"tests\": [\"tests\u002Ftest_auth.py\"],\n    \"docs\": [\"README.md\", \"docs\u002Fauth.md\"],\n    \"config\": [\"setup.py\"],\n    \"infra\": []\n  },\n  \"impact_analysis\": {\n    \"high_impact\": [\"authentication\", \"security\"],\n    \"medium_impact\": [\"API endpoints\"],\n    \"low_impact\": [\"documentation\"],\n    \"breaking_changes\": false\n  },\n  \"security_sensitive\": true,\n  \"needs_security_review\": true,\n  \"uses_mac_ui\": false,\n  \"mac_ui_ref_repo\": \"owner\u002Fmac-ui\",\n  \"risk_class\": [\"domain\", \"auth\", \"api\"]\n}\n```\n\n`risk_class` is an array of zero or more of: `domain`, `auth`, `data`, `api`, `concurrency`, `ops`.\nThe orchestrator uses it to gate QR passes (see `shared\u002Frisk-class-routing.md`).\n\n`uses_mac_ui` (see Step 4) tells `security-scan` and `docs-drift`\nto fetch mac-ui's live authority docs. `mac_ui_ref_repo` is the repo they fetch\nfrom, taken from `$MAC_UI_REF_REPO`. Downstream skills read both from this JSON.\n\n## Step 0: Parse Arguments\n\nExtract PR URL and output dir from arguments:\n\n```bash\nPR_URL=\"$1\"\n# Default to a private per-run temp dir when run standalone (no OUTPUT_DIR passed)\nOUTPUT_DIR=\"${2:-$(mktemp -d -t pr-review-XXXXXX)}\"\n\n# Create output dir if missing\nmkdir -p \"$OUTPUT_DIR\"\n\n# Extract PR number for filename\nPR_NUMBER=$(echo \"$PR_URL\" | grep -oE 'pull\u002F[0-9]+' | grep -oE '[0-9]+')\n\necho \"Output directory: $OUTPUT_DIR\" >&2\necho \"PR number: $PR_NUMBER\" >&2\n```\n\n## Step 1: Fetch PR Metadata\n\n`\u002Freview:review` captures the PR once into `$OUTPUT_DIR` before this skill\nruns. Read `$OUTPUT_DIR\u002Fpr-view.json` and `$OUTPUT_DIR\u002Fpr.files`; fetch only\nwhen they are absent (standalone run):\n\n```bash\nif [ ! -s \"$OUTPUT_DIR\u002Fpr.files\" ]; then\n  gh pr view \"$PR_URL\" --json number,title,url,baseRefName,headRefName,author,state,additions,deletions,body \\\n    > \"$OUTPUT_DIR\u002Fpr-view.json\"\n  gh pr diff \"$PR_URL\" --name-only > \"$OUTPUT_DIR\u002Fpr.files\"\nfi\n```\n\nStore in variables for later use.\n\n## Step 2: Get Changed Files\n\n```bash\ncat \"$OUTPUT_DIR\u002Fpr.files\"\n```\n\nCount files and categorize by type:\n- **Code**: `.py`, `.js`, `.go`, `.java`, `.rb`, `.php`, `.ts`, `.tsx`, `.jsx`\n- **Tests**: `test_*.py`, `*.test.js`, `*_test.go`, `Test*.java`\n- **Docs**: `*.md`, `*.rst`, `*.txt`, `docs\u002F`, `README*`\n- **Config**: `*.json`, `*.yaml`, `*.yml`, `*.toml`, `*.ini`, `Makefile`, `Dockerfile`\n- **Infra**: `.github\u002F`, `terraform\u002F`, `k8s\u002F`, `.circleci\u002F`, `.gitlab-ci.yml`\n\n## Step 3: Detect Languages\n\nAnalyze file extensions and count:\n```bash\nsed 's\u002F.*\\.\u002F\u002F' \"$OUTPUT_DIR\u002Fpr.files\" | sort | uniq -c | sort -rn\n```\n\n**Primary language**: extension with most files\n**Secondary languages**: extensions with >10% of files\n\n**Language mapping:**\n- `.py` → Python\n- `.js`, `.jsx`, `.ts`, `.tsx` → JavaScript\u002FTypeScript\n- `.go` → Go\n- `.java` → Java\n- `.rb` → Ruby\n- `.rs` → Rust\n- `.php` → PHP\n- `.c`, `.cpp`, `.cc` → C\u002FC++\n\n## Step 4: Detect Frameworks\n\nLook for framework indicators in changed files or project root.\n\n**Python:**\n- Django: `django` in requirements.txt, `manage.py` exists\n- Flask: `flask` in requirements.txt, `app.py` pattern\n- FastAPI: `fastapi` in requirements.txt\n- Pytest: `pytest` in requirements.txt or `pytest.ini` exists\n\n**JavaScript:**\n- React: `package.json` contains `\"react\"`\n- Vue: `package.json` contains `\"vue\"`\n- Angular: `package.json` contains `\"@angular\"`\n- Express: `package.json` contains `\"express\"`\n- Jest: `package.json` contains `\"jest\"`\n- Mocha: `package.json` contains `\"mocha\"`\n\n**Go:**\n- `go.mod` exists → Go modules\n- Standard library (no frameworks typically)\n\n**Java:**\n- Spring: `pom.xml` or `build.gradle` contains `spring`\n- JUnit: `pom.xml` contains `junit`\n\n**Rust:**\n- Cargo: `Cargo.toml` exists (a `[workspace]` root marks a multi-crate workspace).\n- Test runner: `cargo-nextest` if `.config\u002Fnextest.toml` exists or a `justfile`\n  recipe runs `nextest`; else plain `cargo test`.\n- Coverage: `cargo-llvm-cov` if a `just coverage`\u002F`llvm-cov` recipe or\n  `cargo-llvm-cov` in CI. Note any `--fail-under-lines` threshold (a hard gate).\n- Supply-chain: `cargo-audit`, `cargo-deny` (`deny.toml`), `cargo-machete`.\n- Command source: prefer a `justfile` — its `fmt`\u002F`clippy`\u002F`test`\u002F`coverage`\u002F`ci`\n  recipes are what CI runs; record exact recipes, don't guess.\n\n**mac-ui \u002F Web Components (`$MAC_UI_PACKAGE`):**\n- Only when both `$MAC_UI_PACKAGE` (npm name, e.g. `@scope\u002Fmac-ui`) and\n  `$MAC_UI_REF_REPO` (`owner\u002Frepo`) are set; otherwise leave `uses_mac_ui: false`.\n- Set `uses_mac_ui: true` when any of: `package.json` (root or a workspace\n  package) depends on `$MAC_UI_PACKAGE` or its `-react`\u002F`-utils` siblings; a changed\n  file registers or consumes a `mac-*` custom element (`customElements.define`,\n  a `\u003Cmac-…>` tag, or an import from `$MAC_UI_PACKAGE`).\n- Monorepo: `lerna.json` + `packages\u002F` → lerna workspace; `biome.json` → Biome\n  lint\u002Fformat; `vite.config.ts`\u002F`web-dev-server-config.js` → Vite\u002FWTR.\n- Test runner: per-package `package.json` `test` script is authoritative\n  (web-test-runner \u002F vitest \u002F jsdom); don't assume.\n\n## Step 5: Analyze Test Setup\n\n### 5.1 Find Test Framework\n\nLook for:\n- Python: `pytest.ini`, `tox.ini`, `setup.py` with test_suite\n- JavaScript: `jest.config.js`, `package.json` \"test\" script\n- Go: `*_test.go` files (standard testing)\n- Java: `pom.xml` with surefire plugin, JUnit\n\n### 5.2 Determine Test Command\n\nInfer from config: Python → `pytest` \u002F `python setup.py test` \u002F `make test`; JS → `npm test`; Go → `go test .\u002F...`; Rust → `just` recipes or `cargo nextest` \u002F `cargo test`. Prefer the command CI actually runs.\n\n### 5.3 Safety Assessment\n\n`can_run_safely` when: standard framework, no external deps, no destructive ops, reasonable runtime (\u003C5min).\n\nMark **unsafe** for integration\u002Fe2e, DB\u002Fdocker requirements, or tests that hit live network. **Rust:** unsafe when gated on `PGURL` \u002F Kafka \u002F compose; unit-only nextest filter is usually safe. **mac-ui:** default unsafe unless package `test` is jsdom\u002Fvitest-only (needs Chromium otherwise).\n\n## Step 6: Detect Build System\n\nLook for build config files.\n\n**Python:**\n- `setup.py` → setuptools\n- `pyproject.toml` → modern Python (poetry, flit, hatch)\n- `requirements.txt` → pip\n- `Pipfile` → pipenv\n- `Makefile` → make\n\n**JavaScript:**\n- `package.json` → npm\u002Fyarn\n- `yarn.lock` → yarn\n- `package-lock.json` → npm\n\n**Go:**\n- `go.mod` → Go modules\n- `Makefile` → make\n\n**Java:**\n- `pom.xml` → Maven\n- `build.gradle` → Gradle\n\n**Rust:**\n- `Cargo.toml` → cargo (workspace if `[workspace]`)\n- `justfile` → task runner; its recipes are the source of truth for\n  `install`\u002F`test`\u002F`lint`\u002F`build` (mirror them into the commands map below)\n\n**JS monorepo:**\n- `lerna.json`\u002F`pnpm-workspace.yaml`\u002F`package.json` `workspaces` → monorepo;\n  commands run per-package (`npm -w \u003Cpkg> test`)\n\nRecord `install` \u002F `test` \u002F `lint` \u002F `build` commands in the build_system JSON (prefer `justfile` \u002F package scripts over guesses).\n\n## Step 7: Impact Analysis\n\n### 7.1 Detect High-Impact Areas\n\nLook for changes in sensitive files\u002Fpatterns.\n\n**Authentication\u002FSecurity:**\n- Files matching: `*auth*`, `*security*`, `*login*`, `*password*`, `*token*`\n- Keywords in diff: \"auth\", \"login\", \"password\", \"secret\", \"key\"\n\n**Database:**\n- Files matching: `*migration*`, `*schema*`, `*model*`, `*db*`\n- Keywords: \"ALTER TABLE\", \"DROP\", \"CREATE TABLE\"\n\n**API:**\n- Files matching: `*api*`, `*endpoint*`, `*route*`, `*handler*`\n- Keywords: \"GET\", \"POST\", \"PUT\", \"DELETE\" in route definitions\n\n**Configuration:**\n- Files: `config\u002F*`, `.env*`, `*.yaml`, `*.json` (in root or config dirs)\n\n**Infrastructure:**\n- Files: `Dockerfile`, `docker-compose.yml`, `k8s\u002F*`, `terraform\u002F*`\n\n### 7.2 Detect Breaking Changes\n\nIndicators:\n- Major version bump in package file\n- Removed or renamed functions\u002Fclasses\n- Changed function signatures\n- Deleted files\n- Database schema changes (DROP, ALTER)\n\nKeywords in commits\u002FPR title:\n- \"BREAKING\", \"breaking change\", \"incompatible\", \"removed\", \"deprecated\"\n\n## Step 8: Security Sensitivity Assessment\n\nDetermine if PR needs extra security scrutiny.\n\n**High security sensitivity:**\n- Changes authentication\u002Fauthorization code\n- Modifies database schemas\n- Changes API endpoints\n- Touches encryption\u002Fcrypto code\n- Modifies access control\n- Updates dependencies with known vulnerabilities\n\n**Markers:**\n```python\nsecurity_sensitive = (\n  affects_auth OR\n  affects_database OR\n  affects_api OR\n  affects_crypto OR\n  updates_security_deps\n)\n```\n\n## Step 8b: Emit `risk_class` array\n\nSet `RISK_CLASS_JSON` to a JSON array of applicable classes (`[]` is valid). Include a class when the diff\u002Ftitle\u002Fbody\u002Fpaths strongly suggest it — prefer false-positive inclusion over missing a QR pass.\n\n| Class | Include when |\n|---|---|\n| `domain` | Domain model, aggregates, bounded-context, ownership\u002FCODEOWNERS cross-boundary, layering\u002Fhex\u002Fports changes |\n| `auth` | Authn\u002Fz, sessions, tokens, IDOR-prone ID lookups, permission\u002Frole changes |\n| `data` | Migrations, schema, serializers, caches as SoT, dual-write, retention\u002Fdelete |\n| `api` | Public\u002Finternal HTTP\u002FRPC\u002Fevent\u002Fwebhook contracts, OpenAPI\u002FProtobuf\u002FAvro, versioning |\n| `concurrency` | Locks, atomics, shared mutable state, async cancel, queues\u002Fconsumers, idempotent handlers |\n| `ops` | Timeouts, retries, circuit breakers, metrics\u002Ftraces on new paths, pools, pagination limits, hot-path perf |\n\nMap from impact_analysis + path heuristics. Example: auth+API endpoint change → `[\"auth\",\"api\"]` (and often `domain` if model touched).\n\n## Step 9: Generate Analysis JSON\n\nCombine all findings into structured JSON, write to `$OUTPUT_DIR\u002Fpr-analysis-\u003CPR_NUMBER>.json`.\n\nBuild JSON with `jq -n` so every PR-derived value is safely escaped — pass strings with `--arg`, numbers\u002Fbooleans\u002Farrays\u002Fobjects with `--argjson`. Never interpolate untrusted text into a heredoc.\n\n```bash\njq -n \\\n  --argjson pr \"$PR_JSON\" \\\n  --argjson changes \"$CHANGES_JSON\" \\\n  --argjson languages \"$LANGUAGES_JSON\" \\\n  --argjson frameworks \"$FRAMEWORKS_JSON\" \\\n  --argjson test_setup \"$TEST_SETUP_JSON\" \\\n  --argjson build_system \"$BUILD_SYSTEM_JSON\" \\\n  --argjson change_categories \"$CHANGE_CATEGORIES_JSON\" \\\n  --argjson impact_analysis \"$IMPACT_ANALYSIS_JSON\" \\\n  --argjson security_sensitive \"$SECURITY_SENSITIVE\" \\\n  --argjson needs_security_review \"$NEEDS_SECURITY_REVIEW\" \\\n  --argjson uses_mac_ui \"${USES_MAC_UI:-false}\" \\\n  --arg mac_ui_ref_repo \"${MAC_UI_REF_REPO:-}\" \\\n  --argjson risk_class \"${RISK_CLASS_JSON:-[]}\" \\\n  '{\n    pr: $pr,\n    changes: $changes,\n    languages: $languages,\n    frameworks: $frameworks,\n    test_setup: $test_setup,\n    build_system: $build_system,\n    change_categories: $change_categories,\n    impact_analysis: $impact_analysis,\n    security_sensitive: $security_sensitive,\n    needs_security_review: $needs_security_review,\n    uses_mac_ui: $uses_mac_ui,\n    mac_ui_ref_repo: $mac_ui_ref_repo,\n    risk_class: $risk_class\n  }' > \"$OUTPUT_DIR\u002Fpr-analysis-${PR_NUMBER}.json\"\n```\n\n## Step 10: Provide Summary to User\n\nDisplay human-readable summary.\n\n```\n✅ PR Analysis Complete\n\nPR: #123 - Add user authentication\nFiles changed: 15 (+450, -120)\n\nLanguages:\n  - Python (85%)\n  - JavaScript (10%)\n  - Shell (5%)\n\nFrameworks:\n  - Django\n  - Pytest\n\nTest Setup:\n  - Framework: pytest\n  - Command: pytest\n  - Can run safely: ✅\n  - Test files: 1\n\nImpact Areas:\n  - 🔴 High: authentication, security\n  - 🟡 Medium: API endpoints\n  - 🟢 Low: documentation\n\nRisk classes: domain, auth, api\n\nSecurity: ⚠️  Requires security review\n\nAnalysis saved to: $OUTPUT_DIR\u002Fpr-analysis-123.json\n```\n\n## Error Handling\n\n**If gh CLI fails:**\n```\nError: Could not fetch PR. Check:\n- gh is installed and authenticated\n- PR URL is valid and accessible\n- You have permissions to view this PR\n```\n\n**If analysis is incomplete:**\n- Still generate JSON with available data\n- Mark missing fields as `null`\n- Prefer `risk_class: []` over omitting the key\n- Note in summary which analysis steps failed\n\n## Notes\n\n- Does NOT modify code or run tests - only analyzes\n- All analysis read-only (safe to run on any PR)\n- Output JSON designed to be consumed by other skills\n- Can be run standalone or as part of review\n- Routing consumers: orchestrator + `shared\u002Frisk-class-routing.md`\n","# Analyze PR Changes\n\nAnalyze a pull request: what changed, which languages\u002Fframeworks involved, how to test it, what impact areas need review, which **risk classes** should gate deeper passes.\n\n**Foundation** for other review skills — produces structured analysis driving test recommendations, security scanning, documentation validation, and quality-review pass routing (`shared\u002Frisk-class-routing.md`).\n\n## Inputs\n\n- **PR URL**: Full GitHub\u002FEnterprise PR URL (e.g., `https:\u002F\u002Fgithub.com\u002Forg\u002Frepo\u002Fpull\u002F123`)\n- **OUTPUT_DIR** (optional): Output dir. Defaults to private `mktemp -d`.\n\n## Outputs\n\nWrites analysis to `\u003COUTPUT_DIR>\u002Fpr-analysis-\u003CPR_NUMBER>.json`:\n```json\n{\n  \"pr\": {\n    \"number\": 123,\n    \"title\": \"Add user authentication\",\n    \"url\": \"https:\u002F\u002Fgithub.com\u002Forg\u002Frepo\u002Fpull\u002F123\",\n    \"base_branch\": \"main\",\n    \"head_branch\": \"feature\u002Fauth\",\n    \"author\": \"username\",\n    \"state\": \"open\"\n  },\n  \"changes\": {\n    \"files_changed\": 15,\n    \"additions\": 450,\n    \"deletions\": 120,\n    \"files\": [\"src\u002Fauth.py\", \"tests\u002Ftest_auth.py\", \"README.md\"]\n  },\n  \"languages\": {\n    \"primary\": \"python\",\n    \"detected\": [\"python\", \"javascript\", \"shell\"],\n    \"confidence\": {\n      \"python\": 0.85,\n      \"javascript\": 0.10,\n      \"shell\": 0.05\n    }\n  },\n  \"frameworks\": {\n    \"detected\": [\"django\", \"pytest\", \"npm\"],\n    \"confidence\": \"high\"\n  },\n  \"test_setup\": {\n    \"framework\": \"pytest\",\n    \"test_command\": \"pytest\",\n    \"test_files\": [\"tests\u002Ftest_auth.py\"],\n    \"config_files\": [\"pytest.ini\", \"setup.py\"],\n    \"can_run_safely\": true,\n    \"safety_notes\": \"Uses pytest with standard config\"\n  },\n  \"build_system\": {\n    \"type\": \"python\",\n    \"files\": [\"setup.py\", \"requirements.txt\", \"pyproject.toml\"],\n    \"commands\": {\n      \"install\": \"pip install -r requirements.txt\",\n      \"test\": \"pytest\",\n      \"lint\": \"flake8\"\n    }\n  },\n  \"change_categories\": {\n    \"code\": [\"src\u002Fauth.py\", \"src\u002Fapi.py\"],\n    \"tests\": [\"tests\u002Ftest_auth.py\"],\n    \"docs\": [\"README.md\", \"docs\u002Fauth.md\"],\n    \"config\": [\"setup.py\"],\n    \"infra\": []\n  },\n  \"impact_analysis\": {\n    \"high_impact\": [\"authentication\", \"security\"],\n    \"medium_impact\": [\"API endpoints\"],\n    \"low_impact\": [\"documentation\"],\n    \"breaking_changes\": false\n  },\n  \"security_sensitive\": true,\n  \"needs_security_review\": true,\n  \"uses_mac_ui\": false,\n  \"mac_ui_ref_repo\": \"owner\u002Fmac-ui\",\n  \"risk_class\": [\"domain\", \"auth\", \"api\"]\n}\n```\n\n`risk_class` is an array of zero or more of: `domain`, `auth`, `data`, `api`, `concurrency`, `ops`.\nThe orchestrator uses it to gate QR passes (see `shared\u002Frisk-class-routing.md`).\n\n`uses_mac_ui` (see Step 4) tells `security-scan` and `docs-drift`\nto fetch mac-ui's live authority docs. `mac_ui_ref_repo` is the repo they fetch\nfrom, taken from `$MAC_UI_REF_REPO`. Downstream skills read both from this JSON.\n\n## Step 0: Parse Arguments\n\nExtract PR URL and output dir from arguments:\n\n```bash\nPR_URL=\"$1\"\n# Default to a private per-run temp dir when run standalone (no OUTPUT_DIR passed)\nOUTPUT_DIR=\"${2:-$(mktemp -d -t pr-review-XXXXXX)}\"\n\n# Create output dir if missing\nmkdir -p \"$OUTPUT_DIR\"\n\n# Extract PR number for filename\nPR_NUMBER=$(echo \"$PR_URL\" | grep -oE 'pull\u002F[0-9]+' | grep -oE '[0-9]+')\n\necho \"Output directory: $OUTPUT_DIR\" >&2\necho \"PR number: $PR_NUMBER\" >&2\n```\n\n## Step 1: Fetch PR Metadata\n\n`\u002Freview:review` captures the PR once into `$OUTPUT_DIR` before this skill\nruns. Read `$OUTPUT_DIR\u002Fpr-view.json` and `$OUTPUT_DIR\u002Fpr.files`; fetch only\nwhen they are absent (standalone run):\n\n```bash\nif [ ! -s \"$OUTPUT_DIR\u002Fpr.files\" ]; then\n  gh pr view \"$PR_URL\" --json number,title,url,baseRefName,headRefName,author,state,additions,deletions,body \\\n    > \"$OUTPUT_DIR\u002Fpr-view.json\"\n  gh pr diff \"$PR_URL\" --name-only > \"$OUTPUT_DIR\u002Fpr.files\"\nfi\n```\n\nStore in variables for later use.\n\n## Step 2: Get Changed Files\n\n```bash\ncat \"$OUTPUT_DIR\u002Fpr.files\"\n```\n\nCount files and categorize by type:\n- **Code**: `.py`, `.js`, `.go`, `.java`, `.rb`, `.php`, `.ts`, `.tsx`, `.jsx`\n- **Tests**: `test_*.py`, `*.test.js`, `*_test.go`, `Test*.java`\n- **Docs**: `*.md`, `*.rst`, `*.txt`, `docs\u002F`, `README*`\n- **Config**: `*.json`, `*.yaml`, `*.yml`, `*.toml`, `*.ini`, `Makefile`, `Dockerfile`\n- **Infra**: `.github\u002F`, `terraform\u002F`, `k8s\u002F`, `.circleci\u002F`, `.gitlab-ci.yml`\n\n## Step 3: Detect Languages\n\nAnalyze file extensions and count:\n```bash\nsed 's\u002F.*\\.\u002F\u002F' \"$OUTPUT_DIR\u002Fpr.files\" | sort | uniq -c | sort -rn\n```\n\n**Primary language**: extension with most files\n**Secondary languages**: extensions with >10% of files\n\n**Language mapping:**\n- `.py` → Python\n- `.js`, `.jsx`, `.ts`, `.tsx` → JavaScript\u002FTypeScript\n- `.go` → Go\n- `.java` → Java\n- `.rb` → Ruby\n- `.rs` → Rust\n- `.php` → PHP\n- `.c`, `.cpp`, `.cc` → C\u002FC++\n\n## Step 4: Detect Frameworks\n\nLook for framework indicators in changed files or project root.\n\n**Python:**\n- Django: `django` in requirements.txt, `manage.py` exists\n- Flask: `flask` in requirements.txt, `app.py` pattern\n- FastAPI: `fastapi` in requirements.txt\n- Pytest: `pytest` in requirements.txt or `pytest.ini` exists\n\n**JavaScript:**\n- React: `package.json` contains `\"react\"`\n- Vue: `package.json` contains `\"vue\"`\n- Angular: `package.json` contains `\"@angular\"`\n- Express: `package.json` contains `\"express\"`\n- Jest: `package.json` contains `\"jest\"`\n- Mocha: `package.json` contains `\"mocha\"`\n\n**Go:**\n- `go.mod` exists → Go modules\n- Standard library (no frameworks typically)\n\n**Java:**\n- Spring: `pom.xml` or `build.gradle` contains `spring`\n- JUnit: `pom.xml` contains `junit`\n\n**Rust:**\n- Cargo: `Cargo.toml` exists (a `[workspace]` root marks a multi-crate workspace).\n- Test runner: `cargo-nextest` if `.config\u002Fnextest.toml` exists or a `justfile`\n  recipe runs `nextest`; else plain `cargo test`.\n- Coverage: `cargo-llvm-cov` if a `just coverage`\u002F`llvm-cov` recipe or\n  `cargo-llvm-cov` in CI. Note any `--fail-under-lines` threshold (a hard gate).\n- Supply-chain: `cargo-audit`, `cargo-deny` (`deny.toml`), `cargo-machete`.\n- Command source: prefer a `justfile` — its `fmt`\u002F`clippy`\u002F`test`\u002F`coverage`\u002F`ci`\n  recipes are what CI runs; record exact recipes, don't guess.\n\n**mac-ui \u002F Web Components (`$MAC_UI_PACKAGE`):**\n- Only when both `$MAC_UI_PACKAGE` (npm name, e.g. `@scope\u002Fmac-ui`) and\n  `$MAC_UI_REF_REPO` (`owner\u002Frepo`) are set; otherwise leave `uses_mac_ui: false`.\n- Set `uses_mac_ui: true` when any of: `package.json` (root or a workspace\n  package) depends on `$MAC_UI_PACKAGE` or its `-react`\u002F`-utils` siblings; a changed\n  file registers or consumes a `mac-*` custom element (`customElements.define`,\n  a `\u003Cmac-…>` tag, or an import from `$MAC_UI_PACKAGE`).\n- Monorepo: `lerna.json` + `packages\u002F` → lerna workspace; `biome.json` → Biome\n  lint\u002Fformat; `vite.config.ts`\u002F`web-dev-server-config.js` → Vite\u002FWTR.\n- Test runner: per-package `package.json` `test` script is authoritative\n  (web-test-runner \u002F vitest \u002F jsdom); don't assume.\n\n## Step 5: Analyze Test Setup\n\n### 5.1 Find Test Framework\n\nLook for:\n- Python: `pytest.ini`, `tox.ini`, `setup.py` with test_suite\n- JavaScript: `jest.config.js`, `package.json` \"test\" script\n- Go: `*_test.go` files (standard testing)\n- Java: `pom.xml` with surefire plugin, JUnit\n\n### 5.2 Determine Test Command\n\nInfer from config: Python → `pytest` \u002F `python setup.py test` \u002F `make test`; JS → `npm test`; Go → `go test .\u002F...`; Rust → `just` recipes or `cargo nextest` \u002F `cargo test`. Prefer the command CI actually runs.\n\n### 5.3 Safety Assessment\n\n`can_run_safely` when: standard framework, no external deps, no destructive ops, reasonable runtime (\u003C5min).\n\nMark **unsafe** for integration\u002Fe2e, DB\u002Fdocker requirements, or tests that hit live network. **Rust:** unsafe when gated on `PGURL` \u002F Kafka \u002F compose; unit-only nextest filter is usually safe. **mac-ui:** default unsafe unless package `test` is jsdom\u002Fvitest-only (needs Chromium otherwise).\n\n## Step 6: Detect Build System\n\nLook for build config files.\n\n**Python:**\n- `setup.py` → setuptools\n- `pyproject.toml` → modern Python (poetry, flit, hatch)\n- `requirements.txt` → pip\n- `Pipfile` → pipenv\n- `Makefile` → make\n\n**JavaScript:**\n- `package.json` → npm\u002Fyarn\n- `yarn.lock` → yarn\n- `package-lock.json` → npm\n\n**Go:**\n- `go.mod` → Go modules\n- `Makefile` → make\n\n**Java:**\n- `pom.xml` → Maven\n- `build.gradle` → Gradle\n\n**Rust:**\n- `Cargo.toml` → cargo (workspace if `[workspace]`)\n- `justfile` → task runner; its recipes are the source of truth for\n  `install`\u002F`test`\u002F`lint`\u002F`build` (mirror them into the commands map below)\n\n**JS monorepo:**\n- `lerna.json`\u002F`pnpm-workspace.yaml`\u002F`package.json` `workspaces` → monorepo;\n  commands run per-package (`npm -w \u003Cpkg> test`)\n\nRecord `install` \u002F `test` \u002F `lint` \u002F `build` commands in the build_system JSON (prefer `justfile` \u002F package scripts over guesses).\n\n## Step 7: Impact Analysis\n\n### 7.1 Detect High-Impact Areas\n\nLook for changes in sensitive files\u002Fpatterns.\n\n**Authentication\u002FSecurity:**\n- Files matching: `*auth*`, `*security*`, `*login*`, `*password*`, `*token*`\n- Keywords in diff: \"auth\", \"login\", \"password\", \"secret\", \"key\"\n\n**Database:**\n- Files matching: `*migration*`, `*schema*`, `*model*`, `*db*`\n- Keywords: \"ALTER TABLE\", \"DROP\", \"CREATE TABLE\"\n\n**API:**\n- Files matching: `*api*`, `*endpoint*`, `*route*`, `*handler*`\n- Keywords: \"GET\", \"POST\", \"PUT\", \"DELETE\" in route definitions\n\n**Configuration:**\n- Files: `config\u002F*`, `.env*`, `*.yaml`, `*.json` (in root or config dirs)\n\n**Infrastructure:**\n- Files: `Dockerfile`, `docker-compose.yml`, `k8s\u002F*`, `terraform\u002F*`\n\n### 7.2 Detect Breaking Changes\n\nIndicators:\n- Major version bump in package file\n- Removed or renamed functions\u002Fclasses\n- Changed function signatures\n- Deleted files\n- Database schema changes (DROP, ALTER)\n\nKeywords in commits\u002FPR title:\n- \"BREAKING\", \"breaking change\", \"incompatible\", \"removed\", \"deprecated\"\n\n## Step 8: Security Sensitivity Assessment\n\nDetermine if PR needs extra security scrutiny.\n\n**High security sensitivity:**\n- Changes authentication\u002Fauthorization code\n- Modifies database schemas\n- Changes API endpoints\n- Touches encryption\u002Fcrypto code\n- Modifies access control\n- Updates dependencies with known vulnerabilities\n\n**Markers:**\n```python\nsecurity_sensitive = (\n  affects_auth OR\n  affects_database OR\n  affects_api OR\n  affects_crypto OR\n  updates_security_deps\n)\n```\n\n## Step 8b: Emit `risk_class` array\n\nSet `RISK_CLASS_JSON` to a JSON array of applicable classes (`[]` is valid). Include a class when the diff\u002Ftitle\u002Fbody\u002Fpaths strongly suggest it — prefer false-positive inclusion over missing a QR pass.\n\n| Class | Include when |\n|---|---|\n| `domain` | Domain model, aggregates, bounded-context, ownership\u002FCODEOWNERS cross-boundary, layering\u002Fhex\u002Fports changes |\n| `auth` | Authn\u002Fz, sessions, tokens, IDOR-prone ID lookups, permission\u002Frole changes |\n| `data` | Migrations, schema, serializers, caches as SoT, dual-write, retention\u002Fdelete |\n| `api` | Public\u002Finternal HTTP\u002FRPC\u002Fevent\u002Fwebhook contracts, OpenAPI\u002FProtobuf\u002FAvro, versioning |\n| `concurrency` | Locks, atomics, shared mutable state, async cancel, queues\u002Fconsumers, idempotent handlers |\n| `ops` | Timeouts, retries, circuit breakers, metrics\u002Ftraces on new paths, pools, pagination limits, hot-path perf |\n\nMap from impact_analysis + path heuristics. Example: auth+API endpoint change → `[\"auth\",\"api\"]` (and often `domain` if model touched).\n\n## Step 9: Generate Analysis JSON\n\nCombine all findings into structured JSON, write to `$OUTPUT_DIR\u002Fpr-analysis-\u003CPR_NUMBER>.json`.\n\nBuild JSON with `jq -n` so every PR-derived value is safely escaped — pass strings with `--arg`, numbers\u002Fbooleans\u002Farrays\u002Fobjects with `--argjson`. Never interpolate untrusted text into a heredoc.\n\n```bash\njq -n \\\n  --argjson pr \"$PR_JSON\" \\\n  --argjson changes \"$CHANGES_JSON\" \\\n  --argjson languages \"$LANGUAGES_JSON\" \\\n  --argjson frameworks \"$FRAMEWORKS_JSON\" \\\n  --argjson test_setup \"$TEST_SETUP_JSON\" \\\n  --argjson build_system \"$BUILD_SYSTEM_JSON\" \\\n  --argjson change_categories \"$CHANGE_CATEGORIES_JSON\" \\\n  --argjson impact_analysis \"$IMPACT_ANALYSIS_JSON\" \\\n  --argjson security_sensitive \"$SECURITY_SENSITIVE\" \\\n  --argjson needs_security_review \"$NEEDS_SECURITY_REVIEW\" \\\n  --argjson uses_mac_ui \"${USES_MAC_UI:-false}\" \\\n  --arg mac_ui_ref_repo \"${MAC_UI_REF_REPO:-}\" \\\n  --argjson risk_class \"${RISK_CLASS_JSON:-[]}\" \\\n  '{\n    pr: $pr,\n    changes: $changes,\n    languages: $languages,\n    frameworks: $frameworks,\n    test_setup: $test_setup,\n    build_system: $build_system,\n    change_categories: $change_categories,\n    impact_analysis: $impact_analysis,\n    security_sensitive: $security_sensitive,\n    needs_security_review: $needs_security_review,\n    uses_mac_ui: $uses_mac_ui,\n    mac_ui_ref_repo: $mac_ui_ref_repo,\n    risk_class: $risk_class\n  }' > \"$OUTPUT_DIR\u002Fpr-analysis-${PR_NUMBER}.json\"\n```\n\n## Step 10: Provide Summary to User\n\nDisplay human-readable summary.\n\n```\n✅ PR Analysis Complete\n\nPR: #123 - Add user authentication\nFiles changed: 15 (+450, -120)\n\nLanguages:\n  - Python (85%)\n  - JavaScript (10%)\n  - Shell (5%)\n\nFrameworks:\n  - Django\n  - Pytest\n\nTest Setup:\n  - Framework: pytest\n  - Command: pytest\n  - Can run safely: ✅\n  - Test files: 1\n\nImpact Areas:\n  - 🔴 High: authentication, security\n  - 🟡 Medium: API endpoints\n  - 🟢 Low: documentation\n\nRisk classes: domain, auth, api\n\nSecurity: ⚠️  Requires security review\n\nAnalysis saved to: $OUTPUT_DIR\u002Fpr-analysis-123.json\n```\n\n## Error Handling\n\n**If gh CLI fails:**\n```\nError: Could not fetch PR. Check:\n- gh is installed and authenticated\n- PR URL is valid and accessible\n- You have permissions to view this PR\n```\n\n**If analysis is incomplete:**\n- Still generate JSON with available data\n- Mark missing fields as `null`\n- Prefer `risk_class: []` over omitting the key\n- Note in summary which analysis steps failed\n\n## Notes\n\n- Does NOT modify code or run tests - only analyzes\n- All analysis read-only (safe to run on any PR)\n- Output JSON designed to be consumed by other skills\n- Can be run standalone or as part of review\n- Routing consumers: orchestrator + `shared\u002Frisk-class-routing.md`\n",{"name":5,"description":7,"allowed-tools":24},"Bash Read Grep Glob","main","a3f19bcc313571bff79dca391a83f9c4d38bb335","review\u002Fskills\u002Fanalyze",0,"https:\u002F\u002Fgithub.com\u002Fozzycodes2\u002Fclaudellum","https:\u002F\u002Fgithub.com\u002Fozzycodes2","Software Engineer | Engineering Manager | AI whisperer | ☕Enjoyer","2026-11-14 04:50:11",{"source":8,"skillName":5,"commands":34,"prompt":44,"zipAvailable":45},[35,38,41],{"tool":36,"command":37},"npx","npx skills add ozzycodes2\u002Fclaudellum --skill analyze",{"tool":39,"command":40},"bunx","bunx skills add ozzycodes2\u002Fclaudellum --skill analyze",{"tool":42,"command":43},"pnpm","pnpm dlx skills add ozzycodes2\u002Fclaudellum --skill analyze","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fozzycodes2\u002Fclaudellum\u002Fblob\u002Fmain\u002Freview\u002Fskills\u002Fanalyze\u002FSKILL.md",true,[],[48,55,62,69,76,83],{"skillNo":49,"name":50,"nameZh":6,"description":51,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":52,"categories":53,"keywords":54,"publishedAt":19},"01M7ASQB3CTKMKDNAXD9DCF1YC","writing-design-docs","Use when the user wants to write a problem-statement design doc, says \"let's plan a feature properly\" \u002F \"write a design doc\" \u002F \"I'm thinking about how to do X\" for a non-trivial X, or before committing to a non-obvious technical direction","https:\u002F\u002Fgithub.com\u002Fozzycodes2\u002Fclaudellum\u002Fblob\u002Fmain\u002Ftechnical-writing\u002Fskills\u002Fwriting-design-docs\u002FSKILL.md",[],[],{"skillNo":56,"name":57,"nameZh":6,"description":58,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":59,"categories":60,"keywords":61,"publishedAt":19},"01M7ASQ6JD4QRV5ZKK2QME401Y","write-doc","Use when the user asks to write or draft a README, ADR, runbook, tutorial, how-to, explanation, or reference doc, or a caller passes \"type ADR\" or \"type README\". Picks the type, fills a template, adds diagrams. RFCs and design docs belong to writing-design-docs.","https:\u002F\u002Fgithub.com\u002Fozzycodes2\u002Fclaudellum\u002Fblob\u002Fmain\u002Ftechnical-writing\u002Fskills\u002Fwrite-doc\u002FSKILL.md",[],[],{"skillNo":63,"name":64,"nameZh":6,"description":65,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":66,"categories":67,"keywords":68,"publishedAt":19},"01M7ASQ1VWNVP1RE7M5D4G2QMG","review-doc","Use when the user asks to review, critique, score, grade, or \"how good is this doc\" for a Markdown doc or pasted text. Read-only. Scores it on the 20 Practical Prose dimensions and emits a findings table. Does not edit; fix-doc applies the findings next.","https:\u002F\u002Fgithub.com\u002Fozzycodes2\u002Fclaudellum\u002Fblob\u002Fmain\u002Ftechnical-writing\u002Fskills\u002Freview-doc\u002FSKILL.md",[],[],{"skillNo":70,"name":71,"nameZh":6,"description":72,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":73,"categories":74,"keywords":75,"publishedAt":19},"01M7ASPWST208JZNR7HF7J6KMV","fix-doc","Use when the user asks to fix, edit for prose quality, polish, tighten, humanize, or de-slop a Markdown doc or pasted text, or says \"make this read less AI\". Applies review-doc findings, generates flagged diagrams, lists substantive issues for the author, then runs the AI-tell pass last. Modifies the target.","https:\u002F\u002Fgithub.com\u002Fozzycodes2\u002Fclaudellum\u002Fblob\u002Fmain\u002Ftechnical-writing\u002Fskills\u002Ffix-doc\u002FSKILL.md",[],[],{"skillNo":77,"name":78,"nameZh":6,"description":79,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":80,"categories":81,"keywords":82,"publishedAt":19},"01M7ASPS6Y9ZGK9KCDHNPDR75A","create-slides","Use when the user asks for a slide deck, presentation, talk, or slides from a document, report, PR, notes, or topic. Builds one self-contained Machinify-branded HTML deck in a minimalist style, with headline-plus-visual slides, speaker notes, and every diagram drawn by architecture-design:create-diagram.","https:\u002F\u002Fgithub.com\u002Fozzycodes2\u002Fclaudellum\u002Fblob\u002Fmain\u002Ftechnical-writing\u002Fskills\u002Fcreate-slides\u002FSKILL.md",[],[],{"skillNo":84,"name":85,"nameZh":6,"description":86,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":87,"categories":88,"keywords":89,"publishedAt":19},"01M7ASPAKFY045KHR92Y4QFTWV","start-session","Open a Claude Code working session in a fresh, isolated git worktree, so the user can start a task with a single \u002Fstart-session \u003Cname>. Use at the START of a session when the user says \"start session\", \"start a worktree\", \"spin up a worktree for ABC-123\", \"begin work on \u003Cticket>\", or passes a name\u002Fticket to work under. Creates and ENTERS a worktree via the EnterWorktree tool (never `git worktree add`) under .claude\u002Fworktrees\u002F, named exactly after the argument, on a local branch `worktree-\u003Cargument>`. Reports what the worktree inherited (`.worktreeinclude` copies, symlinked node_modules) and whether its `.env` still points at the main checkout's stack. If the argument is a JIRA key (e.g. ABC-123, PROJ-1505), also loads that story with the Atlassian CLI (`acli`) when available and summarizes the implementation ask. Also renames the session to the argument (the same effect as `\u002Frename \u003CNAME>`) so it's easy to find in `\u002Fresume`. Then stops and waits — it sets up the workspace and context, it does not implement.","https:\u002F\u002Fgithub.com\u002Fozzycodes2\u002Fclaudellum\u002Fblob\u002Fmain\u002Fsession-mgmt\u002Fskills\u002Fstart-session\u002FSKILL.md",[],[]]