Skip to content

Instantly share code, notes, and snippets.

@lajlev
Created November 24, 2025 08:35
Show Gist options
  • Select an option

  • Save lajlev/a1a712a4980565d6e12f80f3a3192f9a to your computer and use it in GitHub Desktop.

Select an option

Save lajlev/a1a712a4980565d6e12f80f3a3192f9a to your computer and use it in GitHub Desktop.

Git and Version Control (Claude Code & Antigravity)

Compatibility Note: The slash commands below (/branch, /m, /merge, /pr) are optimized for Claude Code and Antigravity.

Branch Management

  • Trigger with /branch.
  • Check the current branch and git status.
  • Use an LLM to suggest feature branch names based on the task.
  • Create and checkout new feature branches using the suggested names.
  • Push new branches to the remote repository; instructions can be provided by the LLM.

Committing Changes

  • Trigger with /m.
  • Use the LLM to draft commit messages encompassing recent changes.
  • Run git add for all modified files.
  • Follow with a git commit using the LLM-generated message.
  • Push changes to the remote repository.

Merging Requests

  • Trigger with /merge.
  • Verify with the LLM for any active PRs related to the current branch.
  • Merge PRs using best practices, potentially suggested by the LLM.
  • Employ GitHub CLI or manual steps to complete and confirm the merge.
  • Remove feature branches post-merge both locally and remotely.

Pull Requests

  • Trigger with /pr.
  • LLM can determine if the current branch is ready for a PR.
  • If changes are approved, create and checkout feature branches.
  • Add and commit changes; draft PRs with detailed descriptions.
  • Push changes and use GitHub CLI to facilitate pull requests to the main branch.

Fallback for Other AI Editors

If you are using an AI editor that does not support these slash commands (e.g., Cursor, Windsurf), use the >> syntax as a trigger:

  • >>branch → Read .agent/workflows/branch.md and execute steps.
  • >>m → Read .agent/workflows/m.md and execute steps.
  • >>merge → Read .agent/workflows/merge.md and execute steps.
  • >>pr → Read .agent/workflows/pr.md and execute steps.

Instruction for AI: When the user types >>[command], you MUST read the corresponding workflow file and strictly follow its instructions.

NEVER commit or push changes unless explicitly instructed by the user.

  • Do NOT use git commands (git add, git commit, git push) unless the user specifically asks
  • Do NOT use slash commands like /m, /pr, /branch, /merge unless the user invokes them
  • When making code changes, stop after the changes are complete and wait for user confirmation
  • If the user wants to commit, they will use /m or explicitly ask you to commit
  • ALWAYS ask the user if they want to commit changes before doing so

Exception Cases

You MAY commit/push ONLY when:

  • User explicitly says "commit", "push", "git add", etc.
  • User invokes a command (/m, /pr, /branch, /merge)
  • User asks "save these changes" or similar clear intent

Workflow

  1. Make code changes as requested
  2. Inform the user what was changed
  3. STOP and wait for user instruction
  4. Only proceed with git operations if explicitly told to do so

Remember: The user controls when code is committed, not you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment