Skip to content
Back to skills

Commit

ASecurity

Create a Git commit from the intended changes, with the simplify cleanup gate and precise staging. Does not push.

  • 2 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added September 25, 2026
ai-agentsbashrailsgitdocumentation

Works with

  • claude code

Security analysis

A100/100

Pro scans all 2 files and shows the line behind each finding

Scanned September 27, 2026

npx -y skills add gtapps/skills --skill commit --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Commit?

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

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

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: commit
description: "Create a Git commit from the intended changes, with the simplify cleanup gate and precise staging. Does not push."
---

# Commit

Create one deliberate commit without sweeping in unrelated user work.

## Establish scope

Resolve the repository root with `git rev-parse --show-toplevel` and run Git operations there. In Claude Code, use a separate Bash call to `cd` to the returned literal path; its worktree checker rejects Git command substitutions.

Inspect `git status --short` and `git diff --staged --stat`.

- If changes are staged, respect that exact staged scope.
- If nothing is staged and this session created or edited known paths, exclude secrets and scratch files, then stage only the intended paths with `git add -- <paths>`.
- If nothing is staged and session ownership is unclear, show modified and untracked paths and ask what belongs. Do not guess.
- Never use git add ., git add -A, or git add -u.

Before cleanup, record staged files that also have unstaged changes. Inspect the staged path list for secret-shaped files such as .env, credentials files, private keys, PEM files, tokens, or generated secret material. If any are staged, stop and flag paths without printing secret contents.

## Simplify the staged diff

Unless the user passed `--no-simplify` or explicitly requested skipping cleanup for a trivial typo, documentation, or comment-only commit:

1. Invoke the available `simplify` skill in staged-only mode, and say the scope in plain words: review and edit only what `git diff --staged` shows, leaving unstaged and untracked work out. Claude Code's bundled `/simplify` has no mode parameter and reads its argument as a review target, so the plain wording is what keeps it on the staged diff.
2. Surface its concise report.
3. Re-stage each file simplify changed only when that file had no pre-existing unstaged changes.
4. If a changed file already had unstaged work, stop. A whole-file git add would mix unrelated hunks; let the user stage the cleanup interactively or authorize the whole file.

If simplify made no edits, continue.

## Commit

1. Show git diff --staged --stat.
2. Inspect git diff --staged and git log -5 --oneline to understand intent and local message style.
3. Draft a concise message focused on why the change exists. Use Conventional Commits only when the repository does.
4. Run `git commit -m` with the selected message. Existing commit authorization covers choosing the message; do not ask for another confirmation.
5. If a hook fails, fix the cause, re-stage only intended paths, and create a new commit attempt. Never bypass the hook or amend a previous commit.
6. Run git status and report the commit identifier, subject, and outstanding changes.

## Guardrails

- Never push unless the user separately asks.
- Never amend, use --no-verify, disable signing, or add AI attribution trailers unless requested.
- Never claim cleanup or checks ran when they did not.

Files in this skill

  • SKILL.md2.6 KB
  • agents/openai.yaml207 B

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…