Jujutsu (jj) version control skills for committing, pushing, opening PRs, and rebasing
- version
- 2026-07-09
- GitHub stars
- 12
Install
/plugin install jj@jeffh-claude-pluginsRun it inside Claude Code after adding the marketplace with /plugin marketplace add jeffh/claude-plugins.
Contents
Discovered from sourceSkills 3
Commit, Push, and Create PRs
Execute the complete workflow from uncommitted changes to open pull requests:
- Commit — Describe changes with proper commit messages
- Bookmark — Create bookmarks for the stack
- Push & PR — Push to origin and create/update pull requests
Context expectations
When invoked from /jj:commit-push-pr, the GitHub user login, remotes, working-copy status, stack log, open PRs, and any repo PR template are already in context. Do not re-fetch them. If invoked directly, gather them first:
gh api user -q '.login'
jj git remote list
jj status --no-pager
jj log --no-pager -r 'trunk()..@'
jj log -r 'trunk()..@' --no-graph -T 'separate(" | ", change_id.short(), if(description, description.first_line(), "(no description)"), bookmarks) ++ "\n"'
gh pr list --json number,title,headRefName,url,baseRefName --state open
From that context, identify: commits needing descriptions, existing bookmarks, existing PRs, and the GitHub username for the bookmark prefix.
Defaults (no prompting)
Bookmarks:
- One bookmark per commit in the stack
- Prefix
<github-username>/; name derived from the commit description (lowercase, dash-separated)
PRs:
- One PR per bookmark (stacked PRs)
- Base each PR on its parent bookmark (or trunk for the first PR)
- Published (not draft), pushed to
origin
Steps
Execute without additional confirmation prompts.
Step 1: Commit — Invoke the jj:commit skill with the appropriate revset (skip if all commits have descriptions).
Step 2: Create Bookmarks (skip if commits already have bookmarks):
jj bookmark create <prefix><name> -r <change_id>
jj bookmark track <bookmark> --remote=origin
Step 3: Push and Create PRs (skip if no bookmarks need PRs):
jj git push
gh pr create --head <bookmark> --base <base> --title "<title>" --body "<body>"
Honor PR templates
If a PR template was found in context (e.g. .github/PULL_REQUEST_TEMPLATE.md), use its sections and checkboxes verbatim as the PR body, filling each section from the actual changes. When no template exists, write a concise body and do NOT include a "Test plan" section.
Rules
- NEVER add co-author information or Claude attribution
- Complete each step fully before proceeding
- On failure, report the specific error and ask how to proceed (retry or skip)
Error handling
- No changes: Inform the user if the working copy is empty and no commits are in the stack
- trunk() not configured: Fall back to
main@origin, thenmaster@origin - Step failure: Report which step failed with the specific error
Summary
Present final results: commits described, bookmarks created, and PRs created/updated (with URLs).
Commit Changes with Jujutsu
Write jj change descriptions for work done during this session, as if the user wrote them. NEVER add co-author information or Claude attribution.
Usage
- Describe the working copy (
@) and any undescribed parent commits. - If a revset is provided, describe only the specified revision(s), without splitting or modifying other commits.
Context expectations
When invoked from /jj:commit, the working-copy status, full diff, the undescribed-change list, recent log, and any configured commit template are already in context. Do not re-run them.
If invoked directly without that context, gather it first:
jj status --no-pager
jj diff --no-pager
jj log --no-pager -r 'trunk()..@ & description(exact:"")' -T 'change_id ++ "\n"'
Run jj diff --no-pager -r '<change_id>' for each undescribed commit, including parents. If a revset was provided, use jj log --no-pager -r '<revset>' and diff each commit instead.
Honor commit templates
If a commit-message template is configured — templates.draft_commit_description (jj) or commit.template (git) — follow its structure and section headings. Otherwise, match the style of recent log messages.
Message format
<type>: <subject>
[optional body]
Types: feat, fix, docs, refactor, test, chore, build
Rules:
- Subject: imperative mood, lowercase, no period, max 50 chars
- Body: wrap at 72 chars, explain WHY not just WHAT
- Group related changes logically
- Keep changes focused and atomic
Apply descriptions
jj describe -m "message" # current change (@)
jj describe -r <change_id> -m "msg" # specific revision
To split into multiple changes (only when no revset provided):
jj split -m "first message" path/to/files/
jj split -m "second message" more/files/
jj describe -m "remaining changes"
Show results
jj log --no-pager -r 'ancestors(@, 5)'
Rebase Current Stack
Rebase the current changeset stack (from its root through @) onto the latest trunk.
Context expectations
When invoked from /jj:rebase, the latest changes are already fetched and the stack root is already in context. Do not re-fetch. If invoked directly, fetch first:
jj git fetch
Process
-
Identify the stack root:
jj log -r 'roots(::@ ~ ::trunk())'- Finds the earliest changeset in the current stack that's not on trunk
- If this returns nothing, you're already on trunk — report that and stop
-
Rebase the stack:
jj rebase -s 'roots(::@ ~ ::trunk())' -d trunk()- Rebases the entire stack onto trunk using the same revset for consistency
-
Show result:
jj log
Handling conflicts
If the rebase reports conflicts:
- Run
jj status --no-pagerto see conflicted files - Report the conflicts to the user
- Do NOT attempt to resolve automatically — let the user decide
Edge cases
- Empty working copy (
@has no changes): Normal in jj; the rebase still works on the stack. - Already on trunk: If
roots(::@ ~ ::trunk())returns nothing, tell the user they're up to date. - trunk() not configured: Fall back to checking
main@originormaster@origin(prefermain@origin):jj log -r 'main@origin | master@origin' --no-graph -T 'self.bookmarks()'
Notes
trunk()is jj's built-in revset for the primary branch (respects repo config)-srebases the source and all descendants::@means "all ancestors of @ including @";~ ::trunk()excludes trunk and its ancestors
Commands 3
Context
- GitHub user: !
gh api user -q '.login' - Remotes: !
jj git remote list - Status: !
jj status --no-pager - Stack: !
jj log --no-pager -r 'trunk()..@' - Stack detail: !
jj log -r 'trunk()..@' --no-graph -T 'separate(" | ", change_id.short(), if(description, description.first_line(), "(no description)"), bookmarks) ++ "\n"' - Open PRs: !
gh pr list --json number,title,headRefName,url,baseRefName --state open - PR template: !
for f in .github/PULL_REQUEST_TEMPLATE.md .github/pull_request_template.md docs/PULL_REQUEST_TEMPLATE.md PULL_REQUEST_TEMPLATE.md .github/PULL_REQUEST_TEMPLATE/*.md; do [ -f "$f" ] && echo "=== $f ===" && cat "$f"; done; :
Your task
All context is gathered above. Invoke the jj:commit-push-pr skill to run the full workflow. If a PR template appears above, the skill must fill it out rather than invent a body.
Context
- Status: !
jj status --no-pager - Diff: !
jj diff --no-pager - Undescribed changes: !
jj log --no-pager -r 'trunk()..@ & description(exact:"")' -T 'change_id ++ "\n"' - Recent log: !
jj log --no-pager -r 'ancestors(@, 5)' - Commit template: !
jj config get templates.draft_commit_description 2>/dev/null || git config --get commit.template 2>/dev/null || echo none
Your task
All jj context is gathered above. Invoke the jj:commit skill to describe the change(s), passing $ARGUMENTS as the revset when provided. Do not re-run status or diff — use the context above.
Context
- Fetch: !
jj git fetch - Stack root: !
jj log --no-pager -r 'roots(::@ ~ ::trunk())' - Current stack: !
jj log --no-pager -r 'trunk()..@'
Your task
Latest trunk is fetched above. Invoke the jj:rebase skill to rebase the stack onto trunk. If the stack root is empty, report that we're already up to date.
Sponsors
Details
- Marketplace
- jeffh/claude-plugins
- Source
- jj
- Author
- Jeff Hui
- Category
- Development
