vcs-detect

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

Updated Nov 2, 2024
One-click install
npx skills add https://github.com/nrminor/.dotfiles --skill vcs-detect
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: vcs-detect
Source: https://github.com/nrminor/.dotfiles/tree/main/.config/.claude/skills/vcs-detect
Command: npx skills add https://github.com/nrminor/.dotfiles --skill vcs-detect

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill identifies whether a project is governed by jj (Jujutsu) or git and routes VCS commands to the correct CLI, preventing errors in mixed or colocated repositories.

Core Features & Use Cases

  • Detects the active version control system (jj or git) for the current project.
  • Handles colocated repos where both .jj/ and .git/ exist by prioritizing jj commands.
  • Provides guidance for typical VCS operations to ensure the right tool is used.

Quick Start

Run the detection flow to identify the VCS and then execute commands with the appropriate CLI (jj when jj is detected, git when git is detected). If neither is found, warn that the directory is not version controlled.

Frequently Asked Questions about vcs-detect

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

FAQPage Schema
How do I detect which version control system a project uses?

Version control detection identifies whether a project uses jj (Jujutsu) or git by checking for jj root and git rev-parse --show-toplevel. This determines which CLI to route subsequent commands to, ensuring operations work correctly in any repository.

What happens when a repository has both jj and git?

In colocated repositories where both .jj/ and .git/ directories exist, jj is prioritized. Detection routes commands to jj first, preventing conflicts and ensuring the correct tool handles version control operations.

How do I use the right VCS command for my project?

Run detection to identify your VCS (jj or git), then execute commands with the appropriate CLI. If neither version control system is found, the detection warns that the directory is not version controlled.

Can I use this with mixed version control setups?

Yes. Detection handles mixed repositories by determining which VCS is active in the current project context. It prevents errors by routing commands to the correct tool before any VCS operation executes.

What does detection output when no VCS is found?

When neither jj nor git is detected, the output is none and a warning indicates the directory lacks version control. This prevents accidental operations on untracked directories.