<!--
AskUserQuestion is deliberately absent from allowed-tools, and must stay absent. Listing it makes Claude Code's
permission evaluator auto-approve the tool through its always-allow path and return empty answers without ever
rendering the prompt, so every gate in this skill would silently pass. See
han-plugin-builder/skills/guidance/references/skill-building-guidance/allowed-tools-AskUserQuestion.md. The tool still
works unlisted; it prompts once for permission.
-->
Pre-requisites
- gh CLI: !
which gh 2>/dev/null || echo "not installed" - jq: !
which jq 2>/dev/null || echo "not installed" - claude CLI: !
which claude 2>/dev/null || echo "not installed" - git repo: !
git rev-parse --is-inside-work-tree 2>/dev/null || echo NO
If gh, jq, or claude reads not installed, or this is not a git repo: tell the operator which prerequisite is
missing and that it must be installed/configured before /han-release can run, then immediately stop. The skill
cannot proceed without all four.
The claude CLI is what creates the per-plugin tags in Step 10. Every invocation of it in this skill goes through the
shell's command builtin (command claude ...), never a bare claude, because an operator's shell commonly wraps
claude in a function or alias that blocks waiting for terminal input. The which probe above resolves the same way a
bare call would, so it reports the wrapper's presence rather than the executable's; treat a non-empty result as "the
tool is reachable" and let Step 10's first invocation be what proves it runs.
Project Context
- repo: !
gh repo view --json nameWithOwner -q .nameWithOwner 2>/dev/null || git config --get remote.origin.url - current branch: !
git branch --show-current 2>/dev/null || echo unknown - default branch: !
git symbolic-ref --short refs/remotes/origin/HEAD 2>/dev/null | sed 's#^origin/##' || echo unknown - working tree: !
git status --porcelain 2>/dev/null || echo NO - parent plugin name: !
jq -r .name .claude-plugin/marketplace.json 2>/dev/null - plugins (name source version):
!jq -r '.plugins[] | "\(.name)\t\(.source)\t\(.version)"' .claude-plugin/marketplace.json 2>/dev/null
- latest parent tag: !
git fetch --tags --quiet >/dev/null 2>&1; git tag -l 'han--v*' --sort=-v:refname | head -n1 - latest suite tag: !
git tag -l 'v*.*.*' --sort=-v:refname | head -n1 - changelog head: !
grep -m1 '^## v' CHANGELOG.md 2>/dev/null
The two tag probes are separate on purpose. A single pattern covering both namings returns the wrong tag: version
sorting compares the whole refname, so v4.6.0 sorts ahead of han--v5.0.0 and the old suite tag wins on every release
after the transition. The fetch runs on the first probe only; both read the same refreshed tag list.
latest parent tag carries the literal han--v* pattern, because a context-injection command is a fixed string and
cannot interpolate parent plugin name. If parent plugin name is not han, redo the lookup in Step 2 with the actual
name before using either value. Skipping that turns a renamed parent into an empty probe, which Step 2 would read as a
first release and silently expand the changelog to the whole repository history.
Vocabulary used throughout this skill
- parent — the meta-plugin whose name equals the marketplace
name(parent plugin nameabove, normallyhan). It
has no skills or agents of its own; it exists to install the children via dependencies. The parent's own per-plugin
tag is the one the GitHub release attaches to, so the release tag is {parent plugin name}--v{parent target}.
- children — every other entry in
marketplace.json.plugins[](han-core,han-github,han-reporting, and any
future han-* plugin). Each child has its own version line, bumped independently of the others.
- baseline of a plugin — its version at
prev(the latest release tag). For the parent this isprev#. For a child
it is the version recorded in that child's plugin.json at prev; if the child did not exist at prev, it is a
new plugin (see Step 3).
- current of a plugin — the version in its working-tree
plugin.json. - target of a plugin — the version being released for it. The release tag is
{parent plugin name}--v{parent target}.
- tag name of a plugin —
{name}--v{target}, for examplehan--v5.0.0andhan-core--v3.0.0. Every plugin gets
one, and the parent's is what the GitHub release attaches to.
previs the previous release's tag, resolved in Step 2 from the two tag probes. On the first release it is empty.prev#is the part ofprevafter its lastv. That rule is correct under both namings, which matters because
prev can be either shape:
```
v4.6.0 -> prev# is 4.6.0
han--v5.0.0 -> prev# is 5.0.0
```
Do not read prev# as "the number without the leading v". That older rule returns the whole tag string for a
per-plugin tag, and prev# is the parent's baseline (see 3a in references/version-plan-rules.md), so a wrong value here silently corrupts the entire
version plan rather than failing.
- Each plugin's source directory comes from the
sourcefield inmarketplace.json(for example./han-core), so its
plugin.json is {source}/.claude-plugin/plugin.json. Use {source} verbatim in every git command: the
./-prefixed form works both after a {ref}: colon (git show {prev}:{source}/...) and as a pathspec
(git diff ... -- {source}/). Do not strip the leading ./.
Step 1: Parse the invocation and check release safety
- Parse
$ARGUMENTSfor two independent flags, then treat the remaining free text as optional release context that
informs the changelog narrative:
pause_before_publish— true if the argument contains "pause", "review", or "confirm before publish"
(case-insensitive). Default false.
draft_release— true if the argument contains "draft". Default false.- The leftover text (anything that is not those flag phrases) is
$release_context, passed into the narrative
dispatch in Step 5. May be empty.
- Working tree must be clean. If
working treefrom Project Context is non-empty, there are uncommitted or
untracked changes. Stop and tell the operator to commit or stash them first. Releasing an unknown working state is
unsafe and a pushed tag is hard to reverse. This is a hard stop, not a pause gate.
- Branch note (non-blocking). If
current branchis not thedefault branch, do not stop — note in the Step 7
summary that the release is being cut from current branch and the tag will point at that branch's HEAD. The
operator chose autonomous; surface the fact, do not block.
Step 2: Determine previous version, commit range, and PR list
- Resolve
prevfrom the two tag probes, in this order:
1. latest parent tag when it is non-empty. This is the normal case from the second per-plugin release onward.
2. Otherwise latest suite tag. This is the transition release, the one release where the previous tag still carries
the old vX.Y.Z naming. Once a parent tag exists on the remote this arm is unreachable and can be deleted.
3. Otherwise empty: this is the first release. There is no previous tag, the commit range is the full history,
all compare links are omitted, and every plugin is treated as new (Step 3).
If parent plugin name is not han, the latest parent tag probe used the wrong literal. Re-run the lookup
yourself before applying the precedence above:
git tag -l '{parent plugin name}--v*' --sort=-v:refname | head -n1.
prev feeds two different things: the commit range below, and the parent's baseline version at 3a in references/version-plan-rules.md via
prev#. Parse prev# with the after-the-last-v rule in the vocabulary block, not by stripping a leading v.
- Commit range. With a previous tag:
${prev}..HEAD. First release: the full history (HEADwith no range base).
- Nothing to release check. Run
git log {range} --oneline. If it is empty, there are no commits sinceprev.
Stop and tell the operator there is nothing to release.
- Collect merged PRs in the range. Extract PR numbers from both squash subjects and merge commits:
```
git log {range} --pretty=%s%x00%b | grep -oE '#[0-9]+' | tr -d '#' | sort -un
```
For each number N, run gh pr view N --json number,title,author,url,mergedAt,state. Keep only entries where
state is MERGED. Sort the survivors by mergedAt ascending (newest merge last). This is $pr_list. The PR list
is repo-wide and appears once per release; it is not split per plugin. Build the PR lines and the changelog bullets
per references/release-notes-format.md and
references/changelog-rules.md.
- No-PR fallback. If
$pr_listis empty (local-only or squash history with no PR refs), record the notable commit
subjects from git log {range} --oneline instead, and use the commits form documented in both reference files.
- Collect closed issues and their attribution. For each merged PR
Nin$pr_list, find the issues that PR
closed and credit everyone involved, following references/attribution-rules.md.
That file holds the closing-issue lookup, the substantive-comment test that decides who counts as a contributor, the
bot-account exclusions, and the shape of each $issue_list entry. If no closed issues are found, $issue_list is
empty and the issues subsection/section is omitted everywhere.
Step 3: Build the per-plugin version plan
Enumerate the plugins from plugins in Project Context (one parent, plus each child). For every plugin, determine
baseline, whether it changed in {range}, and its target. Classify changes against