Commit
Agent skills for markdown writing, conventional commits, PRs, and releases — works with Claude Code, Codex, Cursor, and 40+ agents
npx -y skills add skrrt-sh/skills --skill commitAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 1 stars1 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its author says it does
Copied from the file, not written here
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".
SKILL.md
12.8 KB, as published. Nobody here has run it
Git Commit Skill
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.
Additional Resources
Before choosing a commit message, read:
Workflow
- Pre-flight branch check (mandatory) — before touching staging or writing a commit,
run
git branch --show-currentand confirm you are on the correct short-lived branch for the work at hand. Never commit directly to a protected branch (main,master,developunder Gitflow). If the branch is wrong, fix it now — do not proceed and "fix it later". See "Branch Guard" and "Branching Strategy Awareness" below. - Check for prior PR work in the same problem boundary — if the current change is a
fix or follow-up to recent work, run the PR follow-up check in "PR Follow-Up Awareness"
below before staging any files. A closed or merged prior PR means the current branch
may be stale or orphaned, and you must create a fresh branch from an up-to-date
main. - Check the branching strategy — read the branching block from the agent instruction file
(see "Branching Strategy Awareness" below). Validate the current branch is appropriate
for the configured strategy before proceeding. If no block is found, tell the user to run
/setupand stop. - Inspect the worktree with
git status --short,git diff --stat, and the relevant diffs. - Identify the smallest coherent change set. Do not mix unrelated changes into one commit.
- Choose the commit
typefromreference/commit-types.md. - Choose the optional
scopefrom the dominant subsystem, package, app, directory, or concern. - Choose the best
gitmojifromreference/gitmojis.md. - Stage only the intended files or hunks.
- Write the commit header in the required repository format.
- Write a description body explaining what changed and why. Treat the body as required for this skill.
- Add footer lines for breaking changes, issue references, or follow-up metadata.
- Commit with
git.
Branch Guard
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:
- Run
git branch --show-current. - Compare the result to the configured branching strategy (see below).
- If the current branch is protected or wrong for this work:
- Fetch the latest remote state:
git fetch origin. - Ensure
mainis up to date locally:git switch main && git pull --ff-only origin main. - Create a new short-lived branch from fresh
main:git switch -c <type>/<description>.
- Fetch the latest remote state:
- Only after the branch is correct may you stage files or write the commit.
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.
Git Command Subset
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.
Requirements
gitmust be installed and available onPATH.- The repository must already exist and have the intended changes in the worktree.
- When the project uses agent permission settings, prefer
permissions.askfor mutating git commands andpermissions.denyfor destructive commands.
Commit Format
Use this exact header shape:
type(scope): :gitmoji: imperative subject
Rules:
scopeis optional. If absent, usetype: :gitmoji: subject.- Gitmoji is mandatory for every commit written by this skill.
- Put the gitmoji immediately after the colon-space in
type(scope):ortype:. - Prefer gitmoji code form such as
:sparkles:. - Write the subject in imperative mood.
- Keep the subject specific and outcome-focused.
- Do not end the subject with a period.
- Use
[skip ci]only when the change genuinely should not run CI.
Body And Footer
Description body:
- Add a body for every commit produced by this skill.
- Explain what changed and why.
- Prefer short paragraphs or compact bullets.
- Focus on behavior, constraints, migration impact, and notable tradeoffs.
Footer:
- Only add issue-reference footers (
Closes #123,Refs #456) when the user explicitly mentions an issue number or asks to close one. Do not invent placeholder issue numbers likeCloses #0. - Put breaking changes in the footer, for example:
BREAKING CHANGE: old tokens are invalid. - If there is no footer-worthy information, omit the footer entirely — a clean commit with no footer is better than a footer with fabricated references.
- Always include the co-authorship trailer unless the user asks not to:
Co-Authored-By: Skrrt Bot <[email protected]>
Commit Selection Heuristics
- Choose the
typeby the primary intent, not every side effect in the diff. - Choose the gitmoji by the visible nature of the change. The gitmoji complements the type.
- Do not omit the gitmoji. If no gitmoji fits, the commit split is not ready.
- If type and gitmoji pull in different directions, fix the commit split instead of forcing one message.
- Prefer multiple commits over one mixed commit when the diff spans different intents.
- Preserve existing repo conventions if the repository already uses a narrower type or scope vocabulary.
Branching Strategy Awareness
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:
- GitHub Flow: You should be on a feature branch, not
main. If onmain, create a feature branch first usinggit switch -c <type>/<description>— GitHub Flow requires all changes to reachmainthrough a pull request. - Trunk-Based: Agents always work on short-lived branches, never commit directly to
main. If onmain, create a short-lived branch first usinggit switch -c <type>/<description>. On a short-lived branch, proceed normally. - Gitflow: Check the current branch and enforce these rules:
main— never commit here. Stop and tell the user thatmainonly receives merges fromrelease/*orhotfix/*branches.develop— only commit release preparation work (version bumps, changelog updates). For features, stop and tell the user to create a feature branch fromdevelop.feat/*orfeature/*— 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.
PR Follow-Up Awareness
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:
- GitHub:
gh pr list --state all --limit 10 --json number,title,state,headRefName,mergedAt,closedAt - GitLab:
glab mr list --state all --per-page 10
Match a candidate to the user's report by (in priority order):
- Keyword overlap between the user's description and the PR title or branch name
(e.g., "login redirect" matches
fix/login-redirector a PR titled "Fix login redirect loop"). - Files mentioned in the report overlapping the PR's changed files
(
gh pr view <n> --json files -q '.files[].path'). - Recency — prefer PRs merged or closed within the last few days over older ones. If two or more candidates are plausible after this scoring, stop and ask the user which PR they mean. Never guess.
- GitHub:
-
Run
gh pr view <number> --json state,headRefName,mergedAt,closedAt(GitHub) orglab 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 baseRefNameorglab mr view <n>):<target>ismainfor GitHub Flow and TBD, and typicallydevelopfor 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)- Re-apply the fix on the new branch, then stage and commit.
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
mainwhen the user references a PR problem, do not commit onmain. 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.
Guardrails
- Never commit unrelated untracked or modified files.
- Never invent testing results.
- Never use
git commit --amendunless explicitly requested. - Never rewrite history unless explicitly requested.
- Never place the gitmoji before the commit type or after the subject.
- Never omit the description body for a commit produced by this skill.
- Never use a breaking change without a
BREAKING CHANGE:footer. - Never use force-based git commands such as
git push --force,git push -f, orgit push --force-with-lease. - Stop and ask the user before including files that appear unrelated to the requested commit.
- Treat staging and committing as human-approval actions when the project uses agent permission rules.
Task
Handle this request: $ARGUMENTS