Detect whether the current project uses jj (Jujutsu) or git for version control. Run this BEFORE any VCS command to use the correct tool.
Installation
Details
Usage
After installing, this skill will be available to your AI coding assistant.
Verify installation:
skills listSkill Instructions
name: vcs-detect description: Detect whether the current project uses jj (Jujutsu) or git for version control. Run this BEFORE any VCS command to use the correct tool.
VCS Detection Skill
Detect the version control system in use before running any VCS commands.
Why This Matters
- jj (Jujutsu) and git have different CLIs and workflows
- Running
gitcommands in a jj repo (or vice versa) causes errors - Some repos use jj with git colocated (both
.jj/and.git/exist)
Detection Logic
Both jj root and git rev-parse --show-toplevel walk up the filesystem to find repo root.
Priority order:
jj rootsucceeds → jj (handles colocated too)git rev-parsesucceeds → git- Both fail → no VCS
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
Command Mappings
| 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 |
| Pull/Fetch | git pull / git fetch | jj git fetch |
| Rebase | git rebase | jj rebase |
Usage
Before any VCS operation:
- Run detection command
- Use appropriate CLI based on result
- If
none, warn user directory is not version controlled
Example Integration
User: Show me the git log
Agent: [Runs detection] -> Result: jj
Agent: [Runs `jj log` instead of `git log`]
Colocated Repos
When both .jj/ and .git/ exist, the repo is "colocated":
- jj manages the working copy
- git is available for compatibility (GitHub, etc.)
- Always prefer jj commands in colocated repos
More by dmmulroy
View allComprehensive Cloudflare platform skill covering Workers, Pages, storage (KV, D1, R2), AI (Workers AI, Vectorize, Agents SDK), networking (Tunnel, Spectrum), security (WAF, DDoS), and infrastructure-as-code (Terraform, Pulumi). Use for any Cloudflare development task.
Migrate better-result TaggedError from v1 (class-based) to v2 (factory-based) API
Create Product Requirements Documents (PRDs) that define the end state of a feature. Use when planning new features, migrations, or refactors. Generates structured PRDs with acceptance criteria.
Create distinctive, production-grade frontend interfaces. Use when building web components, pages, or applications with React-based frameworks. Includes Tailwind CSS v4, shadcn/ui components, Motion animations, and visual design philosophy for avoiding generic AI aesthetics.
