/apogee:git-commitfrom apogee
This skill should be used whenever creating a git commit or writing a commit message — when the user asks to "commit", "create a commit", "git commit", "write a commit message", "commit my changes", or "conventional commit". Generates a Conventional Commits message from the staged diff (falling back to all changes), validates it against strict rules, and creates the commit. Commit messages are always written in English. Applies only inside a git repository.
Ships in apogee. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
This skill operates only inside a git repository. Before anything else, check:
!git rev-parse --is-inside-work-tree 2>/dev/null && echo GIT_OK || echo NOT_A_GIT_REPO
If the line above reads NOT_A_GIT_REPO, stop immediately and tell the
user this directory is not a git repository; do not run the scripts below.
Write a Conventional Commits message from the current diff, validate it, and create the commit. Commit messages are always English (ASCII only).
This skill is the single path for committing: whenever a commit is needed,
follow the workflow below rather than calling git commit ad hoc. It is
driven by two scripts:
scripts/gather-context.sh — collects the diff + history to summarize.scripts/check-message.sh — validates a candidate message against every
rule and exits non-zero with specific violations (the runnable harness).Scripts are addressed through
${CLAUDE_PLUGIN_ROOT}. Run them from the target git repository (they operate on the repo of the current directory).
Gather context. From inside the target repo:
bash "${CLAUDE_PLUGIN_ROOT}/skills/git-commit/scripts/gather-context.sh"
It prints the scope in use (STAGED, or a fallback notice for ALL changes),
git status --short, the recent git log --oneline -10 (match its style),
the diffstat, and the full diff. If nothing is staged it falls back to all
modified tracked files; if only untracked files exist it tells you which
git add to run, then exits non-zero.
Compose the message following the Rules below. If the diff contains multiple unrelated changes, focus on the single most significant one.
Stage if the scope was the ALL-changes fallback, or if the commit covers only part of the
changes: git commit takes only the index, so an empty one fails. Stage exactly the files
this commit is about, by name (git add <path>...); never git add -A, git add . or -f.
Confirm with git diff --cached --stat.
Validate before committing:
bash "${CLAUDE_PLUGIN_ROOT}/skills/git-commit/scripts/check-message.sh" <<'EOF'
feat(scope): Summary line
Optional body, wrapped at 72.
EOF
It prints OK (exit 0) when valid, or FAIL: … lines (exit 1) for each
violation. Fix every failure and re-validate. WARN (subject 51–72 chars)
does not block but prefer ≤ 50. It also refuses names of the local-only AI tooling
(CLAUDE.md, docs/apogee, .claude/, .beads, a note's file name, …) unless the repo
tracks them: describe the change itself, not the notes behind it.
Create the commit with the message on stdin, -F - (not -m, which
mangles the multi-line body), using the exact text that passed validation:
git commit -F - <<'EOF'
feat(scope): Summary line
Optional body, wrapped at 72.
EOF
No temporary file: the command starts with git commit, so a Bash(git commit:*)
permission rule covers it, nothing is left behind, and nothing is written outside the
project. (A f=$(mktemp) … one-liner starts with an assignment, matches no allow rule, and
in headless runs pushes the agent to write the message file somewhere it cannot clean up.)
Subject line — <type>(<scope>): <Summary>
type(scope): prefix.: ).. ! ?).feat, fix, docs, style, refactor, perf, test,
chore, ci.! before the colon (feat(api)!: Drop v1 endpoints) and a
BREAKING CHANGE: <what breaks> footer; /apogee:release reads both to suggest a major bump.Body (optional)
feat(auth): Add OAuth2 login via Google
Handles token refresh automatically on expiry.
Falls back to session auth if provider is unavailable.
git commit -F - with a quoted heredoc, not -m. -m collapses the
multi-line body and breaks 72-column wrapping. -F - reads the message from
stdin exactly (verified: git log -1 --format=%B returns it intact). Quote the
heredoc marker (<<'EOF') so $ and backticks in the message stay literal.gather-context.sh won't see untracked files. git diff ignores them,
so the fallback covers only modified tracked files. New files must be
git add-ed first; the script prints the exact git add lines for them.—) all fail. Use plain ASCII
punctuation (-, ", ').git/grep. Run the scripts with bash
in the target repo; check-message.sh uses POSIX grep features only, so
it works with both BSD (macOS) and GNU (Linux) grep.| Symptom | Fix |
|---|---|
ERROR: not inside a git work tree | cd into the repo before running the scripts. |
gather-context.sh exits 2, "only untracked files exist" | git add the listed files, then re-run. |
FAIL: subject must match … | Add a valid type prefix from the allowed list. |
FAIL: subject is N chars; hard cap is 72 | Shorten the subject; move detail to the body. |
FAIL: message contains non-ASCII characters | Replace the flagged characters (em-dash, Cyrillic, smart quotes) with ASCII. |
| Body merged into one line after commit | You used -m; amend with git commit --amend -F - <<'EOF'. |
There used to be a PreToolUse hook denying git commit -m / -am / bare
git commit. ADR 0005
removed it: a badly-formatted commit message is a git commit --amend away
from fixed, and the rule was already stated three times in this file.
So the -F - pattern in step 5 of the Workflow is now a convention you
follow, not one you are forced into. Follow it anyway — -m collapses the
multi-line body, which is the actual reason for the rule.
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub mishagin-dev/apogee --plugin apogee20 skills in this plugin
/ai-clean-roomPersonal black-box clean-room skill: build an independent product that reproduces the functionality of a closed-source reference application using only its public documentation, observed behavior and screenshots, without copying its code, texts, icons, design or name. Manual invocation only (/apogee:ai-clean-room)./brOfficial skill for beads_rust (`br`), a local-first, dependency-aware issue tracker for AI agents. Use when creating issues, triaging backlogs, managing dependencies, finding ready work, updating status, or exporting the local JSONL backup (br sync --flush-only)./cleanupReclaim disk space that agent work leaves behind: linked git worktrees (of the repository and of every submodule), the stale records of worktrees deleted by hand, orphaned worktree directories, and the build directories (Rust target/, DerivedData) that make each copy 5–35 GB. Inventories first with a read-only script, deletes only what the user picks. Use when the disk fills up, when worktrees pile up after parallel agents, or when the user asks to clean up, tidy up or free space, in any language. Offered by the session-start reminder and by /apogee:finish./finishClose the unit of work /apogee:start opened, and the only way work is closed in an Apogee project. feature/bugfix: review, docs, public docs, clean tree, git-flow finish into develop, push develop. hotfix: review, then the release preparation (version, CHANGELOG, gate, notes) and the operator's commands. research: check the note is complete, mark it done, propose the follow-up. Detects the type from the current branch./git-flowDrive the installed git flow binary (AVH Edition) for Git Flow branching: init a repo, start/finish/publish feature and bugfix branches, cut and finish a release with tag and back-merge, ship a hotfix, or open a support branch. Use when asked to run git flow, start or finish a feature/release/hotfix, cut a release, tag a version, or initialize Git Flow. Applies only inside a git repository./initBootstrap a project's Apogee context: research the codebase, fill docs/apogee/ai-context and the root CLAUDE.md, seed a CLAUDE.md per first-level submodule. Run once per project, in Plan Mode.