npx claudepluginhub davidleitw/xreview --plugin xreviewThis skill is limited to using the following tools:
<CRITICAL>
Reviews git-tracked code changes for high-impact defects, security issues, regressions, and test gaps with evidence-based findings. Supports auto-fixing.
Reviews code for security vulnerabilities, correctness issues, and maintainability problems with prioritized findings, fix diffs, and commit recommendations.
Performs comprehensive code reviews with automated fixes for Python, TypeScript, JavaScript, Go, Rust projects. Analyzes quality, security, performance, architecture, tests; applies safe fixes and generates reports.
Share bugs, ideas, or general feedback.
| Key | Language |
|---|---|
cpp | C++ |
go | Go |
If review targets are written in a supported language, add --language <key>.
If unsure or mixed languages, omit --language — xreview falls back to general-purpose review.
Only use keys from the table above.
Run: xreview preflight
This single command checks everything: xreview version, codex installation, API key.
Parse the XML output:
If xreview itself is not found (which xreview fails):
a. Ask the user "xreview is not installed. Install it now? (y/n)"
b. If yes: run curl -fsSL https://raw.githubusercontent.com/davidleitw/xreview/master/scripts/install.sh | bash
then re-run preflight.
c. If install fails: tell the user to check https://github.com/davidleitw/xreview/releases. Stop.
Two review modes — pick the one that fits:
--git-uncommitted)Use when reviewing what's about to be committed. Codex will run git diff
to see the changes itself.
--files)Use when:
Codex will read the files directly — no git diff involved.
--contextThe context string is critical — it tells Codex what to focus on and provides background for the final review report. Include as much relevant context as you have.
For git-uncommitted (change-focused):
--context "【背景】why this change is being made — the motivation or problem being solved
【變更類型】feature | refactor | bugfix
【描述】what was changed — specific functions, modules, or behaviors modified
【進度】current status — e.g. 'implementation complete, pre-commit review' or 'WIP, reviewing direction'
【預期行為】what this code should achieve (for refactor: 'behavior should be identical to before')
【未完成】anything not yet done or known limitations, if applicable"
For files (flow/feature review):
--context "【背景】why this review is needed — e.g. 'new feature ready for review', 'investigating production bug'
【Review 焦點】what to focus on — e.g. 'Review the CMS push event flow:
enqueue → EventQueue.push() → purge logic → SendQueue routing.
Focus on concurrency safety and lock correctness across these files.'
【進度】current status of the work
【預期行為】expected behavior — e.g. 'cache and ordered paths are fully independent, no cross-locking'"
For files (single file quality):
--context "【背景】why reviewing this file — e.g. 'recently refactored, want quality check'
【Review 焦點】General quality review of event_queue.cpp.
Look for bugs, race conditions, error handling issues.
【進度】current status"
The better the context, the better Codex's review AND the better the final report. Be specific about the flow direction, expected behavior, and areas of concern. Include background motivation — this gets stored in the session and used when generating the review report.
Run: xreview review --files <paths> --context "<structured context>" [--language ]
or: xreview review --git-uncommitted --context "<structured context>" [--language ]
Add --language only when the review targets match a supported language (see table above).
Parse the XML output from Step 2.
If verdict is APPROVED (zero findings): tell the user "No issues found." Skip to Step 5.
Group findings by file. For each file, read it ONCE, then verify all findings in that file.
For EACH finding:
For SUSPECT findings, challenge Codex before dropping them:
Run: xreview review --session <session-id> --message "F-XXX appears to be a false positive: <your reasoning>. Please re-evaluate."
Parse the response:
After verification, present ALL confirmed findings to the user. For EACH finding:
### F-XXX [SEVERITY/category] title📍 file:lineLow severity findings may use a shorter format but MUST still include suggested fixes.
After ALL findings, tell the user:
以上是本次 review 的發現。你可以:
- 討論任何 finding 的細節
- 告訴我要修哪些(例如「修 F-001 和 F-003」)
- 如果有其他想讓 Codex 檢查的方向,也可以告訴我
Stop here. Wait for the user to respond. Do NOT auto-proceed to fixing.
This is a free-form conversation. Handle user messages based on their intent:
User asks about a finding (e.g. "F-001 的影響範圍?") → Read code, explain context and details.
User challenges a finding (e.g. "F-002 那邊上層已經檢查過了") → Re-verify against code. If the user is right, update classification and tell them.
User asks Codex to check something new (e.g. "還有沒有其他 SQL injection?")
→ Run: xreview review --session <session-id> --message "<user's question>"
→ Verify any new findings (Phase 1 process), then present them (Phase 2 format).
User requests fixes (e.g. "修 F-001 和 F-003") → Proceed to Step 4.
When the user specifies which findings to fix:
Apply fixes for the specified findings only.
Run verification:
xreview review --session <session-id> --message "<message>"
The message MUST include:
Parse the result:
Produce a detailed summary in the conversation. This summary IS the report — do not save it to a file.
Cover these sections:
Be thorough — this is the user's record of the review. Include enough detail that someone reading the summary can understand every finding and every decision without scrolling back through the conversation.
After the summary, clean up the session:
xreview clean --session <session-id>
See reference.md for the complete XML schema documentation.