feat: add unified_review MCP prompt + sync tool/prompt counts
Adds the unified_review MCP prompt (invoked as /code-review-graph:unified_review) that drives the unified-review workflow: graph context -> detect_changes -> score_review -> findings -> dedupe_findings -> generate_report. READ-ONLY: every finding waits for a manual fix decision. Takes base and tier (fast/standard/strict) arguments. - prompts.py: unified_review_prompt + docstring count 5->6 - main.py: @mcp.prompt() registration - tests/test_prompts.py: TestUnifiedReviewPrompt + preamble test - docs: LLM-OPTIMIZED-REFERENCE, COMMANDS, CLAUDE.md, INDEX, architecture, README + 4 localized READMEs; tool count 30->31 and prompt count 5->6 synced (historical ROADMAP/FEATURES version notes left unchanged)
This commit is contained in:
@@ -8,6 +8,7 @@ from code_review_graph.prompts import (
|
||||
onboard_developer_prompt,
|
||||
pre_merge_check_prompt,
|
||||
review_changes_prompt,
|
||||
unified_review_prompt,
|
||||
)
|
||||
|
||||
|
||||
@@ -167,6 +168,52 @@ class TestPreMergeCheckPrompt:
|
||||
assert "dead_code" in _text(result[0])
|
||||
|
||||
|
||||
class TestUnifiedReviewPrompt:
|
||||
def test_returns_list_with_messages(self):
|
||||
result = unified_review_prompt()
|
||||
assert isinstance(result, list)
|
||||
assert len(result) >= 1
|
||||
|
||||
def test_message_has_role_and_content(self):
|
||||
result = unified_review_prompt()
|
||||
for msg in result:
|
||||
assert isinstance(msg, Message)
|
||||
assert msg.role == "user"
|
||||
assert _text(msg)
|
||||
|
||||
def test_default_base_and_tier(self):
|
||||
result = unified_review_prompt()
|
||||
text = _text(result[0])
|
||||
assert "HEAD~1" in text
|
||||
assert "standard tier" in text
|
||||
|
||||
def test_custom_base_and_tier(self):
|
||||
result = unified_review_prompt(base="develop", tier="strict")
|
||||
text = _text(result[0])
|
||||
assert "base=develop" in text
|
||||
assert "strict tier" in text
|
||||
|
||||
def test_mentions_score_review(self):
|
||||
result = unified_review_prompt()
|
||||
assert "score_review" in _text(result[0])
|
||||
|
||||
def test_mentions_dedupe_findings(self):
|
||||
result = unified_review_prompt()
|
||||
assert "dedupe_findings" in _text(result[0])
|
||||
|
||||
def test_mentions_generate_report(self):
|
||||
result = unified_review_prompt()
|
||||
assert "generate_report" in _text(result[0])
|
||||
|
||||
def test_mentions_read_only(self):
|
||||
result = unified_review_prompt()
|
||||
assert "READ-ONLY" in _text(result[0])
|
||||
|
||||
def test_mentions_blocker_rule(self):
|
||||
result = unified_review_prompt()
|
||||
assert "FAIL" in _text(result[0])
|
||||
|
||||
|
||||
class TestTokenEfficiencyPreamble:
|
||||
"""All prompts should include the token efficiency preamble."""
|
||||
|
||||
@@ -190,3 +237,7 @@ class TestTokenEfficiencyPreamble:
|
||||
def test_pre_merge_has_preamble(self):
|
||||
result = pre_merge_check_prompt()
|
||||
assert "get_minimal_context" in _text(result[0])
|
||||
|
||||
def test_unified_review_has_preamble(self):
|
||||
result = unified_review_prompt()
|
||||
assert "get_minimal_context" in _text(result[0])
|
||||
|
||||
Reference in New Issue
Block a user