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

version

Skill0 starsChanged 7 months agoMITView on GitHub

Bump the root package.json version (major|minor|patch), summarize every change since the last release into a new CHANGELOG.md entry, and commit the result with a `vX.Y.Z` message. Use when cutting a release or tagging a new version of the repo.

10 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

8 rules. 0 are common, 3 are distinctive, and 5 are very specific to this project.

  • 0

    Common

    Most of the 9 edited versions we read keep these.

  • 3

    Distinctive

    This author's own choices. Worth a look.

  • 5

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Refuse to run on a dirty tree: If git status --short above shows *any* uncommitted changes, stop.

    line 29
  2. Distinctive:

    Compute the new version: Use the current version from the preflight context and apply the bump per semver:

    line 31
  3. Very specific:

    If the preflight showed a last tag (not (none)), run git log <tag>..HEAD --no-merges --pretty=format:'%h %s'.

    line 37
  4. Very specific:

    If it was (none), run git log --no-merges --pretty=format:'%h %s' for the full history.

    line 38
  5. Distinctive:

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

    line 62
  6. Very specific:

    If the last-tag lookup returned (none), this is the first tagged release — summarize from the very first commit, and title the section …

    line 63
  7. Very specific:

    Update CHANGELOG.md: If it exists, prepend the new section above the existing content (keep a single # Changelog heading at the very top).

    line 65
  8. Very specific:

    No prior tag: Treat the entire history as the "since last release" range.

    line 100

“Common” is measured: kept by at least 6 in 10 of the 9 edited versions of this file we could read. “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 root package.json version, write a CHANGELOG entry summarizing everything since the last release, and commit.

Arguments

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

Preflight context

  • Current version: !node -e "console.log(require('./package.json').version)"
  • Last release tag: !git describe --tags --abbrev=0 --match 'v*' 2>/dev/null || echo '(none)'
  • Working tree status: !git status --short

(Commits since last tag are fetched in step 4 — preflight blocks can't use $(...) substitution under Claude Code's permission system, so we look up the range there instead.)

Steps

  1. Validate the bump type. $ARGUMENTS must be exactly major, minor, or patch. If it's empty or anything else, stop and tell the user the valid options — don't guess.
  2. Refuse to run on a dirty tree. If git status --short above shows any uncommitted changes, stop. A release commit must contain only the version bump and changelog. The user needs to commit or stash first.
  3. Compute the new version. Use the current version from the preflight context and apply the bump per semver:
    • major: X.Y.Z → (X+1).0.0
    • minor: X.Y.Z → X.(Y+1).0
    • patch: X.Y.Z → X.Y.(Z+1)
  4. Fetch and summarize the commits. Get the commit list for the range:

    • If the preflight showed a last tag (not (none)), run git log <tag>..HEAD --no-merges --pretty=format:'%h %s'.
    • If it was (none), run git log --no-merges --pretty=format:'%h %s' for the full history.

    Then write a tight, grouped changelog section. Target format:

    ## 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 last-tag lookup returned (none), this is the first tagged release — summarize from the very first commit, and title the section "vX.Y.Z — initial release" instead of listing everything.
  5. Update CHANGELOG.md. If it exists, prepend the new section 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>
  6. Bump package.json. Run:
    pnpm version <bump> --no-git-tag-version
    --no-git-tag-version is mandatory: it stops pnpm from auto-committing and auto-tagging, so we control the commit message and avoid surprise tags.
  7. Stage and commit. Stage exactly package.json and CHANGELOG.md, nothing else. Commit with:
    git commit -m "vX.Y.Z"
    The message is literally vX.Y.Z — no prefix, no body, no footer. That matches the tag convention the repo uses to find "the last release" on the next bump.
  8. Report back. Tell the user: the old version, the new version, the commit SHA, and the number of commits summarized. Do not push. Do not create a git tag — the user tags (or a CI job does) once they've reviewed the commit.

When to use this skill

  • Cutting a release, even an internal one.
  • 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.
  • A per-package version bump in a workspace package. This skill operates on the root package.json only.

Edge cases

  • No prior tag. Treat the entire history as the "since last release" range. The CHANGELOG section title becomes vX.Y.Z — initial release.
  • CHANGELOG.md exists but has no # Changelog heading. Prepend the new heading plus the new section; leave the old content below untouched.
  • Commit 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.

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.