ai: pr command accepts revisions instead of bookmarks
Assisted-by: Claude Haiku 4.5 via Claude Code
diff --git a/ai/claude/commands/pr.md b/ai/claude/commands/pr.md
index ef7bf0de..b1b42869 100644
--- a/ai/claude/commands/pr.md
+++ b/ai/claude/commands/pr.md
@@ -1,19 +1,23 @@
# Create Pull Request
-Create a pull request using gh for a bookmark that has already been
-pushed.
+Create a pull request using gh for a specified revision.
Usage:
-- `/pr` - Create a PR for the closest pushable bookmark
-- `/pr <bookmark-name>` - Create a PR for the specified bookmark
+- `/pr <revision>` - Create a PR for the specified revision (bookmark, change ID, revset, or commit hash)
+
+Revision must be provided. The revision will be resolved to a bookmark for the PR.
When creating a pull request:
-1. If no bookmark is provided, use `jj log -r 'max(bookmarks() &
- bookmarks(remote=origin))'` to find the closest pushable bookmark (a local
- bookmark that has been pushed to origin)
-2. Run `jj log -r 'trunk()::bookmark-name'` to list all commits from trunk to
- the bookmark
-3. Run `jj diff -r 'trunk()::bookmark-name' --stat` to review all changes
+1. Resolve revision to bookmark name:
+ - If revision is already a bookmark, use it directly
+ - If revision is a revset/change ID/commit hash and you have context for what to name it, create a descriptive bookmark and push:
+ `jj bookmark create <descriptive-name> <revision>`
+ `jj git push -b <descriptive-name>`
+ - If revision is a revset/change ID/commit hash but you lack naming context, push with auto-generated name:
+ `jj git push -c <revision>`
+ Then retrieve the auto-generated bookmark name from the push output
+2. Run `jj log -r 'trunk()::<bookmark>'` to list all commits from trunk to the bookmark
+3. Run `jj diff -r 'trunk()::<bookmark>' --stat` to review all changes
4. Check for .github PR templates and follow them
5. Generate a PR title summarizing all commits in the changeset (not just the
most recent). The title reflects the overall change, not individual commits