post-commit
БесплатноБез исполняемых скриптовНе проверенUse when a code commit just landed (not wip/amend/undo) and CHANGELOG or plugin-version post-commit actions are needed.
от Fusengine★ 36 звёзд на GitHubОб этом скилле
Post-Commit Skill
Universal post-commit actions after a successful code commit.
Step 0: Bump Range + Guard (run first, every time)
This block is the single source for the bump range: the commit command and agent point here, never restate it. --no-bump passed by the caller → skip this whole skill, unconditionally. Otherwise run:
# 1. Base branch: the PR's base (caller's PR_BASE, else the open PR's) > remote default > first local main/master/develop
[ -n "$PR_BASE" ] || PR_BASE="$(gh pr view --json baseRefName -q .baseRefName 2>/dev/null)"
base_ref="${PR_BASE:+origin/$PR_BASE}"
[ -n "$base_ref" ] || base_ref="$(git symbolic-ref --short refs/remotes/origin/HEAD 2>/dev/null)"
if [ -n "$base_ref" ]; then
git fetch --quiet origin "${base_ref#origin/}" 2>/dev/null
git rev-parse --verify --quiet "$base_ref" >/dev/null || base_ref="${base_ref#origin/}"
else
for b in main master develop; do
git rev-parse --verify --quiet "refs/heads/$b" >/dev/null && { base_ref="$b"; break; }
done
fi
# 2. Fork point. None, or HEAD is on the base branch itself → old behaviour: last commit only
base="$(git merge-base HEAD "$base_ref" 2>/dev/null)"
if [ -z "$base" ] || [ "$base" = "$(git rev-parse HEAD)" ]; then
base="$(git rev-parse --verify --quiet HEAD~1)" # single-commit repo: empty → range = whole history (HEAD)
if [ -n "$base" ]; then fb="HEAD~1 (last commit only)"; else fb="whole history (single-commit repo)"; fi
echo "post-commit: no fork point from '${base_ref:-none}' -> fallback $fb" >&2
fi
# 3. Range to bump: since the branch's last bump commit, else since the fork point
bump_re='^chore: (bump marketplace and CHANGELOG|update CHANGELOG) to [0-9]+\.[0-9]+\.[0-9]+$'
last_bump="$(git log -1 --format='%H' -E --grep="$bump_re" ${base:+"$base.."}HEAD)"
since="${last_bump:-$base}"
# range = ${since:+"$since.."}HEAD ${base:+"^$base"} — written out at each use (bash and zsh alike; no word-splitting needed)
changed_plugins="$(git log --no-merges --format= --name-only ${since:+"$since.."}HEAD ${base:+"^$base"} -- plugins/ | cut -d/ -f2 | sort -u)"
new_subjects="$(git log --no-merges --format='%s' ${since:+"$since.."}HEAD ${base:+"^$base"} | grep -vE "$bump_re")"
if [ -n "$last_bump" ] && [ -z "$changed_plugins" ] && [ -z "$new_subjects" ]; then
echo "bump: skipped (nothing since $(git log -1 --format='%h %s' "$last_bump"))"
else
from=root; [ -n "$since" ] && from="$(git rev-parse --short "$since")"
echo "bump: due since $from — plugins: $(printf '%s\n' "$changed_plugins" | tr '\n' ' ')"
fi
bump: skipped→ STOP, report that line. A branch already bumped with nothing new since (a CI-fix or review round that only re-pushes) never stacks a second bump.bump: due→ continue. If the branch was already bumped, only what changed after that bump is bumped again (plugin B added after plugin A's bump is never merged unbumped).PR_BASE: the commit agent sets it to the branch the PR targets (developin Git Flow) —origin/HEADis the default branch, too far back for a PR intodevelop: other features' bump commits would land in the range.- Steps 1, M1 read the range
${since:+"$since.."}HEAD ${base:+"^$base"}(the^"$base"drops commits merged in from the base branch; plainHEADin a single-commit repo); M3.5 diffs from$base. NeverHEAD~1outside the fallback above. New shell → re-run this block.
Step 1: Read the Branch's Commits
Every commit of the Step 0 range, not only the last one — a mandate lands several WIP commits. Merge commits and bump subjects are skipped; output is grouped by conventional type (oldest first within a type):
git log --no-merges --reverse --format='%s' ${since:+"$since.."}HEAD ${base:+"^$base"} \
| grep -vE '^chore: (bump marketplace and CHANGELOG|update CHANGELOG) to [0-9]+\.[0-9]+\.[0-9]+$' \
| awk '{ t = $0; sub(/[(:!].*/, "", t); print t "\t" $0 }' | sort -s -k1,1 | cut -f2-
Save these subjects for the CHANGELOG entry: one line per subject, each under its type's prefix (references/changelog-type-mapping.md).
Step 2: Detect Repo Type
Check if .claude-plugin/marketplace.json exists in the repo root.
- EXISTS → Follow Marketplace Path (Steps M1–M5)
- DOES NOT EXIST → Follow Standard Path (Steps S1–S2)
Standa
Установить post-commit в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
BashReadEditВложенные файлы
FAQ
Что делает скилл post-commit?
Use when a code commit just landed (not wip/amend/undo) and CHANGELOG or plugin-version post-commit actions are needed.
Как установить скилл post-commit?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл post-commit запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
doc-coauthoring
Guide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision…
от Anthropicacademy-guide
Stop and check this skill before finishing any reply to a question about how to use Claude or a Claude product — it recommends matching courses, tutorials…
от Anthropicinternal-comms
A set of resources to help me write all kinds of internal communications, using the formats that my company likes to use. Claude should use this skill…
от Anthropicskill-development
This skill should be used when the user wants to "create a skill", "add a skill to plugin", "write a new skill", "improve skill description", "organize skill…
от Anthropic