Skip to content

oprogramadorreal/optimus-claude / skills/commit

commit

Verified

Stages, commits, and optionally pushes local changes with a Conventional Commits message — always previews and confirms first, and offers a feature branch on protected branches. Modes: "suggest" proposes a message without committing (read-only); "branch [description]" creates and switches to a conventionally named branch, never committing or altering local changes. Multi-repo aware.

FileKindSize
README.mdmarkdown2.9 KB
SKILL.mdskill md7.0 KB
agents/openai.yamlconfig198 B
references/branch-naming.mdmarkdown1.5 KB
references/conventional-commit-format.mdmarkdown1.4 KB
# optimus:commit

A [Claude Code](https://docs.anthropic.com/en/docs/claude-code) git-hygiene skill: commit local changes with a [Conventional Commits](https://www.conventionalcommits.org/) message, preview a message without committing, or create a conventionally named branch.

## Modes

| Invocation | What it does | Modifies repo |
|---|---|---|
| `/optimus:commit` | Stages, commits, and optionally pushes after you confirm | Yes |
| `/optimus:commit suggest` | Proposes a commit message in a copyable code block | No — read-only |
| `/optimus:commit branch "description"` | Creates and switches to a `<type>/<slug>` branch (description optional — falls back to conversation context, then local diffs) | Branch only — never commits, stashes, or touches files |

## Features

- Analyzes staged, unstaged, and untracked changes; asks before including untracked files and flags secret-looking ones (`.env`, keys, credentials) for individual confirmation
- Always previews the branch, full message, and file list before committing — commit and push, commit only, edit the message, or cancel
- Detects protected branches via `.claude/hooks/restrict-paths.sh` and offers to create a feature branch automatically
- Suggests splitting into separate commits when changes span multiple concerns, with the files to stage for each
- Captures the implementation conversation's *why* into the commit body — run it in the conversation where the work happened
- Multi-repo workspaces: detects repos with changes and processes each independently
- Branch mode preserves all local changes exactly as they are and stops rather than invent a meaningless name when there is no naming signal

## Example — default mode

```
Branch: feat/signup-validation
Commit message:
  feat(auth): add email format validation to signup form

Files to stage:
  src/auth/validate.ts
  src/auth/__tests__/validate.test.ts

Action: Commit and push / Commit only / Edit message / Cancel
```

After confirming "Commit and push":

```
Committed: a1b2c3d feat(auth): add email format validation to signup form
Pushed to: origin/feat/signup-validation
```

## Example — branch mode

```
> /optimus:commit branch "fix login timeout"

## Branch

Created `fix/login-timeout` from `main`.
Local changes preserved (nothing committed or pushed).
```

## Related skills

- `/optimus:pr` — create a pull request after committing (commit first, then pr, in the same conversation)
- `/optimus:code-review` — review changes before committing
- `/optimus:worktree` — parallel work in an isolated directory (also creates a branch)

## Quick Start

This skill is part of the [optimus](https://github.com/oprogramadorreal/optimus-claude) plugin. See the [main README](../../README.md) for installation instructions.

## Requirements

- Optimus installed in a [supported host](../../README.md#supported-hosts-and-versions)
- Git

## License

[MIT](../../LICENSE)
receiving-code-reviewobra/superpowersUse when receiving code review feedback, before implementing suggestions, especially if feedback seems unclear or technically questionable - requires technical rigor and verification, not performative agreement or blind implementationStars: 321kUpdated Claude CodeCodexVerifiedInstall
requesting-code-reviewobra/superpowersUse when completing tasks, implementing major features, or before merging to verify work meets requirementsStars: 321kUpdated Claude CodeCodexVerifiedInstall
using-git-worktreesobra/superpowersUse when starting feature work that needs isolation from current workspace or before executing implementation plans - ensures an isolated workspace exists via native tools or git worktree fallbackStars: 321kUpdated Claude CodeCodexVerifiedInstall
verification-before-completionobra/superpowersUse when about to claim work is complete, fixed, or passing, before committing or creating PRs - requires running verification commands and confirming output before making any success claims; evidence before assertions alwaysStars: 321kUpdated Claude CodeCodexVerifiedInstall