mcpField
J
jujutsu-workflow

jujutsu-workflow

github.com/netresearchDevelopment2077 installsUpdated today
Repository

About jujutsu-workflow

A workflow guide for coding agents working in repositories that use Jujutsu (jj). It sets rules for safe repository detection, changes, recovery, Git handoff, and verification.

Key features

  1. 01Detect jj, Git, colocated, and shadowed repositories
  2. 02Use agent-safe jj command practices
  3. 03Make and split changes non-interactively
  4. 04Recover through the operation log
  5. 05Hand off changes through Git
  6. 06Verify repository state before completion

Use cases

  1. 01Work in a repository containing .jj/
  2. 02Avoid mutating Git staging in colocated repositories
  3. 03Recover an unintended jj operation
  4. 04Prepare changes for a Git-based pull request

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/netresearch/jujutsu-workflow-skill --skill jujutsu-workflow

After installing, type/jujutsu-workflowin Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

references/
agent-safety.md
command-map.md
git-interop.md
parallel-agents.md
pr-handoff.md
recovery-playbook.md
why-jj-for-agents.md
scripts/
detect_jj_state.sh
verify_handoff.sh

Details

From the project README

Jujutsu Workflow

Prefer jj (Jujutsu) over raw git whenever a .jj/ repo is present. Git stays the canonical remote/PR/CI/audit interface: mutate with jj, verify with read-only Git.

1. Detect & gate first

Run ${CLAUDE_SKILL_DIR}/scripts/detect_jj_state.sh, or check manually:

  • .jj/ present → jj repo: use jj, never mutating raw git.
  • .jj/ and .git/ → colocated: mutate with jj, read with git, never touch the git index/staging.
  • only .git/ → plain Git repo: do not introduce jj unless asked.
  • in a git worktree, jj root ≠ git rev-parse --show-toplevel → shadowed (exit 3): jj answers for the parent repo. Run no jj; use git, then ask.

See references/git-interop.md.

2. Agent-safety rules (non-negotiable)

  • Always --no-pager on commands that print. Do not write ui.paginate into the user's config — --user outlives the session and takes paging away from their interactive jj too.
  • Always -m. Never run editor/TUI forms — bare jj describe|commit|squash, jj split (interactive), jj squash -i, jj resolve, jj diffedit — they hang agents.
  • jj snapshots the working copy only when a jj command runs, not on every file write.

See references/agent-safety.md.

3. Edit loop

jj --no-pager status
# edit files (snapshotted on the next jj command)
jj --no-pager diff
jj describe -m "<project-conventional message>"
jj new -m "<next unit>"     # one change per logical unit

Split non-interactively: jj split <path> -m "<msg>". See references/command-map.md.

4. Recover (reversible)

jj --no-pager op log → jj undo or jj op restore <id>. Conflicts are first-class: jj status flags them; edit markers, then verify. See references/recovery-playbook.md.

5. Hand off via Git

jj git fetch
jj rebase -d <default-branch>
jj bookmark create <branch> -r @-    # every pushed commit needs a description
jj git push --bookmark <branch>      # new bookmarks push directly

Never push to a protected/default branch; never rewrite public history unless allowed. Open the PR with gh/glab. See references/pr-handoff.md.

6. Parallel agents

One jj workspace per concurrent agent — never share a working copy. See references/parallel-agents.md.

7. Verify before "done"

Run ${CLAUDE_SKILL_DIR}/scripts/verify_handoff.sh, or report jj --no-pager status, jj --no-pager log --limit 10, jj --no-pager diff --stat, git status --short --branch. Never claim "done/tested/ready" without that output; disclose force-pushes, recoveries, conflicts.

When jj helps, and when it doesn't: references/why-jj-for-agents.md.

Comments

Markdown supported