/compound-engineering:ce-worktreefrom compound-engineering
Set up isolated Jujutsu workspaces for fresh work or for an existing bookmark, PR, or revision. Use when starting isolated work or isolating an existing ref.
Ships in compound-engineering. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Ensure the current work happens in an isolated JJ workspace, without disturbing the user's main workspace. The harness may already have isolated the session.
Done when: the harness is working in the verified isolated workspace and the caller has its absolute path, registered name, base revision, and relevant bookmark or PR details; otherwise report a blocker.
Order of operations: detect existing isolation → prefer the harness's native colocated JJ workspace capability → use JJ directly when the harness can adopt the result. Never create a workspace the harness cannot see. See JJ workspaces, the CLI reference, and JJ for Git experts. Use JJ for all version-control operations.
Two modes, set by the caller's need:
ce-work and ce-code-review use when the user picks the workspace option without naming a ref.@ and parent revisions (an empty @ can be immediately above the bookmark), as well as any known active session's use of the bookmark. If another workspace is already working on that bookmark, report its path and let the caller choose to work there or, if separate isolation is essential, use a fresh change at the same commit without moving the shared bookmark. Treat uncertain or concurrent bookmark ownership as a blocker for writes to that bookmark.Discover the current root with jj workspace root. Run every subsequent JJ command by setting its working directory to the relevant absolute workspace root; jj -R alone does not change directories. Confirm the harness's current directory and lifecycle metadata, then inspect the registrations:
(cd "$workspace_root" && jj workspace list)
(cd "$workspace_root" && jj workspace root --name "$registered_name")
(cd "$workspace_root" && jj git colocation status)
.jj/repo (directory); a linked workspace has a .jj/repo pointer (file). Match the resolved absolute registered path to the current root. A standalone workspace can still be isolated if the harness confirms it provided that workspace for this task. Neither the name default nor colocation alone proves whether isolation exists.@ is that commit or an empty change directly on top of it, it is already aligned. Otherwise start a fresh change with jj new "$base" only when the workspace is clean, conflict-free, and safe to retarget for this task; preserve unrelated tracked and ignored work and existing bookmarks. If @ is the requested commit itself, start a fresh child before editing so setup does not rewrite that commit or advance its bookmark. If the existing isolation or alignment cannot safely be verified, report the blocker.Use these base-resolution rules for both creation and existing-ref alignment:
origin), or main if no default can be established. Inspect jj git remote list and the project's configuration; for a verified GitHub repository, GIT_DIR=$(jj git root) gh repo view "$repo" --json defaultBranchRef can confirm the default. Refresh that exact bookmark with jj git fetch --remote "exact:$remote" --branch "exact:$base_bookmark" when available; use the verified remote bookmark (<bookmark>@<remote>) after a successful refresh. A missing remote, differently named remote, or failed refresh does not block fresh work if the corresponding local base is verified; disclose the fallback. Never silently substitute a different base.jj git fetch; do not substitute a similarly named ref.GIT_DIR=$(jj git root) gh pr view "$pr" --repo "$repo" --json headRefOid,headRefName,headRepository,headRepositoryOwner,isCrossRepository,url with the verified base repository. Verify the exact head commit, head repository, and head branch. If the commit is missing locally, fetch the exact head branch from a JJ remote that points to the head repository, including for forks; add a uniquely named remote for the verified head URL only when changing shared remote configuration is authorized. Confirm that the fetched remote bookmark resolves to the reported head OID; if the head moved, re-resolve the PR, and if the exact commit cannot be obtained, stop and report the blocker. Do not substitute the merge ref, a same-named branch in the base repository, or a stale local ref.Verify the selected ref resolves to exactly one commit with jj log --no-graph -r "$resolved_ref" -T 'commit_id ++ "\n"' from the source root. Use that full commit ID as base. Refreshes must preserve existing local PR/source bookmarks; if the configured fetch would move one, use an authorized separate non-tracking remote or report the blocker.
For a new workspace only, capture the local date once (date +%Y%m%d). Derive a meaningful lowercase kebab-case slug from the task, PR, or revision; normalize caller-supplied names by stripping an existing YYYYMMDD- prefix before applying the captured date. Use the same YYYYMMDD-<slug> identity for the JJ workspace name and the basename under $workspace_root/.tmp/worktrees/. Keep any selected identity already recorded for this run, including its original date and collision suffix.
| Input | Workspace name and directory basename (example date: 2026-10-08) |
|---|---|
| Fresh work: fix email validation | 20261008-fix-email-validation |
| PR #214 | 20261008-pr-214 |
Review revision efcb657 | 20261008-review-efcb657 |
Caller supplies 20261001-Fix_Email_Validation for a new run | 20261008-fix-email-validation |
20261008-pr-214 is registered and .tmp/worktrees/20261008-pr-214-2 already exists | 20261008-pr-214-3 |
| That same run resumes the next day | 20261008-pr-214-3 |
Ensure the root .gitignore ignores .tmp/ before creating anything there. Honor an existing directory-only rule; if no effective rule covers the directory, add /.tmp/ to the source root's .gitignore when authorized, preserving user edits. Stop if the path is already tracked, .tmp/ or the destination parent redirects outside the workspace's local .tmp/ tree, or you cannot safely establish the ignore rule. For each candidate check both the exact JJ registration (jj workspace list -T 'name ++ "\n"') and the absolute destination, including symlinks. Skip collisions with -2, -3, etc. Record the chosen name, path, and base in the caller's run state under local .tmp/ before attempting creation. Recheck before creating. On a failed or interrupted attempt, reconcile the registration and filesystem with the record before retrying or reusing it; do not overwrite state, choose a new date, or switch to a new name to work around an uncertain partial creation.
If the harness owns workspace creation, use its supported colocated JJ capability. Request the chosen name, absolute destination, and verified base. If the capability cannot satisfy these requirements, report a compatibility blocker through the decision path below; do not bypass the harness's lifecycle. A worktree-only capability does not satisfy the JJ requirement.
When the harness does not own creation and provides a supported way to adopt the resulting workspace, create it explicitly from the source root:
(cd "$workspace_root" && jj workspace add --colocate --name "$name" --revision "$base" "$absolute_destination")
Verify jj workspace root --name "$name" maps to the expected absolute destination and that its basename equals the registered name. Run jj git colocation status and verify @- equals the selected base from the created workspace's absolute root:
(cd "$absolute_destination" && jj git colocation status)
(cd "$absolute_destination" && jj log --no-graph -r '@-' -T 'commit_id ++ "\n"')
Adopt the workspace with the harness's session-directory capability (for example, OpenCode's opencode.session.move with the absolute destination) unless the native creation tool has already moved the session. Confirm the session is actually operating in that root before work proceeds; a shell-local cd does not move the session. For new work, create the meaningful task bookmark at @ from this root with jj bookmark create "$task_bookmark" -r @; confirm the name is unused first. On resume, reuse that bookmark only if the run record and its target establish ownership. Report the path, name, base and bookmark/PR details, and identify who owns cleanup.
If creation, verification, or adoption fails, including a sandbox or permission error, report the specific failure and preserve any partial state. Do not proceed in the original checkout without confirmation or retry alternative paths automatically. Offer choices such as "work in the current workspace" or "stop and resolve the blocker" through the host's blocking question tool, identified by capability in the current tool list. If listed but unloaded, use the host's tool-discovery primitive; if absent or the call errors, present numbered options in chat and wait for the reply.
Completion is not cleanup authorization. Follow the harness lifecycle for harness-owned isolation; do not independently remove it. For a run-owned workspace whose removal is authorized:
jj workspace list and jj workspace root --name "$retire_name" from the surviving root. Never remove the main workspace or unrelated, ambiguously owned, still-referenced, or non-disposable content.jj status, jj diff --summary); inventory its files against jj file list to account for ignored and untracked content, including under .tmp/. Removal snapshots working-copy state, but ignored and unsnapshotted files are not protected. Preserve needed content or stop if it cannot safely be retired.(cd "$surviving_root" && jj workspace remove -- "$retire_name"). Verify both that the registered name is absent and that the verified absolute directory no longer exists. Directory removal can fail with a warning despite a successful exit. If removal fails or either check is inconclusive, retain remaining state and report the blocker; never force-delete or use a separate Git cleanup command. Bookmark deletion is a separate decision; keep best, archive, recovery, and other still-needed bookmarks.Use jj workspace forget from the surviving root only when the authorized intent is to unregister a workspace while preserving its files.
What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub ucirello/compound-engineering-plugin --plugin compound-engineering38 skills in this plugin
/ce-babysit-prBabysits an open GitHub PR until merge-ready, first judging whether an old PR still belongs. Use when asked to watch a PR over time or update an old one — not for one-shot comment resolution or one CI failure. GitHub (incl. Enterprise) only./ce-bakeoffDevelop independent competing solutions to a defined brief, compare them, and synthesize a winning approach. Use when choosing well requires developing alternatives beyond their current form. Use ce-pov to judge developed material and ce-ideate to discover opportunities./ce-brainstormExplore vague or ambitious ideas into a right-sized requirements-only unified plan. Use when the user wants to brainstorm or scope what to build. Not for executing already-specified work. Use ce-pov for a verdict on adopting a named external technology./ce-code-reviewReview a named diff or PR for bugs, regressions, tests, and standards. Use when asked to review code or when a shipping skill needs a review receipt. Use when asked to apply this review's findings locally. Use ce-resolve-pr-feedback for feedback already left on a PR./ce-commitCommit local Jujutsu changes with a clear, value-communicating message. Use when the user asks to commit or save working-copy changes with a repository-appropriate message./ce-commit-push-prCommit, push, and open a PR. Use when asked to ship/open a PR, or for PR-description-only flows like writing, rewriting, or describing a PR body.