--- name: truce description: Settle contradictions between skills. `/truce` lists what needs a decision; `/truce ` drafts and approves a Bridge; `/truce edit ` changes an approved Bridge; `/truce allow ` marks a Pair as needing no Bridge; `/truce help` lists these forms. disable-model-invocation: true --- Run the core as `CLAUDE_PLUGIN_DATA="${CLAUDE_PLUGIN_DATA}" bash "${CLAUDE_PLUGIN_ROOT}/hooks/run.sh" `, called `truce` below. The core owns every state change; this skill only reads its output and relays it. Terms: a **Pair** is two skills active in the same session; a **Clash** is a Pair whose instructions contradict each other; the **Lead** is the skill whose rules win where they truly contradict; a **Bridge** is the short, user-approved note for a Pair (its Lead, how each contradiction resolves, one worked example), injected whenever the Pair is active; a Bridge is **Stale** when either skill changed since approval, and is not injected until re-approved; an **Allow** marks a Pair as needing no Bridge, and survives edits to either skill. Arguments: `$ARGUMENTS` ## No arguments: review 1. Run `truce status`. It prints JSON: `pending` (Clashes, each `skills` and `reason`), `stale` (Bridges whose skill changed, each `skills` and `lead`), `missing_bridges` (bridged Pairs whose Bridge file is missing or empty, each `skills` and `path`), `corrupt` (paths of unreadable records truce moved aside), `unavailable`, `bridges`, `allows`, `bridge_files` (each approved Bridge whose skills are available here: `skills`, `path`, `tokens`, `over_cap`). 2. Print each `pending` Pair as ` + : `, then each `stale` Pair as ` + : Stale, a skill changed since approval`, then each `missing_bridges` Pair as ` + : Bridge file missing or empty at , nothing is injected; run /truce to redraft it`. 3. For each `corrupt` path print `Unreadable record moved aside: . The Pair will be checked again; delete the file to clear this notice.` 4. When `unavailable` is above 0, print `N Pairs use skills not available here`. 5. Print one status line: `truce: approved Bridges, Allows`. 6. Print each `bridge_files` entry as `Bridge + : ` (it can be edited by hand); when `over_cap`, add `, over the cap at tokens, still injected`. 7. When `pending`, `stale`, `missing_bridges` and `corrupt` are all empty, add: nothing is pending, and a Bridge can still be made by hand with `/truce `. Done when steps 2 to 7 are printed from the JSON, with nothing invented. ## `allow ` 1. Run `truce allow ` with the two names as typed. 2. Exit 0: print `Allowed + : no Bridge needed, and it stays allowed after either skill is edited.` 3. Non-zero: print the core's stderr line as the error. The core stored nothing. Done when the Pair is reported allowed, or the error is printed. ## ` `: draft and approve Works from any state, including skills that are not loaded, a no-Clash Verdict, a Stale Bridge or an Allow (approving replaces the Allow). Nothing is stored or injected until step 4. All model calls happen inside the core; never write or edit Bridge text yourself. 1. Run `truce propose `. It prints JSON: `skills`, `lead`, `reason`, `stored_lead`. Non-zero: print the core's stderr line as the error and stop; do not guess a Lead. 2. Show the proposed `lead` and its `reason`. When `stored_lead` is set, say it is the Pair's current Lead and offer it as the default. Ask: keep or flip. The answer is the confirmed Lead, one of `skills`. 3. Run `truce draft --lead `. It prints JSON: `text`, `tokens`, `cap`, `over_cap`. Non-zero: print the error and stop. Show `text` exactly as returned. When `over_cap` is true, also show `tokens` against `cap` and say the draft is still over; never cut it. 4. Ask: approve or cancel. Put the full `text`, exactly as returned, in a fenced block inside the approve question itself (use a fence longer than any fence inside `text`, so its example stays unchanged), not only in a message before it, which the interface can collapse: the user must see the Bridge they approve. Cancel: stop; nothing was stored. Approve: pipe the shown `text` unchanged to `truce approve --lead ` on stdin (a heredoc with a quoted delimiter). It prints the Bridge file path; print `Bridge approved for + , Lead . File: ` (the file can be edited by hand). Done when the Pair is approved from the shown text, or the user cancelled or an error was printed. ## `edit ` Works on an approved Bridge, or an allowed Pair that kept its Bridge text (approving replaces the Allow). Nothing is stored until step 3. Never write or edit Bridge text yourself. 1. Run `truce edit --instruction ""`. It prints JSON: `skills`, `lead`, `text`, `tokens`, `cap`, `over_cap`. Non-zero: print the core's stderr line as the error and stop; nothing was stored. 2. Show `lead` and `text` exactly as returned. When `over_cap` is true, also show `tokens` against `cap` and say it is still over; never cut it. 3. Ask: approve or cancel. Put the full `text`, exactly as returned, in a fenced block inside the approve question itself (use a fence longer than any fence inside `text`, so its example stays unchanged), not only in a message before it, which the interface can collapse: the user must see the Bridge they approve. Cancel: stop. Approve: pipe the shown `text` unchanged to `truce approve --lead ` on stdin (a heredoc with a quoted delimiter), using the `lead` the edit reported. Print `Bridge approved for + , Lead . File: `. Done when the edit is approved from the shown text, or the user cancelled or an error was printed. ## `help` Print the forms, one per line, with nothing before them: - `/truce`: list Pairs waiting for a decision, and Stale Bridges. - `/truce `: draft a Bridge, confirm which skill leads, and approve it. - `/truce edit `: change an approved Bridge. - `/truce allow `: mark a Pair as needing no Bridge. - `/truce help`: show this list. ## Any other arguments Print that the form is not available yet, then the list from `help`.