Command Palette

Search for a command to run...

UnylyUnyly
Back to skills

commit

FreeRuns bundled scriptsNot checked

"Commit staged or intended changes: compose a Conventional Prefix or Natural Language message, then use ai-commit — with --all, --staged, --close, --finding…

PaulRBergby PaulRBerg★ 109 GitHub stars

About this skill

Git Commit

Compose the semantic commit message from immutable evidence. Let ai-commit own deterministic preparation, commit, index reconciliation, and push mechanics.

Run every command from the target repository cwd. Do not surround ai-commit with extra git status, git log, or git diff calls: preparation provides the complete evidence for this workflow. Use --porcelain only in deterministic automation that explicitly parses its stable TSV records. The normal skill flow consumes the human-readable sections.

1. Parse Arguments

Arguments: $ARGUMENTS

  • ai-commit selects the message format from repository config. Pass --natural or --conventional only as an explicit one-off override, never to reproduce repository policy.
  • --all: capture all worktree and index changes. This intentionally risks including another agent's work.
  • --staged: capture exactly the current index. Do not add session paths. It conflicts with --all.
  • --natural: force Natural Language Format for this commit.
  • --conventional: force Conventional Prefix Format for this commit.
  • --push: request a push after commit. Otherwise push only when standing instructions authorize it.
  • --rebase: with --push, let ai-commit rebase a behind branch onto its fetched upstream before the push. Pass it with every authorized push unless the user excludes it.
  • --close <issue_numbers>: pass one ai-commit commit --close <N> per positive decimal issue number. Accept comma- or space-separated input. ai-commit writes the Closes #N lines.
  • --finding <finding_ids>: pass one ai-commit commit --finding <id> per ledger finding this commit fixes. Accept comma- or space-separated input. Also infer a finding from context when this session's commit fixes a specific ledger finding. ai-commit writes the Finding-ID: <id> trailer and resolves the finding after the commit. Never include or resolve findings the commit does not actually fix.
  • --squash: replace every branch commit after the merge base with one commit that carries the net branch diff. The helper finds the merge base with the resolved default branch. Squash mode requires a clean tree and index and an attached non-default branch. It conflicts with --all, --staged, and --push.
  • --base <branch>: override default-branch detection. Use it only with --squash.
  • In Conventional Prefix Format, a positional type keyword overrides the inferred type. In Natural Language Format, a positional verb or category keyword overrides the inferred verb. Quoted positional text overrides the inferred description or subject.

If the requested operation is only to push a clean branch that is already ahead, skip preparation. Check the push destination below. Run ai-commit push --rebase only when a destination is available.

Push Destination

Before requesting a push, read the current branch with git symbolic-ref --short HEAD. Check git config --get branch.<name>.remote and git remote. Config exit 1 means the branch has no configured remote. Other command failures are errors, not evidence that no remote exists.

When no branch remote and no named remotes exist, omit --push and --rebase. Complete the local commit and report Push skipped: no remote configured. For push-only work, report the skip without invoking ai-commit push. Do not create a remote or retry. If the user requires remote publication, report the missing destination as a blocker.

ai-commit pushes to the configured upstream: branch.<name>.remote and branch.<name>.merge. The remote can be a named remote or a URL, even when git remote is empty. Without a branch remote, ai-commit uses origin. Other configured remotes do not replace origin automatically. If the upstream branch has a different name, branch.<name>.pushRemote must equal branch.<name>.remote. gh pr checkout writes this configuration for a PR that lets maintainers push.

When you work on an existing PR, get its head repository and branch from gh pr view before you commit or push. A push to another branch does not update the PR. If the upstream does not match the PR head, correct the branch configuration:

git config branch.<branch>.remote '<head-remote-or-url>'
git config branch.<branch>.merge 'refs/heads/<head-branch>'
git config branch.<branch>.pushRemote '<head-remote-or-url>'

Then push with ai-commit. Do not push manually. Do not force-push. If ai-commit refuses the destination, report its error. Before you report completion, read the PR again and verify that its head SHA matches the pushed commit.

Squash Mode

Enter squash mode only when the user explicitly requests a squash. Never infer it from branch state, a merge request, or standing instructions. When --squash is present, follow references/squash.md for the plan and reset steps. Then continue with steps 2 to 5 in --staged mode. Never pass --push in squash mode, even when st

Full SKILL.md on GitHub

Install commit in Claude Code & Claude Desktop

Sign up to install this skill

Create a free account to reveal the install command and save the skill to your library.

  • Reveal the one-line install command
  • Save skills to your synced library
  • Get notified when skills update
Sign up freeI already have an account

Allowed tools

Tools this skill is permitted to call.

No restriction — this skill can use any tool.

Bundled files

agents/openai.yamlreferences/failure-recovery.mdreferences/squash.mdscripts/git-squash.py

FAQ

What does the commit skill do?

"Commit staged or intended changes: compose a Conventional Prefix or Natural Language message, then use ai-commit — with --all, --staged, --close, --finding, or --push. Also squash a branch into one commit with --squash."

How do I install the commit skill?

Copy the skill folder into ~/.claude/skills (the Claude Code tab above does this in one command), or install it as a plugin.

Does the commit skill run scripts?

Yes, this skill bundles executable scripts. Review the source before installing.

Related skills

Compare commit with