Skip to content
Back to skills

Push Commit

ASecurity

Stage all changes, commit with a descriptive message, and push to the remote. Trigger with "push commit", "commit and push", "push changes", "/push-commit".

  • 57 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added October 17, 2026
securitybashgitapi

Works with

  • api

Security analysis

A100/100

Scanned October 17, 2026

npx -y skills add diegosouzapw/awesome-omni-skill --skill push-commit --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Push Commit?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Push Commit
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/diegosouzapw-push-commit/badge)](https://www.skillsdirectory.com/skills/diegosouzapw-push-commit)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: push-commit
description: Stage all changes, commit with a descriptive message, and push to the remote. Trigger with "push commit", "commit and push", "push changes", "/push-commit".
---

# Push & Commit

Stage all local changes, generate a commit message, and push to the current branch's remote.

## Workflow

### Step 1: Check State

Run these in parallel:

- `git status` — see what's changed (never use `-uall`)
- `git diff --stat` — summary of staged and unstaged changes
- `git log --oneline -5` — recent commit messages for style reference
- `git branch --show-current` — confirm current branch

If there are no changes (no untracked files, no modifications), stop and tell the user there's nothing to commit.

### Step 2: Stage Changes

Run `git add -A` to stage everything.

**Exception:** If you see files that likely contain secrets (`.env`, `credentials.json`, API keys, tokens), do NOT stage them. Warn the user and list the suspicious files. Stage everything else by name.

### Step 3: Generate Commit Message

Analyze the staged diff and write a commit message that:

- Summarizes the nature of the changes (new feature, update, fix, refactor, docs, etc.)
- Focuses on the **why**, not the **what**
- Follows the style of recent commits in the repo
- Is 1-2 sentences max
- Ends with `Co-Authored-By: Claude <noreply@anthropic.com>`

Use a HEREDOC to pass the message:

```bash
git commit -m "$(cat <<'EOF'
Your commit message here.

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

### Step 4: Push

Run `git push origin <current-branch>`.

If the branch has no upstream, use `git push -u origin <current-branch>`.

### Step 5: Confirm

Run `git status` to verify the working tree is clean, and tell the user the commit hash and what was pushed.

## Edge Cases

- **No changes:** Tell the user there's nothing to commit. Don't create an empty commit.
- **Secrets detected:** Warn the user and skip those files. Stage and commit everything else.
- **Push fails (no upstream):** Retry with `-u` flag to set upstream tracking.
- **Push fails (rejected):** Tell the user — do NOT force push. Suggest `git pull --rebase` first.
- **Pre-commit hook fails:** Fix the issue, re-stage, and create a NEW commit (never amend).

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.