refactor: rename review_pending_changes to review_changes
- Renamed tool from review_pending_changes to review_changes for brevity - Enhanced tool descriptions for better MCP auto-discovery - Updated all references throughout codebase including: - Tool implementation (tools/review_changes.py) - Test files (tests/test_review_changes.py) - Server registration and imports - Documentation in README.md - Tool prompts in prompts/tool_prompts.py - Enhanced review_changes description to emphasize pre-commit usage - All tests pass, linting and formatting checks pass 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -6,7 +6,7 @@ from .analyze import AnalyzeTool
|
||||
from .chat import ChatTool
|
||||
from .debug_issue import DebugIssueTool
|
||||
from .review_code import ReviewCodeTool
|
||||
from .review_pending_changes import ReviewPendingChanges
|
||||
from .review_changes import ReviewChanges
|
||||
from .think_deeper import ThinkDeeperTool
|
||||
|
||||
__all__ = [
|
||||
@@ -15,5 +15,5 @@ __all__ = [
|
||||
"DebugIssueTool",
|
||||
"AnalyzeTool",
|
||||
"ChatTool",
|
||||
"ReviewPendingChanges",
|
||||
"ReviewChanges",
|
||||
]
|
||||
|
||||
@@ -86,7 +86,7 @@ class BaseTool(ABC):
|
||||
f"Please provide the full absolute path starting with '/'"
|
||||
)
|
||||
|
||||
# Check if request has 'path' attribute (for review_pending_changes)
|
||||
# Check if request has 'path' attribute (for review_changes)
|
||||
if hasattr(request, "path") and request.path:
|
||||
if not os.path.isabs(request.path):
|
||||
return (
|
||||
|
||||
@@ -9,15 +9,15 @@ from typing import Any, Dict, Literal, Optional
|
||||
from pydantic import Field
|
||||
|
||||
from config import MAX_CONTEXT_TOKENS
|
||||
from prompts.tool_prompts import REVIEW_PENDING_CHANGES_PROMPT
|
||||
from prompts.tool_prompts import REVIEW_CHANGES_PROMPT
|
||||
from utils.git_utils import find_git_repositories, get_git_status, run_git_command
|
||||
from utils.token_utils import estimate_tokens
|
||||
|
||||
from .base import BaseTool, ToolRequest
|
||||
|
||||
|
||||
class ReviewPendingChangesRequest(ToolRequest):
|
||||
"""Request model for review_pending_changes tool"""
|
||||
class ReviewChangesRequest(ToolRequest):
|
||||
"""Request model for review_changes tool"""
|
||||
|
||||
path: str = Field(
|
||||
...,
|
||||
@@ -65,11 +65,11 @@ class ReviewPendingChangesRequest(ToolRequest):
|
||||
)
|
||||
|
||||
|
||||
class ReviewPendingChanges(BaseTool):
|
||||
"""Tool for reviewing pending git changes across multiple repositories."""
|
||||
class ReviewChanges(BaseTool):
|
||||
"""Tool for reviewing git changes across multiple repositories."""
|
||||
|
||||
def get_name(self) -> str:
|
||||
return "review_pending_changes"
|
||||
return "review_changes"
|
||||
|
||||
def get_description(self) -> str:
|
||||
return (
|
||||
@@ -86,10 +86,10 @@ class ReviewPendingChanges(BaseTool):
|
||||
return self.get_request_model().model_json_schema()
|
||||
|
||||
def get_system_prompt(self) -> str:
|
||||
return REVIEW_PENDING_CHANGES_PROMPT
|
||||
return REVIEW_CHANGES_PROMPT
|
||||
|
||||
def get_request_model(self):
|
||||
return ReviewPendingChangesRequest
|
||||
return ReviewChangesRequest
|
||||
|
||||
def get_default_temperature(self) -> float:
|
||||
"""Use analytical temperature for code review."""
|
||||
@@ -106,7 +106,7 @@ class ReviewPendingChanges(BaseTool):
|
||||
# Limit length to avoid filesystem issues
|
||||
return name[:100]
|
||||
|
||||
async def prepare_prompt(self, request: ReviewPendingChangesRequest) -> str:
|
||||
async def prepare_prompt(self, request: ReviewChangesRequest) -> str:
|
||||
"""Prepare the prompt with git diff information."""
|
||||
# Find all git repositories
|
||||
repositories = find_git_repositories(request.path, request.max_depth)
|
||||
Reference in New Issue
Block a user