post-commit
npx machina-cli add skill fusengine/agents/post-commit --openclawPost-Commit Skill
Universal post-commit actions after a successful code commit.
Step 1: Read Last Commit
git log --format='%s' -1
Save the commit message for CHANGELOG entry.
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)
Standard Path (any repo without marketplace.json)
Step S1: Update CHANGELOG
Read the latest git tag to determine current version:
git describe --tags --abbrev=0 2>/dev/null || echo "v0.0.0"
Increment PATCH: X.Y.Z → X.Y.(Z+1).
If CHANGELOG.md does not exist, create it with # Changelog heading.
Add a new entry at the top (after the # Changelog heading):
## [X.Y.Z] - DD-MM-YYYY
- commit message from Step 1
Step S2: Git Tag
git add CHANGELOG.md
git commit -m "$(cat <<'EOF'
chore: update CHANGELOG to X.Y.Z
EOF
)"
git tag vX.Y.Z
STOP. Output summary and ask user if they want to push the tag.
Marketplace Path (repo with .claude-plugin/marketplace.json)
Step M1: Detect Modified Plugins
git diff --name-only HEAD~1 | grep '^plugins/' | cut -d/ -f2 | sort -u
If no plugins modified → Skip to Step M3 (still bump suite version).
Skip directories without .claude-plugin/plugin.json.
Step M2: Bump Plugin Versions
For each modified plugin detected in Step M1:
- Read
plugins/{name}/.claude-plugin/plugin.json - Increment PATCH version:
X.Y.Z→X.Y.(Z+1) - Write the new version back to
plugin.json
Then determine plugin type from marketplace.json:
- In
plugins[]array → Also update matchingversionfield inmarketplace.json - In
core[]array → Only bumpplugin.json(core entries have no version field)
Step M3: Bump Suite Version
Read metadata.version from .claude-plugin/marketplace.json.
Increment PATCH: X.Y.Z → X.Y.(Z+1).
Write the new suite version back to marketplace.json → metadata.version.
Step M4: Update CHANGELOG
Add a new entry at the top of CHANGELOG.md (after the # Changelog heading):
## [X.Y.Z] - DD-MM-YYYY
- type(plugin-name): description from the code commit message
Where X.Y.Z is the new suite version from Step M3.
Include (plugin-name X.Y.Z) in each line for bumped plugins.
Step M5: Commit, Tag, and Push
Stage all modified files:
git add CHANGELOG.md .claude-plugin/marketplace.json plugins/*/.claude-plugin/plugin.json
Commit with HEREDOC format:
git commit -m "$(cat <<'EOF'
chore: bump marketplace and CHANGELOG to X.Y.Z
EOF
)"
This MUST be a separate commit from the code changes. Never combine.
Then tag and push:
git tag vX.Y.Z
git push origin vX.Y.Z
Only tag the bump commit. Never tag code commits.
Version Bump Rules
- ALL commit types trigger PATCH bump only
- MINOR/MAJOR bumps are manual user decisions, never automatic
- The bump commit is always SEPARATE from code changes
CHANGELOG Type Mapping
| Commit Type | CHANGELOG Prefix |
|---|---|
feat | Added |
fix | Fixed |
refactor | Changed |
docs | Documentation |
perf | Performance |
test | Tests |
chore | Maintenance |
style | Style |
ci | CI/CD |
build | Build |
Source
git clone https://github.com/fusengine/agents/blob/main/plugins/commit-pro/skills/post-commit/SKILL.mdView on GitHub Overview
Post-commit automates housekeeping after a successful code commit. It updates the CHANGELOG and creates a git tag for standard repos, and for marketplace repos it also bumps plugin versions and the suite version. It detects which path to run by checking for .claude-plugin/marketplace.json.
How This Skill Works
It starts by reading the last commit message, then detects repo type via marketplace.json. In standard path, it updates CHANGELOG to the next patch version and tags the commit; in marketplace path, it bumps modified plugin versions, updates marketplace.json, then bumps the suite version, updates the changelog, and finally commits, tags, and pushes as applicable.
When to Use It
- When you commit to a standard repo without marketplace.json and want automated CHANGELOG entry and a new tag
- When you commit to a marketplace repo with modified plugins and want plugin and suite version bumps
- When you commit to a marketplace repo but no plugins were changed and only the suite version should be bumped
- When you make the first commit in a repo and need CHANGELOG.md to be created and populated
- When you want to avoid triggering on WIP/amend/undo commits and only run after regular commits
Quick Start
- Step 1: Make a commit in your repo (ensure it isn't a WIP/amend/undo)
- Step 2: Let the post-commit action run automatically to update CHANGELOG and version(s)
- Step 3: Review the generated summary and push the new tag if you want to publish the release
Best Practices
- Write descriptive commit messages since the last commit message is used to populate the CHANGELOG
- Review the generated CHANGELOG entries before pushing the new tag
- Keep plugin.json and marketplace.json version fields in sync when plugins are bumped
- Test the workflow on a feature branch before enabling it on main
- Avoid manual edits to bumped version numbers outside the automated flow
Example Use Cases
- A standard repo receives a new feature; the post-commit creates a new CHANGELOG entry for the next patch and creates a vX.Y.Z tag
- A marketplace repo has changes in plugins 'weather' and 'auth'; plugin.json versions are bumped, marketplace.json updates their references, the suite version increments, and a changelog entry is added
- A marketplace repo with no plugin changes bumps only the suite version and updates the CHANGELOG with the summary from the commit message
- First-ever commit to a repo where CHANGELOG.md did not exist; the skill creates the file, adds the initial [X.Y.Z] entry, and tags the release
- A WIP or amend commit occurs; the post-commit workflow is skipped to avoid tagging or changelog updates