Skip to content

chore: share agent slash commands#63

Merged
boorad merged 3 commits into
mainfrom
chore/shared-agent-commands
May 5, 2026
Merged

chore: share agent slash commands#63
boorad merged 3 commits into
mainfrom
chore/shared-agent-commands

Conversation

@boorad
Copy link
Copy Markdown
Contributor

@boorad boorad commented May 5, 2026

Summary

  • Move shared slash command definitions from .claude/commands to .agents/commands
  • Replace .claude/commands with a symlink for Claude compatibility
  • Document the shared command lookup in AGENTS.md
  • Update release-plz workflow checkout/rebase behavior and include the v0.1.7 release commit

Testing

  • cargo check
  • cargo clippy -- -D warnings
  • cargo fmt --check
  • cargo test
  • actionlint .github/workflows/release-plz.yml

Summary by CodeRabbit

  • Documentation

    • Added guidance on shared agent command usage and clarified that agent-specific command directories reference centralized shared command definitions.
  • Chores

    • Improved release automation to automatically rebase newly created release PRs for cleaner history.
    • Made CI release steps use explicit commit references and token-based authentication for more reliable releases.

@boorad boorad self-assigned this May 5, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 5, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: ca867eac-32e6-46d9-a5b3-15e6973b097b

📥 Commits

Reviewing files that changed from the base of the PR and between de308b4 and 852030d.

📒 Files selected for processing (1)
  • .github/workflows/release-plz.yml

📝 Walkthrough

Walkthrough

Points .claude/commands to the shared ../.agents/commands, documents the shared-agent command convention in AGENTS.md, and updates the release-plz GitHub Actions workflow to pin checkout to the commit SHA, expose the Release PR step outputs, and add a conditional rebase step for created release PRs.

Changes

Agent Command Centralization

Layer / File(s) Summary
Symlink / Pointer
.claude/commands
File updated from empty to a single-line reference ../.agents/commands.
Documentation
AGENTS.md
Adds "Shared Agent Commands" section instructing agents to consult .agents/commands/<command>.md for slash commands and notes .claude/commands is a symlink to the shared definitions.

Release Workflow Enhancements

Layer / File(s) Summary
Checkout Configuration
.github/workflows/release-plz.yml
actions/checkout@v6 in both release-plz-release and release-plz-pr jobs now sets ref: ${{ github.sha }} and fetch-depth: 0; release-plz-pr checkout also adds token: ${{ steps.app-token.outputs.token }}.
Release PR Outputs
.github/workflows/release-plz.yml
The Release PR step in release-plz-pr now declares id: release-pr so its outputs can be referenced by subsequent steps.
Conditional Rebasing Logic
.github/workflows/release-plz.yml
Adds Rebase release PR branch step that runs when steps.release-pr.outputs.prs_created == 'true'; it parses the PR JSON with jq to extract .number, validates it, and runs gh pr update-branch <pr_number> --rebase with GH_TOKEN sourced from the App token.

Sequence Diagram

sequenceDiagram
  actor Actions as GitHub Actions
  participant App as GitHub App
  participant Checkout as actions/checkout
  participant ReleaseStep as release-plz Release PR
  participant Parser as jq
  participant GH as gh CLI
  participant GitHub as GitHub API

  Actions->>App: request App token
  App-->>Actions: return token
  Actions->>Checkout: checkout repo @ commit SHA (token if provided)
  Checkout-->>Actions: repo contents
  Actions->>ReleaseStep: run Release PR step
  ReleaseStep-->>Actions: outputs (prs JSON, prs_created)
  Note right of Actions: if prs_created == 'true'
  Actions->>Parser: parse steps.release-pr.outputs.prs (extract .number)
  Parser-->>Actions: pr_number
  Actions->>GH: set GH_TOKEN and run gh pr update-branch pr_number --rebase
  GH->>GitHub: request rebase/update branch
  GitHub-->>GH: result
  GH-->>Actions: result
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

  • EnforceAuth/zift#41: Related to the .claude/commands symlink and AGENTS.md shared-command definitions.

Poem

🐰 A hop to one shared commands nest,
Paths aligned and docs addressed,
Actions pin the SHA so true,
Tokens pass and PRs get stew—
A little rabbit cheers: "All set!"

🚥 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 'chore: share agent slash commands' clearly and concisely summarizes the main change of moving slash command definitions to a shared location and documenting the lookup pattern.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


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

Copy link
Copy Markdown

@amazon-q-developer amazon-q-developer Bot left a comment

Choose a reason for hiding this comment

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

The changes correctly implement shared agent command definitions by relocating them to .agents/commands and creating a symlink for Claude compatibility. The workflow updates properly add branch specification and automated rebase functionality, and the documentation clearly describes the command lookup mechanism. All changes are functional and ready to merge.


You can now have the agent implement changes and create commits directly on your pull request's source branch. Simply comment with /q followed by your request in natural language to ask the agent to make changes.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
.github/workflows/release-plz.yml (1)

91-106: 💤 Low value

Remove unused head_branch variable or clarify intent.

The head_branch is extracted and validated on lines 100-101 but never used—only pr_number is passed to gh pr update-branch. The variable either represents defensive programming or dead code that should be removed for clarity.

Note: For mono-repos with multiple PRs, the pr output is designed to provide the first PR object only. The code will not fail with jq parsing, but it will only rebase the first PR. If all release PRs require rebasing, consider using the prs output (array) instead and looping through each PR.

🤖 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 @.github/workflows/release-plz.yml around lines 91 - 106, The script extracts
head_branch via "head_branch=$(jq -r '.head_branch // empty' <<<"$PR')" and
checks it but never uses it; remove that extraction and its emptiness check and
only validate pr_number (the jq extraction for pr_number and the gh pr
update-branch "$pr_number" call remain), or if the intent was to rebase multiple
PRs switch to using the "prs" array output and loop over each PR object instead
of relying on a single "pr" object; update the jq/validation logic accordingly
and remove the dead head_branch variable and related conditional.
🤖 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.md`:
- Around line 20-21: The AGENTS.md text incorrectly calls `.claude/commands` a
"symlink" while the repo uses a plain text file; either make `.claude/commands`
an actual filesystem symlink pointing to the shared command definitions
(preferred) or update AGENTS.md to say it is a text file that contains the path
to the shared commands. Locate the `.claude/commands` artifact and either
replace it with a symlink to the shared commands target or change the wording in
AGENTS.md to "text file containing a path reference" and keep the documented
command lookup/path details unchanged.

---

Nitpick comments:
In @.github/workflows/release-plz.yml:
- Around line 91-106: The script extracts head_branch via "head_branch=$(jq -r
'.head_branch // empty' <<<"$PR')" and checks it but never uses it; remove that
extraction and its emptiness check and only validate pr_number (the jq
extraction for pr_number and the gh pr update-branch "$pr_number" call remain),
or if the intent was to rebase multiple PRs switch to using the "prs" array
output and loop over each PR object instead of relying on a single "pr" object;
update the jq/validation logic accordingly and remove the dead head_branch
variable and related conditional.
🪄 Autofix (Beta)

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: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: c10a7bd3-8e4d-4164-ae96-e6c18f69c1fe

📥 Commits

Reviewing files that changed from the base of the PR and between 3776352 and 268a841.

📒 Files selected for processing (8)
  • .agents/commands/address-pr-feedback.md
  • .agents/commands/commit.md
  • .agents/commands/handoff.md
  • .agents/commands/pr.md
  • .agents/commands/review.md
  • .claude/commands
  • .github/workflows/release-plz.yml
  • AGENTS.md

Comment thread AGENTS.md
Signed-off-by: Brad Anderson <brad@enforceauth.com>
@boorad boorad force-pushed the chore/shared-agent-commands branch from 268a841 to 8b246cf Compare May 5, 2026 12:56
@boorad
Copy link
Copy Markdown
Contributor Author

boorad commented May 5, 2026

@coderabbitai Addressed review-body nitpick in de308b4: removed the unused head_branch extraction/validation from .github/workflows/release-plz.yml and now validate only the PR number before gh pr update-branch --rebase.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 5, 2026

Tip

For best results, initiate chat on the files or code changes.

@boorad Thanks for the update! Confirmed — removing the unused head_branch extraction and validation simplifies the step nicely, and validating only the PR number before gh pr update-branch --rebase is the right approach.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 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 @.github/workflows/release-plz.yml:
- Line 31: The workflow pins the checkout to a moving branch head ("ref: main")
which can run against a different commit than the event that triggered the run;
replace both occurrences of "ref: main" in the release-plz.yml checkout steps
with the triggering commit SHA (use the GitHub context, e.g. the
github.sha/event SHA) so the checkout uses the exact commit that started the
workflow (update the two "ref: main" instances referenced in the checkout
steps).
🪄 Autofix (Beta)

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: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 62d49528-5fdf-48d7-af47-5702e1039297

📥 Commits

Reviewing files that changed from the base of the PR and between 8b246cf and de308b4.

📒 Files selected for processing (1)
  • .github/workflows/release-plz.yml

Comment thread .github/workflows/release-plz.yml Outdated
@boorad boorad merged commit e224bac into main May 5, 2026
2 checks passed
@boorad boorad deleted the chore/shared-agent-commands branch May 5, 2026 13:06
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