vcs-detect

Detect whether a project uses jj or git for version control.

Updated Jun 12, 2025
One-click install
npx skills add https://github.com/stevoland/dotfiles --skill vcs-detect-stevoland
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: vcs-detect
Source: https://github.com/stevoland/dotfiles/tree/main/opencode/skill/vcs-detect
Command: npx skills add https://github.com/stevoland/dotfiles --skill vcs-detect-stevoland

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps ensure VCS operations use the correct CLI by detecting whether a project is using jj (Jujutsu) or git, preventing invalid commands.

Core Features & Use Cases

  • VCS detection: determines if the repo is jj, git, or none.
  • Safe command routing: ensures subsequent VCS commands map to the correct tool.
  • Use Case: In a colocated repo with both .jj and .git/, automatically route commands to jj while maintaining compatibility with git when needed.

Quick Start

Run the detection sequence before performing any VCS operation, then execute the appropriate CLI based on the result.

Frequently Asked Questions about vcs-detect

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I detect if a repository uses jj or git for version control?

Detecting the VCS involves running jj root or git rev-parse --show-toplevel to find the repo root and map commands to the correct CLI. This determines if a project uses jj or git.

How does command routing work for colocated repos with both .jj and .git directories?

Command routing for colocated repos automatically routes VCS commands to jj while maintaining compatibility with git. It detects both .jj and .git directories to ensure operations use the correct CLI.

Why do my git commands fail in a colocated jj and git repository?

Git commands may fail in colocated repositories because the project uses jj. Running a VCS detection sequence before operations ensures commands map to the correct CLI, preventing invalid commands.

Do I need to manually check for .jj or .git directories before running version control operations?

No, you do not need to manually check. VCS detection automatically determines if the repo is jj, git, or none by running jj root or git rev-parse --show-toplevel, ensuring safe command routing.

What is the best way to prevent invalid VCS commands in Jujutsu projects?

The best way to prevent invalid VCS commands is to run a detection sequence before any operation. This determines if the repo uses jj or git and maps subsequent commands to the correct CLI.