updated 7d ago
Suggest and apply semver bumps for marketplace plugins changed on the current branch.
O que dá para fazer com Bump Plugins?
name: bump-plugins description: Use when preparing a branch or PR that changes marketplace plugins — analyzes commits vs a base ref, suggests a major/minor/patch version bump per changed plugin with reasoning, and applies the bumps on confirmation user-invocable: true argument-hint: "[base-ref] (default: merge-base with upstream main)" allowed-tools: Bash, Read, Edit, Glob, Grep, AskUserQuestion
bump-plugins
Suggest and apply semver bumps for marketplace plugins changed on the current branch.
Synopsis
/bump-plugins [base-ref]
base-ref overrides the comparison base (a branch, tag, or SHA). Without it, the base
is the merge-base of HEAD with the upstream main — the main branch of whichever
remote points at github.com/openshift-eng/edge-tooling, discovered by URL rather
than assuming a remote name.
Prerequisites
- Run from the repository root (the
./marketplaceCLI must be present) - The branch under analysis is checked out as
HEAD
Steps
1. Determine the base ref
- If
$ARGUMENTSis non-empty, use it as the base ref; verify it resolves withgit rev-parse --verify <base-ref>and stop with a clear error if it does not. - Otherwise find the upstream remote: the entry in
git remote -vwhose fetch URL matchesgithub.com[:/]openshift-eng/edge-tooling(any protocol, optional.gitsuffix). Do not assume its name — it may beorigin,upstream,openshift, etc.- Run
git fetch <upstream-remote> mainfirst so the local tracking ref is current, then usegit merge-base <upstream-remote>/main HEAD. If the fetch fails (e.g. offline), check whether<upstream-remote>/mainalready exists locally; if it does, use it and note the stale ref in the report. If it does not exist, fall through to the fallback chain below. - If no remote matches, or the upstream tracking ref is unavailable after a failed
fetch, fall back to
git merge-base origin/main HEAD, thengit merge-base main HEAD. If none of these refs exist, stop with a clear error. Note the fallback in the report: a fork'smaincan be far behind upstream, which would misattribute old upstream commits to the branch.
- Run
- If the base resolves to the same commit as
HEAD, stop: there are no branch commits to analyze.
2. Detect changed plugins
- Run
git diff --name-only <base>..HEAD -- plugins/and group the paths by top-level directory underplugins/. - Classify each directory:
- Active plugin:
plugins/<name>/.claude-plugin/plugin.jsonexists atHEAD. Include in Step 3 for version analysis. - New plugin (added on the branch):
plugin.jsonexists atHEADbut not at<base>(git show <base>:plugins/<name>/.claude-plugin/plugin.jsonfails). Include in Step 3 — there is no base version to compare, so skip the "already bumped" check and report the current version as-is with a note that this is a new plugin. - Deleted plugin: paths appear in the diff but
plugin.jsondoes not exist atHEAD. Report it in the Step 4 table as removed (no bump possible). Do not include in Step 3. - Non-plugin directory: no
plugin.jsonatHEADand no diff paths that previously had one at<base>. Ignore silently.
- Active plugin:
- If no active, new, or deleted plugin directories changed, report that and stop.
3. Classify each changed plugin
For each changed plugin, read git log --oneline <base>..HEAD -- plugins/<name> and
git diff <base>..HEAD -- plugins/<name>, then pick the highest applicable level:
- major — breaking for plugin users:
- a skill, agent, or slash command is removed or renamed
- slash-command arguments change incompatibly (removed, reordered, made required)
- new required prerequisites (credentials, tools, cluster state)
- a hook or MCP server is removed
- an output format that consumers depend on changes incompatibly
- minor — backward-compatible additions:
- new skill, agent, hook, or MCP server
- new optional arguments or flags
- new capabilities added to an existing skill
- patch — everything else:
- bug fixes, prompt clarifications and tweaks, docs, typos, lint fixes
- internal refactors with unchanged user-facing behavior
Then check whether the branch already bumped the version: for plugins that existed at
the base (not new plugins), compare the version field from
git show <base>:plugins/<name>/.claude-plugin/plugin.json against the one at HEAD.
If it was already bumped, do not re-suggest — verify the existing bump is at least the
suggested level and report the plugin as "already bumped" (or "already bumped, but
under-scoped" when e.g. the branch bumped patch while the diff warrants minor or
major). For new plugins (no base version), skip this check.
4. Present suggestions and confirm
Present one table for all changed plugins:
| Plugin | Base version | Current version | Suggested bump | New version | Reasoning |
|---|
Column semantics: Base version is the version at <base> (or "—" for new plugins).
Current version is the version at HEAD. Suggested bump is the bump level to
apply (or "none" / "already bumped" / "removed"). New version is the target version
after applying the bump (or "—" when no action needed).
Reasoning is one line citing the driving commit(s) or change. Include "already bumped" rows for completeness, marked as requiring no action. Include deleted-plugin rows marked as "removed".
Then confirm with AskUserQuestion before changing anything: apply all suggestions, apply a subset (multi-select of plugins), or skip. Never edit files without this confirmation.
5. Apply confirmed bumps
- Edit the
versionfield in each confirmedplugins/<name>/.claude-plugin/plugin.json. - Run
./marketplace catalog-updateonce to sync the central.claude-plugin/marketplace.jsonfrom the per-plugin manifests. - Run
./marketplace validate <name>for each bumped plugin and report failures. - Show
git diff --statof the result. Leave the changes uncommitted unless the user asks; the repo convention is a dedicated "Bump plugins" commit.
Examples
User: /bump-plugins
Claude: Finds the remote tracking openshift-eng/edge-tooling, fetches its main,
computes the merge-base with HEAD, detects that lvms-ci and
microshift-ci changed, suggests a patch bump for each with one-line reasoning, asks
for confirmation, then edits both plugin.json files and runs
./marketplace catalog-update and ./marketplace validate.
User: /bump-plugins 07a4fd9
Claude: Same analysis, but comparing HEAD against commit 07a4fd9.
Edge Cases
- No remote tracks
openshift-eng/edge-tooling: fall back per Step 1 and state clearly which base was used — suggestions against a stale forkmainmay be wrong. - Dirty working tree: if
git status --porcelainshows uncommitted changes to anyplugin.jsonor to.claude-plugin/marketplace.json, warn before Step 5 and let the user decide whether to proceed. - Version already bumped on the branch: handled in Step 3 — report instead of re-suggesting; flag under-scoped bumps.
- Prerelease/build-metadata versions (e.g.
1.2.0-rc.1): the marketplace semver regex allows suffixes. Bump the numeric core and ask before dropping the suffix. - New plugin added on the branch:
plugin.jsonexists atHEADbut not at<base>. Handled in Step 2 — include it in analysis, skip the base-version comparison in Step 3, show "—" for base version in the table. - Plugin deleted on the branch: handled in Step 2 — report it in the table as removed, no bump possible.
- Version at HEAD lower than at base (accidental downgrade): flag it explicitly instead of suggesting a bump on top.
Notes
- The per-plugin
plugin.jsonis the source of truth;.claude-plugin/marketplace.jsonis a synced catalog. Never hand-edit the catalog —./marketplace catalog-updateregenerates it. - Steps 1–4 are read-only; only Step 5 modifies files, and only after explicit confirmation in Step 4.
Instalação
Adicione Bump Plugins ao seu cliente. Escolha o que você usa.
npx skills add openshift-eng/edge-toolingInstalls every skill in the repository, then prompts for which to keep.
/plugin marketplace add openshift-eng/edge-toolingAdds the repository as a plugin marketplace; install individual plugins with `/plugin install`.
git clone https://github.com/openshift-eng/edge-tooling
cp -r .claude/skills/bump-plugins ~/.claude/skills/A skill is a plain directory. Copy it into `.claude/skills/` in a project or in your home directory.
Pontuação
69 / 100
Boa