[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6BV1323Q04ET53HNX439SY8":3,"skill-same:01M6BV1323Q04ET53HNX439SY8":89},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":8,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":18,"categories":19,"keywords":30,"publishedAt":51,"linkOnly":52,"markdownContent":53,"markdownBody":54,"frontMatter":55,"refName":62,"commitSha":63,"skillDirectory":64,"forksCount":15,"repositoryHtmlUrl":65,"repositoryHomepageUrl":17,"ownerHtmlUrl":66,"ownerBlogUrl":67,"ownerDescription":17,"updatedAt":68,"install":69,"resources":82},"01M6BV1323Q04ET53HNX439SY8","open-code-review","Git 变更 AI 代码审查","Performs AI-powered code review on Git changes using the `ocr` CLI from alibaba\u002Fopen-code-review. Use when the user asks to review code, review a pull request, review staged\u002Funstaged changes, review a commit, or compare branches for code quality issues. Produces line-level review comments and can automatically apply fixes when requested. With appropriate review rules, can detect various types of issues including bugs, security vulnerabilities, performance problems, and code quality concerns.","使用来自 alibaba\u002Fopen-code-review 的 `ocr` CLI 对 Git 变更执行 AI 驱动的代码审查。当用户要求审查代码、审查拉取请求（PR）、审查已暂存\u002F未暂存的变更、审查某次提交，或比较分支以发现代码质量问题时使用。生成行级审查意见，并可在用户要求时自动应用修复。配合适当的审查规则，可检测多种类型的问题，包括 bug、安全漏洞、性能问题和代码质量隐患。","pkking\u002Fdotfiles","pkking","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F2853724?v=4","01M6BTYGKF2NYA1TM9G1XSAE7N","li chaoran","01M6BTYGQW6GANXWW15H8SPDQ2",0,"Apache-2.0",null,"https:\u002F\u002Fgithub.com\u002Fpkking\u002Fdotfiles\u002Fblob\u002Fmaster\u002Fdotfiles\u002Fdot_config\u002Fskillshare\u002Fskills\u002Fopen-code-review\u002FSKILL.md",[20,25],{"categoryNo":21,"categoryName":22,"taxonomyType":23,"taxonomyTypeDesc":24},"01M8BQ6TQZN6R52WBJ9H8NRMQM","软件开发工程师","PROFESSION","适用职业",{"categoryNo":26,"categoryName":27,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8BR5V701HCN066VEP7H4812","代码仓库协作管理","SCENARIO","使用场景",[31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50],"review","open code review","open","code","code review","performance","commit","code quality","pull request","run","github","release","issues","code-review","pull","protocols","https","ocr","first","cli","2026-11-10 10:12:30",false,"---\nname: open-code-review\ndescription: >\n  Performs AI-powered code review on Git changes using the `ocr` CLI from\n  alibaba\u002Fopen-code-review. Use when the user asks to review code, review\n  a pull request, review staged\u002Funstaged changes, review a commit, or\n  compare branches for code quality issues. Produces line-level review\n  comments and can automatically apply fixes when requested. With appropriate\n  review rules, can detect various types of issues including bugs, security\n  vulnerabilities, performance problems, and code quality concerns.\nlicense: Apache-2.0\ncompatibility: >\n  Requires the `ocr` CLI installed (via `npm install -g\n  @alibaba-group\u002Fopen-code-review` or GitHub release binary). Requires a\n  configured supported LLM provider before first run (protocols: Anthropic,\n  OpenAI Chat Completions, OpenAI Responses, AWS Bedrock).\nmetadata:\n  author: alibaba\n  homepage: https:\u002F\u002Fgithub.com\u002Falibaba\u002Fopen-code-review\n  version: \"1.0.0\"\n---\n\n# Open Code Review\n\nThis Codex plugin skill intentionally mirrors the canonical skill at\n`skills\u002Fopen-code-review\u002FSKILL.md`. Keep both files synchronized when updating\nOCR agent instructions; a symlink is avoided because plugin installs may only\nmaterialize the plugin subtree.\n\nA skill for invoking [open-code-review](https:\u002F\u002Fgithub.com\u002Falibaba\u002Fopen-code-review) (`ocr`) — an open-source AI code review CLI that reads Git diffs and generates structured, line-level review comments.\n\n## Workflow\n\n### Step 1: Gather Business Context\n\nAnalyze the review target (commits, branch, or changes) to extract concise business context. Pass this context via `--background` to improve review quality.\n\n### Step 2: Run Code Review\n\n**Do not pre-check whether `ocr` is installed** — skip probes like `command -v ocr` or `ocr --version`. Assume the CLI is available and run the review directly; that saves a tool call on the common path. Only if the review fails with `command not found` should you install it per Troubleshooting.\n\nRun the OCR command with appropriate flags. **Always pass business context via `--background`** when available:\n\n```bash\nocr review --audience agent --background \"business context here\" [user-args]\n```\n\n**Argument handling:**\n\n- **Background context** (RECOMMENDED): use `--background \"context\"` or `-b \"context\"` to provide business context for better review quality\n- **Default** (no user arguments): reviews staged, unstaged, and untracked changes (workspace mode)\n- **Specific commit**: use `--commit` or `-c` to review a single commit against its parent\n- **Branch comparison**: use `--from \u003Cref>` and `--to \u003Cref>` to review diff between two refs\n- **Timeout**: effective timeout per review group = `--timeout` × review rounds. Default `--timeout 15` with default effort `medium` (2 rounds) gives 30 minutes; `low`\u002F`high` give 15\u002F45 minutes.\n- **Concurrency**: default concurrency is 8 file workers; reduce with `--concurrency \u003Cn>` if rate limits are hit\n- **Preview mode**: use `--preview` or `-p` to preview which files will be reviewed without running the LLM\n- **Output file**: use `--output \u003Cpath>` to write the full result to a file instead of stdout. If the command fails with `unknown flag: --output`, do not continue the review with plain stdout. Ask the user whether to upgrade (`npm i -g @alibaba-group\u002Fopen-code-review@latest`) and wait for the answer before proceeding. After the user confirms and the upgrade succeeds, rerun with `--output`.\n- **Installation**: if `ocr` command is not found, install it by running `npm i -g @alibaba-group\u002Fopen-code-review`\n\n**Common invocation patterns:**\n\n| User says | Command to run |\n|-----------|---------------|\n| \"review my changes\" \u002F \"review the working copy\" | `ocr review --audience agent -b \"context\"` |\n| \"review this PR\" \u002F \"review feature branch\" | `ocr review --audience agent -b \"context\" --from main --to \u003Cbranch>` |\n| \"review commit abc123\" | `ocr review --audience agent -b \"context\" --commit abc123` |\n| \"what would be reviewed?\" (dry-run) | `ocr review --preview` |\n\n**Output mode:**\n\n- Always use `--audience agent` to suppress progress UI and emit only the final summary\n- **Prevent output truncation**: For large reviews or restricted tool environments, pass `--output \u002Ftmp\u002Focr_out.txt` and inspect the file in full via a file reading tool instead of piping stdout through `tail` or `head`, which drops earlier review comments.\n\n**On failure:** If `ocr review` exits non-zero (e.g. an LLM connection error), do not retry blindly — consult the Troubleshooting section below for the matching fix before re-running.\n\n### Step 3: Report\n\nOCR output includes structured `severity` (critical \u002F high \u002F medium \u002F low) and `category` (bug \u002F security \u002F performance \u002F maintainability \u002F test \u002F style \u002F documentation \u002F other) on each comment. Present results grouped by severity, discarding `low` severity items that are likely false positives or nitpicks.\n\n### Step 4: Fix\n\nBefore applying fixes, check whether the user requested automatic fixes:\n\n- If the user explicitly requested \"review and fix\" or similar, proceed with automatic fixes\n- If the user only requested \"review\" without fix intent, ask for permission before applying any changes\n\nWhen fixing issues and suggestions:\n\n- Focus on critical, high, and medium severity items\n- Apply fixes directly to the code when safe and well-defined\n- For complex fixes requiring manual intervention, clearly describe what needs to be done\n- Always verify fixes with the user before committing\n\n## Output Format\n\nEach comment in OCR's output contains:\n\n- `path`: File path\n- `content`: Review comment text\n- `start_line` \u002F `end_line`: Line range (both 0 means positioning failed)\n- `category`: Issue category (bug, security, performance, maintainability, test, style, documentation, other)\n- `severity`: Issue severity (critical, high, medium, low)\n- `suggestion_code`: Optional fix suggestion\n- `existing_code`: Optional original code snippet\n- `thinking`: Optional LLM reasoning process\n\nPresent results grouped by severity using this template:\n\n```markdown\n## Code Review Results\n\n**Files reviewed**: N\n**Issues found**: X critical, Y high, Z medium\n\n### Critical\n\n- **`path\u002Fto\u002Ffile.java:42`** [bug] — Brief description\n  > Recommendation: How to fix\n\n### High\n\n- **`path\u002Fto\u002Ffile.java:26`** [bug] — Brief description\n  > Recommendation: How to fix\n\n### Medium\n\n- **`path\u002Fto\u002Ffile.ts:88`** [performance] — Brief description\n  > Recommendation: How to fix (if applicable)\n```\n\nIf no critical, high, or medium severity issues remain after filtering, state: \"Review complete — no critical, high, or medium issues found in N files.\"\n\n**Handling mispositioned comments:**\n\nWhen `start_line` and `end_line` are both `0`, the comment failed to locate the exact position in the file. In such cases:\n\n1. Read the comment content to understand the issue\n2. Examine the target file mentioned in the comment\n3. Identify the relevant code section based on the comment's context\n4. Apply the fix or suggestion to the correct location\n\n## Custom Review Rules\n\nIf the user wants project-specific rules, OCR resolves them in this priority order:\n\n1. `--rule \u003Cpath>` flag (highest)\n2. `\u003Crepo>\u002F.opencodereview\u002Frule.json`\n3. `~\u002F.opencodereview\u002Frule.json`\n4. Built-in system defaults (lowest)\n\nBy default, the first matching user rule replaces the built-in system rule. Set `merge_system_rule: true` on a rule entry when the matched system rule and user rule should both be included.\n\nRule file format:\n\n```json\n{\n  \"rules\": [\n    {\n      \"path\": \"**\u002F*.java\",\n      \"rule\": \"All new methods must validate required parameters for null\",\n      \"merge_system_rule\": true\n    },\n    {\n      \"path\": \"**\u002F*mapper*.xml\",\n      \"rule\": \"Check SQL for injection risks and missing closing tags\"\n    }\n  ]\n}\n```\n\nTo preview which rule applies to a file before reviewing:\n\n```bash\nocr rules check src\u002Fmain\u002Fjava\u002Fcom\u002Fexample\u002FFoo.java\n```\n\n## Advanced Review Options\n\nBeyond the common flags above, `ocr review` exposes a few groups of controls. Run `ocr review --help` for the complete list.\n\n**Scoping**\n\n- `--exclude '\u003Cpatterns>'` — comma-separated gitignore-style patterns (for example `--exclude '**\u002Fgenerated\u002F*,**\u002Ftestdata\u002F*'`), merged with `rule.json` excludes.\n- `--background-file \u003Cpath>` — read review context from a Markdown file. Takes precedence over `--background`.\n\n**Output**\n\n- `--format text|json|sarif` — `text` (default) for humans; `json` for machine-readable findings; `sarif` for code-scanning integrations such as GitHub Code Scanning.\n\n**Model**\n\n- `--provider \u003Cname>` \u002F `--model \u003Cname>` — override the configured provider\u002Fmodel for this run only (for example, to recheck a diff with a different model; the user names the model, `ocr llm providers` lists the built-ins).\n\n**Budget**\n\n- `--max-tokens \u003Cn>` — per-group prompt ceiling; defaults to the configured value or the template default (`200000`).\n- `--max-tokens-budget \u003Cn>` — cap total input + output tokens for the run. Checked before every LLM round: a group already over budget gets one final round to submit findings, no further groups are dispatched, partial results are still published, and skipped files are reported as `failed(budget)`.\n- `--no-filter` — keep all review comments and skip the LLM post-filtering call.\n\n## Gotchas\n\n- **LLM must be configured first** — `ocr review` will fail loudly if no LLM is reachable. See the Troubleshooting section below if this happens.\n- **Working directory matters** — `ocr review` operates on the Git repo at the current directory. Use `--repo \u002Fpath\u002Fto\u002Frepo` to run from elsewhere.\n- **Untracked files are reviewed in workspace mode** — running bare `ocr review` includes staged, unstaged, *and* untracked changes. Stage selectively if you want narrower scope.\n- **Large diffs may hit token limits** — `MAX_TOKENS` sets the prompt budget (`200000` in the review template; `ocr scan` uses `58888`); conversation context is compressed to stay within this prompt budget. Model output is capped separately by `MAX_COMPLETION_TOKENS` (`16384`). A file whose diff alone exceeds ~80% of `MAX_TOKENS` is skipped before the LLM is called.\n- **Plan phase triggers on either of two thresholds** — a group runs an extra risk-analysis phase before main review when its largest changed file reaches `PLAN_MODE_LINE_THRESHOLD` (default `50`) **or** it holds 2+ files whose combined changed lines reach `PLAN_MODE_GROUP_LINE_THRESHOLD` (default `100`). This adds latency but improves quality.\n- **Don't pass `--audience human`** — it streams progress UI that pollutes output. Always use `--audience agent`.\n- **Comment language follows config** — the `language` config controls review comment language, defaults to `English`, and accepts any language name (for example `English` or `中文`).\n- **Avoid output truncation** — Large review runs produce verbose output. Never pipe command output to `tail` or `head` as it drops review comments from earlier sections. Use `--output \u003Cpath>` and read it in full; on older CLIs, follow the **Output file** guidance above.\n- **Resume an interrupted review** — a failed or interrupted range\u002Fcommit review can be continued with `ocr review --resume \u003Cid>` using the same `--from`\u002F`--to` or `--commit` target (the id is printed as `retry with: --resume \u003Cid>` on failure, or find it with `ocr session list`). Workspace resume is not supported.\n\n## Validation\n\nAfter the review completes, verify success by checking:\n\n1. The command exited with code 0\n2. Comments were generated (or \"No comments generated\" message appears)\n3. Warnings (if any) are displayed in stderr\n\nIf errors occurred, check the stderr warnings for details about which files failed and why.\n\n## Troubleshooting\n\n**`ocr: command not found`**\n\nInstall the CLI:\n\n```bash\nnpm install -g @alibaba-group\u002Fopen-code-review\n```\n\n**`unknown flag: --output`**\n\nThe CLI is older than v1.10.0. Do not continue the review with plain stdout. Ask the user whether to upgrade (`npm i -g @alibaba-group\u002Fopen-code-review@latest`) and wait for the answer before proceeding. After the user confirms and the upgrade succeeds, rerun with `--output`.\n\n**`ocr review` fails with LLM connection error**\n\nPrompt the user to configure an LLM provider.\n\nInteractive setup (recommended):\n\n```bash\nocr config provider\n```\n\nManual setup (alternative):\n\n```bash\nocr config set llm.url https:\u002F\u002Fapi.anthropic.com\u002Fv1\u002Fmessages\nocr config set llm.auth_token \u003Capi-key>\nocr config set llm.model claude-opus-4-6\nocr config set llm.use_anthropic true\n```\n\nVerify connectivity with `ocr llm test`. Stop here and ask the user to provide credentials — never invent or hardcode API keys.\n\n## References\n\n- Full docs: https:\u002F\u002Fgithub.com\u002Falibaba\u002Fopen-code-review\n- NPM package: https:\u002F\u002Fwww.npmjs.com\u002Fpackage\u002F@alibaba-group\u002Fopen-code-review\n- Issue tracker: https:\u002F\u002Fgithub.com\u002Falibaba\u002Fopen-code-review\u002Fissues\n","# Open Code Review\n\nThis Codex plugin skill intentionally mirrors the canonical skill at\n`skills\u002Fopen-code-review\u002FSKILL.md`. Keep both files synchronized when updating\nOCR agent instructions; a symlink is avoided because plugin installs may only\nmaterialize the plugin subtree.\n\nA skill for invoking [open-code-review](https:\u002F\u002Fgithub.com\u002Falibaba\u002Fopen-code-review) (`ocr`) — an open-source AI code review CLI that reads Git diffs and generates structured, line-level review comments.\n\n## Workflow\n\n### Step 1: Gather Business Context\n\nAnalyze the review target (commits, branch, or changes) to extract concise business context. Pass this context via `--background` to improve review quality.\n\n### Step 2: Run Code Review\n\n**Do not pre-check whether `ocr` is installed** — skip probes like `command -v ocr` or `ocr --version`. Assume the CLI is available and run the review directly; that saves a tool call on the common path. Only if the review fails with `command not found` should you install it per Troubleshooting.\n\nRun the OCR command with appropriate flags. **Always pass business context via `--background`** when available:\n\n```bash\nocr review --audience agent --background \"business context here\" [user-args]\n```\n\n**Argument handling:**\n\n- **Background context** (RECOMMENDED): use `--background \"context\"` or `-b \"context\"` to provide business context for better review quality\n- **Default** (no user arguments): reviews staged, unstaged, and untracked changes (workspace mode)\n- **Specific commit**: use `--commit` or `-c` to review a single commit against its parent\n- **Branch comparison**: use `--from \u003Cref>` and `--to \u003Cref>` to review diff between two refs\n- **Timeout**: effective timeout per review group = `--timeout` × review rounds. Default `--timeout 15` with default effort `medium` (2 rounds) gives 30 minutes; `low`\u002F`high` give 15\u002F45 minutes.\n- **Concurrency**: default concurrency is 8 file workers; reduce with `--concurrency \u003Cn>` if rate limits are hit\n- **Preview mode**: use `--preview` or `-p` to preview which files will be reviewed without running the LLM\n- **Output file**: use `--output \u003Cpath>` to write the full result to a file instead of stdout. If the command fails with `unknown flag: --output`, do not continue the review with plain stdout. Ask the user whether to upgrade (`npm i -g @alibaba-group\u002Fopen-code-review@latest`) and wait for the answer before proceeding. After the user confirms and the upgrade succeeds, rerun with `--output`.\n- **Installation**: if `ocr` command is not found, install it by running `npm i -g @alibaba-group\u002Fopen-code-review`\n\n**Common invocation patterns:**\n\n| User says | Command to run |\n|-----------|---------------|\n| \"review my changes\" \u002F \"review the working copy\" | `ocr review --audience agent -b \"context\"` |\n| \"review this PR\" \u002F \"review feature branch\" | `ocr review --audience agent -b \"context\" --from main --to \u003Cbranch>` |\n| \"review commit abc123\" | `ocr review --audience agent -b \"context\" --commit abc123` |\n| \"what would be reviewed?\" (dry-run) | `ocr review --preview` |\n\n**Output mode:**\n\n- Always use `--audience agent` to suppress progress UI and emit only the final summary\n- **Prevent output truncation**: For large reviews or restricted tool environments, pass `--output \u002Ftmp\u002Focr_out.txt` and inspect the file in full via a file reading tool instead of piping stdout through `tail` or `head`, which drops earlier review comments.\n\n**On failure:** If `ocr review` exits non-zero (e.g. an LLM connection error), do not retry blindly — consult the Troubleshooting section below for the matching fix before re-running.\n\n### Step 3: Report\n\nOCR output includes structured `severity` (critical \u002F high \u002F medium \u002F low) and `category` (bug \u002F security \u002F performance \u002F maintainability \u002F test \u002F style \u002F documentation \u002F other) on each comment. Present results grouped by severity, discarding `low` severity items that are likely false positives or nitpicks.\n\n### Step 4: Fix\n\nBefore applying fixes, check whether the user requested automatic fixes:\n\n- If the user explicitly requested \"review and fix\" or similar, proceed with automatic fixes\n- If the user only requested \"review\" without fix intent, ask for permission before applying any changes\n\nWhen fixing issues and suggestions:\n\n- Focus on critical, high, and medium severity items\n- Apply fixes directly to the code when safe and well-defined\n- For complex fixes requiring manual intervention, clearly describe what needs to be done\n- Always verify fixes with the user before committing\n\n## Output Format\n\nEach comment in OCR's output contains:\n\n- `path`: File path\n- `content`: Review comment text\n- `start_line` \u002F `end_line`: Line range (both 0 means positioning failed)\n- `category`: Issue category (bug, security, performance, maintainability, test, style, documentation, other)\n- `severity`: Issue severity (critical, high, medium, low)\n- `suggestion_code`: Optional fix suggestion\n- `existing_code`: Optional original code snippet\n- `thinking`: Optional LLM reasoning process\n\nPresent results grouped by severity using this template:\n\n```markdown\n## Code Review Results\n\n**Files reviewed**: N\n**Issues found**: X critical, Y high, Z medium\n\n### Critical\n\n- **`path\u002Fto\u002Ffile.java:42`** [bug] — Brief description\n  > Recommendation: How to fix\n\n### High\n\n- **`path\u002Fto\u002Ffile.java:26`** [bug] — Brief description\n  > Recommendation: How to fix\n\n### Medium\n\n- **`path\u002Fto\u002Ffile.ts:88`** [performance] — Brief description\n  > Recommendation: How to fix (if applicable)\n```\n\nIf no critical, high, or medium severity issues remain after filtering, state: \"Review complete — no critical, high, or medium issues found in N files.\"\n\n**Handling mispositioned comments:**\n\nWhen `start_line` and `end_line` are both `0`, the comment failed to locate the exact position in the file. In such cases:\n\n1. Read the comment content to understand the issue\n2. Examine the target file mentioned in the comment\n3. Identify the relevant code section based on the comment's context\n4. Apply the fix or suggestion to the correct location\n\n## Custom Review Rules\n\nIf the user wants project-specific rules, OCR resolves them in this priority order:\n\n1. `--rule \u003Cpath>` flag (highest)\n2. `\u003Crepo>\u002F.opencodereview\u002Frule.json`\n3. `~\u002F.opencodereview\u002Frule.json`\n4. Built-in system defaults (lowest)\n\nBy default, the first matching user rule replaces the built-in system rule. Set `merge_system_rule: true` on a rule entry when the matched system rule and user rule should both be included.\n\nRule file format:\n\n```json\n{\n  \"rules\": [\n    {\n      \"path\": \"**\u002F*.java\",\n      \"rule\": \"All new methods must validate required parameters for null\",\n      \"merge_system_rule\": true\n    },\n    {\n      \"path\": \"**\u002F*mapper*.xml\",\n      \"rule\": \"Check SQL for injection risks and missing closing tags\"\n    }\n  ]\n}\n```\n\nTo preview which rule applies to a file before reviewing:\n\n```bash\nocr rules check src\u002Fmain\u002Fjava\u002Fcom\u002Fexample\u002FFoo.java\n```\n\n## Advanced Review Options\n\nBeyond the common flags above, `ocr review` exposes a few groups of controls. Run `ocr review --help` for the complete list.\n\n**Scoping**\n\n- `--exclude '\u003Cpatterns>'` — comma-separated gitignore-style patterns (for example `--exclude '**\u002Fgenerated\u002F*,**\u002Ftestdata\u002F*'`), merged with `rule.json` excludes.\n- `--background-file \u003Cpath>` — read review context from a Markdown file. Takes precedence over `--background`.\n\n**Output**\n\n- `--format text|json|sarif` — `text` (default) for humans; `json` for machine-readable findings; `sarif` for code-scanning integrations such as GitHub Code Scanning.\n\n**Model**\n\n- `--provider \u003Cname>` \u002F `--model \u003Cname>` — override the configured provider\u002Fmodel for this run only (for example, to recheck a diff with a different model; the user names the model, `ocr llm providers` lists the built-ins).\n\n**Budget**\n\n- `--max-tokens \u003Cn>` — per-group prompt ceiling; defaults to the configured value or the template default (`200000`).\n- `--max-tokens-budget \u003Cn>` — cap total input + output tokens for the run. Checked before every LLM round: a group already over budget gets one final round to submit findings, no further groups are dispatched, partial results are still published, and skipped files are reported as `failed(budget)`.\n- `--no-filter` — keep all review comments and skip the LLM post-filtering call.\n\n## Gotchas\n\n- **LLM must be configured first** — `ocr review` will fail loudly if no LLM is reachable. See the Troubleshooting section below if this happens.\n- **Working directory matters** — `ocr review` operates on the Git repo at the current directory. Use `--repo \u002Fpath\u002Fto\u002Frepo` to run from elsewhere.\n- **Untracked files are reviewed in workspace mode** — running bare `ocr review` includes staged, unstaged, *and* untracked changes. Stage selectively if you want narrower scope.\n- **Large diffs may hit token limits** — `MAX_TOKENS` sets the prompt budget (`200000` in the review template; `ocr scan` uses `58888`); conversation context is compressed to stay within this prompt budget. Model output is capped separately by `MAX_COMPLETION_TOKENS` (`16384`). A file whose diff alone exceeds ~80% of `MAX_TOKENS` is skipped before the LLM is called.\n- **Plan phase triggers on either of two thresholds** — a group runs an extra risk-analysis phase before main review when its largest changed file reaches `PLAN_MODE_LINE_THRESHOLD` (default `50`) **or** it holds 2+ files whose combined changed lines reach `PLAN_MODE_GROUP_LINE_THRESHOLD` (default `100`). This adds latency but improves quality.\n- **Don't pass `--audience human`** — it streams progress UI that pollutes output. Always use `--audience agent`.\n- **Comment language follows config** — the `language` config controls review comment language, defaults to `English`, and accepts any language name (for example `English` or `中文`).\n- **Avoid output truncation** — Large review runs produce verbose output. Never pipe command output to `tail` or `head` as it drops review comments from earlier sections. Use `--output \u003Cpath>` and read it in full; on older CLIs, follow the **Output file** guidance above.\n- **Resume an interrupted review** — a failed or interrupted range\u002Fcommit review can be continued with `ocr review --resume \u003Cid>` using the same `--from`\u002F`--to` or `--commit` target (the id is printed as `retry with: --resume \u003Cid>` on failure, or find it with `ocr session list`). Workspace resume is not supported.\n\n## Validation\n\nAfter the review completes, verify success by checking:\n\n1. The command exited with code 0\n2. Comments were generated (or \"No comments generated\" message appears)\n3. Warnings (if any) are displayed in stderr\n\nIf errors occurred, check the stderr warnings for details about which files failed and why.\n\n## Troubleshooting\n\n**`ocr: command not found`**\n\nInstall the CLI:\n\n```bash\nnpm install -g @alibaba-group\u002Fopen-code-review\n```\n\n**`unknown flag: --output`**\n\nThe CLI is older than v1.10.0. Do not continue the review with plain stdout. Ask the user whether to upgrade (`npm i -g @alibaba-group\u002Fopen-code-review@latest`) and wait for the answer before proceeding. After the user confirms and the upgrade succeeds, rerun with `--output`.\n\n**`ocr review` fails with LLM connection error**\n\nPrompt the user to configure an LLM provider.\n\nInteractive setup (recommended):\n\n```bash\nocr config provider\n```\n\nManual setup (alternative):\n\n```bash\nocr config set llm.url https:\u002F\u002Fapi.anthropic.com\u002Fv1\u002Fmessages\nocr config set llm.auth_token \u003Capi-key>\nocr config set llm.model claude-opus-4-6\nocr config set llm.use_anthropic true\n```\n\nVerify connectivity with `ocr llm test`. Stop here and ask the user to provide credentials — never invent or hardcode API keys.\n\n## References\n\n- Full docs: https:\u002F\u002Fgithub.com\u002Falibaba\u002Fopen-code-review\n- NPM package: https:\u002F\u002Fwww.npmjs.com\u002Fpackage\u002F@alibaba-group\u002Fopen-code-review\n- Issue tracker: https:\u002F\u002Fgithub.com\u002Falibaba\u002Fopen-code-review\u002Fissues\n",{"name":5,"license":16,"metadata":56,"description":60,"compatibility":61},{"author":57,"version":58,"homepage":59},"alibaba","1.0.0","https:\u002F\u002Fgithub.com\u002Falibaba\u002Fopen-code-review","Performs AI-powered code review on Git changes using the `ocr` CLI from alibaba\u002Fopen-code-review. Use when the user asks to review code, review a pull request, review staged\u002Funstaged changes, review a commit, or compare branches for code quality issues. Produces line-level review comments and can automatically apply fixes when requested. With appropriate review rules, can detect various types of issues including bugs, security vulnerabilities, performance problems, and code quality concerns.\n","Requires the `ocr` CLI installed (via `npm install -g @alibaba-group\u002Fopen-code-review` or GitHub release binary). Requires a configured supported LLM provider before first run (protocols: Anthropic, OpenAI Chat Completions, OpenAI Responses, AWS Bedrock).\n","master","0952986a94cbbf338098cd44c77bb9282287019d","dotfiles\u002Fdot_config\u002Fskillshare\u002Fskills\u002Fopen-code-review","https:\u002F\u002Fgithub.com\u002Fpkking\u002Fdotfiles","https:\u002F\u002Fgithub.com\u002Fpkking","https:\u002F\u002Ffosstodon.org\u002F@pkking","2026-11-14 21:58:55",{"source":9,"skillName":5,"commands":70,"prompt":80,"zipAvailable":81},[71,74,77],{"tool":72,"command":73},"npx","npx skills add pkking\u002Fdotfiles --skill open-code-review",{"tool":75,"command":76},"bunx","bunx skills add pkking\u002Fdotfiles --skill open-code-review",{"tool":78,"command":79},"pnpm","pnpm dlx skills add pkking\u002Fdotfiles --skill open-code-review","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fpkking\u002Fdotfiles\u002Fblob\u002Fmaster\u002Fdotfiles\u002Fdot_config\u002Fskillshare\u002Fskills\u002Fopen-code-review\u002FSKILL.md",true,[83],{"path":84,"resourceType":85,"resourceTypeDesc":86,"sizeBytes":87,"sourceHtmlUrl":88},"references\u002Fskill_creation_guide.md","REFERENCE","参考文档",17613,"https:\u002F\u002Fgithub.com\u002Fcercova-studios\u002F10x-swe\u002Fblob\u002Fmain\u002Fplugins\u002F10x-swe\u002Fskills\u002Fself-learning\u002Freferences\u002Fskill_creation_guide.md",[90,111,133,150,166,179],{"skillNo":91,"name":92,"nameZh":93,"description":94,"descriptionZh":95,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":96,"sourceHtmlUrl":97,"categories":98,"keywords":105,"publishedAt":110},"01M6BTZYNBAF3ZW1F26AYFNP7C","frontend-design","前端界面视觉设计","Guidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making choices that don't read as templated defaults.","在构建新 UI 或重塑现有 UI 时，提供有特色、有意为之的视觉设计指导。帮助把握美学方向、排版，并做出不显得千篇一律的模板化选择。","https:\u002F\u002Fgithub.com\u002Fpkking\u002Fdotfiles\u002Fblob\u002Fmaster\u002Fdotfiles\u002Fdot_config\u002Fskillshare\u002Fskills\u002Ffrontend-design\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002Fpkking\u002Fdotfiles\u002Fblob\u002Fmaster\u002Fdotfiles\u002Fdot_config\u002Fskillshare\u002Fskills\u002Ffrontend-design\u002FSKILL.md",[99,102],{"categoryNo":100,"categoryName":101,"taxonomyType":23,"taxonomyTypeDesc":24},"01M8BQ6TQMKHSMFVQHR2KYAEVN","界面设计师",{"categoryNo":103,"categoryName":104,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8BRASNPVNJVQQJ4KZX8XM5D","前端开发与界面实现",[106,107,108,109],"frontend","design","frontend design","ui","2026-11-12 13:55:43",{"skillNo":112,"name":113,"nameZh":114,"description":115,"descriptionZh":115,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":116,"licenseFileUrl":117,"sourceHtmlUrl":118,"categories":119,"keywords":126,"publishedAt":110},"01M6BTYMZJTANQTXN0PXP0FZPE","aihot","AIHOT AI 资讯查询","查询 AIHOT 的中文 AI 资讯、精选、当前热点和日报。用户询问今天或最近的 AI 新闻、AI 圈动态、大模型或产品发布、OpenAI／Anthropic／Google 最新消息、AI 论文、AI 日报、AIHOT 精选、当前最热事件，或需要同步当前全部精选时使用。必须通过 aihot.news 的匿名只读 API 获取当前数据，不凭训练记忆回答新闻；不需要 API Key 或 MCP server。","MIT","https:\u002F\u002Fgithub.com\u002Fpkking\u002Fdotfiles\u002Fblob\u002Fmaster\u002Fdotfiles\u002Fdot_config\u002Fskillshare\u002Fskills\u002Faihot\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fpkking\u002Fdotfiles\u002Fblob\u002Fmaster\u002Fdotfiles\u002Fdot_config\u002Fskillshare\u002Fskills\u002Faihot\u002FSKILL.md",[120,123],{"categoryNo":121,"categoryName":122,"taxonomyType":23,"taxonomyTypeDesc":24},"01M8BS5011KJDVSRXG1DC4P666","普通用户",{"categoryNo":124,"categoryName":125,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8C9YENBBTPQMH1CHGQPFWJQ","工具调用与实时数据查询",[113,127,128,129,130,131,132],"MCP","api","server","openai","mcp server","google",{"skillNo":134,"name":135,"nameZh":136,"description":137,"descriptionZh":138,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":116,"licenseFileUrl":17,"sourceHtmlUrl":139,"categories":140,"keywords":147,"publishedAt":51},"01M6BV2S7QC2D65HBV50KRXP9P","writing-shape","文章段落塑形","Writing, exploit: shape raw material into an article, paragraph by paragraph.","写作，深入挖掘（exploit）：把原始素材塑造成一篇文章，逐段推进。","https:\u002F\u002Fgithub.com\u002Fpkking\u002Fdotfiles\u002Fblob\u002Fmaster\u002Fdotfiles\u002Fdot_config\u002Fskillshare\u002Fskills\u002Fwriting-shape\u002FSKILL.md",[141,144],{"categoryNo":142,"categoryName":143,"taxonomyType":23,"taxonomyTypeDesc":24},"01M8C55A3R2M9C8CAKG3W16HTA","内容创作者",{"categoryNo":145,"categoryName":146,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8CA3WT74BY17JY9YCJY42FJ","创意写作与内容编排",[148,149],"writing shape","writing",{"skillNo":151,"name":152,"nameZh":153,"description":154,"descriptionZh":155,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":116,"licenseFileUrl":17,"sourceHtmlUrl":156,"categories":157,"keywords":164,"publishedAt":51},"01M6BV2QMHAVE24QQS5YRB91AN","writing-great-skills","Skill 编写规范参考","Reference for writing and editing skills well — the vocabulary and principles that make a skill predictable.","编写和编辑 skills 的参考指南——介绍让技能变得可预测的语言与原则。","https:\u002F\u002Fgithub.com\u002Fpkking\u002Fdotfiles\u002Fblob\u002Fmaster\u002Fdotfiles\u002Fdot_config\u002Fskillshare\u002Fskills\u002Fwriting-great-skills\u002FSKILL.md",[158,161],{"categoryNo":159,"categoryName":160,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8BRN0CV1NMDZ5TEJX1GVM29","插件与技能管理",{"categoryNo":162,"categoryName":163,"taxonomyType":23,"taxonomyTypeDesc":24},"01M8BRZZF9D7PVFN5MXSPWWD61","AI 工程师",[165,149],"writing great skills",{"skillNo":167,"name":168,"nameZh":169,"description":170,"descriptionZh":171,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":116,"licenseFileUrl":17,"sourceHtmlUrl":172,"categories":173,"keywords":176,"publishedAt":51},"01M6BV2NJCTKZ7FJX22977QKJ9","writing-fragments","写作素材片段挖掘","Writing, explore: mine raw fragments, no structure yet.","写作，探索（explore）：挖掘原始片段，暂不组织结构。","https:\u002F\u002Fgithub.com\u002Fpkking\u002Fdotfiles\u002Fblob\u002Fmaster\u002Fdotfiles\u002Fdot_config\u002Fskillshare\u002Fskills\u002Fwriting-fragments\u002FSKILL.md",[174,175],{"categoryNo":142,"categoryName":143,"taxonomyType":23,"taxonomyTypeDesc":24},{"categoryNo":145,"categoryName":146,"taxonomyType":28,"taxonomyTypeDesc":29},[177,149,178],"writing fragments","explore",{"skillNo":180,"name":181,"nameZh":182,"description":183,"descriptionZh":184,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":116,"licenseFileUrl":17,"sourceHtmlUrl":185,"categories":186,"keywords":191,"publishedAt":51},"01M6BV2KQFWWPY0C168DF0F8G6","writing-for-agents","智能体文档编写","Writing documents for agents. Use when creating or editing skills, or modifying AGENTS.md or CLAUDE.md.","为智能体（agent）编写文档。在创建或编辑 skills，或修改 AGENTS.md 或 CLAUDE.md 时使用。","https:\u002F\u002Fgithub.com\u002Fpkking\u002Fdotfiles\u002Fblob\u002Fmaster\u002Fdotfiles\u002Fdot_config\u002Fskillshare\u002Fskills\u002Fwriting-for-agents\u002FSKILL.md",[187,188],{"categoryNo":162,"categoryName":163,"taxonomyType":23,"taxonomyTypeDesc":24},{"categoryNo":189,"categoryName":190,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8BSAA4FBTWZP6X98STEHG99","智能体开发",[149,192,193],"writing for agents","documents"]