Skill v1.0.0
currentLLM-judged scan90/100version: "1.0.0" name: jj-vcs description: Work effectively in jj (Jujutsu) version control repos. Use when detecting .jj directory, committing changes, or managing version control in jj-based projects.
jj Version Control for Agents
jj (Jujutsu) is a modern VCS that can coexist with git. It uses fundamentally different mental models that enable fearless experimentation and powerful history manipulation.
Related files in this skill:
commands.md- Command reference and git translationworkflows.md- Workflow patterns (squash, edit, stacked changes)
Detection
# jj repo has .jj directory (may coexist with .git)ls -d .jj 2>/dev/null && echo "jj repo"
If .jj exists, use jj commands instead of git.
Core Mental Model
Everything is a Commit
In git: working tree → staging → commits → stash → "in progress" states. In jj: only commits. Your working copy IS a commit (@).
vim file.txt # Edit filejj status # Shows changes in @ (not "uncommitted")jj log # @ visible in history
Implication: No "forgot to commit" risk. Every edit auto-snapshots.
Change IDs vs Commit IDs
| ID Type | Stability | Example | Use For | |
|---|---|---|---|---|
| Change ID | Stable across rewrites | qpvuntsm | Referencing work | |
| Commit ID | Changes on any edit | f7b5e2a | Git compatibility |
Automatic Descendant Rebasing
When you modify a commit, all descendants auto-rebase:
Before: A → B → CEdit A...After: A' → B' → C' (automatic)
Conflicts are First-Class
Git: Conflicts block operations, require immediate resolution. jj: Conflicts recorded in commits. Continue working, resolve later.
jj rebase -d main # Creates conflictjj new -m "continue" # Can still work!
Operation Log = Safety Net
Every command recorded. Undo ANY operation.
jj undo # Undo last operationjj op log # See all operationsjj op restore <op-id> # Jump to any state
Philosophy: Experiment fearlessly. You can always go back.
Workflow Decision Tree
What are you doing?│├─ Simple feature/fix?│ └─ SQUASH WORKFLOW│ jj new -m "feat" → edit → jj squash (or jj new for next)│├─ Complex multi-part task?│ └─ STACKED CHANGES│ jj new -m "part 1" → edit → jj new -m "part 2" → edit → ...│├─ Fix specific earlier commit?│ └─ EDIT WORKFLOW│ jj edit <id> → fix → jj new│├─ Scattered fixes across stack?│ └─ ABSORB PATTERN│ edit files → jj absorb│└─ Made a mistake?└─ jj undo
See workflows.md for detailed patterns.
Quick Start (Default Workflow)
# 1. Create change with intentjj new -m "feat: implement feature"# 2. Edit files (auto-captured)# ... make changes ...# 3. Reviewjj diffjj status# 4. Continue to next taskjj new -m "feat: next task"# Previous work now in @-# 5. Push when readyjj bookmark create my-feature -r @-jj git push -b my-feature
Essential Commands (Quick Reference)
# Statusjj status # Working copy statejj log # History (mutable)jj diff # Changes in @# Creating workjj new -m "message" # New changejj describe -m "message" # Describe current# History manipulationjj squash # Move @ to parentjj squash --into <id> # Move @ to specific commitjj absorb # Distribute fixes intelligently# Pushingjj bookmark create name -r @jj git push -b name# Safetyjj undo # Undo last opjj op log # Operation history
See commands.md for full reference.
When to Use This Skill
Activate when:
.jjdirectory exists- User mentions jj or Jujutsu
- Need version control in jj-based project
For commands: see commands.md For workflows: see workflows.md