From 8b246cf5363d4a8a416b4bf57c794553187876d8 Mon Sep 17 00:00:00 2001 From: Brad Anderson Date: Tue, 5 May 2026 08:56:38 -0400 Subject: [PATCH 1/3] chore: share agent slash commands Signed-off-by: Brad Anderson --- .../commands/address-pr-feedback.md | 0 {.claude => .agents}/commands/commit.md | 0 {.claude => .agents}/commands/handoff.md | 0 {.claude => .agents}/commands/pr.md | 0 {.claude => .agents}/commands/review.md | 0 .claude/commands | 1 + .github/workflows/release-plz.yml | 20 +++++++++++++++++++ AGENTS.md | 8 ++++++++ 8 files changed, 29 insertions(+) rename {.claude => .agents}/commands/address-pr-feedback.md (100%) rename {.claude => .agents}/commands/commit.md (100%) rename {.claude => .agents}/commands/handoff.md (100%) rename {.claude => .agents}/commands/pr.md (100%) rename {.claude => .agents}/commands/review.md (100%) create mode 120000 .claude/commands diff --git a/.claude/commands/address-pr-feedback.md b/.agents/commands/address-pr-feedback.md similarity index 100% rename from .claude/commands/address-pr-feedback.md rename to .agents/commands/address-pr-feedback.md diff --git a/.claude/commands/commit.md b/.agents/commands/commit.md similarity index 100% rename from .claude/commands/commit.md rename to .agents/commands/commit.md diff --git a/.claude/commands/handoff.md b/.agents/commands/handoff.md similarity index 100% rename from .claude/commands/handoff.md rename to .agents/commands/handoff.md diff --git a/.claude/commands/pr.md b/.agents/commands/pr.md similarity index 100% rename from .claude/commands/pr.md rename to .agents/commands/pr.md diff --git a/.claude/commands/review.md b/.agents/commands/review.md similarity index 100% rename from .claude/commands/review.md rename to .agents/commands/review.md diff --git a/.claude/commands b/.claude/commands new file mode 120000 index 0000000..1ea3574 --- /dev/null +++ b/.claude/commands @@ -0,0 +1 @@ +../.agents/commands \ No newline at end of file diff --git a/.github/workflows/release-plz.yml b/.github/workflows/release-plz.yml index d3d3954..523da7d 100644 --- a/.github/workflows/release-plz.yml +++ b/.github/workflows/release-plz.yml @@ -28,6 +28,7 @@ jobs: - uses: actions/checkout@v6 with: fetch-depth: 0 + ref: main # Use the App token so release-plz's git push (tags, etc.) # is authored by the App rather than the default GITHUB_TOKEN. token: ${{ steps.app-token.outputs.token }} @@ -69,6 +70,7 @@ jobs: - uses: actions/checkout@v6 with: fetch-depth: 0 + ref: main token: ${{ steps.app-token.outputs.token }} - uses: dtolnay/rust-toolchain@stable @@ -76,6 +78,7 @@ jobs: - uses: Swatinem/rust-cache@v2 - name: Release PR + id: release-pr uses: release-plz/action@v0.5 with: command: release-pr @@ -84,3 +87,20 @@ jobs: # release-plz PR (PRs opened with the default GITHUB_TOKEN # do not trigger workflow runs). GITHUB_TOKEN: ${{ steps.app-token.outputs.token }} + + - name: Rebase release PR branch + if: steps.release-pr.outputs.prs_created == 'true' + env: + GH_TOKEN: ${{ steps.app-token.outputs.token }} + PR: ${{ steps.release-pr.outputs.pr }} + run: | + set -euo pipefail + + pr_number=$(jq -r '.number // empty' <<<"$PR") + head_branch=$(jq -r '.head_branch // empty' <<<"$PR") + if [[ -z "$pr_number" || -z "$head_branch" ]]; then + echo "release-plz reported a PR but did not return a PR number and head branch" >&2 + exit 1 + fi + + gh pr update-branch "$pr_number" --rebase diff --git a/AGENTS.md b/AGENTS.md index bf5940a..485f26b 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -12,6 +12,14 @@ After cloning, configure the pre-commit hook: git config core.hooksPath .githooks ``` +## Shared Agent Commands + +When the user enters a slash command such as `/pr`, `/review`, `/commit`, +`/handoff`, or `/address-pr-feedback`, first check +`.agents/commands/.md` and follow those instructions if present. +Claude's `.claude/commands` directory is a symlink to these shared command +definitions. + ## Build & Development ```bash From de308b4072c5a312aca8b5840930ade603a6a46e Mon Sep 17 00:00:00 2001 From: Brad Anderson Date: Tue, 5 May 2026 08:59:19 -0400 Subject: [PATCH 2/3] fix: address CodeRabbit workflow nitpick --- .github/workflows/release-plz.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release-plz.yml b/.github/workflows/release-plz.yml index 523da7d..f5356d1 100644 --- a/.github/workflows/release-plz.yml +++ b/.github/workflows/release-plz.yml @@ -97,9 +97,8 @@ jobs: set -euo pipefail pr_number=$(jq -r '.number // empty' <<<"$PR") - head_branch=$(jq -r '.head_branch // empty' <<<"$PR") - if [[ -z "$pr_number" || -z "$head_branch" ]]; then - echo "release-plz reported a PR but did not return a PR number and head branch" >&2 + if [[ -z "$pr_number" ]]; then + echo "release-plz reported a PR but did not return a PR number" >&2 exit 1 fi From 852030dea2bb64b4ce9558686149ef0536b85628 Mon Sep 17 00:00:00 2001 From: Brad Anderson Date: Tue, 5 May 2026 09:03:23 -0400 Subject: [PATCH 3/3] fix: pin release workflow checkout to event sha --- .github/workflows/release-plz.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release-plz.yml b/.github/workflows/release-plz.yml index f5356d1..e3f1ebd 100644 --- a/.github/workflows/release-plz.yml +++ b/.github/workflows/release-plz.yml @@ -28,7 +28,7 @@ jobs: - uses: actions/checkout@v6 with: fetch-depth: 0 - ref: main + ref: ${{ github.sha }} # Use the App token so release-plz's git push (tags, etc.) # is authored by the App rather than the default GITHUB_TOKEN. token: ${{ steps.app-token.outputs.token }} @@ -70,7 +70,7 @@ jobs: - uses: actions/checkout@v6 with: fetch-depth: 0 - ref: main + ref: ${{ github.sha }} token: ${{ steps.app-token.outputs.token }} - uses: dtolnay/rust-toolchain@stable