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..e3f1ebd 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: ${{ 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 }} @@ -69,6 +70,7 @@ jobs: - uses: actions/checkout@v6 with: fetch-depth: 0 + ref: ${{ github.sha }} 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,19 @@ 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") + if [[ -z "$pr_number" ]]; then + echo "release-plz reported a PR but did not return a PR number" >&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