feat: add project-review workflow (whole-project / single-feature review)
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
This commit is contained in:
+26
-5
@@ -28,6 +28,13 @@ Three-layer unified code review (CRG graph context + ai-code-review scoring + gs
|
||||
- Fingerprint merge + quality score via `dedupe_findings_tool`
|
||||
- Standalone HTML report via `generate_report_tool`
|
||||
|
||||
### `/code-review-graph:project-review`
|
||||
Whole-project or single-feature code review (not diff-based).
|
||||
- Scope parsed from user instruction: 全面/整个项目 → whole-project; otherwise feature + target
|
||||
- Whole-project: `score_review_tool(all_files=True)` scores every source file
|
||||
- Feature: `semantic_search_nodes` + `query_graph(children_of)` locate the code
|
||||
- Read-only: every finding waits for a manual fix decision
|
||||
|
||||
## MCP Tools
|
||||
|
||||
### Core Tools
|
||||
@@ -259,11 +266,14 @@ findings to the appendix, and computes `PR quality score = max(0, 10 -
|
||||
#### `generate_report_tool`
|
||||
```
|
||||
review_data: dict # metrics + findings + verdict + tier + scope
|
||||
output_path: str | None # Default: <repo_root>/code-review-report.html
|
||||
repo_root: str | None
|
||||
output_path: str | None # Base name without extension
|
||||
repo_root: str | None # Default: <repo_root>/code-review-report
|
||||
format: str = "both" # "html" | "markdown" | "both"
|
||||
```
|
||||
Renders the standalone HTML code review report (self-contained, no external
|
||||
dependencies) from the bundled `report-template.html`.
|
||||
Renders the standalone HTML review report (self-contained, no external
|
||||
dependencies) and/or the Chinese Markdown report from the bundled
|
||||
`report-template.html`. Default `format="both"` writes
|
||||
`code-review-report.html` + `code-review-report.md`.
|
||||
|
||||
#### `refactor_tool`
|
||||
```
|
||||
@@ -310,7 +320,7 @@ kind: str | None
|
||||
limit: int = 20
|
||||
```
|
||||
|
||||
## MCP Prompts (6 workflow templates)
|
||||
## MCP Prompts (7 workflow templates)
|
||||
|
||||
### `review_changes`
|
||||
Pre-commit review workflow using detect_changes, affected_flows, and test gaps.
|
||||
@@ -346,6 +356,17 @@ base: str = "HEAD~1"
|
||||
tier: str = "standard" # fast | standard | strict
|
||||
```
|
||||
|
||||
### `project_review`
|
||||
Whole-project or single-feature code review (not diff-based). Reviews
|
||||
the entire codebase or a single feature/module using graph-wide analysis
|
||||
and objective scoring. READ-ONLY: every finding waits for a manual fix
|
||||
decision. Scope is parsed from the user instruction (全面/整个项目 →
|
||||
whole-project; otherwise feature + target keyword).
|
||||
```
|
||||
scope: str = "whole-project" # whole-project | feature
|
||||
target: str = "" # feature/module keyword when scope="feature"
|
||||
```
|
||||
|
||||
## CLI Commands
|
||||
|
||||
```bash
|
||||
|
||||
Reference in New Issue
Block a user