| name | detect-jujutsu |
| description | Use at session start or before the first version control action to detect whether the repository should be operated with Git or Jujutsu (jj). |
| version | 0.5.0 |
Detecting Jujutsu (jj)
This skill determines whether the current repository uses Jujutsu (jj). Use the detection ladder in order.
Trigger cues: user asks to run version control actions (for example status, diff, log, commit, amend, push, branch, rebase) where both git and jj may be available.
If jj is available in the current repo, prefer jj as the default VCS for this session unless the user or project policy explicitly asks for git.
Detection Ladder
Stop at the first successful detection.
Step 1: Try jj st --no-pager (fast path)
jj st --no-pager
- Exit 0 → JJ repo. Use
jj commands. Invoke use-jujutsu skill. STOP HERE.
- Blocked by tool policy → Proceed to Step 3 (do not attempt Step 2).
- Exit non-zero → Proceed to Step 2.
Step 2: Run detection script (authoritative)
The script is embedded inline to work across multiple coding agents regardless of where skills are installed.
cat > /tmp/detect-jj.sh << 'SCRIPT_EOF'
QUIET=
[ == ];
QUIET=
() {
[ = ];
}
}
REPO_ROOT=$(git rev-parse --show-toplevel 2>/dev/null)
[ -z ];
2
! -v jj >/dev/null 2>&1;
[ -d ];
2
( && jj st --no-pager --color=never >/dev/null 2>&1);
0
[ -d ];
2
1
SCRIPT_EOF
bash /tmp/detect-jj.sh