Automate Git Branching and Committing
A skill that groups related file changes, auto-generates branch names and commit messages, and streamlines the git-to-PR flow.
Why it matters
Streamline your code shipping process with intelligent Git automation. This skill automatically groups changes, generates descriptive branch names, and crafts commit messages, reducing manual effort and cognitive load.
Outcomes
What it gets done
Intelligently detect and group related code changes.
Automatically generate descriptive Git branch names.
Streamline staging, committing, and pushing code.
Optionally create GitHub Pull Requests with generated descriptions.
Install
Add it to your toolbox
Run in your project directory:
curl -fsSL https://spark.entire.vc/get/ag-smart-git-automation | bash Overview
Smart Git Automation
A skill that groups related git changes, auto-generates branch names and commit messages, and streamlines the flow from scan to PR with minimal manual confirmation. Use it for routine git workflows to reduce confirmation overhead; it never bypasses repository branch policies or review gates and always confirms destructive/publishing actions.
What it does
This skill intelligently detects and groups related git changes, auto-generates descriptive branch names and commit messages, and streamlines the workflow from scan through PR creation with fewer manual prompts. It starts by running git status, git diff --stat, git diff --name-only, and git diff --staged --stat in parallel, then groups changed files logically - files in the same module/directory, files edited together recently, or complementary new files - presenting the groups clearly (e.g. "UI Components" vs "API Layer"). It generates a branch name in <type>/<short-description> format (types: feature, fix, refactor, docs, test, chore) derived from the dominant change pattern, converted to kebab-case and capped at 50 characters, then asks for a one-word confirmation or an alternative name. For branching and committing, it checks whether the current branch already matches the proposed name (staying if so, offering to switch or create if not), creates the branch only after name validation via git checkout -b, stages only explicit pathspecs (never concatenating untrusted filenames into a shell command, using NUL-delimited paths from git diff -z --name-only when needed), and generates a commit message (a max-72-character <type>: <description> first line plus a grouped-changes body), showing a preview before committing with one-word confirmation. After committing it asks whether to push, and if so runs git push -u origin <branch-name>; it then asks whether to create a PR, checking the remote (using the correct fork remote if applicable) and using gh pr create with a branch-derived title and an auto-generated body summarizing changes and file breakdown. Key rules: always group files automatically but let the user adjust, generate branch names from actual changes rather than asking the user to invent one, minimize confirmations to single-word answers, never commit secrets/credentials/large binaries, verify the GitHub repo exists before attempting PR creation, skip the PR step entirely if the user declines, and offer to amend or add a new commit if the target branch already has changes.
When to use - and when NOT to
Use it when you want a faster, smarter git workflow that groups changes logically and reduces manual confirmation overhead for routine commits and PRs. It explicitly must not bypass repository-specific maintainer rules, branch policies, or required review gates, and destructive or publishing actions (push, PR creation) always require explicit confirmation - it streamlines routine git flow, it does not remove accountability for those actions.
Inputs and outputs
Inputs: the current working tree's uncommitted/staged changes, plus one-word confirmations at each streamlined decision point (branch name, commit, push, PR).
Outputs: a logically grouped changes summary, a created git branch with a generated name, a commit with an auto-generated message, an optional push to the remote, and an optional PR with an auto-generated title and body.
git checkout -b "feature/add-user-auth"
git add -- src/api/client.ts src/api/types.ts
git push -u origin feature/add-user-auth
gh pr create --title "feature/add-user-auth" --body "..."
Who it's for
Developers who want a faster git workflow - automatic change grouping, branch naming, and commit message generation - while keeping explicit confirmation gates on push, PR creation, and any repository policy requirements.
FAQ
Common questions
Discussion
Questions & comments · 0
Sign In Sign in to leave a comment.