Create a commit message from staged changes, bump and sync version numbers, update CHANGELOG.md, and run npm run docs only when changes are not minor. Use for pre-commit finalization, version hygiene, changelog hygiene, and docs gating.
Instalação
Instalar com Codex ou Claude Copie este prompt, cole no Codex, Claude ou outro assistente e deixe que ele revise a página da skill e instale para você.
Create a commit message from staged changes, bump and sync version numbers, update CHANGELOG.md, and run npm run docs only when changes are not minor. Use for pre-commit finalization, version hygiene, changelog hygiene, and docs gating.
argument-hint
Optional: extra context for commit intent or release note tone
user-invocable
true
disable-model-invocation
false
Staged Commit Workflow
What This Skill Produces
This skill produces a ready-to-use commit package from the current staged diff:
A commit message based on staged changes
A synchronized version bump across package.json ("version") and public/sw.js (SW_VERSION)
An updated CACHE_VERSION in public/sw.js using format v<YYYY>.<MM>.<DD>.<branch>
An updated CHANGELOG.md entry under the new package version header
Updated generated docs from npm run docs when the change is not minor
When to Use
Use this skill when:
You already staged changes and want a consistent commit message
You want changelog updates enforced before commit
You want docs generation to run only when warranted
Do not use this skill when:
Nothing is staged
You only want to commit without changelog/docs checks
Inputs
Optional user note describing intent (bug fix, feature, audit cleanup)
Optional flag: force-docs to run docs even for minor changes
Optional flag: skip-version-bump to skip version increment (for example, test-only or config-only commits)
Optional flag: bump=patch, bump=minor, or bump=major to override the default minor version increment
Optional changelog policy note if team-specific rules differ from standard Keep a Changelog usage
ADD, FIX, UPDATE, REMOVE, DEPRECATE, SECURITY, or AUDIT
Draft commit message from observed impact:
Format: KEYWORD: short present-tense summary
Keep summary under 72 characters when possible
Prefer user-visible impact over implementation detail
Sync version numbers (skip if skip-version-bump flag is set):
Read current "version" from package.json -> format major.minor.patch
Apply bump: default is minor increment (major.(minor+1).0, reset patch to 0) because all branch-based staged changes are minor by semver convention; honor bump=patch, bump=minor, or bump=major if provided
Update "version" in package.json to the new version string
Update SW_VERSION constant on line 3 of public/sw.js to match the new version string exactly
Get current branch name: git rev-parse --abbrev-ref HEAD
Normalize branch name: replace all / with -, lowercase (for example, feature/fix-csp -> feature-fix-csp)
Compute new cache version: v<YYYY>.<MM>.<DD>.<normalized-branch> using today's date with zero-padded month and day
Update CACHE_VERSION constant on line 1 of public/sw.js to the computed cache version string
Stage both package.json and public/sw.js
Perform changelog preflight checks:
If changelog formatting expectations are not clear, ask the user before editing
Final command suggestion only: git commit -m "<message>"
Decision Rules
Use these rules in priority order:
If no staged files: stop and ask user to stage files first.
If staged changes are test-only, typo-only, comment-only, or non-functional refactors: treat as minor and use bump=patch to keep the version increment minimal; skip version bump entirely if skip-version-bump is provided.
If staged changes alter exported APIs, user-facing behavior, routing, schema/contracts, or docs-source comments used by TypeDoc: treat as non-minor.
If user passes skip-version-bump, do not modify package.json or public/sw.js versions.
If user passes force-docs, run docs even when change is minor.
If uncertain, treat as non-minor and run docs.
SW_VERSION in public/sw.js must always equal "version" in package.json. If they are out of sync when the skill runs, fix the mismatch first before applying the new bump.
Quality Checks
Before finalizing:
Commit message keyword matches actual change type
Message is present tense and specific
"version" in package.json and SW_VERSION in public/sw.js are identical
CACHE_VERSION in public/sw.js matches format v<YYYY>.<MM>.<DD>.<branch> with today's date and the current branch
Both package.json and public/sw.js are staged when version bump runs
CHANGELOG.md updated under the matching new package version section
Version header includes package version and date in YYYY-MM-DD format when newly created
Existing version sections are reused to keep same-version commits grouped together