From git-plugin
Automates full Git workflow: detects related issues, creates logical commits with links, runs pre-commit, pushes feature branch, creates GitHub PR. Triggers on 'create PR' or similar intents.
npx claudepluginhub laurigates/claude-plugins --plugin git-pluginThis skill uses the workspace's default tool permissions.
- Pre-commit config: !`find . -maxdepth 1 -name ".pre-commit-config.yaml"`
Creates isolated Git worktrees for feature branches with prioritized directory selection, gitignore safety checks, auto project setup for Node/Python/Rust/Go, and baseline verification.
Executes implementation plans in current session by dispatching fresh subagents per independent task, with two-stage reviews: spec compliance then code quality.
Dispatches parallel agents to independently tackle 2+ tasks like separate test failures or subsystems without shared state or dependencies.
find . -maxdepth 1 -name ".pre-commit-config.yaml"git branch --show-currentgit status --porcelain=v2 --branchgit diff --numstatgit diff --cached --numstatgit log --format='%h %s' --max-count=10git remote -vgh label list --json name --limit 50gh issue list --state open --json number,title,labels --limit 30Parse these parameters from the command (all optional):
$1: Remote branch name to push to (e.g., feat/auth-oauth2). If not provided, auto-generate from first commit type. Ignored with --direct.--push: Automatically push after commits--direct: Push current branch directly to same-named remote (e.g., git push origin main). Mutually exclusive with --pr.--pr / --pull-request: Create pull request after pushing (implies --push, uses feature branch pattern)--draft: Create as draft PR (requires --pr)--issue <num>: Link to specific issue number (requires --pr)--no-commit: Skip commit creation (assume commits already exist)--range <start>..<end>: Push specific commit range instead of all commits--labels <label1,label2>: Apply labels to the created PR (requires --pr)--skip-issue-detection: Skip automatic issue detection (use when --issue is provided or for trivial changes)IMPORTANT: Execute all steps continuously without pausing to ask for confirmation between steps. This is a complete workflow — commit, push, and PR creation flow as a single operation. Do not stop after committing to ask whether to push or create a PR; proceed through all applicable steps.
--direct: any branch is valid, stay on current branchfix/handle-timeout-edge-case, feat/add-oauth-support). Use git checkout -b <branch-name>.Purpose: Automatically identify open GitHub issues that the staged changes may fix or close.
Analyze staged changes:
git diff --cached --name-onlyMatch against open issues:
gh issue list --state open)bug label + fix changes)Report detected issues:
Detected potentially related issues:
HIGH CONFIDENCE:
- #123 "Login fails with invalid token" → Fixes #123
Match: Changes to src/auth/token.ts, issue mentions token validation
MEDIUM CONFIDENCE:
- #456 "Improve error messages" → Refs #456
Match: Error handling changes in src/auth/
Suggested closing keywords for commit message:
Fixes #123
Refs #456
Determine appropriate keywords:
Fixes #N for bug fixes that fully resolve the issueCloses #N for features that complete the issueRefs #N for partial progress or related changesConfirm with user (if uncertain):
git add -u for modified files, git add <file> for new filespre-commit rungit add -uFixes #N - for bug fixes that resolve an issueCloses #N - for features that complete an issueResolves #N - alternative closing keywordRefs #N - references issue without closingRelated to #N - indicates relationshipFixes owner/repo#N - closes issue in different repoFixes #1, fixes #2, fixes #3Fixes: #123If --direct: Push current branch to same-named remote:
# Direct push to current branch
git push origin HEAD
Otherwise (feature branch — created in Step 1 or pre-existing):
# Push the current feature branch and set upstream
git push -u origin $(git branch --show-current)
5a. Identify post-merge follow-up actions.
Before creating the PR, scan commit messages, diff context, and any conversation context for actions that must happen after the PR is merged:
| Signal | Examples |
|---|---|
| Commit messages | "migration", "run after deploy", "manual step", "update config" |
| File patterns | *.sql, migration files, deployment scripts, runbooks |
| Context | User mentioned a deployment step, documentation update, or announcement |
For each post-merge action identified, create a GitHub issue — not a PR checklist item. PR descriptions are closed and buried once a PR merges; issues remain open until resolved.
gh issue create \
--title "[Chore] DB: Run migration for new schema" \
--body "Follow-up to <PR-URL>.\n\nRun: rake db:migrate in production after deploy." \
--label "chore"
# Note the returned issue number for the PR body
Common follow-up types: database migrations, production deployments, manual config changes, external documentation updates, customer-facing announcements, dependent follow-on PRs.
5b. Create the PR, including follow-up issue links in the body.
Use mcp__github__create_pull_request with:
head: The remote branch name (e.g., feat/auth-oauth2)base: maintitle: Derived from commit messagebody: Include summary, issue link if --issue provided, and a Follow-up Issues section listing any issues created in 5adraft: true if --draft flag setPR body structure when follow-up issues exist:
## Summary
...
## Follow-up Issues
<!-- Post-merge actions tracked as issues so they survive PR closure -->
- #456: run database migration for new schema
- #457: update production feature-flag config
## Related Issues
Fixes #123
If --labels provided, add labels after PR creation:
gh pr edit <pr-number> --add-label "label1,label2"
After PR creation, watch CI checks to confirm the PR is ready for merge:
# Watch all checks (not just required — many repos have no required checks configured)
gh pr checks <pr-number> --watch --fail-fast
On success (exit 0):
gh pr merge <pr-number> --squash --delete-branchOn failure (exit 1):
gh pr checks <pr-number> --json name,state,bucket,link --jq '.[] | select(.bucket == "fail")'
git add -u--direct): Use git push origin HEAD to push current branch directlygit push -u origin <branch>Fixes, Closes, Resolves) auto-close issues when merged to default branchRefs, Related to, See) link without closing - use for partial workFixes #123, Fixes: #123, fixes org/repo#123Fixes #1, fixes #2, fixes #3 (repeat keyword for each)--issue <num> provided, use Fixes #<num> or Closes #<num> in commit body