| name | jj |
| description | Use for any version-control task in repositories managed by Jujutsu (`jj`) or colocated `.jj` + `.git` repos. Trigger when the user asks for status, history rewriting, commit description updates, bookmark/branch management, push/fetch workflows, conflict handling, undo/recovery, or Git-to-Jujutsu migration. Prefer `jj` commands for repository mutations. |
Jujutsu (jj) Workflow Skill
Execute version-control tasks with jj first. Keep commands non-interactive unless the user explicitly asks for an interactive workflow.
Detect Repository Mode
- Run
jj root to confirm Jujutsu context.
- Treat the repository as Jujutsu-managed when
.jj/ exists.
- In colocated repos (
.jj/ + .git/), use jj for mutations and keep git usage read-only unless the user explicitly requests otherwise.
Use Agent-Safe Command Patterns
- Pass a message flag instead of opening an editor:
jj describe -m "message"
jj commit -m "message"
jj squash -m "message"
- Avoid commands that require interactive UI flows when running non-interactively.
- After history mutations (
squash, rebase, abandon, restore), run jj status to verify state.
Run the Core Daily Flow
- Inspect current state:
jj status
jj log -n 10
jj show
jj diff
- Start and describe work:
jj new
jj describe -m "Implement feature X"
-
Continue editing files. Jujutsu tracks working-copy changes automatically.
-
Navigate the change graph without revision IDs:
jj next -e
jj prev -e
jj edit <change>
Without -e, jj next/jj prev create a new working-copy commit on top of the target revision.
Handle History Edits
Use these commands for most agent workflows:
jj absorb
jj squash
jj split <path>... -m "split: <summary>"
jj rebase -r <revision> -d <destination>
jj simplify-parents
jj duplicate <revision> --destination <target>
jj abandon <revision>
jj restore <path>
In agent contexts, always pass both filesets and -m to jj split.
Use jj evolog to inspect how a change has evolved over time (useful for debugging history mutations).
Load cheat-sheet.md when the user describes a Git command and needs a Jujutsu equivalent.
Push and Sync with Remotes
- Sync from remote:
jj git fetch
jj rebase -d main@origin
- Push a single change quickly:
jj git push --change @-
- Use bookmarks for explicit branch-like collaboration:
jj bookmark create feat/my-change -r @-
jj git push -b feat/my-change
Load colocated-git.md for teams that use GitHub/GitLab while you work locally in Jujutsu.
Resolve Conflicts
- Inspect conflict state:
jj status
jj resolve --list
- In non-interactive agent contexts, edit conflicted files directly and remove conflict markers. In interactive contexts, use the configured merge tool:
jj resolve <file>
- Re-run
jj status until no unresolved conflicts remain.
Recover Safely
Use operation-level undo when something goes wrong:
jj undo
jj op log
jj op restore <operation-id>
Prefer these commands instead of attempting destructive resets.
Use Workspaces for Parallel Work
Workspaces let you check out multiple changes simultaneously in separate directories (like git worktree):
jj workspace add ../my-feature
jj workspace list
jj workspace forget <name>
Each workspace has its own working-copy commit but shares the full change graph and operation log.
Inspect Files
jj diff
jj diff -r <revision>
jj file annotate <path>
jj file list
Auto-Format Code
If a formatting tool is configured, apply it across revisions:
jj fix
Handle Version Differences
- Run
jj --version.
- If a command flag behaves differently, run
jj help <subcommand>.
- Prefer command forms documented in sources.md when uncertain.