From skrrt-skills
Creates focused conventional commits with mandatory gitmojis. Use when the agent needs to review git changes, split work into commits, stage files, or write commit messages. Always use this skill when the user asks to commit, make a commit, write a commit message, split changes into commits, stage and commit files, or anything involving git commit workflows. Trigger for phrases like "commit this", "write a commit", "split into commits", "conventional commit", "gitmoji commit", "stage and commit", "commit the changes", or "help me commit".
How this skill is triggered — by the user, by Claude, or both
Slash command
/skrrt-skills:commit [what-to-commit][what-to-commit]The summary Claude sees in its skill listing — used to decide when to auto-load this skill
> Skill instructions for splitting changes and writing conventional commits with mandatory gitmojis.
Skill instructions for splitting changes and writing conventional commits with mandatory gitmojis.
You are a commit writer. Follow the vivaxy/vscode-conventional-commits workflow and this repository's
stricter gitmoji placement rules.
Before choosing a commit message, read:
git branch --show-current and confirm you are on the correct short-lived branch for
the work at hand. Never commit directly to a protected branch (main, master, develop
under Gitflow). If the branch is wrong, fix it now — do not proceed and "fix it later".
See "Branch Guard" and "Branching Strategy Awareness" below.main./setup and stop.git status --short, git diff --stat, and the relevant diffs.type from reference/commit-types.md.scope from the dominant subsystem, package, app, directory, or concern.gitmoji from reference/gitmojis.md.git.This is a hard pre-flight gate enforced by agent adherence to this skill — not by a script or hook. Projects that need a machine-enforced backstop should add branch protection rules on the forge. Before staging, before writing a commit message, before anything that mutates git state:
git branch --show-current.git fetch origin.main is up to date locally: git switch main && git pull --ff-only origin main.main: git switch -c <type>/<description>.Never stage files on the wrong branch with a plan to "move them later" — that path leaks unrelated work into the commit and loses context. Fix the branch first, every time.
Stay within this safe git subset unless the user explicitly asks for something else:
git status --shortgit diff --statgit diff -- <path>git add -- <path>git add -p -- <path>git restore --staged -- <path>git commit --file <file> (preferred — supports header + body)git commit --message <header> (only for follow-up fixups when explicitly body-less)git branch --show-currentgit branch --list (for checking active branches, e.g., Gitflow release detection)git switch -c <branch> (for creating branches when the strategy requires it)git switch <branch> (for switching to an existing branch)git fetch origin (pre-flight to refresh remote state)git fetch origin --prune (drop stale remote-tracking refs for deleted branches)git pull origin <branch> (for syncing with the target branch)git pull --ff-only origin <branch> (safe fast-forward sync; preferred over plain pull)git pull --rebase origin <branch> (GitHub Flow / TBD only — for rebasing before PR)git rebase --continue (GitHub Flow / TBD only — after resolving rebase conflicts)git rebase --abort (GitHub Flow / TBD only — to abandon a failed rebase)Never use rebase commands under Gitflow. Avoid history-rewriting or destructive git commands
beyond the rebase operations listed above.
git must be installed and available on PATH.permissions.ask for mutating
git commands and permissions.deny for destructive commands.Use this exact header shape:
type(scope): :gitmoji: imperative subject
Rules:
scope is optional. If absent, use type: :gitmoji: subject.type(scope): or type:.:sparkles:.[skip ci] only when the change genuinely should not run CI.Description body:
Footer:
Closes #123, Refs #456) when the user explicitly mentions
an issue number or asks to close one. Do not invent placeholder issue numbers like Closes #0.BREAKING CHANGE: old tokens are invalid.Co-Authored-By: Skrrt Bot <[email protected]>type by the primary intent, not every side effect in the diff.Before committing, check the project's agent instruction file for a <!-- skrrt:branching -->
block. Search these locations in order: CLAUDE.md, AGENTS.md, .claude/CLAUDE.md,
.github/AGENTS.md. If present, respect the configured strategy:
main. If on main, create a feature
branch first using git switch -c <type>/<description> — GitHub Flow requires all changes to
reach main through a pull request.main.
If on main, create a short-lived branch first using git switch -c <type>/<description>.
On a short-lived branch, proceed normally.main — never commit here. Stop and tell the user that main only receives merges
from release/* or hotfix/* branches.develop — only commit release preparation work (version bumps, changelog updates).
For features, stop and tell the user to create a feature branch from develop.feat/* or feature/* — normal commits allowed. This is where feature work happens.release/* — only bug fixes, version bumps, and release-oriented tasks. No new features.hotfix/* — only critical fixes. Keep the scope minimal.If no branching strategy block is found, tell the user to run /setup to configure a branching
strategy before proceeding. Do not guess or assume a default.
When the user reports an issue inside the same problem boundary as a recent PR — even if they do not explicitly reference the PR — you must verify the state of the precedent PR before staging or committing anything. Assume nothing about the current branch. A branch that looked active an hour ago may have been merged and deleted by the forge.
Identify the precedent PR. If the user does not name it, inspect recent PRs for the same scope:
gh pr list --state all --limit 10 --json number,title,state,headRefName,mergedAt,closedAtglab mr list --state all --per-page 10Match a candidate to the user's report by (in priority order):
fix/login-redirect or a PR titled "Fix login
redirect loop").gh pr view <n> --json files -q '.files[].path').Run gh pr view <number> --json state,headRefName,mergedAt,closedAt (GitHub) or
glab mr view <number> (GitLab) to check whether the precedent PR is open, merged, or
closed without merge.
Branch on the state:
PR is still open — stay on (or switch to) the PR's source branch, pull any remote
updates with git pull --ff-only origin <source-branch>, then commit the fix. The push
will update the existing PR. Do not open a new one.
PR was merged — the source branch is almost certainly gone on the remote. Resolve
the merged PR's target branch first (read it from gh pr view <n> --json baseRefName
or glab mr view <n>): <target> is main for GitHub Flow and TBD, and typically
develop for Gitflow feature PRs (or the release branch for Gitflow hotfixes). Then
do all of the following, in order, before staging any file:
git switch <target>git fetch origin --prune (drops stale remote-tracking refs for deleted branches)git pull --ff-only origin <target> (bring local <target> up to the merged state)git switch -c <type>/<description> (create a fresh short-lived branch)Never reuse a branch whose PR was already merged — the forge has deleted it and the
local copy is now orphaned and stale. A new PR will be needed via /pr.
PR was closed without merge — stop and ask the user whether to reopen the existing
branch (if it still exists locally and on the remote) or start fresh from main. Do
not guess.
If the agent is currently on main when the user references a PR problem, do not
commit on main. Identify the PR's source branch and apply the rules above.
Commit cleanly: whatever path you take, confirm git status shows only the intended
changes before staging. Stray modifications from a stale branch must be reconciled (stash,
discard, or include intentionally) — not quietly committed.
git commit --amend unless explicitly requested.BREAKING CHANGE: footer.git push --force, git push -f, or git push --force-with-lease.Handle this request: $ARGUMENTS
Creates, edits, and optimizes skills for Claude Code, including drafting, evaluating with test prompts, iterating on performance, and improving skill descriptions for better triggering accuracy.
npx claudepluginhub skrrt-sh/skills