refactor(skill): upgrade open-code-review skill to modular structure with v1.9.1 features - #850
Open
lidaixingchen wants to merge 5 commits into
Open
Conversation
Contributor
|
✅ OpenCodeReview: Review skipped: no items were selected. |
There was a problem hiding this comment.
Pull request overview
Refactors the skills/open-code-review documentation into a modular “progressive reference navigation” structure and updates the guidance to cover newer CLI capabilities through v1.9.1 (review/scan modes, session resume, per-run overrides, MCP, troubleshooting).
Changes:
- Reworked
SKILL.mdinto a slimmer main guide with a navigation table and updated workflows for review vs. scan. - Added dedicated reference docs for flags, LLM configuration, rules, MCP integration, and troubleshooting/session management.
- Updated examples to prefer
--audience agentand--format json, and documented newer session/comment tooling.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| skills/open-code-review/SKILL.md | Main skill guide refactored to progressive navigation and updated workflows/examples. |
| skills/open-code-review/references/flags.md | Centralized CLI flags reference and defaults. |
| skills/open-code-review/references/llm-config.md | Installation + LLM configuration + per-run override documentation. |
| skills/open-code-review/references/rules.md | Extracted custom rule resolution/format/debugging docs. |
| skills/open-code-review/references/mcp.md | Documented MCP server configuration and built-in tool registry. |
| skills/open-code-review/references/troubleshooting.md | Added performance tuning, troubleshooting, and session management guidance. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| | "Review feature PR" | `ocr review --audience agent --format json -b "ctx" --from main --to feature` | | ||
| | "Review commit abc123" | `ocr review --audience agent --format json -b "ctx" --commit abc123` | | ||
| | "Which files will be reviewed?" | `ocr review --preview --format json` | | ||
| | "Resume interrupted review" | `ocr review --audience agent --format json --resume <session-id>` | |
Comment on lines
+44
to
+46
| # Resume interrupted review or scan | ||
| ocr review --audience agent --format json --resume <session-id> | ||
| ocr scan --audience agent --format json --resume <session-id> |
| | `--max-tokens-budget` | | `0` (unlimited) | Token budget cap; outputs partial results gracefully if exceeded | | ||
| | `--provider` | | Configured Provider | Per-run override for LLM Provider (e.g. `openai`, `anthropic`) | | ||
| | `--model` | | Configured Model | Per-run override for LLM model | | ||
| | `--max-tokens` | | `58888` | Per-run override for per-file prompt token limit | |
| | Symptom | Action | | ||
| |---------|--------| | ||
| | Rate limit errors | Lower `--concurrency` to 2-4 | | ||
| | Frequent 429 / 50x errors | Configure `ocr config set llm.retry_codes 429,500,502,503` | |
…TP 5xx notation based on review feedback
- Fix retry_codes examples: accepts 4xx only; 408/409/429 and all 5xx are already retried by the SDK by default - Fix ocr session comments flag: --format json -> --json - Fix JSON status enum: scan mode emits success / completed_with_warnings / completed_with_errors (no manifest) - Fix exit-code semantics: non-zero only on run-level failure or when every selected item failed; partial failures exit 0 - Clarify background sanitization (strip control chars, 2000/8000 char limits) applies to --background-file only; inline -b passes through raw - Clarify --max-tools min-10 clamp applies to review mode only; scan mode only takes effect above the template default - Enrich JSON output structure: llm, trace_id, tool_calls, project_summary, token breakdown fields, comments.thinking, coverage reused/waived sets, and stderr failure emission - Add provider-level config (providers.*, custom_providers.*), extended env vars (OCR_LLM_AUTH_HEADER, OCR_LLM_EXTRA_HEADERS, OCR_USE_ANTHROPIC, OCR_LLM_TIMEOUT, OCR_CONFIG_PATH), llm.timeout_sec / auth_header / extra_* keys, and ocr config provider / model / unset commands - Add session --repo flag, MCP behavioral details, rules matching details - Update stale model example to claude-opus-5; defer to ocr llm providers Signed-off-by: 历代星辰
lidaixingchen
force-pushed
the
refactor/upgrade-skill-to-modular-v1.9
branch
from
August 11, 2026 19:18
b6d3fd8 to
feba657
Compare
- Add console truncation prevention guidance in Step 2 (redirect to file, session comments recovery, stderr note) and a Gotchas entry, matching the truncation topic of alibaba#809 with a more complete recovery path - Add Tool Output truncation troubleshooting row - Add official site link to References Signed-off-by: 历代星辰
…ng note - Remove host-specific size estimate (~45KB) from truncation guidance; keep host-agnostic wording since agents vary (Claude Code, Codex, etc.) - Add Windows PowerShell redirect caveat: PowerShell 5 '>' writes UTF-16 and corrupts JSON; use Out-File -Encoding utf8 or bash Signed-off-by: 历代星辰
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary of Changes
This PR refactors the built-in
open-code-reviewskill into a modular, progressive-disclosure architecture and aligns it with all latest CLI features up to v1.9.1.Key Enhancements:
Modular Architecture & Token Efficiency:
SKILL.mdwith a streamlined main guide using Progressive Reference Navigation.references/:references/flags.md: Comprehensive CLI flags reference for review & scan modes.references/llm-config.md: Installation, LLM configuration, resolution priority, and per-run CLI overrides.references/rules.md: Custom rule definitions, hierarchy, and matching debugging.references/mcp.md: MCP server integration & tool registration specifications.references/troubleshooting.md: Troubleshooting, performance tuning, session management & filtering.Alignment with v1.9.1 CLI Features:
--provider,--model, and--max-tokensCLI flags to override configuration per-run.ocr scan --resume <session-id>support.ocr session commentssubcommand options (--severity,--category,--json).llm.retry_codes(custom 4xx retry codes; 408/409/429 and all 5xx are already retried by the SDK) andmax_tokens(per-file token cap).--previewflag options (supports--format json).OCR_USE_ANTHROPICguidance to standardOCR_LLM_PROTOCOL=anthropic.Follow-up Accuracy Fixes (verified against source):
retry_codesexamples: only 4xx codes are accepted —429,502,503would error out; 408/409/429 and all 5xx are retried by the SDK by default.ocr session commentsflag: it is--json, not--format json.statusenum: scan mode has no manifest and emitssuccess/completed_with_warnings/completed_with_errors, not the review-mode values.--background-fileonly; inline--backgroundpasses through raw.--max-toolsmin-10 clamp is review-mode only; scan mode takes effect only above the template default.llm,trace_id,tool_calls,project_summary, token breakdown fields,comments.thinking, coveragereused/waivedsets, and stderr failure emission.providers.*,custom_providers.*), extended env vars (OCR_LLM_AUTH_HEADER,OCR_LLM_EXTRA_HEADERS,OCR_USE_ANTHROPIC,OCR_LLM_TIMEOUT,OCR_CONFIG_PATH),llm.timeout_sec/auth_header/extra_*keys, andocr config provider/model/unsetcommands.session --repoflag, MCP behavioral details, and rules matching details (case-insensitive matching, single-level include/exclude, heuristic file references).claude-opus-5, deferring toocr llm providers.ocr session commentsrecovery in Step 2, a Gotchas entry, and a troubleshooting row (covers the topic of docs(skill): avoid output truncation in agent skill instructions #809 with a complete recovery path), plus the official site link.Reconciliation with main:
main(including feat(llm): add novita api as a default provider #829 novita provider, feat(providers): add siliconflow-cn as a built-in model provider #775 siliconflow-cn provider, and docs(skill): avoid output truncation in agent skill instructions #809 skill doc changes). The two new providers do not change any documented behavior — the docs defer toocr llm providers.ocr session commentsrecovery). Note docs(skill): avoid output truncation in agent skill instructions #809's "default: Chinese" statement does not match the source —resolveLang("")returns "English" (internal/config/template/template.go).