- Pre-commit config: !`find . -maxdepth 1 -name ".pre-commit-config.yaml" 2>/dev/null`
Creates commits with issue references, runs pre-commit hooks, and pushes changes with optional PR creation.
/plugin marketplace add laurigates/claude-plugins/plugin install git-plugin@laurigates-pluginsgit/find . -maxdepth 1 -name ".pre-commit-config.yaml" 2>/dev/nullgit branch --show-currentgit status --porcelain=v2 --branch 2>/dev/nullgit diff --numstat 2>/dev/nullgit diff --cached --numstat 2>/dev/nullgit log --format='%h %s' -n 10git remote get-url origin 2>/dev/nullgh label list --json name --limit 50 2>/dev/nullgh issue list --state open --json number,title,labels --limit 30 2>/dev/nullParse 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 on main--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)Execute this commit workflow using the main-branch development pattern:
--direct, any branch is valid. Otherwise, verify on main branch (warn if not).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 pattern for PRs):
# Push main to remote feature branch
git push origin main:<remote-branch>
# Or push commit range for multi-PR workflow
git push origin <start>^..<end>:<remote-branch>
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 and issue link if --issue provideddraft: true if --draft flag setIf --labels provided, add labels after PR creation:
gh pr edit <pr-number> --add-label "label1,label2"
git add -u--direct): Use git push origin HEAD to push current branch directlygit push origin main:<remote-branch> for PR workflowgit push origin <start>^..<end>:<remote-branch> for commit rangesFixes, 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