Skip to content

Add project-scoped bumping-version skill - #37

Merged
ether-moon merged 1 commit into
mainfrom
ether_karrot/add-project-bumping-version
Aug 4, 2026
Merged

Add project-scoped bumping-version skill#37
ether-moon merged 1 commit into
mainfrom
ether_karrot/add-project-bumping-version

Conversation

@ether-moon

@ether-moon ether-moon commented Aug 4, 2026

Copy link
Copy Markdown
Owner

Summary

  • install bumping-version from ether-moon/release-workflow at project scope with npx skills add
  • keep the canonical skill under .agents/skills/, link it for Claude Code under .claude/skills/, and record the source hash in skills-lock.json
  • update the Versioning policy documentation to reference the project-scoped skill

Why

bumping-version now has an independent repository and release cycle instead of being bundled with the core skill-set plugin. Installing it at project scope keeps release automation available to both Codex and Claude Code without depending on a global installation.

Installation

npx skills add ether-moon/release-workflow \
  --skill bumping-version \
  --agent claude-code \
  --agent codex \
  --yes

Validation

  • npx skills list --agent claude-code --agent codex
  • installed runner parity with ether-moon/release-workflow
  • release runner inspect against the pushed branch: version 1.14.4, consistent manifests, valid changelog and policy
  • complete plugins/skill-set/tests/run.sh suite with the repository's mise Ruby
  • strict plugin and marketplace validation
  • generated inventory, 192 eval cases, trigger matrix, and reference validation

Summary by CodeRabbit

  • New Features

    • Added a guided version-release workflow with inspection, preparation, publishing, and cleanup steps.
    • Added dry-run previews, validation checks, structured results, and recovery information.
    • Added safeguards for version updates, release branches, commits, and remote publishing.
  • Documentation

    • Added comprehensive guidance for version management, approval, recovery, and reconciliation.
    • Updated project instructions and skill configuration for the new release workflow.

@coderabbitai

coderabbitai Bot commented Aug 4, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Adds the project-scoped bumping-version skill, its Bash release workflow CLI, a Claude symlink, updated repository guidance, and a skills lock. The CLI supports inspection, preview, preparation, publication, cleanup, structured JSON results, and recovery state.

Changes

Versioning skill

Layer / File(s) Summary
Workflow contract and inspection
.agents/skills/bumping-version/SKILL.md, .agents/skills/bumping-version/scripts/release-workflow, .claude/skills/bumping-version, AGENTS.md, skills-lock.json
Defines the release workflow and implements dependency checks, repository resolution, policy and manifest inspection, recent-commit collection, CLI dispatch, and project-level skill wiring.
Version preview and manifest updates
.agents/skills/bumping-version/SKILL.md, .agents/skills/bumping-version/scripts/release-workflow
Validates semantic-version changes, generates changelog entries, and updates JSON, TOML, and text manifests atomically.
Compare-and-swap release preparation
.agents/skills/bumping-version/SKILL.md, .agents/skills/bumping-version/scripts/release-workflow
Creates isolated release worktrees, verifies preview inputs and base commits, updates release files, validates commit scope, and persists release state.
Publication, cleanup, and recovery
.agents/skills/bumping-version/SKILL.md, .agents/skills/bumping-version/scripts/release-workflow
Validates publication approval and remote state, pushes prepared commits, reconciles repeated operations, cleans up worktrees and branches, and emits structured recovery results.

Estimated code review effort: 4 (Complex) | ~60 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the main change: adding the project-scoped bumping-version skill.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ether_karrot/add-project-bumping-version

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@ether-moon
ether-moon marked this pull request as ready for review August 4, 2026 11:16
@ether-moon
ether-moon merged commit abce7d2 into main Aug 4, 2026
1 of 2 checks passed

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 5

🧹 Nitpick comments (2)
.agents/skills/bumping-version/scripts/release-workflow (2)

29-34: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

gh is declared mandatory but never used. The runner publishes with git push and never creates a pull request, so GitHub CLI has no call site. Declaring it in preflight makes the skill fail with MISSING_DEPENDENCY on hosts without gh.

  • .agents/skills/bumping-version/scripts/release-workflow#L29-L34: change the preflight loop to for dependency in git jq; do, and drop the redundant bash check because the script already runs under Bash.
  • .agents/skills/bumping-version/SKILL.md#L12-L12: update the documented dependency list to Bash 3.2 or newer, git, and jq.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.agents/skills/bumping-version/scripts/release-workflow around lines 29 -
34, Remove the unused gh and redundant bash checks from preflight() in
.agents/skills/bumping-version/scripts/release-workflow, leaving only git and jq
as validated commands. Update the dependency documentation in
.agents/skills/bumping-version/SKILL.md to list Bash 3.2 or newer, git, and jq.

510-517: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Replace files instead of using GNU-only chmod --reference.

The script requires Bash 3.2, which targets macOS, where BSD chmod does not support --reference. The failing call is suppressed and mv then replaces the manifest/changelog with the temp file's default mode. Write into the existing file path, or preserve/refine permissions using a portable fallback.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.agents/skills/bumping-version/scripts/release-workflow around lines 510 -
517, Update the temporary-file replacement logic around the manifest version
update to avoid GNU-only chmod --reference, which is unsupported by Bash
3.2/macOS environments. Preserve the existing manifest file’s permissions
portably by writing the jq output directly to the existing path or using a
portable permission-preservation fallback before mv, while retaining cleanup and
failure handling.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.agents/skills/bumping-version/scripts/release-workflow:
- Around line 1-6: Extend the deterministic validation workflow in
validate-skill-set.yml to include
.agents/skills/bumping-version/scripts/release-workflow, ensuring this
executable is included in shellcheck and/or script test coverage and changes to
it can gate releases. Preserve the existing validation behavior for
plugins/skill-set/**.
- Line 874: Validate RELEASE_WORKFLOW_DATE using the same override-validation
flow as RELEASE_WORKFLOW_TIMESTAMP, requiring the YYYY-MM-DD format before it is
used to generate the changelog heading. Reject malformed user-supplied dates
rather than allowing them to reach the changelog-writing logic, while preserving
the default current-date behavior.
- Around line 1214-1226: Update the cleanup flow around cleanup_log and the git
update-ref call so output redirection falls back to /dev/null when the temp_root
directory no longer exists. Preserve logging to cleanup.log when the directory
is available, and ensure branch removal still executes and remains idempotent
during retries.
- Around line 126-138: Update the base-fetch logic after `ls-remote` to fetch
`refs/heads/$base_branch` rather than requesting the unadvertised `$base_sha`
object directly. After fetching, resolve the fetched remote branch tip and
compare it with the existing `base_sha`, emitting an error if they differ, while
preserving the subsequent `cat-file` validation.
- Around line 337-351: Update the commit collection logic in the release-history
function so a missing expected release subject cannot enumerate the entire
repository history: bound the git log result to the intended recent-commit
limit. Replace the per-commit jq invocation inside the `while` loop with one jq
pass over the complete bounded input, preserving the existing `{sha, subject}`
structure and `commit_range` behavior when `last_release` is found.

---

Nitpick comments:
In @.agents/skills/bumping-version/scripts/release-workflow:
- Around line 29-34: Remove the unused gh and redundant bash checks from
preflight() in .agents/skills/bumping-version/scripts/release-workflow, leaving
only git and jq as validated commands. Update the dependency documentation in
.agents/skills/bumping-version/SKILL.md to list Bash 3.2 or newer, git, and jq.
- Around line 510-517: Update the temporary-file replacement logic around the
manifest version update to avoid GNU-only chmod --reference, which is
unsupported by Bash 3.2/macOS environments. Preserve the existing manifest
file’s permissions portably by writing the jq output directly to the existing
path or using a portable permission-preservation fallback before mv, while
retaining cleanup and failure handling.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: dd6284ab-5bce-4a68-9327-19ef5521709e

📥 Commits

Reviewing files that changed from the base of the PR and between 0c63702 and b39e4e1.

📒 Files selected for processing (5)
  • .agents/skills/bumping-version/SKILL.md
  • .agents/skills/bumping-version/scripts/release-workflow
  • .claude/skills/bumping-version
  • AGENTS.md
  • skills-lock.json

Comment on lines +1 to +6
#!/usr/bin/env bash

set -eu
set -o pipefail

program_name=${0##*/}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Verify the committed file mode and current CI coverage for the new skill path.
set -eu

echo '== committed mode =='
git ls-files -s .agents/skills/bumping-version/scripts/release-workflow

echo '== workflow references to shellcheck/test paths =='
fd -t f -e yml -e yaml . .github/workflows --exec rg -n 'shellcheck|run\.sh|\.agents|plugins/skill-set' {}

echo '== existing test harnesses =='
fd -t f -g 'run.sh' .

Repository: ether-moon/skill-set

Length of output: 1529


🏁 Script executed:

#!/bin/bash
set -eu

echo '== candidate references to .agents/bumping-version or release-workflow =='
rg -n 'bumping-version|\.agents|release-workflow|plugins/skill-set' . \
  --glob '!/.git' \
  --glob '!.agents/cache/**' \
  --glob '!plugins/skill-set/cache/**' \
  | sed -n '1,220p'

echo '== file mode for related bumping script and directory =='
if [ -e .agents/skills/bumping-version ]; then
  git ls-files -s .agents/skills/bumping-version | sed -n '1,40p'
fi

echo '== workflow relevant sections =='
sed -n '1,80p' .github/workflows/validate-skill-set.yml

Repository: ether-moon/skill-set

Length of output: 14802


Extend the deterministic validation workflow to include the release script.

.agents/skills/bumping-version/scripts/release-workflow already has mode 100755, but .github/workflows/validate-skill-set.yml only gates plugins/skill-set/** and does not shellcheck or test this executable. Add coverage for external agent scripts or gate releases against this workflow.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.agents/skills/bumping-version/scripts/release-workflow around lines 1 - 6,
Extend the deterministic validation workflow in validate-skill-set.yml to
include .agents/skills/bumping-version/scripts/release-workflow, ensuring this
executable is included in shellcheck and/or script test coverage and changes to
it can gate releases. Preserve the existing validation behavior for
plugins/skill-set/**.

Comment on lines +126 to +138
if ! remote_line=$(git -C "$repo_path" ls-remote --exit-code origin "refs/heads/$base_branch" 2>&1); then
remote_code=$(classify_remote_error "$remote_line")
emit_error "$remote_code" "Unable to resolve origin/$base_branch." \
"Verify the remote branch and authentication, then retry."
fi
base_sha=${remote_line%%[[:space:]]*}
if ! git -C "$repo_path" fetch --no-tags origin "$base_sha" >/dev/null 2>&1; then
emit_error "REMOTE_FETCH_FAILED" "Unable to fetch exact base commit $base_sha from origin/$base_branch." \
"Verify remote access and retry."
fi
git -C "$repo_path" cat-file -e "$base_sha^{commit}" 2>/dev/null || \
emit_error "BASE_NOT_FOUND" "Fetched base commit is unavailable: $base_sha" \
"Fetch origin/$base_branch and retry."

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🌐 Web query:

Does GitHub allow git fetch of an unadvertised commit SHA, and what is the Git default for uploadpack.allowAnySHA1InWant?

💡 Result:

GitHub generally does not allow a direct git fetch of an unadvertised commit SHA [1][2][3]. When you attempt to fetch a commit that is not reachable via an advertised ref (such as a branch tip or a tag), the server will typically reject the request with an error message stating that it does not allow requests for unadvertised objects [1][2]. Regarding the Git configuration setting uploadpack.allowAnySHA1InWant: 1. Default Value: The default value for uploadpack.allowAnySHA1InWant is false [4]. 2. Context: This setting controls whether the Git server (upload-pack) will accept fetch requests for any object SHA-1, regardless of whether it is an advertised ref [4]. When set to true, it permits fetching objects that are not reachable from current branches or tags [5][6]. 3. Protocol v2: It is worth noting that when using Git protocol version 2, the reachability restrictions are typically lifted, and the server behaves as if uploadpack.allowAnySHA1InWant is enabled [7]. For environments where you cannot fetch an unadvertised commit via standard git fetch, alternative methods such as using the GitHub API to download the commit as a tarball are commonly used [1].

Citations:


🌐 Web query:

Git 2.45 uploadpack.allowAnySHA1InWant defaults v2 unadvertised objects

💡 Result:

In Git 2.45, the configuration setting uploadpack.allowAnySHA1InWant does not have a hardcoded "default" value in the sense of being set to true or false by the software; rather, it is described as "not set" by default [1][2][3]. When this configuration is not explicitly set, Git's behavior is governed by the underlying logic of the upload-pack process, which allows fetch requests for objects that are reachable or at the tip of advertised references [4][5]. The setting uploadpack.allowAnySHA1InWant serves as an override that, when enabled (set to true), explicitly permits a client to request any object in the repository's object store, even those not reachable from advertised refs [1][4][2]. Key points regarding this setting in Git 2.45 include: - Relationship with other settings: Enabling uploadpack.allowAnySHA1InWant implies enabling both uploadpack.allowTipSHA1InWant and uploadpack.allowReachableSHA1InWant [1][2][3]. Conversely, setting it to false will disable those two options as well [2][3]. - Documentation clarification: Recent updates to Git documentation (including around the 2.45 timeframe) have clarified that this setting impacts the other two allow-options and explicitly states its default is "not set" rather than a boolean default of false [2][3]. - Protocol behavior: While Git 2.45 introduced various security and resource-bounding updates to upload-pack (such as fixing how v2 protocol capabilities are advertised), it did not fundamentally change the protocol default regarding unadvertised objects to be "open" by default; the security model still relies on restricting access to objects not reachable from advertised refs unless the administrator explicitly opts into broader access via configuration [4][6][7].

Citations:


Fallback to ref-based fetching for the base commit.

Fetching origin "$base_sha" requests an unadvertised object. Git servers without uploadpack.allowAnySHA1InWant reject that demand unless the commit is reachable from advertised refs, so releases can fail at REMOTE_FETCH_FAILED. Fetch refs/heads/$base_branch, then compare the fetched tip against the existing ls-remote SHA for the same immutability check.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.agents/skills/bumping-version/scripts/release-workflow around lines 126 -
138, Update the base-fetch logic after `ls-remote` to fetch
`refs/heads/$base_branch` rather than requesting the unadvertised `$base_sha`
object directly. After fetching, resolve the fetched remote branch tip and
compare it with the existing `base_sha`, emitting an error if they differ, while
preserving the subsequent `cat-file` validation.

Comment on lines +337 to +351
while IFS=$'\t' read -r candidate_sha candidate_subject; do
if [[ "$candidate_subject" == "$expected_release_subject" ]]; then
last_release=$candidate_sha
break
fi
done < <(git -C "$repo_path" log "$base_sha" --format='%H%x09%s' 2>/dev/null)
commit_range=$base_sha
[[ -z "$last_release" ]] || commit_range="$last_release..$base_sha"
while IFS=$'\t' read -r commit_sha subject; do
[[ -n "$commit_sha" ]] || continue
commits=$(jq -cn --argjson commits "$commits" --arg sha "$commit_sha" \
--arg subject "$subject" '$commits + [{sha:$sha,subject:$subject}]')
done < <(git -C "$repo_path" log "$commit_range" --format='%H%x09%s' 2>/dev/null)
printf '%s\n' "$commits"
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀 Performance & Scalability | 🟠 Major | ⚡ Quick win

Unbounded history walk produces O(N) subprocesses and an unusable changelog entry.

If no commit subject matches the expected release subject, line 344 leaves commit_range as $base_sha. Line 349 then enumerates the entire history, and line 347 spawns one jq process per commit. build_changelog_entry spawns two or three more per commit.

This path is reached on a first release with this skill, and after any change to the Commit message policy. On a repository with thousands of commits, prepare spawns thousands of processes and writes a CHANGELOG.md entry containing one bullet per commit in history.

Build the list in one jq pass and bound the commit count.

🐛 Proposed fix
-  while IFS=$'\t' read -r commit_sha subject; do
-    [[ -n "$commit_sha" ]] || continue
-    commits=$(jq -cn --argjson commits "$commits" --arg sha "$commit_sha" \
-      --arg subject "$subject" '$commits + [{sha:$sha,subject:$subject}]')
-  done < <(git -C "$repo_path" log "$commit_range" --format='%H%x09%s' 2>/dev/null)
+  commits=$(git -C "$repo_path" log --max-count=200 "$commit_range" \
+    --format='%H%x09%s' 2>/dev/null |
+    jq -Rsc 'split("\n") | map(select(length > 0) | split("\t") | {sha:.[0],subject:.[1]})')
   printf '%s\n' "$commits"

Note that recent_commits is part of input_digest, so a preview taken before this change is invalidated by it. That is the intended compare-and-swap behavior.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
while IFS=$'\t' read -r candidate_sha candidate_subject; do
if [[ "$candidate_subject" == "$expected_release_subject" ]]; then
last_release=$candidate_sha
break
fi
done < <(git -C "$repo_path" log "$base_sha" --format='%H%x09%s' 2>/dev/null)
commit_range=$base_sha
[[ -z "$last_release" ]] || commit_range="$last_release..$base_sha"
while IFS=$'\t' read -r commit_sha subject; do
[[ -n "$commit_sha" ]] || continue
commits=$(jq -cn --argjson commits "$commits" --arg sha "$commit_sha" \
--arg subject "$subject" '$commits + [{sha:$sha,subject:$subject}]')
done < <(git -C "$repo_path" log "$commit_range" --format='%H%x09%s' 2>/dev/null)
printf '%s\n' "$commits"
}
while IFS=$'\t' read -r candidate_sha candidate_subject; do
if [[ "$candidate_subject" == "$expected_release_subject" ]]; then
last_release=$candidate_sha
break
fi
done < <(git -C "$repo_path" log "$base_sha" --format='%H%x09%s' 2>/dev/null)
commit_range=$base_sha
[[ -z "$last_release" ]] || commit_range="$last_release..$base_sha"
commits=$(git -C "$repo_path" log --max-count=200 "$commit_range" \
--format='%H%x09%s' 2>/dev/null |
jq -Rsc 'split("\n") | map(select(length > 0) | split("\t") | {sha:.[0],subject:.[1]})')
printf '%s\n' "$commits"
}
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.agents/skills/bumping-version/scripts/release-workflow around lines 337 -
351, Update the commit collection logic in the release-history function so a
missing expected release subject cannot enumerate the entire repository history:
bound the git log result to the intended recent-commit limit. Replace the
per-commit jq invocation inside the `while` loop with one jq pass over the
complete bounded input, preserving the existing `{sha, subject}` structure and
`commit_range` behavior when `last_release` is found.

base_sha=$(printf '%s' "$inspection" | jq -r '.base_sha')
current_version=$(printf '%s' "$inspection" | jq -r '.current_version')
version=$(next_version "$current_version" "$release_level")
release_date=${RELEASE_WORKFLOW_DATE:-$(date -u +%Y-%m-%d)}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win

Validate RELEASE_WORKFLOW_DATE like the timestamp override.

RELEASE_WORKFLOW_TIMESTAMP is validated at lines 959-965, but RELEASE_WORKFLOW_DATE is used verbatim. A malformed value reaches line 491 and writes a heading such as ## [1.2.3] - not-a-date into CHANGELOG.md. Every later check still passes, so the malformed heading is committed and pushed. A user-supplied changelog file is already required to match YYYY-MM-DD, so the generated path should hold the same rule.

🐛 Proposed fix
   release_date=${RELEASE_WORKFLOW_DATE:-$(date -u +%Y-%m-%d)}
+  case "$release_date" in
+    [0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]) ;;
+    *)
+      emit_error "INVALID_RELEASE_DATE" "Release date must use YYYY-MM-DD: $release_date" \
+        "Unset RELEASE_WORKFLOW_DATE or provide a YYYY-MM-DD value."
+      ;;
+  esac
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
release_date=${RELEASE_WORKFLOW_DATE:-$(date -u +%Y-%m-%d)}
release_date=${RELEASE_WORKFLOW_DATE:-$(date -u +%Y-%m-%d)}
case "$release_date" in
[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]) ;;
*)
emit_error "INVALID_RELEASE_DATE" "Release date must use YYYY-MM-DD: $release_date" \
"Unset RELEASE_WORKFLOW_DATE or provide a YYYY-MM-DD value."
;;
esac
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.agents/skills/bumping-version/scripts/release-workflow at line 874,
Validate RELEASE_WORKFLOW_DATE using the same override-validation flow as
RELEASE_WORKFLOW_TIMESTAMP, requiring the YYYY-MM-DD format before it is used to
generate the changelog heading. Reject malformed user-supplied dates rather than
allowing them to reach the changelog-writing logic, while preserving the default
current-date behavior.

Comment on lines +1214 to +1226
cleanup_log="$(printf '%s' "$state_json" | jq -r '.temp_root')/cleanup.log"
if [[ "$worktree_present" == true ]] && \
! git -C "$repo_path" worktree remove "$worktree" >"$cleanup_log" 2>&1; then
emit_error "WORKTREE_REMOVE_FAILED" "Unable to remove prepared worktree: $worktree" \
"The worktree and branch are preserved. Inspect $cleanup_log."
fi

if [[ "$cleanup_mode" == success && "$branch_present" == true ]]; then
if ! git -C "$repo_path" update-ref -d "refs/heads/$branch" "$commit_sha" >"$cleanup_log" 2>&1; then
emit_error "BRANCH_REMOVE_FAILED" "Unable to remove published release branch: $branch" \
"The worktree was removed; remove local branch $branch after inspection."
fi
fi

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win

Cleanup fails when the temporary directory is already gone.

cleanup_log points inside temp_root, which lives under TMPDIR and can be reaped by the OS. The state file lives in the Git common directory and survives. If temp_root is missing, the redirection at line 1222 fails before git update-ref runs, so cleanup reports BRANCH_REMOVE_FAILED for a branch removal it never attempted. SKILL.md line 102 promises that retrying the exact cleanup command reconciles idempotently, so this breaks the documented contract.

Fall back to /dev/null when the directory is absent.

🐛 Proposed fix
   cleanup_log="$(printf '%s' "$state_json" | jq -r '.temp_root')/cleanup.log"
+  [[ -d "${cleanup_log%/*}" ]] || cleanup_log=/dev/null
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
cleanup_log="$(printf '%s' "$state_json" | jq -r '.temp_root')/cleanup.log"
if [[ "$worktree_present" == true ]] && \
! git -C "$repo_path" worktree remove "$worktree" >"$cleanup_log" 2>&1; then
emit_error "WORKTREE_REMOVE_FAILED" "Unable to remove prepared worktree: $worktree" \
"The worktree and branch are preserved. Inspect $cleanup_log."
fi
if [[ "$cleanup_mode" == success && "$branch_present" == true ]]; then
if ! git -C "$repo_path" update-ref -d "refs/heads/$branch" "$commit_sha" >"$cleanup_log" 2>&1; then
emit_error "BRANCH_REMOVE_FAILED" "Unable to remove published release branch: $branch" \
"The worktree was removed; remove local branch $branch after inspection."
fi
fi
cleanup_log="$(printf '%s' "$state_json" | jq -r '.temp_root')/cleanup.log"
[[ -d "${cleanup_log%/*}" ]] || cleanup_log=/dev/null
if [[ "$worktree_present" == true ]] && \
! git -C "$repo_path" worktree remove "$worktree" >"$cleanup_log" 2>&1; then
emit_error "WORKTREE_REMOVE_FAILED" "Unable to remove prepared worktree: $worktree" \
"The worktree and branch are preserved. Inspect $cleanup_log."
fi
if [[ "$cleanup_mode" == success && "$branch_present" == true ]]; then
if ! git -C "$repo_path" update-ref -d "refs/heads/$branch" "$commit_sha" >"$cleanup_log" 2>&1; then
emit_error "BRANCH_REMOVE_FAILED" "Unable to remove published release branch: $branch" \
"The worktree was removed; remove local branch $branch after inspection."
fi
fi
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.agents/skills/bumping-version/scripts/release-workflow around lines 1214 -
1226, Update the cleanup flow around cleanup_log and the git update-ref call so
output redirection falls back to /dev/null when the temp_root directory no
longer exists. Preserve logging to cleanup.log when the directory is available,
and ensure branch removal still executes and remains idempotent during retries.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant