vcs-detect
SKILL.md
VCS Detection Skill
Detect the version control system in use before running VCS commands.
Why This Matters
- jj and git have different CLIs and workflows.
- Running git commands in a jj repo (or vice versa) causes avoidable errors.
- Some repos are colocated (both
.jj/and.git/exist).
Detection Logic
Priority order:
jj rootsucceeds -> jj- else
git rev-parse --show-toplevelsucceeds -> git - else -> none
Detection Command
if jj root &>/dev/null; then echo "jj"
elif git rev-parse --show-toplevel &>/dev/null; then echo "git"
else echo "none"
fi
Common Command Mapping
| Operation | git | jj |
|---|---|---|
| Status | git status |
jj status |
| Log | git log |
jj log |
| Diff | git diff |
jj diff |
| Commit | git commit |
jj commit / jj describe |
| Branch list | git branch |
jj branch list |
| New branch | git checkout -b <name> |
jj branch create <name> |
| Push | git push |
jj git push |
| Fetch/Pull | git fetch / git pull |
jj git fetch |
| Rebase | git rebase |
jj rebase |
Usage
Before VCS operations:
- Run the detection command.
- Use the matching CLI (
jjorgit). - If
none, report that the directory is not version controlled.
Colocated Repos
If both .jj/ and .git/ exist, prefer jj commands and use git compatibility subcommands when needed.
Weekly Installs
2
Repository
ajoslin/dotGitHub Stars
23
First Seen
Feb 21, 2026
Security Audits
Installed on
opencode2
claude-code2
github-copilot2
codex2
kimi-cli2
gemini-cli2