Skip to content

Refactor git tools: replace 4 tools with 11 focused implementations#339

Merged
will-lamerton merged 15 commits intomainfrom
feature/improved-git-tools
Feb 5, 2026
Merged

Refactor git tools: replace 4 tools with 11 focused implementations#339
will-lamerton merged 15 commits intomainfrom
feature/improved-git-tools

Conversation

@will-lamerton
Copy link
Member

@will-lamerton will-lamerton commented Feb 4, 2026

Summary

Replaced the existing 4 git tools with 11 focused, well-designed tools that cover core git operations needed by a coding agent. A viable closing of #98 - I know this PR pulls away from that, but testing this PR makes git operations intelligent, automatic and easy to understand.

Changes

Deleted Tools:

  • git_smart_commit - Over-engineered, models can write commit messages directly
  • git_create_pr - Only generated templates, replaced with actual PR creation
  • git_branch_suggest - Unnecessary, models can suggest branch names
  • git_status_enhanced - Replaced with simpler git_status

New Tools (11):

  • git_status - Show repository status, branch, sync state
  • git_diff - Show unstaged, staged, or branch diffs
  • git_log - View commit history with filters
  • git_add - Stage files for commit
  • git_commit - Create commits
  • git_push - Push to remote
  • git_pull - Pull from remote with rebase option
  • git_branch - List, create, switch, or delete branches
  • git_stash - Save, list, apply, pop, or clear stashes
  • git_reset - Unstage files or reset commits
  • git_pr - Create, view, or list GitHub PRs (via gh CLI)

Improvements

  • Consistent error handling across all git tools
  • Improved user feedback messages
  • Standardized parameter handling
  • Removed redundant code
  • Fixed typos and improved command descriptions
  • Better tool approval levels (AUTO, STANDARD, ALWAYS_APPROVE)
  • Added comprehensive test coverage

Testing

Updated git-tools.spec.tsx to individual test files for all tools improving coverage.

Bonus: If git is not installed, tools won't be registered, saving ~2,000-4,000 tokens.

@will-lamerton will-lamerton merged commit 6e35d8b into main Feb 5, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant