agentleFS
ihuzaifashoukatihuzaifashoukat/splicedeck/.claude/skills/recovering-from-a-refusal/SKILL.md

recovering-from-a-refusal

Skill4 starsChanged 3 months agoApache-2.0View on GitHub

Turns a splicedeck refusal into the next correct call in one turn. Use when an spd command exits 1, when an MCP verb returns an envelope with ok false, when a refusal code such as UNKNOWN_HANDLE, SHEET_NOT_VERIFIED, GATE_BLOCKING, FFMPEG_ABSENT, ENCODER_UNPROVEN, BOOKMARK_UNKNOWN, NOT_ON_WORD_EDGE or RIGHTS_MISSING appears, or when the user reports that splicedeck refused to do something.

We split this skill into the rules it gives an agent

2 rules. About 0 are common, 2 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    No call you can send fixes it.

    line 35
  2. Distinctive:

    Every code is one of three, and the class tells you what to expect before you look.

    line 85

≈ “Common” is an estimate: at least 1 in 5 of the 308,232 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Recovering from a refusal

A splicedeck refusal is a successful call that carries its own correction. It is not an error to report and not a wall to work around. Ninety-four codes exist so that recovery is one turn rather than a diagnosis.

The full catalogue, generated from the code, is in references/refusal-codes.md. Read it when you need a specific code. The four rules below are what you need every time.

The four rules

1. When retry_with is non-empty, send one of those calls verbatim.

The server built them from what it already knows — the handles that exist, the bookmarks that are shipped, the rung that is proven. Re-deriving the arguments yourself turns a one-turn recovery into a guessing loop, and you will get it wrong in exactly the places the server would not.

{"ok": false, "refused": "SHEET_NOT_VERIFIED",
 "retry_with": [{"verb": "verify", "args": {"sheet": "c1"}}]}

Send verify(sheet="c1"). Do not construct something similar.

2. When needs_human is true, stop and report human_step.

No call you can send fixes it. Saying so plainly is the correct outcome. Inventing a workaround here is worse than stopping, because the workaround usually means disabling the thing that refused.

3. Never install anything in response to a refusal.

FFMPEG_ABSENT does not mean "go and get ffmpeg". This project never installs, downloads, vendors or bundles ffmpeg — that is a deliberate rule, not an omission, and docs/first-run.md §4 gives the three reasons. The same holds for TIER_BINARY_ABSENT. Report the step; the human runs it.

4. A refusal is not a reason to change the plan.

Most refusals mean one call is missing, not that the approach is wrong. Add the call and continue.

The ones you will actually hit

CodeWhat it really meansDo this
UNKNOWN_HANDLEThe handle was never minted here — or, on splice, you passed a source handle where a sheet source key belongsinspect first; for splice, read sources[].key out of the sheet
SHEET_NOT_VERIFIEDThe sheet changed since verifyrun verify again, then retry
GATE_BLOCKINGA gate fails, commonly an empty body lanerun verify to see which; splice a segment if the body is empty
BOOKMARK_UNKNOWNNo bookmark by that nameretry_with lists the ones that exist; only baseline ships
UNKNOWN_PARTYNo directory at casebook/parties/<party>/a human creates it; mkdir is the whole step
ENCODER_UNPROVENffmpeg lists it, this machine cannot run itrun trial; never substitute an encoder yourself
NOT_ON_WORD_EDGEA cut edge falls inside a wordretry_with carries two calls, one keeping the word and one excluding it — pick by meaning
VALUE_NOT_PERMITTEDAn argument carried a value where an identifier belongs, usually a key that looks like a pathsend a plain identifier
RIGHTS_MISSINGAn asset has no licence recordhuman step; delivery will not proceed without one
LANE_DISK_SHORTNot enough free space for the planned runreport the numbers; the human frees space

Reading the envelope

{"ok": false, "verb": "deliver", "refused": "CODE",
 "plain": "one sentence, at most 160 characters",
 "retry_with": [{"verb": "…", "args": {…}}],
 "needs_human": false,
 "human_step": "present only when needs_human is true",
 "spent": {"class": "heavy", "ms": 13}}

On MCP the envelope is in structuredContent and isError is false — a refusal is deliberately not a JSON-RPC error, because hosts flatten protocol errors to a string and the model would then see the sentence and never retry_with.

On the CLI the envelope is on stdout and the exit code is 1.

Three fix classes

Every code is one of three, and the class tells you what to expect before you look.

  • always — a machine fix always exists, so retry_with is never empty. If you see an empty one on an always code, that is a bug worth reporting.
  • sometimes — check retry_with; it may be empty depending on state.
  • human — needs_human is true. Rule 2.

When retry_with is empty and the class is always

That is a defect, not a puzzle. It has happened: five construction sites once passed a dict where a tuple of calls belonged, so callers received the strings ["verb", "args"]. If you see it, say so rather than guessing at the arguments — the guess will look like it worked and will not be what the server meant.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

Reviews can't be read right now.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.