- implements blueprint 028 - rewrite 290 cross-skill markdown links across 59 files to unchecked backtick-wrapped /skill-name prose (R-023), so skill content resolves under any install depth — symlinked, flat-copied, or whole-tree - add skills/productivity/conjure-a-skill/scripts/skill-ref-check — validates every /skill-name mention resolves to a real skill folder, the replacement coverage link-check lost on these references - add scripts/link-skills.sh, mirroring mattpocock/skills, symlinking every skill into ~/.claude/skills and ~/.agents/skills - docs(readme): point Install at link-skills.sh and npx skills@latest add for non-Claude-Code harnesses
4.5 KiB
[ -d .jj ] fails. jj repos → resolve-conflicts-jj.
resolve-conflicts-git
git-native counterpart of /resolve-conflicts-jj.
Unlike jj, git conflicts are mid-operation limbo — MERGE_HEAD or a
paused rebase holds the repo until you continue or abort. The limbo is
still not an emergency: --abort is a clean reset to before the
operation, so you can always stop, think, and re-attempt. Never resolve
under abort-pressure.
Process
-
See the state.
git status(unmerged paths + which operation is in flight),git log --oneline --graph HEAD MERGE_HEAD(merge) orgit rebase --show-current-patch(rebase) — what each side was doing. -
Check topology before touching markers. A branch rebased onto the wrong base produces phantom conflicts. If the conflicted commits' true destination isn't the current base:
git rebase --abort, thengit rebase --onto <correct-base> <old-base> <branch>. Re-attempt; often the conflict shrinks or vanishes. -
Find the primary sources. Why does each side exist?
git config merge.conflictStyle zdiff3(once, before merging) — markers then show the common base between|||||||and=======, so you see what each side changed, not just what it is.- Three versions on demand:
git show :1:<file>(base),:2:(ours/HEAD),:3:(theirs). - Intent:
git log --merge -p -- <file>shows both sides' commits touching the file; check blueprints/PRs/issues if cited.
-
Resolve each hunk — preserve both intents. Apply the semantic change of the incoming side onto the destination's evolved text, not a side-pick. Truly incompatible → pick the side matching the merge's stated goal, note the trade-off. Never invent new behaviour; never abort as a way of abandoning the work.
-
Continue, editor guarded.
git add <resolved-files>, thenGIT_EDITOR=true git merge --continue(orrebase --continue) — an unguarded continue spawns$GIT_EDITORfor the merge message and hangs a headless session. Rebase: repeat per stopped commit. -
Verify. Run the project's automated checks (typecheck, tests, lint) — the conflicted span never ran them. Cross-file consistency: a resolved file may reference a sibling that had its own conflict —
grep -rn <term> <dir>. Thengit show— the commit message must still describe the resulting diff; reword if the resolution changed the story.
git specifics worth knowing
- Rebase replays commit-by-commit — expect the same conflict shape
repeatedly;
git config rerere.enabled truerecords resolutions and replays them automatically. git checkout --ours/--theirs <file>is a whole-file side-pick — exactly what step 4 forbids, except for generated/lock files where regeneration is the real resolution.- During rebase, ours/theirs invert intuition: "ours" = the base being rebased onto, "theirs" = your replayed commit.
- Aborting is cheap and safe (
merge --abort/rebase --abort) — unlike jj there is no committed conflict to return to, so abort only with the topology fix (step 2) or a fresh attempt in hand.
Output / done criteria
git statusclean of unmerged paths, operation concluded; checks green; each hunk's resolution traceable to both parents' intent; message still matches the diff.
Guardrails
- Never resolve by side-picking without reading both intents
(
checkout --ours/--theirsonly for regenerable files). - Never invent behaviour absent from both sides.
- Never run
merge --continue/rebase --continueheadless withoutGIT_EDITOR=trueor-mwhere accepted. - Never leave conflict markers in a "resolved" file —
grep -rn '<<<<<<<' .before continuing.
See also
/resolve-conflicts-jj— jj counterpart; topology-first rule and real-world phantom-conflict case (OKF/LEARNINGS.md) apply verbatim./commit-atomic-git— sealing discipline after resolution./review-angles— a resolved merge is a diff like any other; review it.