agentleFS
robmclartyrobmclarty/fascicle/.claude/skills/version/SKILL.md

version

Skill4 starsChanged 3 months agoApache-2.0View on GitHub

Bump the root package.json version via scripts/bump-version.mjs, summarize every commit since the last release into a new CHANGELOG.md section, and commit with a `vX.Y.Z` message. Use when cutting a release.

  • Deletes or force-pushes
  • Commits and pushes

2 other projects use a version of this.

Adopted by

Most recently taken up by

  • Other versions2 projects use a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 2

    1. buildomator/buildomator★ 90same name
    2. robmclarty/trellis★ 2same name

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

  • In this repository3 other files it gives its agents.

The file

We split this skill into the rules it gives an agent

11 rules. About 0 are common, 2 are distinctive, and 9 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 9

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Parse the bump-result JSON from preflight: Read the mode field and branch:

    line 32
  2. Very specific:

    If since is a SHA: git log <since>..HEAD --no-merges --pretty=format:'%h %s'

    line 37
  3. Very specific:

    If since is null: git log --no-merges --pretty=format:'%h %s' (initial release)

    line 38
  4. Very specific:

    Draft the CHANGELOG section: Use the JSON's new field for the version heading (don't recompute):

    line 40
  5. Distinctive:

    Write for a reader who didn't follow the work.

    line 62
  6. Very specific:

    If the JSON's since is null, this is the first release — title the section "vX.Y.Z — initial release" instead of listing every commit in …

    line 63
  7. Very specific:

    Prepend the new section to CHANGELOG.md: If the file exists, prepend above the existing content (keep a single # Changelog heading at the …

    line 67
  8. Very specific:

    Commit: Use the JSON's new field literally:

    line 83
  9. Very specific:

    No prefix, no body, no footer, so the release commit reads as vX.Y.Z in the log.

    line 89
  10. Distinctive:

    If it exits non-zero:

    line 93
  11. Very specific:

    Create an annotated tag and push it: Use the JSON's new field literally:

    line 98

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

version

Bump the version in the root package.json, prepend a CHANGELOG.md section summarizing every commit since the last release, and commit. The deterministic work — dirty-tree check, semver math, file rewrite — happens in scripts/bump-version.mjs before this skill begins reasoning. The skill itself only summarizes commits, drafts prose, and runs git.

The repo is one package with one manifest, so a bump rewrites exactly one version field: the root package.json.

Arguments

$ARGUMENTS — one of major, minor, or patch. No default; fail fast if missing or anything else.

Preflight context

  • Bump result: !node scripts/bump-version.mjs $ARGUMENTS

The bump script runs first, before the skill reasons about anything. By the time you read this, one of two things is true on disk:

  • the root package.json version has been rewritten to the new version (mode: "bump"),
  • nothing was changed and the script emitted an error JSON (mode: "error").

On a successful bump, the JSON carries everything the skill needs: new is the authoritative version (never recompute it), and since is the SHA of the previous release — the commit the most recent vX.Y.Z git tag reachable from HEAD points at — the left boundary for the CHANGELOG commit range. If since is null, there is no prior release and this is an initial release.

Steps

  1. Parse the bump-result JSON from preflight. Read the mode field and branch:
    • mode: "error" → go to "Steps — error". Do not proceed.
    • mode: "bump" → continue below.
  2. Fetch the commit range using the JSON's since SHA:
    • If since is a SHA: git log <since>..HEAD --no-merges --pretty=format:'%h %s'
    • If since is null: git log --no-merges --pretty=format:'%h %s' (initial release)
  3. Draft the CHANGELOG section. Use the JSON's new field for the version heading (don't recompute):

    ## vX.Y.Z — YYYY-MM-DD
    
    ### Added
    - <one line per user-visible addition>
    
    ### Changed
    - <behavior changes, refactors that matter externally>
    
    ### Fixed
    - <bug fixes>
    
    ### Internal
    - <tooling, tests, docs — keep this section short or omit>

    Rules for the summary:

    • Group by impact, not by commit. Collapse three commits that together land one feature into one bullet.
    • Omit any Added/Changed/Fixed/Internal section that has no entries.
    • Each bullet is one line. Reference commit hashes only if the line is genuinely ambiguous without one.
    • Write for a reader who didn't follow the work. "Fixed flaky cache eviction under concurrent writes" beats "fixed bug in cache".
    • If the JSON's since is null, this is the first release — title the section "vX.Y.Z — initial release" instead of listing every commit in repo history.

    Print the drafted section back to the user as a fenced markdown code block in your response text — the entire block, verbatim, exactly as it will be prepended to CHANGELOG.md. This is the user's one chance to see the prose in isolation before it's folded into the file, committed, and tagged. Do this before moving on to step 4; don't summarize or abbreviate — print the raw markdown. The skill continues automatically after printing (no wait for confirmation); if the user wants to change the prose, they'll interrupt.

  4. Prepend the new section to CHANGELOG.md. If the file exists, prepend above the existing content (keep a single # Changelog heading at the very top). If it doesn't exist, create it with:

    # Changelog
    
    <new section here>
  5. Stage exactly package.json + CHANGELOG.md, nothing else:

    git add package.json CHANGELOG.md

    Confirm via git status --short that no other files are staged. If anything unexpected is staged, stop and hand it back to the user — a release commit is not the place to sneak other changes in.

  6. Commit. Use the JSON's new field literally:

    git commit -m "vX.Y.Z"

    No prefix, no body, no footer, so the release commit reads as vX.Y.Z in the log. The authoritative release marker is the annotated tag created in step 8; the next bump finds "the last release" from that tag (the plain commit message is only a fallback).

  7. Verify with pnpm check --only docs,links,spell,prose,prose-health --bail. Only these five checks can fail on a (version string + CHANGELOG) diff — a single semver-string replacement plus prose can't break types, lint, struct, deps, dead-code, or tests, so running the full pipeline is wasted CPU. The two prose slots are in the set because vale and the prose ratchet read CHANGELOG.md like any other markdown; the v0.12.6 release shipped a two-semicolon sentence that passed the old docs,links,spell set locally and then failed prose in publish.yaml, stranding the tag on a commit that can never pass. The heavy checks gate prepublishOnly (check:all) instead, which is where release-readiness actually matters. If the narrow check exits 0, continue to step 8.

    If it exits non-zero:

    • The release commit is already created (step 6 already ran).
    • Undo with git reset --hard HEAD~1. This restores both package.json (back to the old version) and CHANGELOG.md.
    • Tell the user the check failed, show the tail of the relevant .check/*.txt or .check/*.json diagnostic, and stop. Don't retry the commit; the user decides whether to fix and re-invoke the skill or investigate first.
  8. Create an annotated tag and push it. Use the JSON's new field literally:

    git tag -a vX.Y.Z -m "vX.Y.Z"
    git push origin vX.Y.Z

    Annotated (not lightweight) so the tag carries author, date, and message. Pushing the tag triggers the release pipeline: publish.yaml starts an OIDC trusted-publishing run that pauses at the npm-publish environment for a required-reviewer approval, and release.yaml creates the GitHub Release from the CHANGELOG section. Pushing refs/tags/vX.Y.Z also sends the commit it points to, so the tagged commit reaches the remote even if the branch ref hasn't moved yet. The push is tag-only by design — branch pushes stay the user's call — but that means the branch ref lags until they push it (see step 9).

    Error handling:

    • git tag fails because the tag already exists → stop and tell the user. Don't force-overwrite. A prior release at this version already exists and the user needs to resolve it by hand.
    • git push fails (network, auth, permissions) → the local tag is already created. Tell the user the commit + tag exist locally, show the push error, and suggest re-running git push origin vX.Y.Z once the issue is resolved. Do not delete the tag.
  9. Report back. Tell the user: the old version, the new version (both from the JSON), the commit SHA, the tag name, the number of commits summarized, and whether the tag push succeeded. Then point them at the two things that finish the release: (a) approve the paused publish.yaml run in GitHub Actions (the npm-publish gate) to let the provenance publish proceed, and (b) push the release branch (git push origin main) so the branch ref includes the release commit — the skill pushes only the tag.

Steps — error

Triggered when the preflight JSON's mode is "error". The script made no changes (no version field touched, no commit). Branch on error_type:

  • dirty_tree → tell the user the working tree must be clean before a release commit; show the listed dirty files; suggest committing or stashing first; stop.
  • usage → relay the script's usage message verbatim; stop.
  • runtime → relay the script's message and stop. Don't speculate or retry.

In every error case: no edits, no git operations, no retry. The user decides what to do next.

When to use this skill

  • Cutting a release, even an internal one (patch/minor/major).
  • User asks to "bump the version" or "tag a new version".

When NOT to use this skill

  • There's no meaningful change since the last release (no commits between last tag and HEAD). Tell the user and stop.
  • The user wants to edit an existing CHANGELOG entry or retro-tag an older commit — that's a different workflow, not this skill.

Edge cases

  • No prior release. When since in the JSON is null, treat the entire history as the range and title the section vX.Y.Z — initial release. The script identifies the previous release from the most recent vX.Y.Z git tag reachable from HEAD (resolved to its commit), falling back to a commit messaged exactly vX.Y.Z only when no release tag exists — so a release cut by direct-tagging (rather than through this skill) is still detected correctly.
  • CHANGELOG.md exists but has no # Changelog heading. Prepend the new heading plus the new section; leave the old content below untouched.
  • Commit list contains merge commits. Drop them from the summary unless they introduced something not present in the squashed commits. --no-merges on the log is fine if the output is noisy.
  • A commit is marked with BREAKING: or !: but the user asked for patch or minor. Warn the user and ask if they meant major. Don't override silently. Note: by this point the bump has already happened on disk (the script ran in preflight); if the user wants major instead, they need to git restore package.json and re-invoke /version major.
  • pnpm check --only docs,links,spell,prose,prose-health --bail fails in step 7. git reset --hard HEAD~1 restores the pre-bump state. Do not amend, do not retry the commit from inside the skill — the user decides. Common causes: a word in the new CHANGELOG entry is missing from cspell.json's words list, or a vale rule rejects a sentence (e.g. Repo.Semicolon on more than one semicolon). Fix via a separate commit, then re-invoke /version.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.