Add git plugin with enhanced workflows - #2
Conversation
Implements a new git plugin that enhances Claude Code's built-in git capabilities with smart defaults, safety guardrails, and automatic convention detection. Features: - Three user-invocable skills: /git:branch, /git:commit, /git:pr - PreToolUse hooks for safety reminders on git operations - Auto-detection of conventional commits, fork setups, and mainline branches - Reference files with shared detection utilities - Progressive disclosure with lean skills and detailed references Also consolidates markdownlint configuration into single .markdownlint-cli2.jsonc file with combined rules and ignores. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Changed prompt-based hooks to focus on what they can actually verify (tool input parameters) rather than trying to check external conditions (git remotes, file system) they don't have access to. Changes: - create_pull_request hook: Check 'head' parameter format for fork detection - push_files hook: Check 'branch' parameter for mainline detection - Both hooks now return empty systemMessage when parameters look correct This eliminates confusing "hook error" messages and makes hooks more targeted and helpful. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
|
@CodeRabbit review |
✅ Actions performedReview triggered.
|
WalkthroughThis PR introduces a comprehensive Git plugin to the marketplace, including a plugin manifest, documentation for Git workflows, safety hooks configuration, and three core skills for branch creation, committing, and pull request creation with supporting reference documentation. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25–30 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 2✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 4
🤖 Fix all issues with AI agents
In `@git/hooks/hooks.json`:
- Around line 14-37: The hook uses a non-existent matcher
"mcp__plugin_github_github__push_files"; update hooks.json so the matcher either
targets a real GitHub MCP tool (one of the documented names:
mcp__plugin_github_github__create_pull_request,
mcp__plugin_github_github__update_pull_request,
mcp__plugin_github_github__pull_request_read, or
mcp__plugin_github_github__list_pull_requests) if you intended this behavior, or
remove the entire "mcp__plugin_github_github__push_files" hook block if
file-pushing via MCP is not supported, and keep the existing prompt/timeout
behavior only under a valid matcher.
In `@git/README.md`:
- Around line 9-13: Update wording that overstates enforcement: replace the
phrase "Prevents accidental commits directly to main/master branches" (and the
same wording appearing at the later occurrence around lines 75-77) with
non-blocking language such as "Warns before commits to main/master branches" or
"Reminds before committing to main/master branches"; also adjust the feature
heading "Mainline protection" to something like "Mainline reminders/protection
(warning only)" so the README consistently reflects that hooks are non-blocking
warnings.
In `@git/reference/conventional-commits.md`:
- Line 99: Update the table entry that shows the CI example by fixing the
platform capitalization: change the example commit text `ci(github): add
deployment workflow` to use `GitHub` (e.g. `ci(GitHub): add deployment
workflow`) so the platform name is properly capitalized; ensure any other
occurrences of the lowercase `github` in that same row are similarly corrected.
In `@git/reference/mainline-detection.md`:
- Around line 7-8: The document contains conflicting priority orders
(Remote→Local→CLAUDE vs CLAUDE→Remote→Local); pick a single canonical order
(e.g., CLAUDE→Remote→Local if CLAUDE should be highest) and update every
occurrence to match, including the section under the "Use this priority order:"
heading and the other instance referenced around the 51st line; ensure the
header text and any explanatory lines or lists that mention the priority reflect
the chosen order consistently and update any cross-references or examples that
assume the previous order.
♻️ Duplicate comments (2)
git/skills/pr/reference (1)
1-1: Same reference implementation pattern as branch/reference.This file has the same implementation pattern as
git/skills/branch/reference. Please see the review comment on that file regarding verification of whether these should be actual symlinks or text files.git/skills/commit/reference (1)
1-1: Same reference implementation pattern.This file follows the same pattern as
git/skills/branch/referenceandgit/skills/pr/reference. Please see the review comment ongit/skills/branch/referencefor verification of the implementation approach.
🧹 Nitpick comments (2)
git/skills/commit/SKILL.md (2)
24-115: Add explicit user confirmation before running CLAUDE.md commands.
Those commands are repo-sourced and may be long-running or unexpected; make the confirmation step explicit.✏️ Suggested wording
-1. Execute each command specified -2. Verify all pass successfully -3. If any fail, report to user and ask how to proceed -4. Do NOT commit if verification fails without user approval +1. Confirm with the user before running each command (especially long‑running or repo‑sourced) +2. Execute each command specified +3. Verify all pass successfully +4. If any fail, report to user and ask how to proceed +5. Do NOT commit if verification fails without user approval
186-208: Avoid hard‑coding a co‑author identity in the example.
Make it a placeholder or conditional to keep the guidance portable across repos.✏️ Suggested update
-Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> +Co-Authored-By: <assistant-name> <assistant-email>
Summary
This PR adds a new git plugin that enhances Claude Code's built-in git capabilities with smart defaults, safety guardrails, and automatic convention detection.
Changes
Three user-invocable skills:
/git:branch,/git:commit,/git:prPreToolUse hooks for safety reminders on git operations
Four reference files with shared detection utilities
Progressive disclosure design
Consolidated markdownlint configuration
.markdownlint.jsonand.markdownlint-cli2.jsoncTesting
The plugin was tested by using it to commit its own implementation:
/git:branch- Createdadd-git-pluginbranch frommain/git:commit- Staged files and created commit with proper message/git:pr- This PR was created using the plugin itselfManual testing checklist:
claude plugin validate ./gitnpx markdownlint-cli2 "git/**/*.md"Related Issues
N/A - Initial implementation following the design plan.
🤖 Generated with Claude Code using the git plugin
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.