jyn514/dotfiles/jj-workflow

Claude Code and agent skill by jyn514/dotfiles

Trust tier 2
  • community
LLM review pending
Source check pending

Checking that the SKILL.md file is still in the repository.

Use when a task involves inspecting file or revision history, establishing change provenance or ownership, comparing revisions, or shaping history through splits, rebases, restacks, conflicts, or abandonment. Use also before changing an unexplained constraint, compatibility behavior, regression, or proposed reversal when its history could change the fix. Do not use for routine status, diff, or commit tasks that need no history judgment, or routine edits whose requirements and surrounding behavi…

Install

npx vskill@latest install jyn514/dotfiles/jj-workflow

SKILL.md

The same SKILL.md was published earlier as jyn514/dotfiles/jj-workflow.

jj Workflow

Use this skill for nontrivial Jujutsu history work: inspect or interpret path history, annotations, revision ancestry, provenance, or change ownership; compare revisions; or shape history. Prefer jj over Git history-editing commands, keep changes coherent, and do not rewrite shared history unless asked. Before a conflict-capable rebase, merge, or restack, follow operation isolation, even when no conflict is expected. For interpreting or resolving actual or expected file conflicts, use jj-conflict-resolution; a clean history operation needs no semantic-resolution workflow. This skill owns provenance, revision selection, and history shaping.

Inspect and protect work

Start with one command:

  • Run jj status to see the working-copy and parent identity, plus dirty paths.
  • Run jj diff -r @ --summary when you need only the dirty-file list.

Do not run both by default. Narrow inspection with a path-limited command such as jj diff -- path/to/file. Full colored diffs may truncate.

Treat unexpected deltas as authored work until ownership is established. Before mutating a dirty working copy:

before restoring, overwriting, committing, rebasing, or abandoning another contributor's work;

  • stop dependent mutations and ask if ownership or authorization remains unclear;
  • use provenance and a three-way comparison—not similarity—to distinguish independent, stale, and duplicate changes.

Concurrent workers commit only their authorized work and return its change ID. Send each change ID to the owner of the combined candidate. The builder owns integration unless that responsibility was assigned separately under delegation. The coordinator tracks revision dependencies and assigns necessary restacking to an authorized history-work owner; technical acceptance stays with its owner.

Compare and inspect history

Before comparing revisions, state the question and identify the exact revision pair from history.

Fork-only provenance

For a fork-only review, establish the fork's starting revision and head. Upstream HEAD and a merge base with today's upstream do not establish the fork's starting revision. A common-ancestor query applies only to its selected ref, so confirm that ref belongs to the requested lineage. Support each fork-only attribution with the diff or history in that range. If the base is unresolved, report what evidence would resolve it and defer fork-only attributions and keep/drop priorities. Do not rank inherited code from broader tree diffs or commit titles, even provisionally.

Compare revision patches or trees

Use jj interdiff --from A --to B to compare the patches of two revisions, especially when their parents differ. Use jj diff --from A --to B to compare their resulting trees; this may include inherited differences. jj show does not accept filesets. For a path-limited revision patch, use jj diff -r REV <paths>.

Inspect path history

For ordinary path history, pass the path directly:

bash
jj log -n 20 doc/spec/flower --no-graph

To combine path history with a revset, use files() with a quoted path expression:

bash
jj log -r 'files("doc/spec/flower/**") & ancestors(@)' --no-graph

files(doc/spec/flower/**) is invalid. For complex selection, consult jj help -k filesets and jj help -k revsets.

Investigate historical constraints

When an unexplained constraint, compatibility behavior, regression, or proposed reversal could change the fix, inspect its history before changing it. Routine edits whose requirements and surrounding behavior are clear do not require history inspection. When unexplained behavior concerns shared tooling, search its owner, known local consumers, and prior sessions by component name—not only the current repository. Read the supporting evidence and check its version and applicability before reusing it. If file history is needed, start with the relevant jj log. Use jj file annotate and jj diff -r <rev> <files...> for the lines or revisions that explain it, and read the tests that explain the constraint. Do not reverse a historical constraint until you can name why it existed and show that the new design preserves or deliberately replaces it.

Commit

Use jj commit for a coherent completed change. Verify every included hunk first; split mixed concerns. For whole-file ownership, commit explicit paths:

bash
jj commit src/flower/petal.clj -m "Fix markdown code fence handling"
jj show -r CHANGE_ID --summary --no-pager

Use commit-quality for atomic boundaries, selected-candidate acceptance, and message content. Add a body when the diff and subject leave a reason, constraint, or durable verification fact unexplained, not merely because the change is non-mechanical.

In concurrent worktrees, do not use jj describe followed by jj new: it mutates the shared working-copy change. Use jj new only after committing and when a fresh working change cannot disturb concurrent work.

After a commit, @ is the new working copy and @- is usually the commit. Do not use @- as a squash target merely because it is nearby: descendants, rebases, or prior squashes may make it the wrong change. Identify the target by its stable change ID, inspect its patch and descendants, and use that ID explicitly, for example jj squash --from @ --into CHANGE_ID path/to/owned-file.

When exact identity matters:

bash
jj log -r CHANGE_ID --no-graph \
-T '"commit: " ++ commit_id.short() ++ "\nchange: " ++ change_id.short() ++ "\ntitle: " ++ description.first_line() ++ "\n"'

Split or restore

Prefer splitting when separating work. Restore only changes that should be discarded and are clearly yours, or when explicitly asked.

  • Whole-file boundary: use path-limited jj split -r REV <paths...> -m "Message".
  • Whole-hunk boundary in modified regular text files: run bb agent-split list [REV], inspect the complete hunks, then select their IDs with bb agent-split --from COMMIT_ID --hunks 2,5-8 -m "Message" [REV].
  • Partial-hunk boundary or an operation marked unsupported by the listing: use bb agent-split target/jj-split/<name>.patch -m "Message" where the patch-file interface supports that operation.
  • Never use jj split --interactive, jj split --tool :builtin, or another interactive split editor in this repository.

For numbered selection, use the full immutable source commit ID printed by the listing, not a change ID or abbreviation. Both revision operands default to @. list --path <literal-path> filters workspace-relative paths without renumbering global hunk IDs. Use list --json for a machine-readable catalog and bb agent-split --help for option and failure details.

For patch-file selection, build the patch from the revision's generated diff rather than hand-writing headers and context. Preserve unchanged context; the helper recalculates hunk line counts and preflights the selection.

bb agent-split preflights either selection, commits through a trusted path boundary, restores the remainder, and verifies both revisions. Follow its recovery instructions if the split or verification fails.

After any split, inspect selected and remaining changes with jj status and focused jj diff -r CHANGE_ID / jj diff -r @.

Isolate the operation

Perform the rebase, merge, or restack and its resolution in a disposable workspace, or entirely in the repository database without updating the live checkout. Isolation starts before the operation that can introduce conflicts, not after conflicts appear. Use the temporary-workspace procedure. A separate workspace shares history: construct candidate revisions without rewriting the live checkout's revision while the result is unresolved or unvalidated. Check the chosen command's working-copy effects before using a database-only approach.

Record the live checkout's revision and parents before starting. Keep that checkout usable throughout resolution and validation, even when no other agent is editing it. If it already contains conflicts, preserve its authored changes and continue resolution in isolation.

Rebase and abandon

Select the affected history

Establish the intended tip, destination, and authorized stack before choosing flags. Read the installed jj rebase --help when their selection semantics are uncertain. Expand the proposed selection with jj log, including revisions outside the intended tip's ancestry:

  • -s SOURCE moves SOURCE::, not just the path from SOURCE to the intended tip.
  • -b TIP -o DEST moves (DEST..TIP)::, including sibling branches descended from that range.
  • -r SET moves the selected patches, but also reparents descendants to fill the holes; it does not guarantee unchanged sibling identities.

Compare the affected descendants and bookmarks with the authorized scope before mutating. If siblings must keep their ancestry, duplicate only the intended stack onto the destination rather than moving its shared ancestors. Do not perform a broad rebase and then repair unrelated branches. Record the operation ID, intended tip, and affected heads before mutation; inspect the operation diff and verify untouched heads afterward.

Maintain a fork stack

For ongoing authorized fork maintenance, prefer an upstream sync between feature groups over accumulating unrelated work on an old base. This is a working cadence, not permission to schedule background fetches, rewrites, or pushes. Use the lineage comparison above to identify upstream-equivalent changes; titles and empty-looking summaries are only candidates. Inspect their patches, resulting trees, bookmarks, and descendants before abandonment. Fold superseded metadata-only follow-ups into their introducing feature when intermediate revisions remain valid. Keep manifests, lockfiles, generated artifacts, and their authoritative inputs coherent at each retained revision. Do not remove intentional functionality merely to shorten the stack.

When authorized history rewriting includes dropping behavior, remove its changes, tests, and documentation from the introducing revisions rather than append a revert. Abandon a revision if nothing intended remains; otherwise preserve its remaining work. Restack descendants and verify that they do not reintroduce the dropped behavior. This does not authorize rewriting shared history outside the agreed scope.

Before rebasing or abandoning, compare both the patch and resulting tree with the intended replacement. Keep the original visible until the replacement is integrated, descendants are safely restacked, ownership is established, and tree equality is confirmed or every deliberate difference is recorded. For history-only cleanup, require an empty whole-tree diff between the original and replacement tips, separately from unrelated working-copy edits. Do not abandon while an unexpected difference remains unexplained.

Conflicts and stacked fixes

When an actual conflict appears, or inspecting an expected conflict requires semantic composition, load jj-conflict-resolution before editing the resolution. Do not use whole-side selection, union, or concatenation shortcuts.

Resolve conflicts through Jujutsu, not the Git index. Inspect jj status, the conflicted revision, and destination code. Preserve upstream refactors and relocate intended changes when code moved; do not restore obsolete blocks merely because they existed before the rebase.

List conflicts in @ with:

bash
jj log -r @ --no-graph \
-T '"conflicts: " ++ if(conflict, "true", "false") ++ "\n" ++ conflicted_files.map(|f| f.path().display()).join("\n") ++ "\n"'

This is the start of the file. Read the full SKILL.md on GitHub.

Security

  • Security scanPassed, 100 of 100Pattern checks on the skill's files.
  • Model reviewNot runA model review is scheduled for the next rescan.

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

7-day trend score
0

Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/jyn514/dotfiles/jj-workflow/badge)](https://verified-skill.com/skills/jyn514/dotfiles/jj-workflow)

Something wrong with this skill or its page? Tell us.