Discover real tags first (mandatory, always re-run, hard gate) — before
assuming any version, run these commands and show their full output to the
user:
git remote -v
git fetch --tags --force --prune origin 2>&1
git tag --sort=-version:refname | head -10
git describe --tags --abbrev=0 2>/dev/null || echo "(no local tags)"
gh release view --json tagName,name,publishedAt 2>&1 || echo "(gh release view failed)"
gh release list --limit 5 2>&1 || echo "(gh release list failed)"
Mandatory cross-checks:
a. Fetch must succeed. If git fetch prints any error (auth, network, no
remote), STOP and report the exact error to the user. Do not continue with
stale local tags unless the user explicitly says "use local only".
b. Compare local vs. remote. If gh release view returns a tag that is
newer than git tag --sort=-version:refname | head -1, the local clone is
out of date even after fetch — STOP and tell the user the remote latest
release tag verbatim. Ask whether they want to (i) pull the tag and retry,
or (ii) generate notes for a different range.
c. Hard assertion on the chosen new version. Whatever version you are
about to use as <NEW> MUST appear in the output of
git tag --sort=-version:refname from this turn. If it does not appear,
STOP — do not run any git rev-list, git log, git diff --stat, or
validation commands against that version. Tell the user the tag is missing
locally and list the tags that DO exist.
d. Forbidden inference sources for <NEW>. Do not pick the new version
from any of these — they are not source of truth:
- The
v2.4.0 / v2.3.1 examples in this skill file (SKILL.md, EXAMPLE.md).
- Filenames of existing
release-v*.md files in the working directory.
- Versions in
package.json, Cargo.toml, pyproject.toml, go.mod.
- Tag values remembered from earlier in the session or prior conversations.
The only authoritative sources are:
git tag output (post-fetch) and
gh release output, both produced in the current turn.
e. Always print and confirm. After running the commands, print this block
verbatim and wait for explicit user confirmation before continuing:
Detected:
- Local latest tag: <from git tag>
- Remote latest tag: <from gh release view, or "unknown">
- Proposed NEW: <value>
- Proposed BASE: <value>
Confirm to proceed (yes / change).
Also look for the most recent release-v*.md file in the current directory
and detect the language it was written in (for language detection only, per
the Language rule below). The release-note filename is not a source of
truth for the latest tag.