Agent skill
vcs-detect
Detect whether the current project uses jj (Jujutsu) or git for version control. Run this BEFORE any VCS command to use the correct tool.
Install this agent skill to your Project
npx add-skill https://github.com/dmmulroy/.dotfiles/tree/main/home/.config/opencode/skill/vcs-detect
SKILL.md
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
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
pr-walkthrough
Generate an interactive visual walkthrough of any pull/merge request as a local HTML webapp. Produces a multi-slide presentation with SVG diagrams, annotated code, and architecture visuals. Pass a PR/MR URL and optional audience context (e.g. "assume I don't know Rust"). Use when the user says "walkthrough this PR", "explain this MR", "visual walkthrough", "PR presentation", or provides a PR/MR URL and asks for a walkthrough.
tdd
Test-driven development with red-green-refactor loop. Use when user wants to build features or fix bugs using TDD, mentions "red-green-refactor", wants integration tests, or asks for test-first development.
write-a-prd
Create a PRD through user interview, codebase exploration, and module design. Use when user wants to write a PRD, create a product requirements document, or plan a new feature.
grill-me
Interview the user relentlessly about a plan or design until reaching shared understanding, resolving each branch of the decision tree. Use when user wants to stress-test a plan, get grilled on their design, or mentions "grill me".
prd-to-todos
Break a PRD into independently-grabbable file-backed todos using tracer-bullet vertical slices. Use when the user wants to convert a PRD into implementation tasks, create vertical-slice todos, or break down a PRD into work items.
tmux
Remote control tmux sessions for interactive CLIs (python, gdb, etc.) by sending keystrokes and scraping pane output.
Didn't find tool you were looking for?