/optimus:commit [suggest | branch [description]]from optimus
Stages, commits, and optionally pushes changes with Conventional Commits messages. Always previews and confirms first. Offers feature branches on protected branches. Modes: suggest (read-only message proposal) and branch (create/switch to a named branch). Multi-repo aware.
Ships in optimus. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description, though model invocation is off: only you can start it.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Pick the mode from the arguments: suggest → Suggest mode; branch (optionally followed by a description) → Branch mode; anything else → Default mode.
Multi-repo: if git rev-parse --is-inside-work-tree does not return true, read $CLAUDE_PLUGIN_ROOT/skills/init/references/multi-repo-detection.md and apply it. When it returns true, resolve the repository root with git rev-parse --show-toplevel, including in a linked worktree or subdirectory. In a workspace, git commands run inside each child repo; Default and Suggest modes process each repo with changes independently (per-repo steps, per-repo preview under a ## <repo-name> heading, one combined final summary); Branch mode targets a single repo (its step 1).
Gather changes: git diff --cached, git diff, git status --short (untracked = names only), leading with --stat when the diffs are large. In a workspace run these inside each child repo and skip the clean ones. No local changes anywhere → say so and stop.
Untracked-file gate: if git status --short shows untracked files (??):
.env, *.key, *.pem, *.pfx, credentials.*, secrets.*, *.sqlite, *.db).AskUserQuestion — header "Untracked files": "Include all" / "Exclude all" / "Let me choose". "Include all" never covers secret-looking files — each one requires individual confirmation.Generate the message: read $CLAUDE_PLUGIN_ROOT/skills/commit/references/conventional-commit-format.md and apply it to everything gathered. If changes span multiple concerns, AskUserQuestion whether to commit together or split; when splitting, run steps 4–6 once per commit with its pre-assigned files.
Protected-branch check: look for .claude/hooks/restrict-paths.sh — in a workspace check the child repo first, then the workspace root (first found wins). Parse its PROTECTED_BRANCHES array to decide whether the current branch is protected; no hook = unprotected; hook present but array unparseable = treat as unprotected and note it in the preview. If protected, generate a feature branch name per $CLAUDE_PLUGIN_ROOT/skills/commit/references/branch-naming.md — <type> from the commit message, slug from its subject line.
Preview and confirm: show the branch, the full commit message (subject and body — never truncate to subject-only), and the files to stage. AskUserQuestion — "How would you like to proceed?":
<name>, commit, and push" / "Create branch <name> and commit only" / "Edit message" / "Cancel"Execute:
If a "Create branch" option was chosen: git checkout -b <name>. If creation fails (name taken), report it and let the user pick a different name or cancel — never silently auto-suffix a name the user approved (deliberate divergence from branch-naming.md's Collision Handling).
Stage the specific files from steps 1–2 — never git add -A, and never a secret-looking file unless individually confirmed in step 2.
Commit with a heredoc to preserve the multi-line message:
git commit -m "$(cat <<'EOF'
<message>
EOF
)"
If the commit fails, report the error and stop — never proceed to push.
Push only if the user chose a push option; use git push -u origin <branch> when no upstream exists.
Report: created branch (if any), Committed: <short-hash> <subject> per repo, Pushed to: origin/<branch> if pushed. If a feature branch was created, tell the user they are now on it.
Recommend /optimus:pr when a pull request is next — stay in this conversation so the implementation context is captured.
Never stages, commits, or modifies anything.
$CLAUDE_PLUGIN_ROOT/skills/commit/references/conventional-commit-format.md and generate the message(s).## <repo-name> heading (label even a single repo).Recommend /optimus:commit to actually commit — stay in this conversation so the implementation context is captured.
A purely local move: git checkout -b only. Never commit, push, stage, stash, reset, or modify any file or the index — staged, unstaged, and untracked changes carry to the new branch untouched. Ask questions only for multi-repo ambiguity.
Target repo (workspace only): one repo with local changes → target it silently, unless the description or conversation names a different repo (that repo's clean tree is the starting-fresh case; leave the dirty repo untouched). Multiple dirty repos → AskUserQuestion — header "Target repo", one option per repo. No dirty repos → pick the repo the description or conversation points to; ask if ambiguous; with no context at all, inform the user and stop.
Derive the description: record the current branch for the report. Use the first source with enough signal: (1) inline description from the arguments, (2) conversation context, (3) analysis of local changes, including untracked files. If none provides enough signal, print exactly:
Could not determine a meaningful branch name from the conversation or local changes.
Provide a description, e.g., `/optimus:commit branch "add user authentication"`
and stop — never create a branch with a generic or meaningless name.
Name and create: read $CLAUDE_PLUGIN_ROOT/skills/commit/references/branch-naming.md; apply its Type Detection Keywords, Slug Rules, and Collision Handling. Then git checkout -b <branch-name> and report:
## Branch
Created `<branch-name>` from `<original-branch>`.
Local changes preserved (nothing committed or pushed).
Omit the last line when the tree was clean; in a workspace, name the target repo.
When the work is ready to commit, run /optimus:commit in this conversation so the implementation context is captured.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub oprogramadorreal/optimus-claude --plugin optimus19 skills in this plugin
/brainstormRuns a structured design conversation — clarifies intent, proposes 2-3 approaches with trade-offs, iterates the design — and writes a user-approved engineering spec to docs/specs/ that /optimus:tdd auto-detects. No implementation happens until the spec is approved. With the scaffold argument, creates docs/product/ steering skeletons instead (never overwrites, authors no content). Recommends /optimus:init first./code-reviewCode ReviewReviews local changes, an open PR/MR, or a branch diff for bugs, security issues, and violations of the project's own coding guidelines, through review lenses applied inline on a small diff or in parallel agents on a larger one. Excludes style and linter-catchable issues. Read-only: applies fixes or posts PR/MR comments only on explicit approval. For an iterative auto-fix loop, use /optimus:deep review./deepDeep ModeRuns an iterative auto-fix loop on a chosen target — review, refactor, or coverage — dispatching the base skill into fresh subagent contexts per iteration, applying fixes automatically without per-change approval, running tests with bisection on failure, and checkpoint-committing until convergence or the cap. Requires /optimus:init and a test command in .claude/CLAUDE.md./dreamDream — prune and consolidate auto-memoryPrunes and consolidates the project's auto-memory to keep it minimal — deletes stale, wrong, or redundant memories, merges overlapping ones into existing files, and trims the index. Strong bias against growth: never creates new memory files and never stores new facts. Verifies staleness against the current codebase, then presents the plan and asks before deleting. Requires Claude Code auto-memory; run periodically after heavy stretches of work./gauntletRuns a Gauntlet Loop: turns an ambitious goal into a builder/critic prompt judged against a concrete quality bar, confirms with the user, then leads the run until the output beats the bar or the user stops it — or exports a paste-ready /goal prompt for a fresh session. Use for long-horizon goals with an inspectable reference. Long-running; spawns many subagents, edits project files, and commits and pushes finished pieces to a feature branch./handoffCompacts the current conversation into one self-contained, tool-agnostic handoff document at docs/handoffs/<slug>.md so any fresh agent or teammate can resume the work from that file alone. References pushed artifacts by path or URL, inlines anything not on the remote, and redacts secrets and PII. Re-running on an existing handoff offers enhance or overwrite. Writes one project artifact and, when needed, a private scratchpad backup; never commits.Other plugins' skills for the same job