/melt
When to invoke: Resolve content conflicts during Git merge, rebase, cherry-pick, pull, or branch integration. Use for CONFLICT, unmerged paths, or Git’s “needs merge” diagnostic for an unmerged path. Trigger on fix merge conflicts, resolve rebase conflicts, cherry-pick conflict, and similar requests. Do not use for clean Git operations or review-only questions.
Resolve the current conflict without rewriting a published branch. Use the safe cascade: squash repair → summary → mergiraf → rerere → manual resolution → continuation. Keep the original branch for recovery. Never push, reset, or force-push here.
Use the selected source-code backend for searches, bounded reads, and manual edits. Follow code-intelligence routing: search, fresh read, stale-safe write.
1. Repair squash residue
Section titled “1. Repair squash residue”Run this before resolving file conflicts:
python3 skills/melt/scripts/melt.pyz detect-squash-residue --applyUse --base <ref> when the base is not origin/main.
Use --branch <name> when Git cannot identify the original branch.
The command previews by default without --apply.
It creates <original-branch>-clean and replays verified commits in order when safe.
Otherwise it merges the base into the original branch.
It preflights branch collisions before aborting an interrupted operation.
It never pushes or rewrites either branch.
If application.state is confirmation-required, keep the active operation intact.
Ask once whether to discard its staged resolution and abort it.
After explicit confirmation, rerun with --apply --abort-operation.
If confirmation is refused, continue the existing operation instead.
If application.state is failed, report failed_step, error, and recovery_branch; stop.
If it is needs-resolution, continue the cascade.
If it is applied without conflicts, check the operation state and proceed to handoff.
If it is not-applied, continue the existing conflict.
2. Diagnose and inspect
Section titled “2. Diagnose and inspect”python3 skills/melt/scripts/melt.pyz conflict-summarypython3 skills/melt/scripts/melt.pyz operationRead each summary hunk and the operation’s unmerged_paths and conflict_marker_files.
Use git log --merge --oneline only when commit intent is unclear.
Do not accept a structural merge only because it has no markers.
3. Resolve structures
Section titled “3. Resolve structures”Preview mergiraf, then inspect its semantic result before applying it:
python3 skills/melt/scripts/melt.pyz batch-resolvepython3 skills/melt/scripts/melt.pyz batch-resolve --debug <path>The debug command gives the merged output path, log path, and marker count. Read that output with the selected backend. Confirm that both sides’ intended edits remain. Then apply clean resolutions and stage them:
python3 skills/melt/scripts/melt.pyz batch-resolve --applyMelt text tools refuse binary files. Select a side for ordinary binaries and stage it. For generated archives, resolve source files and rebuild the archive instead.
4. Resolve what remains
Section titled “4. Resolve what remains”Run operation again. Its rerere_enabled, configured_merge_tool, and
selected_manual_tool fields define the available fallback.
When rerere is enabled, inspect git rerere status and git rerere diff.
If it is disabled, report the setting and skip that stage.
Do not change global Git configuration during this invocation.
For unresolved text, use the selected manual tool or edit after semantic inspection.
Prefer git mergetool --tool=kdiff3 <path> when selected_manual_tool is kdiff3.
Otherwise use the configured tool and report the substitution.
Stage each resolved path. Resolve lockfiles from their manifests, not their conflict text.
Read conditional cascade stages only when selecting sides, regenerating lockfiles, debugging mergiraf, or maintaining rerere data. Its side-selection and lockfile commands require a judgment about intended content.
5. Continue once
Section titled “5. Continue once”python3 skills/melt/scripts/melt.pyz operationpython3 skills/melt/scripts/melt.pyz operation --continueRun --continue only when status is ready.
It refuses unmerged paths and conflict markers, then continues without an interactive editor.
If it returns blocked, resolve the next conflict and repeat steps 2–5.
If it returns failure, report failed_step and stop.
Handoff only when status is complete.
Do not run a separate raw Git continuation command.
Handoff
Section titled “Handoff”After completion, use the shared handoff gate. Fill the placeholders from the upstream invocation and propagated flags.
handoff_gate: source_skill: /melt id: post-melt-next-step prompt: The Git operation is complete. What should happen next? recommended: rerun-upstream multi: false options: - id: rerun-upstream label: Re-run the upstream gate description: Run the invocation that found the conflict. dispatch: <upstream_invocation> context: upstream_invocation: <command> flags: [<propagated flags>] - id: plate-it label: Plate it description: Publish completed work through /plate. dispatch: /plate context: flags: [<propagated --hard, --open-pr>] - id: checkpoint-and-stop label: Checkpoint & stop description: Write a durable checkpoint, then pause the pipeline. dispatch: /wheypoint - id: stop label: Stop description: Leave the completed operation for inspection. dispatch: noneOmit rerun-upstream and recommend stop when its invocation is unknown.
Wait for the user’s selection. Run a selected non-stop action immediately.
Melt never commits or pushes. /plate owns publication.
See the generated command inventory for all Melt commands.
Cascade stages — branch-specific steps
Section titled “Cascade stages — branch-specific steps”Steps 0 through 3 apply to every invocation. The main skill file defines the squash check, diagnosis, structural resolution, and manual resolution. Use steps 4 through 7 only for the specified conflict types.
Step 4 — Select ours or theirs
Section titled “Step 4 — Select ours or theirs”Use conflict-pick for a file that mergiraf cannot merge.
Read the mergiraf_supported field and the recommendation field from conflict-summary.
Run conflict-pick when the recommendation names that command.
Do not use a static format list.
Mergiraf changes its language support between releases.
# Select ours for every hunk.python3 skills/melt/scripts/melt.pyz conflict-pick hooks/session-start.sh --ours
# Select theirs for every hunk.python3 skills/melt/scripts/melt.pyz conflict-pick .gitignore --theirs
# Select ours only for hunks that match the regular expression.python3 skills/melt/scripts/melt.pyz conflict-pick config.yaml --grep "timeout" --oursThe command leaves unmatched hunks unresolved.
Step 5 — Resolve lockfiles
Section titled “Step 5 — Resolve lockfiles”Text and AST merges cannot validate lockfile content. Select one side and regenerate the lockfile from its manifest.
# Detect lockfile conflicts, select theirs, regenerate each lockfile, and stage it.python3 skills/melt/scripts/melt.pyz lockfile-resolve
# Preview the changes.python3 skills/melt/scripts/melt.pyz lockfile-resolve --dry-run
# Select ours instead.python3 skills/melt/scripts/melt.pyz lockfile-resolve --strategy oursThe command supports these files:
Cargo.lockpackage-lock.jsonyarn.lockpnpm-lock.yamlpoetry.lockPipfile.lockuv.lockGemfile.lockgo.sum
Step 6 — Debug mergiraf
Section titled “Step 6 — Debug mergiraf”First, use the --debug inspection from step 2 in SKILL.md.
Then run these checks:
mergiraf languages | grep <extension> # Confirm that mergiraf supports the file type.git check-attr merge -- <path> # Confirm that Git uses mergiraf.Common causes:
- The extension is absent from
~/.gitattributes. Regenerate the file after an upgrade. - One of the three versions has a parse failure. Mergiraf then uses text merge.
- Mergiraf skips files larger than 1 MB.
Step 7 — Maintain resolution data
Section titled “Step 7 — Maintain resolution data”# Regenerate attributes after an upgrade.mergiraf languages --gitattributes > ~/.gitattributes
# Show paths with recorded resolutions.git rerere status
# Show pending resolution differences.git rerere diff
# Remove a bad resolution.git rerere forget <path>
# Remove old entries.git rerere gc
# List the resolution database.ls .git/rr-cache/Special cases
Section titled “Special cases”Changes that modify only whitespace
Section titled “Changes that modify only whitespace”A formatter on one branch can move AST positions while the other branch changes content. Mergiraf can then produce more conflicts. Run the formatter on the merged result after you resolve all conflicts.
State that cannot be recovered
Section titled “State that cannot be recovered”Offer an abort when the conflict state cannot be recovered. The user decides whether to abort.
git merge --abortgit rebase --abortgit cherry-pick --abort/melt bundle commands
Section titled “/melt bundle commands”scripts/render_generated_regions.py generates this file from the static COMMANDS manifest in src/easy_cheese/skills/melt/commands.py. Do not edit this file. Run each command as python3 skills/melt/scripts/melt.pyz <command> [args...]. Each command returns an integer exit status. Pass --help to a command for its arguments and output format. Keep worked examples in the skill instructions.
| Command | Purpose | Subcommands |
|---|---|---|
batch-resolve |
Run mergiraf structural merge over every conflicted file | |
conflict-pick |
Take ours or theirs for each conflict hunk | |
conflict-summary |
Summarize conflicts with line numbers and framed context | |
detect-squash-residue |
Detect squash-merge residue and print the safe action | |
lockfile-resolve |
Take one side of a lockfile conflict and regenerate it | |
operation |
Report or continue the current Git operation |