agentleFS
AbilityaiAbilityai/cornelius/.claude/skills/git-commit-push/SKILL.md

git-commit-push

Skill109 starsChanged 35 days agoMITView on GitHub

Stage, commit, and push changes to remote repository with approval gate

  • Commits and pushes

9 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

8 rules. 0 are common, 7 are distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 6 edited versions we read keep these.

  • 7

    Distinctive

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Commit and push changes to the remote repository.

    line 11
  2. Distinctive:

    If no changes, inform user and exit.

    line 43
  3. Distinctive:

    Ask for commit message (suggest based on changes)

    line 62
  4. Distinctive:

    Use AskUserQuestion with options:

    line 65
  5. Distinctive:

    Ask which files to stage

    line 89
  6. Distinctive:

    Always shows diff before committing (safety gate)

    line 147
  7. Very specific:

    Does NOT use --force push (safety)

    line 149
  8. Distinctive:

    Does NOT amend existing commits (safety)

    line 150

“Common” is measured: kept by at least 6 in 10 of the 6 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Git Commit and Push

Commit and push changes to the remote repository. Shows diff for approval before committing.

Purpose

Safely commit and push all staged and unstaged changes to the remote repository. Presents changes for review before committing to prevent accidental commits.

State Dependencies

SourceLocationReadWriteDescription
Git status.git/XCurrent repo state
Working directory./XModified files
Remote repositoryoriginXPush destination

Prerequisites

  • Git repository initialized
  • Remote origin configured
  • Changes to commit (untracked or modified files)

Process

Step 1: Check Repository State

# Show current branch
git branch --show-current

# Check if there are changes to commit
git status --short

If no changes, inform user and exit.

Step 2: Review Changes (APPROVAL GATE)

Present the changes for review:

# Show summary of changes
git status

# Show detailed diff of modified files (not untracked)
git diff

# Show staged changes if any
git diff --cached

Ask user:

  1. Show the list of files that will be committed
  2. Ask for commit message (suggest based on changes)
  3. Confirm before proceeding

Use AskUserQuestion with options:

  • "Commit all changes" (Recommended)
  • "Select specific files"
  • "Cancel"

Step 3: Stage and Commit

Based on user choice:

If "Commit all changes":

# Stage all changes
git add -A

# Commit with user-provided message
git commit -m "$(cat <<'EOF'
[commit message here]

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
EOF
)"

If "Select specific files":

  • Ask which files to stage
  • Stage only those files
  • Commit

Step 4: Push to Remote

# Push to current branch's upstream
git push

# If no upstream, push with -u flag
git push -u origin $(git branch --show-current)

Step 5: Verify

# Confirm push succeeded
git log --oneline -1

# Show remote status
git status

Completion Checklist

  • Repository state checked
  • Changes reviewed by user
  • Commit message approved
  • Changes committed
  • Pushed to remote
  • Push verified

Error Recovery

ErrorRecovery
No changes to commitInform user, exit gracefully
No remote configuredAsk user to configure: git remote add origin <url>
Push rejected (non-fast-forward)Suggest git pull --rebase first
Authentication failedCheck SSH keys or credentials
Branch protectionInform user, suggest PR workflow

Usage Examples

Basic usage:

/git-commit-push

After a work session:

User: commit and push my changes
Agent: [runs this skill]

Notes

  • Always shows diff before committing (safety gate)
  • Adds Co-Authored-By trailer for AI contributions
  • Does NOT use --force push (safety)
  • Does NOT amend existing commits (safety)

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.