Setting Up Jujutsu Repositories and Tool Integration
Set up jj repositories including colocation decisions, integrate with development tools like Vite/Vitest, and choose between jj library and CLI for tooling. Use when setting up new repositories, experiencing tool integration issues, or building jj integrations.
Best use case
Setting Up Jujutsu Repositories and Tool Integration is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Set up jj repositories including colocation decisions, integrate with development tools like Vite/Vitest, and choose between jj library and CLI for tooling. Use when setting up new repositories, experiencing tool integration issues, or building jj integrations.
Teams using Setting Up Jujutsu Repositories and Tool Integration should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/setting-up-jujutsu-repositories-and-tool-integration/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How Setting Up Jujutsu Repositories and Tool Integration Compares
| Feature / Agent | Setting Up Jujutsu Repositories and Tool Integration | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Set up jj repositories including colocation decisions, integrate with development tools like Vite/Vitest, and choose between jj library and CLI for tooling. Use when setting up new repositories, experiencing tool integration issues, or building jj integrations.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
# Setting Up Jujutsu Repositories and Tool Integration
## Overview
**Key decisions:**
- **Colocation:** Should you use jj and git in the same directory?
- **Tool integration:** How to configure development tools to work with jj
- **Programmatic access:** Library vs CLI for building jj integrations
Understanding these choices helps you set up repositories correctly and avoid common integration issues.
## Repository Setup
### Colocation Decision
**What is colocation?**
Using jj and git in the same working directory:
```
my-repo/
├── .git/ # Git repository
├── .jj/ # Jujutsu repository
└── src/ # Shared working directory
```
**Creating colocated repository:**
```bash
# Initialize jj in existing git repo
cd my-git-repo
jj git init --colocate
# Or create new colocated repo
jj git init --colocate my-repo
cd my-repo
```
**Creating jj-only repository:**
```bash
# Pure jj repository (no colocation)
jj git init my-repo
cd my-repo
```
### Should You Colocate?
**Advantages:**
- ✅ Use both Git and Jujutsu tools on same repo
- ✅ Easier transition/learning (can fall back to git)
- ✅ Works with git-only tools (IDEs, CI/CD)
- ✅ Single working directory
**Drawbacks:**
- ❌ Potential bookmark/branch conflicts
- ❌ Confusing diffs in conflicted files (shows both tools' markers)
- ❌ Slight performance overhead in large repos
- ❌ Can accidentally use git commands (bad practice in jj)
**Recommendation:**
| Scenario | Recommendation |
|----------|----------------|
| Learning jj | Colocate (easier transition) |
| Team migration | Colocate (gradual adoption) |
| New personal project | jj-only (cleaner) |
| Legacy git project | Colocate (tool compatibility) |
| CI/CD requirements | Colocate (git tooling) |
## Tool Integration
### Vite/Vitest Issues
**Problem:** `jj` commands slow or hang in Vite/Vitest projects.
**Cause:** Vite's file watcher monitors `.jj` directory, causing conflicts and slowdowns.
**Solution:** Configure Vite to ignore `.jj`:
```javascript
// vite.config.js or vite.config.ts
export default {
server: {
watch: {
ignored: ['**/.jj/**']
}
}
}
```
**For Vitest:**
```javascript
// vitest.config.js or vitest.config.ts
export default {
test: {
// ... other config
watch: {
ignored: ['**/.jj/**']
}
}
}
```
**Complete example:**
```javascript
import { defineConfig } from 'vite'
export default defineConfig({
server: {
watch: {
ignored: [
'**/.jj/**', // Ignore jj directory
'**/.git/**', // Good practice to ignore git too
'**/node_modules/**'
]
}
}
})
```
### General Tool Integration
**Common issues and fixes:**
**File watchers:**
- Exclude `.jj/` from watching
- Pattern: `**/.jj/**` or `.jj`
**IDEs (VS Code, IntelliJ, etc.):**
```json
// .vscode/settings.json
{
"files.watcherExclude": {
"**/.jj/**": true
},
"search.exclude": {
"**/.jj/**": true
}
}
```
**Build tools:**
- Add `.jj/` to ignore patterns
- Similar to `.git/` configuration
**Linters/formatters:**
```yaml
# .prettierignore or .eslintignore
.jj/
```
## Programmatic Integration
### Library vs CLI Trade-offs
**Question:** Should I use the jj library or parse CLI output?
**Answer:** Both have trade-offs. Library avoids parsing but isn't stable. CLI is also unstable but more flexible.
### Using the Library
**Pros:**
- ✅ Native Rust integration
- ✅ No parsing needed
- ✅ Direct access to data structures
**Cons:**
- ❌ API not stable (frequent breaking changes)
- ❌ Rust only (no other languages)
- ❌ Won't detect custom backends
- ❌ Requires Rust knowledge
**When to use:**
- Building Rust tools
- Need high performance
- Want type safety
- Willing to handle API changes
### Using the CLI
**Pros:**
- ✅ Language-agnostic (any language can run commands)
- ✅ Works with custom jj binaries
- ✅ Easier to prototype
- ✅ Matches user experience
**Cons:**
- ❌ Output format can change (also unstable)
- ❌ Parsing overhead
- ❌ Process spawning overhead
- ❌ Need to handle errors/edge cases
**When to use:**
- Building scripts (bash, python, etc.)
- Need portability
- Rapid prototyping
- Want consistency with user commands
### Best Practices for CLI Integration
```bash
# Use --no-pager for scripting
jj log --no-pager
# Use templates for structured output
jj log --template 'commit_id ++ "\t" ++ description.first_line() ++ "\n"'
# Use revsets for precise queries
jj log -r 'mine() & after("1 week ago")'
# Check exit codes
if jj status &>/dev/null; then
echo "In jj repository"
fi
```
**Example Python integration:**
```python
import subprocess
import json
def jj_log(revset="@"):
result = subprocess.run(
["jj", "log", "-r", revset, "--no-pager",
"--template", "json"],
capture_output=True,
text=True
)
return json.loads(result.stdout)
```
## When to Use This Skill
Use this skill when:
- ✅ Setting up new jj repositories
- ✅ Deciding on colocation strategy
- ✅ Experiencing tool integration issues (Vite, IDEs, watchers)
- ✅ Building integrations with jj
- ✅ Choosing between library and CLI approach
Don't use this skill for:
- ❌ Daily jj operations (see jj-workflow skill)
- ❌ Commit management (see commit-curation skill)
- ❌ Understanding jj concepts (see other jj skills)
## Progressive Disclosure
For detailed setup guides, configuration examples, and integration patterns:
📚 **See detailed docs:** `faq-reference.md`
This includes:
- Complete colocation analysis
- Tool-specific integration guides
- Advanced configuration examples
- Library API patterns
- CLI parsing strategies
## Quick Reference
```bash
# Repository initialization
jj git init --colocate # Colocated repo (jj + git)
jj git init # jj-only repo
jj git init --colocate existing-git-repo # Add jj to git repo
# Configuration
~/.jjconfig.toml # Global config
.jj/repo/config.toml # Repository config
# Tool integration
# Vite: Add to vite.config.js
server.watch.ignored = ['**/.jj/**']
# VS Code: Add to .vscode/settings.json
"files.watcherExclude": {"**/.jj/**": true}
```
## Remember
**Colocation is a choice, not a requirement.** Use it when you need git compatibility, prefer pure jj otherwise. Always configure development tools to ignore `.jj/` directory to avoid conflicts and performance issues.Related Skills
workflow-integration-git
Git commit workflow with conventional commits, artifact cleanup, and optional push/PR creation
using-mcp-tools-with-mcpc
Use mcpc CLI to interact with MCP servers - call tools, read resources, get prompts. Use when working with Model Context Protocol servers, calling MCP tools, or accessing MCP resources programmatically; prefer key:=value bindings over raw JSON bodies.
update-tool-plugin
Update an existing LNAI tool plugin
u2017-tool-health-monitoring-for-personal-finance-management
Operate the "tool health monitoring for personal finance management" capability in production for tool health monitoring for personal finance management workflows. Use when mission execution explicitly requires this capability and outcomes must be reproducible, policy-gated, and handoff-ready.
tooluniverse-install-skills
Detect and auto-install missing ToolUniverse research skills by checking common client skill directories and cloning from GitHub if absent. Use when ToolUniverse specialized skills are not installed, when setting up a new project, or when the tooluniverse router skill needs to bootstrap its sub-skills before routing.
tooling
Python development tooling configuration and best practices
tool-rename-deprecation
Ensure renamed built-in tool references preserve backward compatibility. Use when renaming a toolReferenceName, tool set referenceName, or any tool identifier. Run on ANY change to tool registration code. Covers legacyToolReferenceFullNames for tools and legacyFullNames for tool sets.
tool-design
Build tools that agents can use effectively, including architectural reduction patterns
Static Analysis Tools Skill
Integration with security-focused static analysis tools
skill-elevenlabs-tts-tool
ElevenLabs text-to-speech CLI tool guide
setup-tooluniverse
Install and configure ToolUniverse with MCP integration for any AI coding client (Cursor, Claude Desktop, Windsurf, VS Code, Codex, Gemini CLI, Trae, Cline, Antigravity, OpenCode, etc.). Covers uv/uvx setup, MCP configuration, API key walkthrough, skill installation, and upgrading. Use when setting up ToolUniverse, configuring MCP servers, troubleshooting installation issues, upgrading versions, or when user mentions installing ToolUniverse or setting up scientific tools.
Red Team Tools and Methodology
This skill should be used when the user asks to "follow red team methodology", "perform bug bounty hunting", "automate reconnaissance", "hunt for XSS vulnerabilities", "enumerate subdomains", or needs security researcher techniques and tool configurations from top bug bounty hunters.