Adds the project-review workflow for code review independent of the git diff. The scope is parsed from the user instruction: 全面/整个项目 -> whole-project (score every source file), otherwise feature + target keyword (locate the code with semantic search + graph queries). - scoring_tools.py: score_review_func gains all_files=True to score every source file in the graph via store.get_all_files() - main.py: score_review_tool gains all_files param; registers the project_review MCP prompt (prompts 6->7) - prompts.py: project_review_prompt(scope, target) with whole-project and feature branches (fixed a precedence bug that truncated the feature text) - skills.py + skills/project-review/: new read-only project-review skill with shared checklists - .opencode/command/code-review-graph-project-review.md: slash command - tests: test_project_review.py (prompt rendering), TestProjectReviewPrompt, skill count assertions 5->6, all_files wiring checks - docs: prompts (6->7) + project-review entries across COMMANDS, CLAUDE, README (+localized), INDEX, architecture, LLM-OPTIMIZED-REFERENCE, CHANGELOG
2.3 KiB
description, agent
| description | agent |
|---|---|
| Run the three-layer unified review (CRG graph context + score_review + dedupe_findings + generate_report). | build |
Unified Review
Run the three-layer unified code review using the MCP prompt workflow.
$ARGUMENTS
Token optimization: Before starting, call get_docs_section_tool(section_name="unified-review") for the optimized workflow.
Steps
-
Load the workflow by calling the
unified_reviewMCP prompt (or theunified-reviewskill). This drives the full READ-ONLY review pipeline. -
Ensure the graph is current by calling
build_or_update_graph_tool(). -
Get the review context by calling
get_review_context_tool()— changed files, blast radius, source snippets. -
Detect changes by calling
detect_changes_tool()— risk score, changed functions, test gaps, affected flows. -
Score objectively by calling
score_review_tool()— SQL risk, exception coverage, redundancy, high-risk density, vulnerability heuristic (good/warn/fail grades). LLM-judged metrics are inllm_judged. -
Review the changed code (Layer 1 chain decomposition): interface, business, data, utility, error handling, security, performance, observability. Produce findings with severity (blocker/major/minor), confidence (1-10), file:line, and proposed fix.
-
Merge findings by calling
dedupe_findings_tool(findings=<your findings>)— fingerprint dedup, multi-source confidence boost, PR quality score. -
Generate the report by calling
generate_report_tool(review_data=<verdict, tier, scope, metrics, merged findings>)— writescode-review-report.htmlandcode-review-report.md(defaultformat="both"). -
Report the verdict (✅ PASS / ❌ FAIL), severity counts, each issue with confidence + fix, and manual-review items.
Important Rules
- READ-ONLY. This workflow never modifies code, commits, or pushes. Every finding waits for a manual fix decision.
- Any blocker → verdict ❌ FAIL, regardless of other scores.
- Tier (fast / standard / strict) comes from
.code-review.yamlat the repo root, or thetierargument.
Tips
- For large diffs (50+ lines), dispatch specialist subagents (testing, maintainability, security, performance, data-migration, api-contract) in parallel before dedupe.
- Security and data-migration are insurance specialists — always run even when silent.