agentleFS
Diego-RomeroDiego-Romero/claude-skills/commit-push/SKILL.md

commit-push

Skill0 starsChanged 9 months agoMITView on GitHub

Stage, commit, and push changes on the current branch. If the user provides $ARGUMENTS, use it as the commit message. Otherwise, analyze the changes and generate a conventional commit message. Check if the project uses a pre-commit hook that auto-formats code: If a pre-commit hook exists that runs formatting, there's no need to run checks manually before committing. If no pre-commit hook is found, detect a verification command: Store as $VERIFY_CMD. If nothing found, skip verification. Identify what changed. Exclude…

  • Reads credentials
  • Commits and pushes

19 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use open-pr.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • Google CloudSkill

    open-pr

    Commits local changes to a new Git branch and opens a GitHub pull request through the configured GitHub MCP server. Use when proposing code changes in a new pull request. Don't use for local-only commits without a remote GitHub repository.

    Also in 3 projects that use this

The file

We split this skill into the rules it gives an agent

12 rules. 0 are common, 7 are distinctive, and 5 are very specific to this project.

  • 0

    Common

    Most of the 16 edited versions we read keep these.

  • 7

    Distinctive

    This author's own choices. Worth a look.

  • 5

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  • could be automatic: a setting could enforce it
  1. Distinctive:

    If the user provides $ARGUMENTS, use it as the commit message.

    line 12
  2. Distinctive:

    Check if the project uses a pre-commit hook that auto-formats code:

    line 19
  3. Very specific:

    Look for husky in package.json (Node.js projects)

    line 21
  4. Very specific:

    Look for .pre-commit-config.yaml (Python/general projects)

    line 22
  5. Very specific:

    Look for .husky/ directory

    line 23
  6. Distinctive:

    If a pre-commit hook exists that runs formatting, there's no need to run checks manually before committing.

    line 25
  7. Distinctive:

    If no pre-commit hook is found, detect a verification command:

    line 30
  8. Very specific:

    package.json: Look for scripts: check → lint

    line 32
  9. Very specific:

    Makefile: Look for targets: check → lint

    line 33
  10. Distinctive:

    Use a conventional commit message following this format:

    line 62
  11. Distinctive:

    If the branch has no upstream, use:

    line 88
  12. Distinctive:

    If push is rejected (non-fast-forward), stop and ask the user how to proceed.

    line 94

“Common” is measured: kept by at least 6 in 10 of the 16 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

Stage, commit, and push changes on the current branch.

If the user provides $ARGUMENTS, use it as the commit message. Otherwise, analyze the changes and generate a conventional commit message.

Pre-flight: Auto-detect Environment

Step 0.1: Find Pre-commit Hook Info

Check if the project uses a pre-commit hook that auto-formats code:

  • Look for husky in package.json (Node.js projects)
  • Look for .pre-commit-config.yaml (Python/general projects)
  • Look for .husky/ directory

If a pre-commit hook exists that runs formatting, there's no need to run checks manually before committing.

Step 0.2: Find Verification Command (optional)

If no pre-commit hook is found, detect a verification command:

  1. package.json: Look for scripts: check → lint
  2. Makefile: Look for targets: check → lint
  3. Cargo.toml: cargo clippy
  4. pyproject.toml: ruff check
  5. go.mod: go vet ./...

Store as $VERIFY_CMD. If nothing found, skip verification.

Steps

1. Review changes

git status
git diff
git diff --cached

Identify what changed. Exclude files that shouldn't be committed:

  • .env or credentials files
  • Vendored/dead files that are no longer used
  • Build output or generated code that should be gitignored

2. Stage relevant files

Stage files individually by name. Do not use git add -A or git add ..

3. Create commit

Use a conventional commit message following this format:

<type>: <short description>

<optional body with details>

Types: feat, fix, docs, refactor, chore, test, perf

Pass the message via HEREDOC:

git commit -m "$(cat <<'EOF'
<message here>

EOF
)"

4. Push

git push

If the branch has no upstream, use:

git push -u origin $(git branch --show-current)

If push is rejected (non-fast-forward), stop and ask the user how to proceed. Do not force push without explicit permission.

5. Confirm

Show the commit hash, message, and branch. Confirm the push succeeded.

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.