agentleFS
mhenkemhenke/claude-code-unplugged/skills/commit-commands/SKILL.md

commit-commands

Skill1 starsChanged 6 months agoMITView on GitHub

Git commit and repository workflows

  • Reads credentials
  • Installs packages
  • Commits and pushes

1 other project uses a version of this.

Adopted by

Most recently taken up by

The file

Show its rules and text

We split this skill into the rules it gives an agent

24 rules. About 0 are common, 20 are distinctive, and 4 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈20

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 4

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    After merging and deleting remote branches

    line 133
  2. Distinctive:

    When your local branch list is cluttered with stale branches

    line 134
  3. Distinctive:

    Use for routine commits during development

    line 147
  4. Distinctive:

    Use when you're ready to create a PR

    line 150
  5. Distinctive:

    Ensure all your changes are complete and tested

    line 151
  6. Distinctive:

    Use when you want to minimize context switching

    line 154
  7. Distinctive:

    Run periodically to keep your branch list clean

    line 157
  8. Distinctive:

    Issue: No changes to commit

    line 198
  9. Distinctive:

    Ensure you have unstaged or staged changes

    line 201
  10. Distinctive:

    Run git status to verify changes exist

    line 202
  11. Distinctive:

    Ensure repository has a GitHub remote

    line 211
  12. Distinctive:

    Issue: No branches marked as [gone]

    line 215
  13. Distinctive:

    Run git fetch --prune to update remote tracking

    line 218
  14. Very specific:

    Combine with other tools: Use commit during development, then commit-push-pr when ready

    line 223
  15. Very specific:

    Regular cleanup: Run clean_gone weekly to maintain a clean branch list

    line 225
  16. Distinctive:

    Review before pushing: Always review the commit message and changes before pushing

    line 226
  17. Distinctive:

    After executing these commands, you will:

    line 281
  18. Distinctive:

    Delete all branches marked as [gone]

    line 285
  19. Distinctive:

    If no branches are marked as [gone], report that no cleanup was needed.

    line 288
  20. Distinctive:

    Create a new branch if on main

    line 305
  21. Distinctive:

    Create a single commit with an appropriate message

    line 306
  22. Very specific:

    Create a pull request using gh pr create

    line 308
  23. Very specific:

    Before executing commands or submitting reviews, you MUST output a structured XML <verification_gate> block evaluating the following checks:

    line 335
  24. Distinctive:

    Do not proceed until you have output this verification gate.

    line 346

≈ “Common” is an estimate: at least 1 in 5 of the 383,637 skill files we read have a rule of the same kind, not the same words. “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

Commit Workflows

Overview

Commit Commands Plugin

Streamline your git workflow with simple commands for committing, pushing, and creating pull requests.

Overview

The Commit Commands Plugin automates common git operations, reducing context switching and manual command execution. Instead of running multiple git commands, use a single slash command to handle your entire workflow.

Commands

commit

Creates a git commit with an automatically generated commit message based on staged and unstaged changes.

What it does:

  1. Analyzes current git status
  2. Reviews both staged and unstaged changes
  3. Examines recent commit messages to match your repository's style
  4. Drafts an appropriate commit message
  5. Stages relevant files
  6. Creates the commit

Usage:

/commit

Example workflow:

# Make some changes to your code
# Then simply run:
/commit

# Claude will:
# - Review your changes
# - Stage the files
# - Create a commit with an appropriate message
# - Show you the commit status

Features:

  • Automatically drafts commit messages that match your repo's style
  • Follows conventional commit practices
  • Avoids committing files with secrets (.env, credentials.json)
  • Includes coding assistant attribution in commit message

commit-push-pr

Complete workflow command that commits, pushes, and creates a pull request in one step.

What it does:

  1. Creates a new branch (if currently on main)
  2. Stages and commits changes with an appropriate message
  3. Pushes the branch to origin
  4. Creates a pull request using gh pr create
  5. Provides the PR URL

Usage:

/commit-push-pr

Example workflow:

# Make your changes
# Then run:
/commit-push-pr

# Claude will:
# - Create a feature branch (if needed)
# - Commit your changes
# - Push to remote
# - Open a PR with summary and test plan
# - Give you the PR URL to review

Features:

  • Analyzes all commits in the branch (not just the latest)
  • Creates comprehensive PR descriptions with:
    • Summary of changes (1-3 bullet points)
    • Test plan checklist
    • coding assistant attribution
  • Handles branch creation automatically
  • Uses GitHub CLI (gh) for PR creation

Requirements:

  • GitHub CLI (gh) must be installed and authenticated
  • Repository must have a remote named origin

clean_gone

Cleans up local branches that have been deleted from the remote repository.

What it does:

  1. Lists all local branches to identify [gone] status
  2. Identifies and removes worktrees associated with [gone] branches
  3. Deletes all branches marked as [gone]
  4. Provides feedback on removed branches

Usage:

/clean_gone

Example workflow:

# After PRs are merged and remote branches are deleted
/clean_gone

# Claude will:
# - Find all branches marked as [gone]
# - Remove any associated worktrees
# - Delete the stale local branches
# - Report what was cleaned up

Features:

  • Handles both regular branches and worktree branches
  • Safely removes worktrees before deleting branches
  • Shows clear feedback about what was removed
  • Reports if no cleanup was needed

When to use:

  • After merging and deleting remote branches
  • When your local branch list is cluttered with stale branches
  • During regular repository maintenance

Installation

This plugin is included in the coding assistant repository. The commands are automatically available when using coding assistant.

Best Practices

Using commit

  • Review the staged changes before committing
  • Let Claude analyze your changes and match your repo's commit style
  • Trust the automated message, but verify it's accurate
  • Use for routine commits during development

Using commit-push-pr

  • Use when you're ready to create a PR
  • Ensure all your changes are complete and tested
  • Claude will analyze the full branch history for the PR description
  • Review the PR description and edit if needed
  • Use when you want to minimize context switching

Using clean_gone

  • Run periodically to keep your branch list clean
  • Especially useful after merging multiple PRs
  • Safe to run - only removes branches already deleted remotely
  • Helps maintain a tidy local repository

Workflow Integration

Quick commit workflow:

# Write code
/commit
# Continue development

Feature branch workflow:

# Develop feature across multiple commits
/commit  # First commit
# More changes
/commit  # Second commit
# Ready to create PR
/commit-push-pr

Maintenance workflow:

# After several PRs are merged
/clean_gone
# Clean workspace ready for next feature

Requirements

  • Git must be installed and configured
  • For commit-push-pr: GitHub CLI (gh) must be installed and authenticated
  • Repository must be a git repository with a remote

Troubleshooting

commit creates empty commit

Issue: No changes to commit

Solution:

  • Ensure you have unstaged or staged changes
  • Run git status to verify changes exist

commit-push-pr fails to create PR

Issue: gh pr create command fails

Solution:

  • Install GitHub CLI: brew install gh (macOS) or see GitHub CLI installation
  • Authenticate: gh auth login
  • Ensure repository has a GitHub remote

clean_gone doesn't find branches

Issue: No branches marked as [gone]

Solution:

  • Run git fetch --prune to update remote tracking
  • Branches must be deleted from the remote to show as [gone]

Tips

  • Combine with other tools: Use commit during development, then commit-push-pr when ready
  • Let Claude draft messages: The commit message analysis learns from your repo's style
  • Regular cleanup: Run clean_gone weekly to maintain a clean branch list
  • Review before pushing: Always review the commit message and changes before pushing

Author

Anthropic (support@anthropic.com)

Version

1.0.0

Commands / Workflows

Command: clean_gone

Description: Cleans up all git branches marked as [gone] (branches that have been deleted on the remote but still exist locally), including removing associated worktrees.

Your Task

You need to execute the following bash commands to clean up stale local branches that have been deleted from the remote repository.

Commands to Execute

  1. First, list branches to identify any with [gone] status Execute this command:

    git branch -v

    Note: Branches with a '+' prefix have associated worktrees and must have their worktrees removed before deletion.

  2. Next, identify worktrees that need to be removed for [gone] branches Execute this command:
    git worktree list
  3. Finally, remove worktrees and delete [gone] branches (handles both regular and worktree branches) Execute this command:
    # Process all [gone] branches, removing '+' prefix if present
    git branch -v | grep '\[gone\]' | sed 's/^[+* ]//' | awk '{print $1}' | while read branch; do
      echo "Processing branch: $branch"
      # Find and remove worktree if it exists
      worktree=$(git worktree list | grep "\\[$branch\\]" | awk '{print $1}')
      if [ ! -z "$worktree" ] && [ "$worktree" != "$(git rev-parse --show-toplevel)" ]; then
        echo "  Removing worktree: $worktree"
        git worktree remove --force "$worktree"
      fi
      # Delete the branch
      echo "  Deleting branch: $branch"
      git branch -D "$branch"
    done

Expected Behavior

After executing these commands, you will:

  • See a list of all local branches with their status
  • Identify and remove any worktrees associated with [gone] branches
  • Delete all branches marked as [gone]
  • Provide feedback on which worktrees and branches were removed

If no branches are marked as [gone], report that no cleanup was needed.


Command: commit-push-pr

Description: Commit, push, and open a PR

Context

  • Current git status: (Retrieve by running git status with your bash tool)
  • Current git diff (staged and unstaged changes): (Retrieve by running git diff HEAD with your bash tool)
  • Current branch: (Retrieve by running git branch --show-current with your bash tool)

Your task

Based on the above changes:

  1. Create a new branch if on main
  2. Create a single commit with an appropriate message
  3. Push the branch to origin
  4. Create a pull request using gh pr create
  5. You have the capability to call multiple tools in a single response. You MUST do all of the above in a single message. Do not use any other tools or do anything else. Do not send any other text or messages besides these tool calls.

Command: commit

Description: Create a git commit

Context

  • Current git status: (Retrieve by running git status with your bash tool)
  • Current git diff (staged and unstaged changes): (Retrieve by running git diff HEAD with your bash tool)
  • Current branch: (Retrieve by running git branch --show-current with your bash tool)
  • Recent commits: (Retrieve by running git log --oneline -10 with your bash tool)

Your task

Based on the above changes, create a single git commit.

You have the capability to call multiple tools in a single response. Stage and create the commit using a single message. Do not use any other tools or do anything else. Do not send any other text or messages besides these tool calls.


🔒 Pre-Execution Verification Gate

Before executing commands or submitting reviews, you MUST output a structured XML <verification_gate> block evaluating the following checks:

  • conventions: All changes align with target guidelines. (PASS/FAIL)
  • correctness: Verify code correctness and lack of logical bugs. (PASS/FAIL)

Example output format:

<verification_gate>
  <conventions>PASS</conventions>
  <correctness>PASS</correctness>
</verification_gate>

Do not proceed until you have output this verification gate.

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.