From b179c0ad487450c7cb71b0eefba7740b2d6b0dc9 Mon Sep 17 00:00:00 2001 From: Fahad Date: Mon, 9 Jun 2025 14:12:55 +0400 Subject: [PATCH] feat: enhance review_pending_changes tool visibility and triggers - Update tool description to strongly encourage Claude to use it before commits - Add 'ALWAYS use this tool before creating any git commit\!' emphasis - Add comprehensive trigger words in TOOL_TRIGGERS including: - 'before commit', 'about to commit', 'ready to commit' - 'review pending changes', 'check my changes' - 'pre-commit', 'before I commit', 'should I commit' - Make it clear this is essential for code quality and preventing bugs - All tests pass (65 tests), ruff linting clean, black formatting applied --- config.py | 17 +++++++++++++++++ tools/review_pending_changes.py | 13 +++++++------ 2 files changed, 24 insertions(+), 6 deletions(-) diff --git a/config.py b/config.py index a51df64..5794fd3 100644 --- a/config.py +++ b/config.py @@ -67,4 +67,21 @@ TOOL_TRIGGERS = { "analyze file", "analyze these files", ], + "review_pending_changes": [ + "review pending changes", + "check my changes", + "validate changes", + "pre-commit review", + "before commit", + "about to commit", + "ready to commit", + "review my git changes", + "check git changes", + "validate my changes", + "review staged changes", + "review unstaged changes", + "pre-commit", + "before I commit", + "should I commit", + ], } diff --git a/tools/review_pending_changes.py b/tools/review_pending_changes.py index d8f2d22..6916a5e 100644 --- a/tools/review_pending_changes.py +++ b/tools/review_pending_changes.py @@ -73,12 +73,13 @@ class ReviewPendingChanges(BaseTool): def get_description(self) -> str: return ( - "REVIEW PENDING GIT CHANGES - Comprehensive pre-commit review of staged/unstaged changes " - "or branch comparisons across multiple repositories. Searches recursively for git repos " - "and analyzes diffs for bugs, security issues, incomplete implementations, and alignment " - "with original requirements. Perfect for final review before committing. " - "Triggers: 'review pending changes', 'check my changes', 'validate changes', 'pre-commit review'. " - "Use this when you want to ensure changes are complete, correct, and ready to commit." + "REVIEW PENDING GIT CHANGES BEFORE COMMITTING - ALWAYS use this tool before creating any git commit! " + "Comprehensive pre-commit validation that catches bugs, security issues, incomplete implementations, " + "and ensures changes match the original requirements. Searches all git repositories recursively and " + "provides deep analysis of staged/unstaged changes. Essential for code quality and preventing bugs. " + "Triggers: 'before commit', 'review changes', 'check my changes', 'validate changes', 'pre-commit review', " + "'about to commit', 'ready to commit'. Claude should proactively suggest using this tool whenever " + "the user mentions committing or when changes are complete." ) def get_input_schema(self) -> Dict[str, Any]: