Git workflow plugin that generates .gitignore files, runs preflight checks, and ships commits as PRs.
- version
- 2.1.0
- GitHub stars
- 37
What it does
- Adds 3 skills (
/git-init,/git-commit-push-pr,/git-preflight) for ignore files, shipping, and quality checks - Covers typecheck, lint, format, security, and test checks across Node.js, Python, .NET, Go, and Rust projects
- Enforces a safe shipping flow: secret-file skipping, no force pushes, and branch creation when committing to main
- Designed for teams that want commits and PRs written in their repo's own commit message style
Generates .gitignore files, runs typecheck, lint, format, security and test checks before you commit, and commits, pushes and opens a PR with a message in your repo's style
Add marketplace
/plugin marketplace add charlesjones-dev/claude-code-plugins-devRun it inside Claude Code once, then install the plugin below.
Install
/plugin install ai-git@ai-agent-pluginsRun it inside Claude Code after adding the marketplace.
Files
Discovered from source/git-commit-push-pr - Commit, Push, PR
Commit the current changes, push them, and open a pull request. Ask the user where to commit and where the PR should merge, and never assume either.
Ask every question with the AskUserQuestion tool when it's available, so the user can answer with one pick. Otherwise ask in plain text, number the options, and wait for the answer.
Arguments
The text typed after the command holds the arguments. In Claude Code it is inserted here: $ARGUMENTS. In other agents, read it from the user's message. It may be empty.
--preflight: run the git-preflight skill with--fixbefore anything else (Step 1).--no-pr: commit and push, then stop without opening a PR.
The two can be combined. Ignore anything else in the arguments, including a commit message, and say in one line that you did: the message comes from the diff.
Step 1: Preflight (only with --preflight)
Run the git-preflight skill from this plugin with --fix as its arguments. It runs the project's typecheck, lint, format, security and test checks, applies the auto-fixes it can without asking, and re-runs what failed.
- Claude Code: call the Skill tool with skill
ai-git:git-preflightand args--fix. - Codex and Cursor: load the
git-preflightskill from this plugin (Codex lists it asai-git:git-preflight), and follow its instructions with--fixas its arguments.
If the skill can't be loaded, stop and tell the user to run /git-preflight --fix ($ai-git:git-preflight --fix in Codex), then run this command again without --preflight.
When preflight finishes:
- It applied fixes: stop. Tell the user what failed and what was fixed, ask them to review the fixes, and tell them to run this command again once they're satisfied.
- Problems remain that it couldn't fix: stop and report them.
- Every check passed with no fixes: continue. If the project has no checks configured, say so and continue.
Step 2: Analyze the changes
git branch --show-currentgit status(never-uall, which can exhaust memory on large repos). If there is nothing to commit (no untracked files and no modifications), tell the user and stop.git diffandgit diff --stagedto see the changes.git log -5 --format='%s'to see the repo's commit message style.
Step 3: Pick the branch
Ask where to commit:
- On
main,masteror the repo's default branch: don't commit there. Offer:- "Create new branch" (description: "Create a feature/fix branch for these changes")
- The user can type a branch name instead ("Other" in AskUserQuestion).
- On any other branch (staging, feature/, fix/, etc.), offer:
- "Current branch ({branch_name})" (description: "Commit directly to {branch_name}"), first and recommended
- "Create new branch" (description: "Create a new branch off {branch_name} for these changes")
If the user picks "Create new branch", name it after the change in the style of the repo's branches (feat/..., fix/...). If they typed a name, use it. Then git checkout -b <branch_name>.
Step 4: Stage and commit
-
Stage the changed files by name. Don't use
git add .orgit add -A. -
Never stage files that look like secrets:
.env,.env.*,credentials.*,*.key,*.pem,*.secretand similar. If any are present, skip them and warn the user. -
Write a concise commit message that says what changed and why, follows the style from Step 2, and uses conventional commit prefixes (
feat:,fix:,docs:) if the repo uses them. -
Add no AI attribution to the commit: no
Co-Authored-Bytrailer, no "Generated with" line, and nothing else that credits Claude, Codex, Cursor or another agent. -
Pass the message through a HEREDOC:
git commit -m "$(cat <<'EOF' your commit message here EOF )"
Step 5: Push
- Check for an upstream:
git rev-parse --abbrev-ref --symbolic-full-name @{u} 2>/dev/null - With no upstream,
git push -u origin <branch>. Otherwisegit push. - If the push is rejected, report why and stop. Never force push.
With --no-pr, show the branch and commit hash, and stop here.
Step 6: Pick the PR target
Opening a PR needs the GitHub CLI (gh), installed and authenticated. If it isn't, say so and stop: the commit is already pushed.
If the branch already has an open PR (gh pr view --json url,state shows OPEN), the push updated it. Give its URL and stop.
Gather context:
# The repo's default branch
gh repo view --json defaultBranchRef --jq .defaultBranchRef.name
# Whether staging exists on origin
git ls-remote --heads origin staging
Ask where the PR should merge, with options built from what exists:
- On
staging: offer only the default branch. - On any other branch:
- If
stagingexists on origin: "staging" (description: "Merge into staging for pre-production review"), first and recommended, then the default branch (description: "Merge directly into {default}"). - Otherwise: the default branch (description: "Merge into {default}"), recommended.
- If
The user can always type another branch name.
Step 7: Open the PR
-
git fetch origin <target>, thengit log origin/<target>..HEAD --onelineandgit diff origin/<target>...HEADto see everything the PR includes. Check that it matches the goal of the change, and nothing else. -
Write the title and body:
- Title: under 70 characters, in the style of the repo's recent PR titles (
gh pr list --state merged --limit 5 --json title), since PR titles often become commit messages. Say what the change does for the user, not how it works: "Cut websocket message size by about 70% with compression", not "Negotiate permessage-deflate on the websocket". - Summary: open with the problem in a sentence or two of plain words, as the user described it. Then say briefly how the change fixes it. Don't lead with a list of every file, function or entry point the change touches. Add up to 3 bullets only for changes a reviewer could miss.
- Test plan: list only what was actually run: the preflight checks with
--preflight, commands run in this session, or testing the user described. If nothing was run, write "Not tested" and one sentence on what needs checking. - End the body with an attribution line for the agent running this skill:
š¤ Generated with [Claude Code](https://claude.com/claude-code)in Claude Code,š¤ Generated with [Codex](https://openai.com/codex)in Codex, orš¤ Generated with [Cursor](https://cursor.com)in Cursor. - Check the title and body, including anything quoted, for secrets and private details.
- Title: under 70 characters, in the style of the repo's recent PR titles (
-
Create it with
gh pr createas a real PR, not a draft, so review bots run. Pass the body through a HEREDOC:gh pr create --base <target> --title "the pr title" --body "$(cat <<'EOF' ## Summary <the problem, then the fix, in a few sentences> ## Test plan <what was actually run> <attribution line for the agent running this skill> EOF )"If it fails because the GitHub GraphQL rate limit is used up, open the PR through the REST API, which has its own limit. Write the body to a file, then run
gh api repos/{owner}/{repo}/pulls -f title="<title>" -f head=<branch> -f base=<target> -F body=@<file>. -
Give the user the PR URL.
Rules
- Ask the branch and PR target questions every time. Never assume.
- Never commit or push directly to
main,masteror the default branch. - Never force push.
- Never use
git status -uall. - Never commit files that look like secrets.
- No AI attribution in commit messages. The PR body ends with the line naming the agent that ran the skill.
- If there is nothing to commit, say so and stop.
Step 7's guidance on PR titles and descriptions is adapted from file-pr in tstack by Theo Browne (MIT). See THIRD-PARTY-NOTICES.md in this plugin.
Readme
AI-Git plugin
Generates .gitignore files, runs your project's checks before you commit, and commits, pushes and opens a PR with a message in your repo's style. It runs in Claude Code, Codex and Cursor.
Available skills
/git-init
Create or update .gitignore with patterns for your project's technology stack.
What it does
- Detects technologies in your project (Node.js, Python, .NET, Go, Rust, PHP, Ruby, Java, Docker, etc.)
- Adds ignore patterns for each detected technology
- Handles environment files, build artifacts, dependencies, OS files, and IDE files
- Merges with an existing .gitignore, keeping your custom patterns and comments
- Groups patterns into commented sections
- Shows a preview and asks before writing
Usage
/git-init
/git-commit-push-pr
Commit, push and open a pull request in one interactive flow. Two flags change what it does:
--preflightruns/git-preflight --fixfirst. If preflight applied fixes, it stops so you can review them before running the command again. If problems remain that preflight couldn't fix, it stops and reports them.--no-prcommits and pushes without opening a PR.
What it does
- Reads
git status, the diff and your last five commit subjects. Stops early if there's nothing to commit - Asks whether to commit to the current branch or a new one. On main, master or the default branch, it creates a new branch
- Stages the changed files by name, skipping secrets (
.env,credentials.*,*.key,*.pem, etc.) - Writes a concise message that says what changed and why, with conventional commit prefixes (
feat:,fix:,docs:) if your repo uses them. It adds no AI attribution to the commit - Pushes, setting upstream with
-uif needed. It never force pushes. With--no-pr, it stops here and shows the commit hash - Asks for the PR target, offering staging first when it exists on origin, then the default branch
- Opens the PR with a title that says what the change does for the user, a summary that starts with the problem and then the fix, a test plan that lists only what was run, and a last line naming the agent that ran the skill (Claude Code, Codex or Cursor)
- Checks the title and body for secrets, and opens the PR through GitHub's REST API when the GraphQL rate limit is used up. It returns the PR's URL. If the branch already has an open PR, the push updates it and you get its URL
/git-commit-push is now /git-commit-push-pr --no-pr.
Usage
/git-commit-push-pr # Commit, push and open a PR
/git-commit-push-pr --no-pr # Commit and push only
/git-commit-push-pr --preflight # Run /git-preflight --fix first, then commit, push and open a PR
/git-commit-push-pr --preflight --no-pr # Run the checks, then commit and push
/git-preflight
Run your project's code quality checks before a commit, PR or deploy.
What it does
- Detects the quality tools each ecosystem in the project has configured
- Runs checks in this order: typecheck, lint, format check, security, tests
- Detects security tools: pnpm/npm/yarn audit, pip-audit, safety, cargo audit, eslint-plugin-security and Semgrep
- Finds Semgrep through package.json scripts, config files, CI workflows or README docs, with a Docker fallback
- Reports each check as pass, warning or fail
- Asks before fixing, or fixes without asking with
--fix - Uses the project's own scripts (
npm run lintover raweslint)
The agent also runs it when you ask to check code before committing.
Usage
/git-preflight # Interactive mode (default)
/git-preflight --fix # Auto-fix all fixable issues
/git-preflight --check-only # Report only, no fixes
/git-preflight --verbose # Show detailed output
In Codex, run it as $ai-git:git-preflight.
Supported ecosystems
| Ecosystem | Type check | Lint | Format | Security | Test |
|---|---|---|---|---|---|
| Node.js/TypeScript | tsc | ESLint, Biome | Prettier | pnpm/npm/yarn audit, eslint-plugin-security, Semgrep | Jest, Vitest |
| Python | MyPy | Ruff | Black, Ruff | pip-audit, safety, Semgrep | Pytest |
| .NET | dotnet build | Analyzers | dotnet format | Semgrep | dotnet test |
| Go | go build | golangci-lint | gofmt | Semgrep | go test |
| Rust | cargo check | Clippy | cargo fmt | cargo audit, Semgrep | cargo test |
Use --fix locally and --check-only in CI, and keep local checks in line with your CI configuration.
Removed and moved skills (October 2026)
| Skill | Status |
|---|---|
/git-commit-push | Merged into /git-commit-push-pr. Run /git-commit-push-pr --no-pr |
/git-pr-codex-loop | Removed. Claude Code's built-in /code-review --fix covers review-and-fix loops, and /workflow-babysit in ai-workflow (Claude Code only) still answers Codex Code Review findings while it takes a branch through merge and deploy |
/workflow-ship (ai-workflow) | Moved here as /git-commit-push-pr --preflight |
/workflow-preflight (ai-workflow) | Moved here as /git-preflight |
Installation
Claude Code:
/plugin marketplace add charlesjones-dev/ai-agent-plugins
/plugin install ai-git@ai-agent-plugins
Codex:
codex plugin marketplace add charlesjones-dev/ai-agent-plugins
codex plugin add ai-git@ai-agent-plugins
Cursor: add this repository as a team marketplace, or copy this folder to ~/.cursor/plugins/local/ai-git. See the Cursor install steps.
Requirements
- Opening a PR needs the GitHub CLI (
gh), installed and authenticated.--no-prdoesn't /git-preflightruns the tools your project already has. It doesn't install them
Example commits
The plugin follows your repository's style.
For repos using conventional commits:
feat: add user authentication middleware
fix: resolve memory leak in websocket handler
docs: update API endpoint documentation
refactor: simplify error handling logic
For repos with a plain style:
Add user authentication middleware
Fix memory leak in websocket handler
Update API endpoint documentation
Simplify error handling logic
When to write the message yourself
- Major releases or version bumps
- Breaking changes that need a detailed explanation
- Merge commits with conflicts
- Commits that need specific issue references
Plugin details
- Name: AI-Git Plugin
- Version: 2.1.0
- Skills:
/git-init,/git-commit-push-pr,/git-preflight - License: MIT
- Author: Charles Jones
Credits
The guidance /git-commit-push-pr follows for PR titles and descriptions is adapted from file-pr in tstack by Theo Browne, under the MIT license. THIRD-PARTY-NOTICES.md has the license.
Contributing
Bug reports and fixes are welcome. See CONTRIBUTING.md.
License
MIT License. See LICENSE.
Details
- Marketplace
- charlesjones-dev/claude-code-plugins-dev
- Source
- plugins/ai-git
- Author
- Charles Jones
- Category
- Community
- Keywords
- ai, git, commit, commits, automation, productivity, devops, version-control, pull-request, gitignore, preflight, code-quality, typecheck, lint, testing, semgrep
- Listed since
- Apr 7, 2026
More from charlesjones-dev/claude-code-plugins-dev
All 17Similar to ai-git
More Git & Releases
fuse-commit-proPluginfusengine/agents36 starsProfessional git commits with Conventional Commits, GitHub Flow branch enforcement, auto PR creation, security validation, and auto-detection
conventional-commitSkillgithub/awesome-copilot17.4K installsStructured XML prompt that generates Conventional Commits messages and runs the final git commit automatically.
git-commit-pushSkillzc277584121/mygitplugin3.4K installsCommit local changes and push them to origin, with no pull request, using enforced signoff and authorship.
git-smartPluginCaptainCrouton89/crouton-kit25 starsSmart git commits with security and quality review
ai-workflowPlugincharlesjones-dev/claude-code-plugins-dev37 starsTakes a branch to production through Claude Code, Codex and Cursor Bugbot review, merge and a watched deploy, or stops when the PR is ready to merge. Also runs
smart-commitPluginrohitg00/awesome-claude-code-toolkit2.8K starsIntelligent git commits with conventional format, semantic analysis, and changelog generation
