From optimus
Stages, commits, and optionally pushes local git changes with conventional commit messages. Analyzes diffs, handles untracked files and protected branches by creating feature branches, multi-repo aware. Use when ready to commit.
npx claudepluginhub oprogramadorreal/optimus-claude --plugin optimusThis skill uses the workspace's default tool permissions.
Stage, commit, and optionally push local changes with a conventional commit message. Commits on the current branch — or, if the current branch is protected, offers to create a feature branch automatically.
Searches, retrieves, and installs Agent Skills from prompts.chat registry using MCP tools like search_skills and get_skill. Activates for finding skills, browsing catalogs, or extending Claude.
Searches prompts.chat for AI prompt templates by keyword or category, retrieves by ID with variable handling, and improves prompts via AI. Use for discovering or enhancing prompts.
Checks Next.js compilation errors using a running Turbopack dev server after code edits. Fixes actionable issues before reporting complete. Replaces `next build`.
Stage, commit, and optionally push local changes with a conventional commit message. Commits on the current branch — or, if the current branch is protected, offers to create a feature branch automatically.
Read $CLAUDE_PLUGIN_ROOT/skills/commit/references/gather-changes.md and follow the procedure (multi-repo detection + git commands).
Read $CLAUDE_PLUGIN_ROOT/skills/commit-message/references/conventional-commit-format.md and follow its instructions to analyze the gathered changes and generate a conventional commit message.
If changes span multiple concerns, use AskUserQuestion to ask whether to commit everything together or split into separate commits. If splitting, process each commit separately through steps 3–7.
In a multi-repo workspace, process each repo with changes through steps 2–7 independently.
If git status --short shows untracked files (??):
.env, *.key, *.pem, *.pfx, credentials.*, secrets.*, *.sqlite, *.db)AskUserQuestion — header "Untracked files", question "Include these untracked files in the commit?":
Get the current branch:
git rev-parse --abbrev-ref HEAD
Check if .claude/hooks/restrict-paths.sh exists. In a multi-repo workspace, check two locations (child repo level first, then workspace root):
<child-repo>/.claude/hooks/restrict-paths.sh<workspace-root>/.claude/hooks/restrict-paths.shUse the first one found (child repo level takes precedence). In a single-repo project, check .claude/hooks/restrict-paths.sh at the project root.
If found, read the file and extract the PROTECTED_BRANCHES array to determine whether the current branch is protected. Remember this result for step 5.
If the hook file does not exist at any checked location, assume the branch is safe for all operations.
If the current branch is protected, generate a feature branch name. Read $CLAUDE_PLUGIN_ROOT/skills/commit/references/branch-naming.md for the naming convention. The <type> comes from the conventional commit message generated in step 2; the <description> is the slugified subject line. Remember this name for step 5.
Present a summary for each repo (in multi-repo, use a heading per repo — e.g., ## repo-name):
Then use AskUserQuestion — header "Action", question "How would you like to proceed?":
If the current branch is NOT protected:
If the current branch IS protected (replace the first two options with feature-branch alternatives):
<name>, commit, and push" — create a new feature branch from the current branch, switch to it, commit, and push<name> and commit only" — create a new feature branch, switch to it, and commit without pushingIf the user chose a "Create branch" option in step 5, create and switch to the feature branch first:
git checkout -b <branch-name>
If branch creation fails (e.g., the branch already exists), report the error and let the user choose a different name or cancel.
Stage the files determined in steps 1 and 3:
git add <specific files>
Prefer git add <specific files> over git add -A. Never stage files that look like secrets.
Commit with the confirmed message. Use a heredoc to preserve multi-line messages (subject + body):
git commit -m "$(cat <<'EOF'
<message>
EOF
)"
If the commit fails for any reason, report the error to the user and stop — do not proceed to the push step.
Only if the user chose an option that includes pushing in step 5:
git push
If there is no upstream tracking branch:
git push -u origin <branch>
If the push fails for any reason, report the error to the user.
Present a summary of what was done (in a multi-repo workspace, show a combined summary across all repos):
<branch-name> (only if a feature branch was created in step 6)<short-hash> <commit message> (per repo in multi-repo)origin/<branch> (if push was performed)If a feature branch was created, inform the user: "You are now on <branch-name>. You can keep working on this branch, or use /optimus:pr to create a pull request. Tip: for best results, start a fresh conversation for the next skill — each skill gathers its own context from scratch."
Otherwise, recommend the next step based on readiness:
/optimus:pr to create or update a PRTell the user: Tip: for best results, start a fresh conversation for the next skill — each skill gathers its own context from scratch.