jyn514/dotfiles/jj-conflict-resolution

Claude Code and agent skill by jyn514/dotfiles

Trust tier 3
  • community
Source check pending

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

Resolve Jujutsu conflicts semantically by composing snapshots and diffs, never with ours/theirs or union heuristics. Use when interpreting or resolving actual or expected file conflicts, including conflicts from rebase, merge, or restack. Use jj-workflow for history operations and their mandatory pre-operation isolation; a conflict-free operation alone does not need this skill.

Install

npx vskill@latest install jyn514/dotfiles/jj-conflict-resolution

SKILL.md

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

Jujutsu conflict resolution

Resolve the file result, not marker text. Jujutsu conflict content is a complete snapshot plus one or more diffs; concatenating sections is invalid.

Scope and authority

This skill owns semantic resolution and validation. It does not choose rebase targets, abandon changes, rewrite shared history, or decide product behavior; use jj-workflow for those decisions. If the conflict representation is unclear, investigate it before editing.

Treat existing working-copy changes as protected until ownership is established. If a dirty file contains unrelated work, stop and ask before overwriting it.

Isolate resolution

Follow history-operation isolation before resolution. If the live checkout already contains conflicts, preserve its authored changes and continue in isolation. Keep it usable until the complete candidate is validated; a separate workspace shares history and does not by itself protect its revision.

Inspect first

Start with one of these commands:

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

Use jj status unless you already know the working-copy commit is conflicted; then use the second command. Before creating a resolution commit, identify the exact conflicted revision and target change.

Inspect the whole conflict and surrounding destination code for each file. Check the installed jj-conflict --help interface rather than assuming its source documentation ships beside an installed skill. If the repository provides the wrapper, use:

bash
jj-conflict inspect path/to/file --json

For a checkout that does not install the wrapper, invoke its tracked path directly:

bash
libexec/agent-wrappers/jj-conflict inspect path/to/file --json

Marker order may vary. Parse both forms:

  • a %%%%%%% diff from: BASE section followed by a +++++++ SIDE snapshot;
  • a +++++++ SIDE snapshot followed by a diff section.

Marker lengths may exceed seven characters. Do not identify sections by fixed-width markers.

Resolve one file

A snapshot supplies complete file content; a diff describes how content changes relative to a named base. In a conflict represented by a snapshot and a diff, the diff's removed lines are historical input to that change, not a second implementation to keep beside the destination. Reading its base reveals what the change is trying to replace. Reading the destination reveals where that behavior belongs now.

For example, a base file calls startWorker() directly. One change adds an admission check around that call. The destination moves worker startup into a helper and adds resource reservation before calling it. Copying both conflict blocks can leave the old direct call beside the new helper path, starting the worker twice or bypassing reservation. Restoring the old block and adding the admission check there preserves the patch's old location while losing the destination's refactor. The resolution instead needs the admission behavior in the destination startup path, with its reservation and unrelated changes preserved. The right location depends on what admission promises and which state exists there, not which conflict section appears first.

For each conflict, record:

  1. current destination snapshot;
  2. base revision named by diff from:;
  3. each transformed side and affected region;
  4. unrelated destination changes to preserve;
  5. semantic result required by both changes.

For each diff side, inspect its base file:

bash
jj file show --revision BASE -- path/to/file

Verify the diff against that base, then apply its changes to the current destination snapshot. Preserve destination refactors and unrelated lines. If destination changes invalidate the diff's context, resolve that region manually; do not restore historical context. If both sides change the same behavior, reconcile the changes explicitly. Do not keep both blocks just because both appeared in the conflict.

A moved callback can change what a test proves

When lifecycle ordering changed, trace the old and destination transitions before composing the fork behavior. That same startup refactor can move the state a race test needs without changing the test's callback name. Suppose the old path runs an extension callback before reserving a run, and the destination reserves the run before invoking that callback. A fixture paused at the callback used to expose an unreserved run. After the refactor, it exposes a reserved run. Reusing the pause point now tests a different state even if the fixture still blocks and releases successfully.

Consider a fork contract that prevents a cancelled startup from launching its worker. To preserve it, identify when cancellation occurs, who owns the reservation then, and whether the worker has launched. A fixture for cancellation before reservation must establish that state before releasing its competing operation. A fixture for cancellation after reservation must establish the reservation and check the required cancellation and cleanup behavior from there. The callback helps arrange the state; its name does not establish the state. Use the concurrent-lifecycle testing guidance for those obligations.

If the required contract still fits the destination transitions, adapt the fork behavior and fixture to those transitions instead of reversing the refactor to recover the old pause point. If the fork requires a cancellation opportunity that the destination intentionally removes, moving the fixture cannot reconcile that policy difference. Ask before dependent edits that would change destination policy. Preserve destination control flow and helper placement unless the required fork contract needs a different result; the old fixture alone does not establish that need.

Conflicting behavioral promises

When the sides promise different behavior, identify what each behavior gives its callers, which governing requirements establish it, and its costs. Tests establish existing behavior; they do not by themselves establish that preserving it serves the requested outcome. If preservation imposes a material cost without an established caller need, explain the tradeoff and obtain authorization before dropping the behavior. For example, a test may require cancellation to wait for resource cleanup even when callers need prompt cancellation and cleanup can continue in the background. Check whether any caller needs cleanup to finish before cancellation returns rather than treating the test's ordering as sufficient justification. Use jj-workflow to remove authorized dropped work from the candidate history.

Composition limits

Do not use :ours, :theirs, equivalent whole-side selection, union merge tools, text concatenation, blind search-and-replace across all conflicts, or jj undo as recovery machinery.

For a multi-sided conflict, inspect every diff alternative and choose the required semantic result explicitly with conflict:diff. If the representation is unclear or a diff cannot be applied uniquely to its base, stop and inspect the exact Jujutsu format before editing. An unresolved ambiguity is safer than a syntactically valid but semantically damaged merge.

Apply a helper composition

Once you have chosen the semantic result, preview the helper composition first. If it is correct, write it and check the file:

bash
jj-conflict apply path/to/file --edit 1,3:2 --preview
jj-conflict apply path/to/file --edit 1,3:2
jj-conflict check path/to/file

Unselected conflicts remain unresolved. Inspect again after a partial resolution before selecting more edits; the numbers refer to the remaining conflicts. The helper rejects conflict shapes it cannot compose safely rather than adding another heuristic.

Separate parallel resolution from history integration

For a stack with several conflicts, distinguish conflicts each revision introduces from conflicts inherited from ancestors. Resolving an ancestor can eliminate an inherited conflict; do not assign both as independent work. Parallelize investigation and patch preparation when neither resolution depends on a decision made by the other and the overlap saves more time than coordination costs. Different files alone do not establish independence: a caller resolution depends on the chosen function signature even when they occupy separate files. Settle shared contracts before parallel preparation that relies on them.

Prepare independent resolutions against fixed revisions in separate disposable workspaces or as standalone patches. Keep rewrites of overlapping ancestor/descendant histories with one integration owner: squashing into an ancestor also rewrites descendants. Integrate in dependency order, then inspect restacked descendants before applying prepared resolutions. Recheck both the proposal's assumptions and the combined behavior; an earlier resolution may have changed the conflict or eliminated it.

Preserve Jujutsu history

A correct file in a disposable workspace is a proposed resolution, not yet evidence that the intended change contains it. Squashing into a nearby revision can leave the introducing change conflicted or attach the fix to a different feature. Descendants can depend on the code just reconciled, including callers that Jujutsu merged without conflicts. A prepared caller resolution can still use the old function signature after an ancestor's resolution changes it. Exact-target integration and renewed descendant inspection establish which history contains the composed behavior.

In the disposable workspace, resolve in a fresh working-copy commit on top of the first conflicted candidate change. Squash it into that exact change only if it is mutable and rewriting it is authorized; otherwise use jj-workflow to choose an allowed history strategy. These commands run in the disposable workspace:

bash
jj new CONFLICTED_CHANGE
# edit and inspect the files
jj diff --summary
jj squash --from @ --into CONFLICTED_CHANGE path/to/resolved-file

Select only owned resolution paths; if a path also contains unrelated edits, separate the hunks through jj-workflow before squashing. Inspect any changes left in the resolution commit and preserve unrelated work.

Use the stable change ID, not a nearby @-, as the squash target. Let descendants restack; then repeat inspection and resolution for each conflicted descendant. Do not abandon a change until its patch and resulting tree are understood.

If a mutating command fails or is interrupted, inspect jj status, jj log, and operation state before retrying. Do not restore files or undo operations on assumption.

Validate

Conflict status and reviewed marker scans check for remaining conflicts; semantic review establishes what the composed code now does. The absence of conflict markers cannot reveal a caller still using the old signature or duplicate configuration keys. Validation follows the result that will be used, not just each file that displayed a conflict.

After each resolution:

bash
jj status
rg -n --hidden --glob '!node_modules/**' --glob '!.git/**' \
'^(<<<<<<<|%%%%%%%|\+{7,}|>{7,})' path/to/resolved/files

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

Security

  • Security scanPassed, 90 of 100Pattern checks on the skill's files.
  • Model reviewPassed

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-conflict-resolution/badge)](https://verified-skill.com/skills/jyn514/dotfiles/jj-conflict-resolution)

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