home / skills / krosebrook / source-of-truth-monorepo / git-pushing

This skill automates staging, committing, and pushing changes with conventional messages to remote branches, saving time and ensuring consistent git history.

This is most likely a fork of the git-pushing skill from benchflow-ai
npx playbooks add skill krosebrook/source-of-truth-monorepo --skill git-pushing

Review the files below or copy the command above to add this skill to your agents.

Files (1)
SKILL.md
2.2 KB
---
name: git-pushing
description: Stage, commit, and push git changes with conventional commit messages. Use when user wants to commit and push changes, mentions pushing to remote, or asks to save and push their work. Also activates when user says "push changes", "commit and push", or similar git workflow requests.
---

# Git Push Workflow

Stage all changes, create a conventional commit, and push to the remote branch.

## When to Use

Automatically activate when the user:
- Explicitly asks to push changes ("push this", "commit and push")
- Mentions saving work to remote ("save to github", "push to remote")
- Completes a feature and wants to share it
- Says phrases like "let's push this up" or "commit these changes"

## Workflow

### 1. Check Git Status

Run `git status` to understand:
- Which files have changed
- What will be committed
- Current branch name

### 2. Stage Changes

- Run `git add .` to stage all changes
- Alternatively, stage specific files if partial commit is needed

### 3. Create Commit Message

**If user provided a message:**
- Use it directly

**If no message provided:**
- Analyze changes using `git diff`
- Generate a conventional commit message:
  - Format: `type(scope): description`
  - Types: `feat`, `fix`, `refactor`, `docs`, `test`, `chore`
  - Keep description concise (50-90 characters)
  - Use imperative mood: "Add" not "Added"
- Always append Claude Code footer:
  ```
  🤖 Generated with [Claude Code](https://claude.com/claude-code)

  Co-Authored-By: Claude <[email protected]>
  ```

**Use heredoc format:**
```bash
git commit -m "$(cat <<'EOF'
commit message here

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
EOF
)"
```

### 4. Push to Remote

- Run `git push` to push commits
- If push fails due to diverged branches, inform user and ask how to proceed

### 5. Confirm Success

- Report commit hash
- Summarize what was committed
- Confirm push succeeded

## Examples

User: "Push these changes"
→ Check status, stage all, generate commit message, push

User: "Commit with message 'fix: resolve table extraction issue'"
→ Use provided message, push

User: "Let's save this to github"
→ Activate workflow, generate appropriate commit message

Overview

This skill stages, commits, and pushes Git changes using conventional commit messages. It automates status checks, staging, commit-message generation (or uses the user’s message), and pushing to the remote while reporting the results. It is tuned for a monorepo workflow and handles simple push conflicts by prompting the user for next steps.

How this skill works

The skill checks the working tree with git status, stages changes (all or selected files), then creates a conventional commit message if none is provided. It commits using a safe heredoc pattern that includes a standardized footer and then runs git push to send the commit to the current remote branch. If the push fails (e.g., diverged branches), it reports the error and asks how to proceed.

When to use it

  • When you explicitly ask to push changes (e.g., "push changes", "commit and push").
  • When you say you want to save or publish work to the remote ("save to github", "push to remote").
  • After finishing a feature or fix and you want to share it with the team.
  • When you need a conventional commit created automatically from the diffs.

Best practices

  • Run git status first to review modified files and the current branch.
  • Provide a commit message when you want full control; otherwise the skill will generate one from the diff using conventional commit types.
  • Prefer staging specific files for targeted commits instead of staging everything when unrelated changes exist.
  • If push fails due to divergence, pull or rebase locally and resolve conflicts before retrying; the skill will offer options but won’t force merges.
  • Keep commit descriptions concise (50–90 characters) and use the imperative mood (e.g., "Add", "Fix").

Example use cases

  • User: "Push these changes" — skill stages all, generates a conventional commit, and pushes.
  • User: "Commit with message 'fix: resolve table extraction issue'" — skill uses the provided message and pushes.
  • User finishing a feature branch who says "let's push this up" — skill prepares and pushes the branch to remote.
  • User wants to save progress to GitHub without crafting a message — skill analyzes diffs and creates a suitable conventional commit.

FAQ

Will this overwrite remote changes if branches diverge?

No. If a push fails due to divergence the skill reports the problem and asks whether to pull, rebase, or abort; it doesn’t force a destructive overwrite.

Can I stage only specific files?

Yes. You can request that specific files be staged instead of running a global git add . and the skill will stage only those paths.

What commit message format is used when none is provided?

The skill generates a conventional commit in the form type(scope): description using types like feat, fix, refactor, docs, test, and chore, and appends a standardized footer for traceability.