/productivity:release [patch|minor|major]from productivity
Bumps version, generates changelog from conventional commits or PR references, and creates a GitHub release. Accepts patch/minor/major argument or auto-detects bump type.
Ships in productivity. Installing the plugin adds it to Claude Code.
basename \git rev-parse --show-toplevel 2>/dev/null` 2>/dev/null || echo "unknown"`jq -r '.plugins[0].version' .claude-plugin/marketplace.json 2>/dev/null || echo "unknown"git describe --tags --abbrev=0 2>/dev/null || echo "No tags found"TAG=\git describe --tags --abbrev=0 2>/dev/null || git rev-list --max-parents=0 HEAD`; git log "$TAG"..HEAD --oneline 2>/dev/null | wc -l | tr -d ' ' || echo "0"`Create a new release for the gopher-ai plugin marketplace.
If $ARGUMENTS is provided (patch, minor, or major), use that bump type.
If $ARGUMENTS is empty, analyze commits since the last tag to suggest a bump type:
BREAKING CHANGE:, !: suffix)feat:)fix:, chore:, docs:, etc.)Ask the user to confirm the bump type using AskUserQuestion before proceeding.
Validate State
git status --porcelainorigin/main and require HEAD to equal origin/mainDetect Changelog Strategy
Automatically detect whether the project uses PR-based or direct-commit workflow:
# Get last tag (or first commit if no tags)
LAST_TAG=$(git describe --tags --abbrev=0 2>/dev/null || git rev-list --max-parents=0 HEAD)
# Count total commits since last tag
TOTAL_COMMITS=$(git log "$LAST_TAG"..HEAD --oneline | wc -l | tr -d ' ')
# Count commits with PR references like (#123)
PR_COMMITS=$(git log "$LAST_TAG"..HEAD --oneline | awk '/\(#[0-9]+\)/ { count++ } END { print count+0 }')
# Calculate percentage (avoid division by zero)
if [ "$TOTAL_COMMITS" -gt 0 ]; then
PR_PERCENTAGE=$((PR_COMMITS * 100 / TOTAL_COMMITS))
else
PR_PERCENTAGE=0
fi
Decision logic:
--generate-notes)Report which strategy was detected to the user.
Calculate New Version
.claude-plugin/marketplace.jsonUpdate Versions
.claude-plugin/marketplace.json:jq --arg v "NEW_VERSION" '
.metadata.version = $v |
.plugins[].version = $v
' .claude-plugin/marketplace.json > /tmp/marketplace.json.tmp && \
mv /tmp/marketplace.json.tmp .claude-plugin/marketplace.json
plugin.json (Claude Code and Codex use these for cache paths):for pjson in plugins/*/.claude-plugin/plugin.json plugins/*/.codex-plugin/plugin.json; do
[ -f "$pjson" ] || continue
jq --arg v "NEW_VERSION" '.version = $v' "$pjson" > /tmp/pj.tmp && mv /tmp/pj.tmp "$pjson"
done
Verify every version source before continuing:
jq -e --arg v "NEW_VERSION" '
.metadata.version == $v and all(.plugins[]; .version == $v)
' .claude-plugin/marketplace.json >/dev/null
for pjson in plugins/*/.claude-plugin/plugin.json plugins/*/.codex-plugin/plugin.json; do
[ -f "$pjson" ] || continue
jq -e --arg v "NEW_VERSION" '.version == $v' "$pjson" >/dev/null
done
Validate and Build
Run the full repository gate before committing:
bash -lc 'python3 -m pip install --disable-pip-version-check --requirement requirements-test.txt && ./scripts/test-installation.sh && ./scripts/test-commands.sh && ./scripts/test-hooks.sh && ./scripts/test-ship-e2e-gate.sh && ./scripts/check-shared-sync.sh && shellcheck agent-skills/scripts/*.sh && for skill_dir in agent-skills/skills/*/; do skill_name=$(basename "$skill_dir"); skill_file="$skill_dir/SKILL.md"; test -f "$skill_file"; lines=$(wc -l < "$skill_file"); test "$lines" -lt 500; name=$(sed -n "/^---$/,/^---$/p" "$skill_file" | awk "/^name:/ {print \$2; exit}"); test "$name" = "$skill_name"; rg -q "^description:" "$skill_file"; done && ruby -ryaml -e "YAML.load_file(ARGV[0])" agent-skills/config/severity.yaml && (cd agent-skills/examples/demo-repo && go build -o /tmp/gopher-ai-demo . && go test ./...)'
./scripts/build-universal.sh
Assert that the builder's exact archives exist and every packaged manifest contains the requested version:
VERSION="NEW_VERSION"
CODEX_ASSET="dist/gopher-ai-codex-plugins-v${VERSION}.tar.gz"
GEMINI_ASSET="dist/gopher-ai-gemini-extensions-v${VERSION}.tar.gz"
OPENCODE_ASSET="dist/gopher-ai-opencode-v${VERSION}.tar.gz"
test -f "$CODEX_ASSET"
test -f "$GEMINI_ASSET"
test -f "$OPENCODE_ASSET"
CODEX_MANIFESTS=$(tar -tzf "$CODEX_ASSET" | rg '/\.codex-plugin/plugin\.json$')
test -n "$CODEX_MANIFESTS"
while IFS= read -r manifest; do
tar -xOzf "$CODEX_ASSET" "$manifest" | jq -e --arg v "$VERSION" '.version == $v' >/dev/null
done <<< "$CODEX_MANIFESTS"
GEMINI_MANIFESTS=$(tar -tzf "$GEMINI_ASSET" | rg '/gemini-extension\.json$')
test -n "$GEMINI_MANIFESTS"
while IFS= read -r manifest; do
tar -xOzf "$GEMINI_ASSET" "$manifest" | jq -e --arg v "$VERSION" '.version == $v' >/dev/null
done <<< "$GEMINI_MANIFESTS"
test "$(tar -xOzf "$OPENCODE_ASSET" opencode/gopher-ai/VERSION)" = "$VERSION"
Stop immediately if any command in this step fails. Do not commit, push, tag, draft, or publish a release.
Commit and Push the Release Change
git add .claude-plugin/marketplace.json plugins/*/.claude-plugin/plugin.json plugins/*/.codex-plugin/plugin.json
git commit -m "chore: release vX.Y.Z"
RELEASE_SHA=$(git rev-parse HEAD)
git push origin HEAD:main
Wait for Release-Commit CI
Poll check runs through GitHub's REST API and require checks for the exact release commit. An empty check set is not success.
CHECKS=""
for attempt in $(seq 1 24); do
CHECKS=$(gh api "repos/{owner}/{repo}/commits/${RELEASE_SHA}/check-runs")
[ "$(jq '.total_count' <<< "$CHECKS")" -gt 0 ] && break
sleep 5
done
test "$(jq '.total_count' <<< "$CHECKS")" -gt 0
for attempt in $(seq 1 60); do
CHECKS=$(gh api "repos/{owner}/{repo}/commits/${RELEASE_SHA}/check-runs")
FAILED=$(jq '[.check_runs[] | select(.status == "completed" and (.conclusion | IN("success", "neutral", "skipped") | not))] | length' <<< "$CHECKS")
PENDING=$(jq '[.check_runs[] | select(.status != "completed")] | length' <<< "$CHECKS")
test "$FAILED" -eq 0
[ "$PENDING" -eq 0 ] && break
sleep 10
done
GREEN_COUNT=$(jq '.total_count' <<< "$CHECKS")
sleep 10
CHECKS=$(gh api "repos/{owner}/{repo}/commits/${RELEASE_SHA}/check-runs")
test "$(jq '[.check_runs[] | select(.status != "completed")] | length' <<< "$CHECKS")" -eq 0
test "$(jq '[.check_runs[] | select(.conclusion | IN("success", "neutral", "skipped") | not)] | length' <<< "$CHECKS")" -eq 0
test "$(jq '.total_count' <<< "$CHECKS")" -eq "$GREEN_COUNT"
test "$(git rev-parse HEAD)" = "$RELEASE_SHA"
test "$(git ls-remote origin refs/heads/main | awk '{print $1}')" = "$RELEASE_SHA"
Stop if checks do not register within two minutes, fail, remain incomplete,
or if HEAD changes. Do not create a tag, draft, or published release.
Create and Verify a Draft Release
Use the strategy detected in step 2. Create a draft targeted at the exact CI-verified commit and upload all three already-verified archives in the same command. GitHub creates the tag from that commit when the draft is published.
Use GitHub's auto-generated notes which work well for PR-based repos:
gh release create vX.Y.Z --draft --target "$RELEASE_SHA" --title "vX.Y.Z" --generate-notes "$CODEX_ASSET" "$GEMINI_ASSET" "$OPENCODE_ASSET"
Generate changelog from commit messages:
git log LAST_TAG..HEAD --format="%s" --reversefeat:) - New functionalityfix:) - Bug fixesrefactor:) - Code changes that neither fix bugs nor add featureschore:, docs:, style:, perf:, test:, ci:) - Everything else--notes flag:gh release create vX.Y.Z --draft --target "$RELEASE_SHA" --title "vX.Y.Z" --notes "$(cat <<'EOF'
## What's Changed
### Features
- **(scope)** description
### Bug Fixes
- **(scope)** description
**Full Changelog**: https://github.com/OWNER/REPO/compare/vOLD...vNEW
EOF
)" "$CODEX_ASSET" "$GEMINI_ASSET" "$OPENCODE_ASSET"
Formatting rules for conventional commits:
type(scope): description or type: description- **(scope)** description or - description (if no scope)chore: release)Verify the release is still a draft, targets the checked commit, and has exactly the expected assets:
RELEASE=$(gh api --paginate --slurp "repos/{owner}/{repo}/releases" | jq --arg tag "vX.Y.Z" 'add | map(select(.tag_name == $tag)) | first')
test "$(jq -r '.draft' <<< "$RELEASE")" = "true"
test "$(jq -r '.target_commitish' <<< "$RELEASE")" = "$RELEASE_SHA"
jq -e --arg codex "${CODEX_ASSET##*/}" --arg gemini "${GEMINI_ASSET##*/}" --arg opencode "${OPENCODE_ASSET##*/}" '
(.assets | length) == 3 and
([.assets[].name] | sort) == ([$codex, $gemini, $opencode] | sort)
' <<< "$RELEASE" >/dev/null
RELEASE_ID=$(jq -r '.id' <<< "$RELEASE")
Publish
Publish only the fully verified draft:
gh api --method PATCH "repos/{owner}/{repo}/releases/${RELEASE_ID}" -F draft=false >/dev/null
PUBLISHED=$(gh api "repos/{owner}/{repo}/releases/${RELEASE_ID}")
jq -e --arg tag "vX.Y.Z" --arg codex "${CODEX_ASSET##*/}" --arg gemini "${GEMINI_ASSET##*/}" --arg opencode "${OPENCODE_ASSET##*/}" '
(.draft | not) and .tag_name == $tag and
([.assets[].name] | sort) == ([$codex, $gemini, $opencode] | sort)
' <<< "$PUBLISHED" >/dev/null
test "$(gh api "repos/{owner}/{repo}/git/ref/tags/vX.Y.Z" --jq '.object.sha')" = "$RELEASE_SHA"
jq '{draft, tag_name, html_url, assets: [.assets[].name]}' <<< "$PUBLISHED"
Report Success
./scripts/refresh-plugins.sh to update local cache/release - Auto-detect bump type from commits/release patch - Force patch bump (1.1.0 → 1.1.1)/release minor - Force minor bump (1.1.0 → 1.2.0)/release major - Force major bump (1.1.0 → 2.0.0)What the command file sets; muted values are Claude Code's defaults
7-day visitors to each command page
npx claudepluginhub gopherguides/gopher-ai --plugin productivity5 commands in this plugin
/changelogContextGenerate changelog from commits since last release/gopher-ai-refreshRefresh Gopher-AI PluginsRefresh all gopher-ai plugins (clear cache + reinstall)/standupContextGenerate standup notes from recent git activity/weekly-summaryContextGenerate weekly work summary from git activityOther plugins' commands for the same job