Local video editor for coding agents: 42 FFmpeg tools with a machine-readable contract and an MCP server, for Claude Code, Cursor and Codex. Cut, captions, reframe, loudness, platform exports. No cloud, no API keys.
Python agent-skillsai-agentsaudio-processingcaptionsclaude-codecodexcoding-agentcursorffmpegloudness-normalizationmcpmcp-servermodel-context-protocolpythonsubtitlestranscodingvideovideo-editingvideo-processingwhisper
feat: token diet — two-tier SKILL.md, --json-brief on every tool, call-saving workflow guidance, short doctor summary (#212)
claude[bot]ee8c6c3a7328
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex dea0df9..19b13da 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -4,7 +4,16 @@## Unreleased-(nothing yet)+### Changed++- **SKILL.md is two-tier** (token diet, 1.10.2): 362 lines / 37.8 KB → 198 lines / 29.1 KB with no rule removed. The long "Things that look right but are wrong" and "Gotchas" prose, and the audio-only recipe table, moved to the new `references/gotchas.md`; SKILL.md keeps one line per item with a `references/gotchas.md#anchor` pointer.+- **Workflow guidance that saves calls**: run `_contract.py doctor` only before the first job on a new machine or after a `kind: missing_tool` failure (not per job); no separate `probe.py` before every edit, because every writing tool's `--json` already carries the input and a probe of the output; use `render.py` with a project.json for jobs of three or more steps; verify with `look.py --tiles 3x2` (or `--at T`), keeping the full 4x3 sheet for jobs about layout across the whole clip.+- `python3 scripts/_contract.py doctor` without `--json` prints counts and what is missing instead of the full capability list (1681 → 522 bytes on a healthy machine). `doctor --json` is unchanged.++### Added++- `--json-brief` on every tool: the same success document as `--json`, trimmed to `status`, `output`, `dry_run`, `verified`, a compact `summary` (`duration_s`, `width`, `height`, `fps`, `vcodec`, `acodec`, `channels`, and `lufs` when the tool measured one), the tool's own keys and the count of commands instead of the command lines — 2372 → 784 bytes for a `cut.py` run. It implies `--json`; `--json`'s own output is unchanged; failures print the same failure document as today.+- `contract --json`: `supports_json_brief` per tool, mirroring the measured `supports_json`. The MCP `tools/list` schema gains the `json_brief` argument on every tool (an addition; the frozen 1.x snapshot was regenerated).## 1.10.1diff --git a/README.md b/README.mdindex c68c8bd..25483e3 100644--- a/README.md+++ b/README.md@@ -153,7 +153,7 @@ These are the rules the skill file gives the agent and the code enforces. Togeth## Tools-42 public tools, all Python 3.9 standard library, all with `--help`, `--dry-run`, `--json`, `--plan FILE` (a dry run written as a plan `render.py` executes later), non-zero exit and a reason on stderr on failure. Every re-encoding tool takes `--codec h264|hevc|av1|prores` and `--quality N` (1.8), and every time flag takes seconds, `mm:ss`, `hh:mm:ss.fff` or SMPTE `hh:mm:ss:ff` with an optional `@fps` suffix (1.9).+42 public tools, all Python 3.9 standard library, all with `--help`, `--dry-run`, `--json`, `--plan FILE` (a dry run written as a plan `render.py` executes later), non-zero exit and a reason on stderr on failure. `--json-brief` (1.10.2) prints the same result document trimmed to what a caller acts on — status, output, `verified`, a compact `summary` of the output probe, the tool's own keys and the command count instead of the command lines — for roughly a third of the bytes; `--json` itself is unchanged. Every re-encoding tool takes `--codec h264|hevc|av1|prores` and `--quality N` (1.8), and every time flag takes seconds, `mm:ss`, `hh:mm:ss.fff` or SMPTE `hh:mm:ss:ff` with an optional `@fps` suffix (1.9).**Analysis and inspection**@@ -259,6 +259,9 @@ built straight from that object. (The rest of a `ToolSpec` — `role`, `capabiliaren't things a parser can express; only `input_schema` is parser-derived.)- **The contract**'s `input_schema` for every tool is generated from the live parser directly.+- **SKILL.md is two-tier** (1.10.2): the file the agent loads every session keeps the workflow, the+ request→script table and one line per gotcha; the long-form detail lives in `references/gotchas.md`+ and the other `references/` files, read only when a job needs it.- **The MCP server** (`mcp/server.py`) carries no schema of its own; `tools/list` is translatedstraight from the contract, `input_schema` included.- **The docs** (`docs/contract.md`'s field reference, this README's tool table) describe the same@@ -286,7 +289,7 @@ The contract is generated from the code that runs, not maintained beside it. For| `output_schema` | what `--json` prints: `status`, `output`, `commands`, `probe`, plus tool-specific fields (`precision`, `checks`, `offset_seconds`, …) || `role` | `analysis`, `analysis_and_execution`, `execution` or `verification` || `capabilities` | the FFmpeg encoders, filters and bitstream filters the tool always needs, and the ones needed only for a flag or input |-| `supports_dry_run`, `supports_json` | measured by the tests, not declared |+| `supports_dry_run`, `supports_json`, `supports_json_brief` | measured by the tests, not declared || `verification` | which tools to run on the output afterwards (`probe`, `check`, `look`) || `requires_visual_verification` | the picture changed; inspect the contact sheet || `audio_only`, `video_required` | whether an audio-only input is accepted or refused |diff --git a/SKILL.md b/SKILL.mdindex c579ffe..9743087 100644--- a/SKILL.md+++ b/SKILL.md@@ -5,126 +5,51 @@ description: 'Edit video and audio with local FFmpeg from natural-language reque# ffmpeg-skill-Scripts live in `scripts/` next to this file; run them with `python3 <skill-dir>/scripts/<name>.py`. Every script has `--help`, and all of them accept `--dry-run`, `--json` (structured result with a probe of the output), `--fast` (preview quality), `--progress`, `--timeout SECONDS` (a single ffmpeg run is killed past this and reported as `kind: timeout`; default 1800) and `--overwrite` (consent to replace an output that already exists; without it the tool warns today and refuses from 2.0) and `--plan FILE` (a dry run written as a plan: fingerprinted inputs, commands, expected output, verify steps; `render.py FILE` executes it later and refuses if an input changed, so "plan → user confirms → execute" is one round trip). Writing tools run nothing under `--dry-run`; `probe`/`check`/`sync`/`multicam`/`scenes`/`cropdetect`/`report`/`silence`/`loudness`/`stabilize` may still run ffmpeg/ffprobe to measure or analyse — they just don't write their final artifact (nor side files such as `--edl`, `--sheet` or a generated `.ass`); `verify` accepts the flag but ignores it. Exact per-tool semantics: `contract --json`'s `dry_run` field (or `docs/contract.md`). Every tool that re-encodes also takes `--codec h264|hevc|av1|prores` and `--quality N` (CRF scale; overrides `--crf`): without them SDR is x264 and HDR is x265 Main10, as before; `--codec prores` needs an explicit `-o NAME.mov` (or `.mkv`), `--codec h264` refuses an HDR source (run `color.py --to-sdr` first). Details for every flag: `references/scripts.md`. Device-specific behaviour (iPhone HDR, GoPro, DJI, screen recordings, Zoom): `references/devices.md`.+Scripts live in `scripts/` next to this file; run them with `python3 <skill-dir>/scripts/<name>.py`. Every script has `--help`; every flag in detail: `references/scripts.md`. Device behaviour (iPhone HDR, GoPro, DJI, screen recordings, Zoom): `references/devices.md`. The long form of this file's one-line rules: `references/gotchas.md`.-## Workflow (always follow this order)+Shared flags, on every script: `--dry-run`; `--json` (output path, a probe of the output, the commands run); `--json-brief` (that document trimmed to status/output/verified, a compact `summary` and the command count — enough to confirm and report); `--fast` (preview quality); `--progress`; `--timeout SECONDS` (`kind: timeout`, default 1800); `--overwrite` (consent to replace an existing output — without it the tool warns today, refuses from 2.0); `--plan FILE` (the dry run as a plan document `render.py FILE` executes later, refusing if an input changed: "plan → user confirms → execute" in one round trip). Every re-encoding tool also takes `--codec h264|hevc|av1|prores` and `--quality N` (CRF scale, replaces the deprecated `--crf`): unset, SDR is x264 and HDR is x265 Main10; `prores` needs an explicit `-o NAME.mov` (or `.mkv`), `h264` refuses an HDR source (run `color.py --to-sdr` first).++Writing tools run nothing under `--dry-run`; `probe`, `check`, `sync`, `multicam`, `scenes`, `cropdetect`, `report`, `silence`, `loudness` and `stabilize` may still run ffmpeg/ffprobe to measure or analyse — they just don't write their final artifact (nor side files such as `--edl`, `--sheet` or a generated `.ass`); `verify` accepts the flag but ignores it. Exact per-tool semantics: `contract --json`'s `dry_run` field (or `docs/contract.md`).-0. **Check the environment once per session, if unfamiliar.** On a machine- you haven't confirmed capability on this session, run- `python3 <skill-dir>/scripts/_contract.py doctor --json` (the npm install- also exposes it as `npx ffmpeg-skill doctor --json`; there is no doctor.py)- once: check `ok` and the target tool's `usable` before relying on it. If- `usable` isn't `yes`, don't run that tool — report the missing capability- instead of discovering it via a runtime failure (a missing `libass`,- `zscale`, or encoder is the common case, e.g. `caption.py`). Don't re-run- `doctor` per job — it queries `ffmpeg -filters`/`-encoders`, not free, and- once per session/unfamiliar machine is enough. `contract --json`'s full- tool schema is for a *planning* agent deciding which tool/params to use- from an abstract goal — not part of this per-job workflow.-1. **Probe first.** Run `probe.py` on every input before touching it. Read the- duration, fps, resolution, codecs, audio channels and the- `variable_frame_rate_suspected` flag. Plan the edit from real numbers, never- from assumptions about the file.-2. **Prefer lossless.** If the request can be satisfied without re-encoding- (plain cuts on keyframes, remuxing, audio-only changes), do not re-encode.- `cut.py` and `loudness.py` stream-copy video by default; only pass- `--accurate` to `cut.py` when the user needs frame-exact cuts.-3. **Plan with `--dry-run --json`, then execute.** Every script accepts- `--dry-run` (prints the ffmpeg commands that would run; writing tools write- nothing, analysis tools still measure — the per-tool list is in the- opening paragraph above and in `contract --json`'s `dry_run` field) and- `--json` (structured result: output path, probe of the output, commands- run). Trust `--json`, not a dry-run's human-readable summary line, for any- number after the plan (dimensions in that line can be a placeholder, not a- computed preview — see `docs/contract.md`). Use them to confirm a plan- before long encodes and to report exact facts. `--fast` gives a quick- preview-quality render (x264 veryfast), `--progress` prints percent and- ETA on stderr for long encodes. Never point `-o` at a file- you did not create in this job unless the user asked for it to be replaced;- pass `--overwrite` only then.-4. **Chain operations in a sensible order.** Colour (HDR→SDR / LUT) → cut →- join → silence → fit → caption/overlay → sync → audio → loudness → export.- Do frame changes (fit/crop) before captions and overlays so text is sized- for the final frame. Re-encode as few times as possible: keep intermediates- at CRF 18 (the default) and only use `export.py` for the last step; for- anything with more than two steps use `render.py` with a project.json.-5. **Check the deliverable.** Before reporting, run `check.py OUTPUT --platform X`- for the destination the user named. Each row is marked `format` or- `judgement`. Format rows (codec, pixel format, size, true peak, colour- tags, VFR) are safe to fix mechanically. Judgement rows change the content:- duration (cut loses material, speed changes motion), aspect (crop loses- edges), fps (drops motion), loudness (ambience must not be boosted). Fix- those only when the user's request already implies the answer, otherwise- state the choice and its cost in one line. Mention WARNs; do not chase them.-6. **Verify the output.** Run `probe.py` on each result and confirm duration,- resolution, fps and audio match what was requested. Report those numbers to- the user (e.g. "final.mp4: 59.98 s, 1080x1920, 30 fps, AAC stereo").- A step is done only when the script exited 0 and the output probes as- expected. Writing the command is not doing the job; a non-zero exit, a- missing or empty file, or a probe that contradicts the request is a- failure, and the report says so with the script's error message.-7. **Keep the user's originals.** Never overwrite the source file. Write new- files next to the input or where the user asked.- Set `FFMPEG_SKILL_NO_OVERWRITE=1` in the environment you run these scripts- in: an output path that already exists is then refused (`kind: input`)- instead of warned about, and `--overwrite` stays the one way to say "yes,- replace it". It is the recommended agent setting because an agent picking- output names cannot see which files the user already cares about — and it- is what 2.0 does by default.-8. **Look at the picture.** Whenever the picture changed (captions, overlays,- graphics, crop/pad, resize, colour, transitions, a `join.py` that scaled or- padded a clip to the first clip's frame, a `color.py --to-sdr` that tone-maps- an HDR source) run `look.py OUTPUT`- (contact sheet) or `look.py OUTPUT --at T`, view the PNG. The job is not- finished until the report's `Look:` line names that PNG; a probe alone- cannot see a caption sitting on someone's face. Audio-only jobs (sync,- loudness, silence, or any job whose input is an audio file) write- `Look: not needed`; there is no picture to inspect. What to look for- splits the same way `check.py`'s rows do in step 5:- - **Mechanical (verify and report as this skill's own job):** the- specified text/logo is present at the specified position, subtitles/text- appear at the specified timestamps, resolution has even dimensions.- Letterboxing/pillarboxing from `fit.py --fit pad` is the *correct*- result of that mode, not a defect — never flag it.- - **Judgement (report to the calling agent/user, don't silently pass or- fail):** whether a subject or face is cut off, whether text sits over a- face, whether colours look washed out, whether a transition "lands"- well or the edit feels cinematic. These require deciding what the- subject *is*, which belongs to the calling agent (see "What this skill- does and does not decide") — state what you see in one line and let the- calling agent or user judge it, don't decide it here.- If the execution environment cannot actually view images (no vision- capability), write `Look: PATH (pixels not inspected; agent has no image- view)` — never claim a picture was inspected when it wasn't, and don't- stall indefinitely waiting for a capability that isn't there.+## Workflow (always follow this order)+0. **Environment, not per job.** Run `python3 <skill-dir>/scripts/_contract.py doctor` (also `npx ffmpeg-skill doctor`; there is no doctor.py) in two cases only: before the first job on a machine you have not used this session, or after a tool failed with `kind: missing_tool`. It queries `ffmpeg -filters`/`-encoders`, so it is not a per-job step. Read `ok` and the tool's `usable`; if `usable` isn't `yes`, report the missing capability (a missing `libass`, `zscale` or encoder is the common case, e.g. `caption.py`) instead of discovering it through a runtime failure. `contract --json`'s full tool schema is for a *planning* agent choosing a tool from an abstract goal, not for this per-job workflow.+1. **Probe what you must plan from.** Run `probe.py` on each input you plan the edit from — duration, fps, resolution, codecs, channels, `variable_frame_rate_suspected` — and whenever the user asks a question about a file. You do not need a separate probe before every edit: every writing tool's `--json` already carries its input and a probe of the output it wrote. Plan from real numbers, never assumptions.+2. **Prefer lossless.** If the request can be met without re-encoding (plain cuts on keyframes, remuxing, audio-only changes), do not re-encode. `cut.py` and `loudness.py` stream-copy video by default; pass `--accurate` to `cut.py` only for frame-exact cuts.+3. **Plan with `--dry-run --json`, then execute.** Trust `--json`, not a dry run's human-readable summary line, for any number after the plan (dimensions there can be a placeholder, not a computed preview — `docs/contract.md`). Use it to confirm a plan before long encodes and to report exact facts. `--fast` is preview quality (x264 veryfast), `--progress` prints percent/ETA on stderr. Never point `-o` at a file you did not create in this job unless the user asked for it to be replaced; pass `--overwrite` only then.+4. **Chain in a sensible order.** Colour (HDR→SDR / LUT) → cut → join → silence → fit → caption/overlay → sync → audio → loudness → export. Frame changes (fit/crop) before captions and overlays, so text is sized for the final frame. Re-encode as few times as possible: intermediates at CRF 18 (the default), `export.py` only for the last step. **Three or more steps: use `render.py` with a project.json** — one call, one JSON, one place for the user to change a number — rather than hand-chaining tools.+5. **Check the deliverable.** Before reporting, run `check.py OUTPUT --platform X` for the destination the user named. Each row is `format` or `judgement`. Format rows (codec, pixel format, size, true peak, colour tags, VFR) are safe to fix mechanically. Judgement rows change the content: duration (cut loses material, speed changes motion), aspect (crop loses edges), fps (drops motion), loudness (ambience must not be boosted) — fix those only when the request already implies the answer, otherwise state the choice and its cost in one line. Mention WARNs; do not chase them.+6. **Verify the output.** Confirm duration, resolution, fps and audio match the request — from the writing tool's own `--json`/`--json-brief` probe, or `probe.py` when you have none — and report those numbers ("final.mp4: 59.98 s, 1080x1920, 30 fps, AAC stereo"). A step is done only when the script exited 0 and the output probes as expected. Writing the command is not doing the job: a non-zero exit, a missing or empty file, or a probe that contradicts the request is a failure, and the report says so with the script's error message.+7. **Keep the user's originals.** Never overwrite the source; write new files next to the input or where the user asked. Set `FFMPEG_SKILL_NO_OVERWRITE=1` in the environment you run these scripts in: an existing output path is then refused (`kind: input`) instead of warned about, and `--overwrite` stays the one way to say "yes, replace it". It is the recommended agent setting — an agent picking output names cannot see which files the user already cares about — and it is what 2.0 does by default.+8. **Look at the picture.** Whenever the picture changed (captions, overlays, graphics, crop/pad, resize, colour, transitions, a `join.py` that scaled or padded a clip to the first clip's frame, a `color.py --to-sdr` that tone-maps an HDR source) run `look.py OUTPUT --tiles 3x2` (or `--at T` for one frame) and view the PNG; the full 4x3 sheet is for a job about layout across the whole clip. The job is not finished until the report's `Look:` line names that PNG — a probe cannot see a caption sitting on someone's face. Audio-only jobs (sync, loudness, silence, or any job whose input is an audio file) write `Look: not needed`; there is no picture. What to look for splits like `check.py`'s rows in step 5:+ - **Mechanical (this skill's own job to verify and report):** the specified text/logo is present at the specified position, subtitles/text appear at the specified timestamps, dimensions are even. Letterboxing/pillarboxing from `fit.py --fit pad` is the *correct* result of that mode, never a defect to flag.+ - **Judgement (report it, don't silently pass or fail):** whether a subject or face is cut off, whether text sits over a face, whether colours look washed out, whether a transition lands. These need deciding what the subject *is*, which belongs to the calling agent (see "What this skill does and does not decide") — say what you see in one line and let them judge it.+ With no vision capability, write `Look: PATH (pixels not inspected; agent has no image view)` — never claim a picture was inspected when it wasn't, and don't stall waiting for a capability that isn't there.## Before you run anything: what to ask, what to assume-Ask one short question only when the answer changes the output materially and the request does not imply it. When several things are open at once (a vague "make it for social media" leaves destination, aspect method, length and captions unresolved), do not ask them one per turn: propose one bundle with your defaults and let the user change any part ("Reels: 9:16 with padding, trimmed to 60 s, -14 LUFS, no captions — OK, or change something?"). One question, one answer, then the run.+Ask one short question only when the answer changes the output materially and the request does not imply it. When several things are open at once (a vague "make it for social media" leaves destination, aspect method, length and captions unresolved), don't ask them one per turn: propose one bundle with your defaults and let the user change any part ("Reels: 9:16 with padding, trimmed to 60 s, -14 LUFS, no captions — OK, or change something?"). One question, one answer, then the run. Never ask for what `probe.py` can tell you.-- **Destination** decides aspect, length limit, loudness and codec. "For Reels" answers all four. If no destination is named and the edit is a plain cut/caption, keep the source format and say so; if the user asks to "export", "post" or "deliver", ask where.-- **Duration** ("make it 60 s") without a method: speed up for ≤1.5× changes, trim otherwise, and state which you chose. Ask if the content is a talk (trimming loses words) and the change is large.-- **Captions** without a text source: use `--transcribe` if a local whisper exists, otherwise ask for the text or a timed file; never invent dialogue.+- **Destination** decides aspect, length limit, loudness and codec; "for Reels" answers all four. No destination named and a plain cut/caption: keep the source format and say so. If the user says "export", "post" or "deliver", ask where.+- **Duration** ("make it 60 s") without a method: speed up for ≤1.5× changes, trim otherwise, and say which you chose. Ask when the content is a talk (trimming loses words) and the change is large.+- **Captions** without a text source: `--transcribe` if a local whisper exists, otherwise ask for the text or a timed file; never invent dialogue.- **Fonts and brand**: if the user mentions a brand, colours or "our font", ask for or create `brand.json` once and reuse it.-- **CJK / non-Latin text**: check that a font exists before rendering (`fc-list :lang=ja file` / `:lang=ko` / `:lang=zh`); pass it with `--font "Name"` or `--font-file /path.ttf`. Tofu boxes are a failed job, not a style.-- **Crop position** for `--fit crop`: default to centre, but if the request or the source names an off-centre subject ("keep the product on the right", "don't cut off my hands", a logo/person visibly off-centre in `look.py`'s sheet) use `--crop-x`/`--crop-y` (0=left/top, 1=right/bottom) instead of the silent centre guess. Ask which edge to keep when the sheet shows the subject near an edge and the request doesn't say.-- Anything else (transition type, caption style): pick the conventional default, say what you picked, and offer the alternative in one line.--Do not ask for things `probe.py` can tell you.+- **CJK / non-Latin text**: check a font exists before rendering (`fc-list :lang=ja file` / `:lang=ko` / `:lang=zh`) and pass it with `--font "Name"` or `--font-file /path.ttf`. Tofu boxes are a failed job, not a style.+- **Crop position** for `--fit crop`: centre by default, but when the request or the source names an off-centre subject ("keep the product on the right", "don't cut off my hands", someone visibly off-centre in the sheet) use `--crop-x`/`--crop-y` (0=left/top, 1=right/bottom) instead of a silent centre guess. Ask which edge to keep when the sheet shows the subject near an edge and the request doesn't say.+- Anything else (transition type, caption style): pick the conventional default, say what you picked, offer the alternative in one line.## What this skill does and does not decide-This skill cuts, joins, measures, syncs, exports and checks files — it executes an edit, it does not decide one. Some things that sound like part of the job but belong to the human, the calling agent, or another skill instead:+This skill cuts, joins, measures, syncs, exports and checks files — it executes an edit, it does not decide one. What belongs to the human, the calling agent or another skill:-- **Which cut is the right one, or whether a deliverable is approvable for release** — this skill measures and reports (`check.py`'s PASS/WARN/FAIL, `cut.py`'s measured duration error); a production agent or the user decides whether that's good enough to ship.-- **What makes a highlight interesting** — `scenes.py --highlights` ranks by a measured proxy (audio energy or scene duration, see its own docs), never by understanding the content; treat its output as candidates, not a verdict.-- **Thumbnail or cover-image composition** — that's a design decision, not a measurement; a thumbnail-generation skill or the user makes it.-- **Understanding what a video is *about*** — this skill has no transcription or vision beyond `look.py`'s contact sheets, which exist for the calling agent's own eyes, not for this skill to interpret on its own.-- **Judging what looks good** — "apply this LUT" or "correct exposure by +0.3 stops" (`color.py`) is mechanical, parameter-determined execution and belongs here; "grade this scene to look cinematic" is a subjective judgement about what looks right and belongs in a colour-grading skill ([`color-grading-skill`](https://github.com/kajisho5/color-grading-skill), see README's "Standalone, and in an ecosystem") that decides the parameters and then calls `color.py` to apply them.-- **Picking a subject or region without being told one** — "crop to this exact box" or "crop to 9:16 keeping x=200,y=0" (`crop.py`/`fit.py --fit crop --crop-x/-y`) is mechanical once the box is known; "crop to keep the speaker in frame" requires deciding *what* the speaker is, which is a vision/composition judgement for the calling agent (from a `look.py` contact sheet) or a motion-graphics skill, not this one.+- **Which cut is right, or whether a deliverable is approvable** — this skill measures and reports (`check.py`'s PASS/WARN/FAIL, `cut.py`'s measured duration error); the user or a production agent decides whether that ships.+- **What makes a highlight interesting** — `scenes.py --highlights` ranks by a measured proxy (audio energy, scene duration), never by understanding content: candidates, not a verdict.+- **Thumbnail or cover composition** — a design decision, not a measurement.+- **Understanding what a video is *about*** — there is no transcription or vision here beyond `look.py`'s contact sheets, which exist for the calling agent's eyes, not for this skill to interpret.+- **Judging what looks good** — "apply this LUT", "correct exposure by +0.3 stops" (`color.py`) is mechanical and belongs here; "grade this scene to look cinematic" belongs to a colour-grading skill ([`color-grading-skill`](https://github.com/kajisho5/color-grading-skill)) that decides the parameters and then calls `color.py`.+- **Picking a subject or region you were not given** — "crop to x=200,y=0" (`crop.py`/`fit.py --crop-x/-y`) is mechanical once the box is known; "crop to keep the speaker in frame" needs deciding *what* the speaker is — a judgement for the calling agent (from a `look.py` sheet) or a motion-graphics skill.-The line in general: if the same input and the same explicit parameters always produce the same, verifiable output, it belongs here. If the "right" answer depends on taste, content understanding, or what looks or sounds good, it belongs to whichever skill or agent makes that judgement — this skill only ever executes parameters it's given, never infers them from what something looks or sounds like.+The line: same input + same explicit parameters always producing the same verifiable output belongs here; anything that depends on taste, content understanding or what looks or sounds good belongs to whoever makes that judgement. This skill executes parameters it is given, never infers them from what something looks or sounds like.If a request needs an FFmpeg feature none of the 42 scripts expose, say so and name the closest built-in option (`--dry-run` to show what would run, or a documented limitation) — never fall back to guessing a raw `ffmpeg`/`ffprobe` invocation or a hand-built filter graph outside `scripts/*.py`. A raw command bypasses every guarantee this skill makes (no shell, typed arguments, verification afterwards); it is exactly the failure mode this skill exists to prevent, so it is never the fallback when a script's flag doesn't cover something.@@ -132,131 +57,94 @@ If a request needs an FFmpeg feature none of the 42 scripts expose, say so and nThis table and `doctor --json`'s `tools` list are the source of truth for what exists: name only a script you have seen in one of them, never a plausible-sounding one (there is no `doctor.py`, no `trim.py`, no `subtitle.py`).-Timestamp flags -- `--start`, `--end`, `--at`, `--from`, `--duration`, `--offset`, and the times in cue and chapter files -- take seconds, `mm:ss(.fff)`, `hh:mm:ss(.fff)` or four-part SMPTE `hh:mm:ss:ff`, with `@fps` naming the rate (`00:01:02:[email protected]`); tolerance-style flags that are a length rather than a point in time (`--min-silence`, `--margin`, `--min-keep`, `--fade`) are plain seconds. Use the timecode forms when the user pastes an editor's timecode list or an NLE cue sheet, so nothing is converted by hand on the way in.+Timestamp flags — `--start`, `--end`, `--at`, `--from`, `--duration`, `--offset`, and the times in cue and chapter files — take seconds, `mm:ss(.fff)`, `hh:mm:ss(.fff)` or four-part SMPTE `hh:mm:ss:ff`, with `@fps` naming the rate (`00:01:02:[email protected]`); tolerance-style flags that are a length rather than a point in time (`--min-silence`, `--margin`, `--min-keep`, `--fade`) are plain seconds. Use the timecode forms when the user pastes an editor's timecode list or an NLE cue sheet, so nothing is converted by hand on the way in.| User says | Do ||-----------|----|-| "what's in this file", "how long is it", "is it 4K" | `probe.py input.mp4` |-| "cut from 1:20 to 2:05", "trim the first 10 seconds" | `cut.py input.mp4 --start 1:20 --end 2:05` |+| "what's in this file", "how long is it" | `probe.py input.mp4` |+| "cut from 1:20 to 2:05", "trim the first 10 s" | `cut.py input.mp4 --start 1:20 --end 2:05` || "keep only these parts", "remove the middle" | `cut.py input.mp4 --segments 0-1:00,1:30-2:00` |-| "make it exactly 60 seconds", "fit it in 30s" | `fit.py input.mp4 --duration 60` (speed) or `--method trim` |-| "make it vertical / for TikTok / 9:16", "square for Instagram" | `fit.py input.mp4 --aspect 9:16 --fit pad` (or `--fit crop`); add `--pad-fill blur` for the blurred-background bars phone editors produce |-| "resize to a specific height, width follows" | `fit.py input.mp4 --height 1080` (or `--width`, or both for an exact frame) |-| "crop to this exact box/rectangle" (known x/y/width/height, not an aspect ratio) | `crop.py input.mp4 --x 100 --y 0 --width 1080 --height 1920` |-| "are there black bars on this?", "what's the crop rectangle to remove the letterboxing" | `cropdetect.py input.mp4` |-| "this old footage is interlaced / combed on motion" | `deinterlace.py input.mp4` |-| "this footage is grainy/noisy, clean it up" | `denoise.py input.mp4 --strength medium` |-| "blur/pixelate this face/plate/region" (known x/y/width/height) | `redact.py input.mp4 --x 820 --y 140 --width 240 --height 240 --mode pixelate` |-| "pull a flat clip out of this 360/spherical video, looking this way" (known yaw/pitch/fov, not "find the interesting part") | `sphere.py insta360.mp4 --yaw 90 --pitch 0 --h-fov 100 --v-fov 70` |-| "the horizon is tilted, straighten this out" (known degrees, not "auto-level") | `straighten.py tilted.mp4 --degrees -2.5` |-| "turn this image into a N-second clip", "title card / end slate" | `insert.py title.png --duration 3` |-| "slow zoom on a photo", "Ken Burns effect" | `insert.py photo.jpg --duration 6 --zoom in --pan right --width 1920 --height 1080` |-| "rotate this 90 degrees", "mirror it horizontally" | `fit.py input.mp4 --rotate 90` / `fit.py input.mp4 --flip h` |-| "reverse this clip", "play it backwards" | `reverse.py input.mp4` |+| "make it exactly 60 seconds" | `fit.py input.mp4 --duration 60` (speed) or `--method trim` |+| "make it vertical / 9:16 / square" | `fit.py input.mp4 --aspect 9:16 --fit pad` (or `--fit crop`; `--pad-fill blur` for blurred bars) |+| "resize to a height/width" | `fit.py input.mp4 --height 1080` (or `--width`, or both for an exact frame) |+| "crop to this exact box" (known x/y/w/h) | `crop.py input.mp4 --x 100 --y 0 --width 1080 --height 1920` |+| "are there black bars on this?" | `cropdetect.py input.mp4` |+| "this old footage is interlaced" | `deinterlace.py input.mp4` |+| "it's grainy/noisy, clean it up" | `denoise.py input.mp4 --strength medium` |+| "blur/pixelate this face/plate" (known box) | `redact.py input.mp4 --x 820 --y 140 --width 240 --height 240 --mode pixelate` |+| "flat view out of this 360 video" (known yaw/pitch/fov) | `sphere.py insta360.mp4 --yaw 90 --pitch 0 --h-fov 100 --v-fov 70` |+| "the horizon is tilted" (known degrees) | `straighten.py tilted.mp4 --degrees -2.5` |+| "turn this image into a clip", "title card" | `insert.py title.png --duration 3` |+| "slow zoom on a photo", "Ken Burns" | `insert.py photo.jpg --duration 6 --zoom in --pan right --width 1920 --height 1080` |+| "rotate 90 degrees", "mirror it" | `fit.py input.mp4 --rotate 90` / `fit.py input.mp4 --flip h` |+| "reverse this clip" | `reverse.py input.mp4` || "stabilize this shaky footage" | `stabilize.py input.mp4` || "make a blank/colour background clip" | `background.py -o bg.mp4 --duration 3 --width 1920 --height 1080 --color 0x101010` || "turn these numbered frames into a video" | `sequence.py --dir frames --pattern "frame_%04d.png" --fps 24` |-| "make a waveform/spectrum video for this podcast/track" | `waveform.py podcast.wav -o waveform.mp4` |-| "hold on this frame for a couple seconds", "freeze the last frame" | `freeze.py clip.mp4 --hold 2` |-| "add some black at the start before the title card" | `pad.py clip.mp4 --start 1.5` |-| "speed up here, slam into slow-mo there, then speed back up" (known segments) | `speedramp.py action.mp4 --segment 0-3:1.0 --segment 3-4:0.25 --segment 4-8:2.0` |-| "loop this background clip to fill 30 seconds" | `loop.py bg_loop.mp4 --duration 30` |-| "cut to the product shot from 0:12 to 0:16, keep my voice underneath", "B-roll over this bit" | `broll.py talk.mp4 --insert product.mp4 --at 12 --end 16` (repeat `--insert/--at` per cutaway; `--audio b|mix` to hear B) |-| "add chapters at 0:00 Intro, 2:15 Setup, …", "chapter markers for YouTube" | `metadata.py episode.mp4 --chapters chapters.txt` (one `TIME TITLE` per line; streams are copied, nothing re-encodes) |-| "set the title / artist / comment on the file" | `metadata.py episode.mp4 --title "Episode 12" --artist "Studio"` |-| "put these videos in a 4x2 grid with the filename on each" | `grid.py t1.mp4 t2.mp4 t3.mp4 t4.mp4 t5.mp4 t6.mp4 t7.mp4 t8.mp4 --cols 4 --rows 2` |+| "waveform/spectrum video for this track" | `waveform.py podcast.wav -o waveform.mp4` |+| "hold on this frame", "freeze the last frame" | `freeze.py clip.mp4 --hold 2` |+| "add black at the start" | `pad.py clip.mp4 --start 1.5` |+| "speed up here, slow-mo there" (known segments) | `speedramp.py action.mp4 --segment 0-3:1.0 --segment 3-4:0.25 --segment 4-8:2.0` |+| "loop this clip to fill 30 seconds" | `loop.py bg_loop.mp4 --duration 30` |+| "cut to the product shot 0:12-0:16", "B-roll over this bit" | `broll.py talk.mp4 --insert product.mp4 --at 12 --end 16` (repeat `--insert/--at`; `--audio b\|mix`) |+| "add chapters", "chapter markers for YouTube" | `metadata.py episode.mp4 --chapters chapters.txt` (`TIME TITLE` per line; streams copied) |+| "set the title / artist / comment" | `metadata.py episode.mp4 --title "Episode 12" --artist "Studio"` |+| "put these videos in a 4x2 grid" | `grid.py t1.mp4 ... t8.mp4 --cols 4 --rows 2` || "add subtitles from this SRT", "burn in captions" | `caption.py input.mp4 --srt subs.srt` |-| "caption it with these lines" (plain text with times) | `caption.py input.mp4 --text cues.txt` |-| "add subtitles but keep them toggleable / editable", "mux in an SRT, don't burn it" | `caption.py input.mp4 --srt subs.srt --mode mux` |-| "put our logo top-right", "add a watermark" | `overlay.py input.mp4 --image logo.png --position top-right --scale 200` |-| "add a title for the first 4 seconds" | `overlay.py input.mp4 --text "Title" --position top --start 0 --end 4 --fade 0.4` |-| "put this webcam clip in the corner", "picture-in-picture" | `overlay.py input.mp4 --video webcam.mp4 --position bottom-right --scale 480` |-| "remove the green screen", "chroma key this" | `overlay.py bg.mp4 --video greenscreen.mp4 --chromakey 0x00ff00` |-| "sync the lav mic to the camera", "line up the two cameras" | `sync.py camera.mp4 mic.wav --replace-audio` / `sync.py camA.mp4 camB.mp4 --trim-second` |-| "fix the audio levels", "normalise to -14 LUFS" | `loudness.py input.mp4` (`-I -16 --tp -1.5` for podcasts, `-I -23` for broadcast) |-| "cut this and make it HEVC / AV1", "a ProRes intermediate of the trimmed clip" (an edit whose *output codec* the user named) | `cut.py input.mp4 --start 0:10 --end 0:40 --codec hevc` (`--codec h264\|hevc\|av1\|prores` and `--quality N` on every editing tool that re-encodes; ProRes needs `-o NAME.mov`; without a named codec leave the default) |-| "export for YouTube / Reels / X", "give me a ProRes master", "make it HEVC" | `export.py input.mp4 --preset youtube|reels|x|prores|h265` (`--normalize` meets the platform's loudness spec in the same call, no separate `loudness.py` pass) |+| "caption it with these lines" (text with times) | `caption.py input.mp4 --text cues.txt` |+| "keep the subtitles toggleable", "mux in an SRT" | `caption.py input.mp4 --srt subs.srt --mode mux` |+| "our logo top-right", "a watermark" | `overlay.py input.mp4 --image logo.png --position top-right --scale 200` |+| "a title for the first 4 seconds" | `overlay.py input.mp4 --text "Title" --position top --start 0 --end 4 --fade 0.4` |+| "webcam clip in the corner", "picture-in-picture" | `overlay.py input.mp4 --video webcam.mp4 --position bottom-right --scale 480` |+| "remove the green screen" | `overlay.py bg.mp4 --video greenscreen.mp4 --chromakey 0x00ff00` |+| "sync the lav mic", "line up two cameras" | `sync.py camera.mp4 mic.wav --replace-audio` / `sync.py camA.mp4 camB.mp4 --trim-second` |+| "fix the audio levels", "normalise to -14 LUFS" | `loudness.py input.mp4` (`-I -16 --tp -1.5` podcast, `-I -23` broadcast) |+| "cut this and make it HEVC / AV1 / ProRes" (output codec named) | `cut.py input.mp4 --start 0:10 --end 0:40 --codec hevc` (`--codec`/`--quality` on any re-encoding tool; ProRes needs `-o NAME.mov`) |+| "export for YouTube / Reels / X", "a ProRes master" | `export.py input.mp4 --preset youtube\|reels\|x\|prores\|h265` (`--normalize` hits the loudness spec in the same call) || "make a GIF preview" | `export.py input.mp4 --preset gif` |-| "make a small/low-res proxy for an analysis pass", "a cheap preview file" | `proxy.py input.mp4 [--width 640 --no-audio]` — not a delivery preset, see `export.py` for those |-| "cut out the pauses / dead air", "tighten it up", "jump cuts" | `silence.py input.mp4 [--threshold -40 --min-silence 0.8]` |-| "stitch these clips together", "add a crossfade between them" | `join.py a.mp4 b.mp4 c.mp4 --transition fade --duration 0.5` |-| "show me what it looks like", "check the captions are readable" | `look.py output.mp4` then view the PNG |+| "a small proxy / cheap preview file" | `proxy.py input.mp4 [--width 640 --no-audio]` — not a delivery preset (those are `export.py`) |+| "cut out the pauses", "jump cuts" | `silence.py input.mp4 [--threshold -40 --min-silence 0.8]` |+| "stitch these clips", "add a crossfade" | `join.py a.mp4 b.mp4 c.mp4 --transition fade --duration 0.5` |+| "show me what it looks like", "are the captions readable" | `look.py output.mp4 --tiles 3x2` then view the PNG || "what would you run?", "don't render yet" | any script with `--dry-run` |-| "make a 60 s highlight from this hour", "find the good bits" | `scenes.py long.mp4 --highlights 6 --target 60 --edl picks.txt` → `cut.py --segments` |-| "is this OK to upload?", "check it meets the Reels spec" | `check.py final.mp4 --platform reels` |-| "set it up so I can tweak and re-render", "several changes to the same edit" | `render.py --init project.json`, edit, `render.py project.json` |-| "add a lower third with my name", "title card", "countdown intro", "progress bar" | `graphics.py input.mp4 --template lower-third --name "..." --title "..." --start 2 --end 8` |-| "use our brand fonts/colours/logo" | pass `--brand brand.json` to caption/overlay/graphics, or `"brand"` in project.json |+| "a 60 s highlight from this hour" | `scenes.py long.mp4 --highlights 6 --target 60 --edl picks.txt` → `cut.py --segments` |+| "is this OK to upload?" | `check.py final.mp4 --platform reels` |+| "several changes to the same edit", 3+ steps | `render.py --init project.json`, edit, `render.py project.json` |+| "a lower third with my name", "countdown intro", "progress bar" | `graphics.py input.mp4 --template lower-third --name "..." --title "..." --start 2 --end 8` |+| "use our brand fonts/colours/logo" | `--brand brand.json` on caption/overlay/graphics, or `"brand"` in project.json || "send me a summary of what you did" | `report.py --before raw.mov --after final.mp4 --platform youtube -o report.html` |-| "do this to every file in the folder", "process the whole shoot" | `batch.py FOLDER --recipe batch.json` (steps or a render project; cached) |-| "transcribe it and caption it" | `caption.py input.mp4 --transcribe --animate pop --karaoke` (needs a local whisper; otherwise `--text`) |+| "do this to every file in the folder" | `batch.py FOLDER --recipe batch.json` (steps or a render project; cached) |+| "transcribe it and caption it" | `caption.py input.mp4 --transcribe --animate pop --karaoke` (needs a local whisper; else `--text`) || "three cameras, cut between them" | `multicam.py camA.mp4 camB.mp4 camC.mp4 --switch "0-20:0,20-40:1,40-60:2"` |-| "it's an iPhone Dolby Vision clip and players show it wrong" | `color.py clip.mov --to-sdr` or `color.py clip.mov --strip-dovi` (keep HDR, drop the DV layer) |-| "does it look like Log / S-Log / flat footage?" | `probe.py clip.mp4 --analyze` (`looks_like_log`) then `color.py --lut` |+| "iPhone Dolby Vision clip looks wrong" | `color.py clip.mov --to-sdr` or `--strip-dovi` (keep HDR, drop the DV layer) |+| "does it look like Log / S-Log?" | `probe.py clip.mp4 --analyze` (`looks_like_log`) then `color.py --lut` || "test the tool on my real files" | `verify.py ~/Footage --report verify.md` || "show me progress", "quick preview first" | any encoding script with `--progress` and/or `--fast` |-| "the colours look washed out / it's an iPhone HDR video" | `color.py input.mov --to-sdr` (probe shows `hdr: true`) |-| "apply this LUT", "convert the S-Log / V-Log footage" | `color.py input.mp4 --lut grade.cube [--lut-strength 0.7]` |-| "the colours are tagged wrong" | `color.py input.mp4 --retag bt709` (stream copy; re-encodes only if the copy can't carry the retagged colour info — check `reencoded` in `--json`) |-| "brighten it a touch / punch up the contrast and saturation / fix the white balance" | `color.py input.mp4 --correct --exposure 0.3 --contrast 1.1 --saturation 1.05 --temperature 5600 --tint -0.05` (typed, no filter string) |-| "clean up the audio", "remove the hiss / room noise" | `audio.py input.mp4 --voice` (speech) or `--denoise` |+| "the colours look washed out / iPhone HDR" | `color.py input.mov --to-sdr` (probe shows `hdr: true`) |+| "apply this LUT", "convert the S-Log footage" | `color.py input.mp4 --lut grade.cube [--lut-strength 0.7]` |+| "the colours are tagged wrong" | `color.py input.mp4 --retag bt709` (stream copy; re-encodes only if the copy can't carry it — see `reencoded`) |+| "brighten it / punch up contrast / fix white balance" | `color.py input.mp4 --correct --exposure 0.3 --contrast 1.1 --saturation 1.05 --temperature 5600 --tint -0.05` |+| "clean up the audio", "remove the hiss" | `audio.py input.mp4 --voice` (speech) or `--denoise` || "add background music under the talking" | `audio.py input.mp4 --music bed.mp3 --duck --fade-out 3` || "convert the 5.1 to stereo" | `audio.py input.mov --downmix` || "swap in the narration track" | `audio.py input.mp4 --replace narration.wav` |-| "pull the audio out of this video", "give me the sound as WAV" | `audio.py input.mp4 -o input.wav` (any audio extension drops the picture; `--audio-stream 1` picks another track) |-| "compress the voice", "limit the peaks to -1 dB", "gate the room noise" | `audio.py input.mp4 --compress --comp-threshold -20 --comp-ratio 4` / `--limit --limit-ceiling -1` / `--gate --gate-threshold -45` (typed acompressor / alimiter / agate options, range-checked) |+| "pull the audio out", "give me the sound as WAV" | `audio.py input.mp4 -o input.wav` (an audio extension drops the picture; `--audio-stream 1` picks a track) |+| "compress the voice", "limit the peaks", "gate the room noise" | `audio.py input.mp4 --compress --comp-threshold -20 --comp-ratio 4` / `--limit --limit-ceiling -1` / `--gate --gate-threshold -45` || "the audio drifts out of sync over the hour" | `sync.py camera.mp4 recorder.wav --fix-drift --replace-audio` || "smooth slow motion", "half speed but fluid" | `fit.py input.mp4 --duration 2x --smooth interpolate` (slow) or `--smooth blend` |-| "TikTok-style captions with the words popping / highlighted" | `caption.py input.mp4 --text cues.txt --animate pop --karaoke` |-| "it's a phone video with variable frame rate" | nothing extra: every re-encoding script conforms VFR to constant fps automatically; `fit.py --fps 30` to pick the rate |-+| "TikTok-style captions with the words popping" | `caption.py input.mp4 --text cues.txt --animate pop --karaoke` |+| "it's a phone video with variable frame rate" | nothing extra: re-encodes conform VFR to constant fps; `fit.py --fps 30` picks the rate |## Audio-only files-Audio files are a first-class input, not a special case. `probe.py`, `cut.py`,-`silence.py`, `loudness.py`, `audio.py`, `sync.py` and `check.py --platform-podcast` all accept WAV, FLAC, MP3, M4A/AAC, OGG and Opus (any container ffmpeg-can read) and write the codec that fits the output extension, so the same-commands work with `talk.wav` in place of `talk.mp4`. What changes:--- The output extension picks the format: `-o out.mp3` converts, `-o out.wav`- keeps PCM, `-o out.m4a` writes AAC. `audio.py in.wav -o out.mp3` with no- other flag is a plain conversion.-- `cut.py` stream-copies audio too, so trims land on a packet boundary- (`precision: packet`, a few ms; the JSON reports `duration_error_ms`). Pass- `--accurate` for a sample-exact trim: `precision: sample` when the output is- PCM or FLAC, `codec_frame` when a lossy codec (AAC, MP3, Opus) frames it- again. A `.wav` output is always PCM, never AAC packets inside a WAV.-- `join.py` joins audio-only clips as audio (`acrossfade` or a butt join) at- one sample rate and channel layout; the output must have an audio extension.- Video and audio clips cannot be mixed in one join.-- An audio extension on a video input (`audio.py talk.mp4 -o talk.wav`,- `cut.py talk.mp4 --start 1:00 --end 2:00 -o part.wav`) extracts the audio; the- output has no video stream. `audio.py --audio-stream N` picks a track when- `probe` lists several under `audio_streams`.-- `Look: not needed` in the report; `Check:` still applies for loudness- (`check.py file.wav --platform podcast` measures LUFS and true peak).-- Scripts that need a picture (`fit`, `caption`, `overlay`, `graphics`,- `color`, `export`, `scenes`, `look`) refuse an audio file with- "input has no video stream". Say so instead of forcing a video wrapper.--| User says (audio file) | Do |-|-----------|----|-| "normalise this WAV to -14 LUFS", "podcast levels" | `loudness.py talk.wav -I -14 --tp -1 -o talk_norm.wav` (`-I -16 --tp -1.5` for podcasts) |-| "remove the silence from this recording" | `silence.py talk.wav -o talk_tight.wav` |-| "clean up the noise in this M4A" | `audio.py talk.m4a --voice -o talk_clean.m4a` (speech) or `--denoise` |-| "convert this WAV to MP3" | `audio.py talk.wav -o talk.mp3` |-| "trim this audio from 00:30 to 02:00" | `cut.py talk.wav --start 0:30 --end 2:00 -o talk_cut.wav` (`--accurate` for sample-exact) |-| "join these recordings", "intro + episode + outro" | `join.py intro.wav episode.m4a outro.wav -o full.flac` (`--transition none` for a butt join) |-| "extract the audio from the video", "mp4 to wav" | `audio.py talk.mp4 -o talk.wav` (`--voice -o talk.m4a` to clean it on the way) |-| "compress / limit / gate the voice" | `audio.py talk.wav --compress --comp-threshold -20 --comp-ratio 4 --limit --limit-ceiling -1 -o talk_dyn.wav` |-| "is this loud enough for Apple Podcasts?" | `check.py talk.m4a --platform podcast` |+Audio is a first-class input: `probe.py`, `cut.py`, `silence.py`, `loudness.py`, `audio.py`, `sync.py` and `check.py --platform podcast` take WAV, FLAC, MP3, M4A/AAC, OGG and Opus, and the output extension picks the format. `Look: not needed` in the report; `Check:` still applies (`check.py file.wav --platform podcast`). Scripts that need a picture (`fit`, `caption`, `overlay`, `graphics`, `color`, `export`, `scenes`, `look`) refuse an audio file with "input has no video stream" — say so instead of forcing a video wrapper. The same commands work with `talk.wav` in place of `talk.mp4` (see the table above); the audio-specific recipes, packet vs sample precision, joining and extracting one track: `references/gotchas.md#audio-only-files`.+## Report format-Reply in the language the request itself is written in: the language of the user's own sentences, not a language the request talks about (a request asking for subtitles in some other language is still answered in the language it was written in) and not the language of a tool's error text or of the file names. Keep the shape below and the field labels (`Done:`, `Steps:`, `Check:`, `Look:`, `Notes:`) in English (they read like log fields, not prose, and stay recognisable across languages); the sentences around them, any question asked, and any explanation of a judgement call are in the user's language. Never default to English because the tool names and flags happen to be English, and never drift into another language because the job is short or the report is a failure: a one-line "file does not exist" is written in the request's language too. A mid-conversation language switch follows the user's latest message, not the first one. This holds for a one-command job too: a three-second audio trim answered with English labels, numbers and one Japanese word in `Notes:` is an English report; the `Done:` line's own description (what was cut, from where) and `Steps:` are written in the user's language even when the values are technical.+Reply in the language the request itself is written in — the language of the user's own sentences, not a language the request talks about (a request for subtitles in another language is still answered in the language it was written in) and not the language of a tool's error text or file names. Keep the field labels (`Done:`, `Steps:`, `Check:`, `Look:`, `Notes:`) in English: they read like log fields and stay recognisable across languages. Everything around them — the sentences, any question, any explanation of a judgement call — is in the user's language. Never default to English because the tool names and flags are English, and never drift into another language because the job was short or the report is a failure: a one-line "file does not exist" is written in the request's language too. A mid-conversation switch follows the user's latest message, not the first one. This holds for a one-command job: a three-second audio trim answered with English labels, numbers and one Japanese word in `Notes:` is an English report — the `Done:` description (what was cut, from where) and `Steps:` are in the user's language even when the values are technical.-Finish every job with this shape (numbers from `probe.py`/`check.py`, not memory):+Finish every job with this shape (numbers from a tool's `--json` or `probe.py`/`check.py`, not memory):```Done: final.mp4 — 59.98 s, 1080x1920, 30 fps, H.264, AAC stereo, -14.1 LUFS@@ -266,9 +154,7 @@ Look: final_sheet.png (captions inside the safe area, logo top-right)Notes: source was VFR, conformed to 30 fps; audio was mono, made stereo```-The same five lines for a Japanese request, prose in Japanese around the English labels-(this is the shape a short job keeps too; English `Done:`/`Steps:` sentences with one Japanese-word in `Notes:` is not a Japanese report):+The same five lines for a Japanese request, prose in Japanese around the English labels (the shape a short job keeps too; English `Done:`/`Steps:` sentences with one Japanese word in `Notes:` is not a Japanese report):```Done: final.mp4 — 59.98 秒、1080x1920、30 fps、H.264、AAC ステレオ、-14.1 LUFS@@ -290,73 +176,23 @@ Look: not needed (nothing written)Notes: send a valid .cube, or say if you want the clip left as is```-A refusal (the request asks for a judgement this skill does not make, or for something outside its scope) uses the same shape: `Failed:` names what was refused and why, `Steps:` lists what did run (usually only probe), `Look: not needed`. Both keep the five labels so a reader can scan a failed report the way they scan a successful one. That includes the shortest failure: a missing input or an invalid LUT still gets `Failed:`, `Steps:`, `Check:`, `Look:` and `Notes:` lines, never prose headings in their place. When a tool's failure JSON carries `error.hint`, quote it in `Notes:` — it is the flag change that would make the retry meaningful.+A refusal (a judgement this skill does not make, or something outside its scope) uses the same shape: `Failed:` names what was refused and why, `Steps:` lists what did run (usually only probe), `Look: not needed`. Both keep the five labels so a failed report scans like a successful one — including the shortest failure: a missing input or an invalid LUT still gets all five lines, never prose headings in their place. When a failure JSON carries `error.hint`, quote it in `Notes:`: it is the flag change that would make the retry meaningful.Every script prints `{"status": "failed", "error": {"kind": input | ffmpeg | output | missing_tool | timeout | verification | interrupted, "message": ...}}` with `--json` and exits non-zero; quote the message, do not paraphrase it into a success.## Things that look right but are wrong-- Re-encoding an HDR (iPhone, HDR10) source through the SDR path: colours go flat. The scripts keep HDR; if you hand-write ffmpeg, do not tag BT.709 on BT.2020 pixels.-- Lossless `-c copy` cuts on VFR or non-keyframe boundaries: the file "works" but starts on a frozen or wrong frame. `cut.py` re-encodes automatically when the snap exceeds 0.5 s; respect that.-- A sync or multicam alignment with `confidence` under 0.3, or an offset larger than 60 % of the analysis window: probably wrong; enlarge `--analyze-seconds` or find a clap. `multicam.py` reports one `confidence` per camera — check all of them, not just that the command succeeded, before trusting the cut.-- `sync.py`/`multicam.py` align audio tracks to each other, never lip sync (mouth movement vs. audio) — there is no face or mouth detection anywhere in this skill. A high confidence means the audio matched well, not that the picture looks right; if the user asks whether lip sync is correct, that needs a look at the actual video, not just the reported offset.-- "Normalised" audio that still clips: check true peak, not just LUFS (`check.py` does both).-- Normalising ambience or near-silence to a speech target: a clip measured at- -40 LUFS or below is room tone, wind or nothing; raising it 25 dB raises the- noise, not the content. Leave the level, say so, and offer music or narration.-- Captions burned before a crop/resize: text lands off-frame. Frame changes first, then text.-- Captions burned at an intermediate size and then upscaled by `export.py` come out soft (a 1280x720 source fit to 9:16 is 406x720 until export scales it to 1080x1920). Fit to the delivery size first (`fit.py --width 1080 --height 1920`), then caption, then export.-- Anything chained by hand through three re-encodes: use `render.py` so the plan is one file and the user can change one number.-- `--fit crop` to reach 9:16 from 16:9 throws away 70 % of the width: a wide shot loses people at the edges. Check the sheet; pad (bars), `--crop-x`/`--crop-y` toward the subject, or a reframe is often the honest answer — a silent centre crop is a guess, not a decision.-- Conforming 60 fps to 30 halves the motion samples: fine for a talking head, visibly choppy for sports, gaming, drone pans. Keep 60 when the platform allows it.-- "Make it 60 seconds" on a 3-minute talk by speed change is unwatchable (3×); by trim it drops two thirds of the words. Ask which, or propose a highlight cut with `scenes.py`.-- `scenes.py --highlights` defaults to the loudest scenes (`--rank-by audio`): a quiet but important moment (a confession, a punchline landing in silence) is skipped, and pure crowd noise or a mic bump can outrank it. `--rank-by duration` picks the longest unbroken scenes instead. Neither is "the best parts" — check the contact sheet (`--sheet`) before treating the picks as final.--## Gotchas--- **Variable frame rate (phone/screen recordings).** `probe.py` sets- `variable_frame_rate_suspected` when `r_frame_rate` and `avg_frame_rate`- disagree. Every re-encoding script then adds `-fps_mode cfr` at the source's- average rate, and `cut.py` switches itself to `--accurate` (copy-cuts on VFR- are unreliable). Pick the rate explicitly with `fit.py --fps 30|60` when the- average is odd (e.g. 23.4 fps from dropped frames).-- **Audio drift / sync.** Don't mix files with different frame rates or sample- rates in one `cut.py --segments` join without re-encoding (`--accurate`).- After `sync.py`, verify by running it again on the output: offset (and drift- ppm with `--fix-drift`) should be ~0. Recordings longer than ~10 minutes from- separate devices: always use `--fix-drift`.-- **Colour.** SDR outputs are H.264 tagged BT.709 `yuv420p`. When `probe.py`- reports `hdr: true` (HDR10/PQ, HLG, Dolby Vision, BT.2020), every editing- script keeps the output HDR (HEVC Main10, source colour tags) so nothing is- silently flattened. Decide with the user: keep HDR (fine for YouTube/phones)- or run `color.py --to-sdr` first for SDR-only destinations, LUT work or- H.264 deliverables. `hdr: true` counts BT.2020 primaries too, so it is also- true for a wide-gamut SDR file; `hdr_signal: true` is the narrower fact —- a real PQ / HLG / Dolby Vision transfer — and `hdr_format` names the- in-between case (`BT.2020 SDR`). `export.py` platform presets are SDR and warn on HDR- input. iPhone `.mov` files also carry timecode/metadata tracks; scripts map- only the first audio track, so extra tracks are dropped on re-encode.- For Log footage (S-Log, V-Log, C-Log: looks grey and low-contrast but is- tagged SDR) run `probe.py --analyze`; `looks_like_log: true` means apply the- manufacturer's `.cube` with `color.py --lut` before anything else. Keep- ProRes masters at source colour: `export.py --preset prores` does not retag.-- **CJK and other non-Latin text.** libass and drawtext need a font that has- the glyphs. Check with `fc-list | grep -i cjk`. Then either name it- (`caption.py --font "Noto Sans CJK JP"`) or point at the file- (`overlay.py --font-file /usr/share/fonts/opentype/noto/NotoSansCJK-Regular.ttc`,- `caption.py --fonts-dir ./fonts --font "Noto Sans CJK JP"`). Without a- matching font you get boxes, not an error. Install: `apt install fonts-noto-cjk`,- `brew install --cask font-noto-sans-cjk`.-- **Windows drawtext crashes on some real builds** (#100): the drawtext tools- resolve a concrete `--font-file` by default, which avoids it; if one still- crashes, pass `--font-file` explicitly. Details: `references/ci-platform-pitfalls.md`.-- **Keyframe cuts.** A lossless `cut.py` result may start up to one GOP (often- 1–10 s) earlier than requested; the script re-encodes automatically when the- deviation exceeds 0.5 s. If the user insists on lossless output, pass- `--tolerance -1` and tell them the cut lands on the nearest earlier keyframe.-- **Rotation metadata.** Phone footage often has a `rotation` tag; `probe.py`- reports it and `fit.py` accounts for it when computing the output frame.-- **Odd dimensions.** `yuv420p` needs even width/height; `fit.py` and- `export.py` round to even values automatically.-- **Speed.** Re-encodes use x264 `medium`. For long files add `--preset veryfast`- to intermediates and keep the default for the final export.+One line each; the full version is `references/gotchas.md`, worth reading before a job in that area.++- HDR (iPhone, HDR10) re-encoded through an SDR path goes flat; the scripts keep HDR, and `hdr: true` is wider than `hdr_signal: true` (a real PQ/HLG/Dolby Vision transfer). Details: [#hdr-and-colour](references/gotchas.md#hdr-and-colour)+- Log footage (S-Log/V-Log/C-Log) is tagged SDR and looks grey: `probe.py --analyze`, then `color.py --lut` before anything else. Details: [#log-footage](references/gotchas.md#log-footage)+- A `-c copy` cut can start on a wrong or frozen frame; `cut.py` re-encodes past a 0.5 s snap — respect it. Details: [#keyframe-cuts](references/gotchas.md#keyframe-cuts)+- VFR phone/screen recordings: re-encodes conform to CFR, `cut.py` switches to `--accurate`; pick the rate with `fit.py --fps` when the average is odd. Details: [#variable-frame-rate](references/gotchas.md#variable-frame-rate)+- Sync/multicam `confidence` under 0.3 (or a huge offset) is probably wrong — check every camera, and remember these align audio, never lip sync. Details: [#sync-multicam-and-drift](references/gotchas.md#sync-multicam-and-drift)+- "Normalised" audio can still clip (check true peak), and ambience at -40 LUFS or below must never be raised to a speech target. Details: [#loudness-and-ambience](references/gotchas.md#loudness-and-ambience)+- Captions burned before a crop/resize land off-frame; burned small then upscaled by `export.py` they come out soft — fit to the delivery size first. Non-Latin text without a real font renders boxes, not an error. Details: [#captions-fonts-and-text-order](references/gotchas.md#captions-fonts-and-text-order)+- `--fit crop` 16:9 → 9:16 throws away 70 % of the width, 60→30 fps halves the motion, and "60 seconds" by speed or by trim are different answers — say which and why. Details: [#reframing-fps-and-duration](references/gotchas.md#reframing-fps-and-duration)+- `yuv420p` needs even dimensions and phone rotation tags are honoured, both automatically. Details: [#dimensions-and-rotation](references/gotchas.md#dimensions-and-rotation)+- `scenes.py --highlights` ranks by loudness (or duration), never by meaning: check the sheet before treating picks as final. Details: [#highlights](references/gotchas.md#highlights)+- Three hand-chained re-encodes should be one `render.py` project; re-encodes use x264 `medium`. Details: [#chaining-and-speed](references/gotchas.md#chaining-and-speed)+- Windows drawtext crashes on some builds (#100): pass `--font-file` explicitly if one does. Details: `references/ci-platform-pitfalls.md`diff --git a/docs/contract.md b/docs/contract.mdindex 6b1cc66..7daf015 100644--- a/docs/contract.md+++ b/docs/contract.md@@ -128,6 +128,7 @@ One entry per tool under `tools`, sorted by id. Tool ids are stable:| `output_schema` | what `--json` prints on stdout || `supports_dry_run`, `dry_run` | whether `--dry-run` plans without running ffmpeg or writing files || `supports_json` | whether `--json` exists |+| `supports_json_brief` | whether `--json-brief` exists (1.10.2): the same success document with `probe` replaced by a compact `summary` (`duration_s`, `width`, `height`, `fps`, `vcodec`, `acodec`, `channels`, and `lufs` when the tool measured one), `commands` replaced by the number of commands run, and the per-step `verification` list dropped (its verdict stays in `verified`). Tool-specific keys are unchanged, `--json`'s own output is unchanged, and a failure prints the same failure document either way || `mutates_input` | always `false`: no tool overwrites its input || `produces_artifact` | writes a file (media, PNG, HTML, EDL) || `verification` | `{required, tools}`: which tools to run on the output afterwards |diff --git a/docs/roadmap.md b/docs/roadmap.mdindex 5f5f92a..e5c107d 100644--- a/docs/roadmap.md+++ b/docs/roadmap.md@@ -60,6 +60,32 @@ minor and `fix` PRs into a patch, so each block below is one or two `feat` PRs psteps) re-run on the tree — eighth audit shipped as 1.9.1; eval 10 and corpus re-run pending.`docs/contract.md` "What 2.0 changes" section written from the `deprecated` list (done).+## 1.10.2 — token diet++The eval-10 follow-up: make a job cost the agent fewer tokens and fewer calls without changing+what any tool does. Nothing here is a behaviour change — `--json`, exit codes, contract fields+and the default MCP `tools/list` are unchanged except for additions.++- **Two-tier SKILL.md** (done): the always-loaded file keeps the workflow, the request→script+ table, the report format and one line per gotcha; the long "Things that look right but are+ wrong" / "Gotchas" prose and the audio-only recipes moved to `references/gotchas.md`, each+ line pointing at its anchor. 362 lines / 37.8 KB → 198 lines / 29.1 KB, no rule dropped.+- **Guidance that saves calls** (done): `doctor` only on a new machine or after a+ `kind: missing_tool` failure, not per job; no separate `probe.py` before every edit (a writing+ tool's `--json` already carries the input and the output probe); `render.py` with a project.json+ for jobs of three or more steps; `look.py --tiles 3x2` (or `--at T`) for verification, the full+ 4x3 sheet only when the job is about layout across the whole clip.+- **`--json-brief`** (done, additive): every tool gains a flag that prints the same success+ document trimmed to `status`, `output`, `dry_run`, `verified`, a compact `summary`+ (duration/width/height/fps/codecs/channels, `lufs` when measured), its own tool-specific keys+ and the command count instead of the command lines — about a third of `--json`'s bytes.+ `contract --json` reports it as `supports_json_brief`, mirroring `supports_json`.+- **Shorter `doctor` summary** (done): the plain-text output states counts and what is missing+ (1681 → 522 bytes on a healthy machine); `doctor --json` is unchanged and still carries every+ capability name, per-tool `usable` and the fix hints.+- **Eval iteration 11** measures tokens per run and keeps only the changes that hold routing,+ honesty, language, report format and look behaviour at iteration-10 levels (pending).+## 1.11.0 — captions people can read- `caption.py` wraps by measured text width (fontconfig metrics, not character count) sodiff --git a/package.json b/package.jsonindex 3d5f3cd..40bff46 100644--- a/package.json+++ b/package.json@@ -33,6 +33,7 @@"references/scripts.md","references/devices.md","references/ci-platform-pitfalls.md",+ "references/gotchas.md","docs/contract.md","SKILL.md","README.md",diff --git a/references/gotchas.md b/references/gotchas.mdnew file mode 100644index 0000000..b5be2fa--- /dev/null+++ b/references/gotchas.md@@ -0,0 +1,172 @@+# Gotchas and things that look right but are wrong++The long form of SKILL.md's "Things that look right but are wrong" and "Gotchas"+bullets. SKILL.md keeps one line per item and points here with the anchors below;+nothing here is optional reading when the job touches that area — it is the+detail, not an aside.++## Colour, HDR and Log++### HDR and colour+SDR outputs are H.264 tagged BT.709 `yuv420p`. When `probe.py` reports+`hdr: true` (HDR10/PQ, HLG, Dolby Vision, BT.2020), every editing script keeps+the output HDR (HEVC Main10, source colour tags) so nothing is silently+flattened. Decide with the user: keep HDR (fine for YouTube/phones) or run+`color.py --to-sdr` first for SDR-only destinations, LUT work or H.264+deliverables. `hdr: true` counts BT.2020 primaries too, so it is also true for a+wide-gamut SDR file; `hdr_signal: true` is the narrower fact — a real PQ / HLG /+Dolby Vision transfer — and `hdr_format` names the in-between case+(`BT.2020 SDR`). `export.py` platform presets are SDR and warn on HDR input.+iPhone `.mov` files also carry timecode/metadata tracks; scripts map only the+first audio track, so extra tracks are dropped on re-encode. Keep ProRes masters+at source colour: `export.py --preset prores` does not retag.++Re-encoding an HDR (iPhone, HDR10) source through an SDR path flattens the+colours. The scripts keep HDR; if you hand-write ffmpeg (never do — see SKILL.md),+do not tag BT.709 on BT.2020 pixels.++### Log footage+S-Log, V-Log and C-Log look grey and low-contrast but are tagged SDR. Run+`probe.py --analyze`; `looks_like_log: true` means apply the manufacturer's+`.cube` with `color.py --lut` before anything else.++## Cutting++### Keyframe cuts+A lossless `cut.py` result may start up to one GOP (often 1–10 s) earlier than+requested; the script re-encodes automatically when the deviation exceeds 0.5 s.+If the user insists on lossless output, pass `--tolerance -1` and tell them the+cut lands on the nearest earlier keyframe. A `-c copy` cut on VFR or a+non-keyframe boundary produces a file that "works" but starts on a frozen or+wrong frame — respect the automatic re-encode rather than forcing the copy.++### Variable frame rate+`probe.py` sets `variable_frame_rate_suspected` when `r_frame_rate` and+`avg_frame_rate` disagree (phone and screen recordings). Every re-encoding+script then adds `-fps_mode cfr` at the source's average rate, and `cut.py`+switches itself to `--accurate` (copy-cuts on VFR are unreliable). Pick the rate+explicitly with `fit.py --fps 30|60` when the average is odd (e.g. 23.4 fps from+dropped frames).++## Audio++### Sync, multicam and drift+A sync or multicam alignment with `confidence` under 0.3, or an offset larger+than 60 % of the analysis window, is probably wrong: enlarge `--analyze-seconds`+or find a clap. `multicam.py` reports one `confidence` per camera — check all of+them, not just that the command succeeded, before trusting the cut.++`sync.py`/`multicam.py` align audio tracks to each other, never lip sync (mouth+movement vs. audio) — there is no face or mouth detection anywhere in this skill.+High confidence means the audio matched well, not that the picture looks right;+whether lip sync is correct needs a look at the video, not the reported offset.++Don't mix files with different frame rates or sample rates in one+`cut.py --segments` join without re-encoding (`--accurate`). After `sync.py`,+verify by running it again on the output: offset (and drift ppm with+`--fix-drift`) should be ~0. Recordings longer than ~10 minutes from separate+devices: always use `--fix-drift`.++### Loudness and ambience+"Normalised" audio can still clip: check true peak, not just LUFS (`check.py`+does both). And do not normalise ambience or near-silence to a speech target — a+clip measured at -40 LUFS or below is room tone, wind or nothing; raising it+25 dB raises the noise, not the content. Leave the level, say so, and offer music+or narration.++## Text and framing++### Captions, fonts and text order+Captions burned before a crop/resize land off-frame: frame changes first, then+text. Captions burned at an intermediate size and then upscaled by `export.py`+come out soft (a 1280x720 source fit to 9:16 is 406x720 until export scales it to+1080x1920) — fit to the delivery size first+(`fit.py --width 1080 --height 1920`), then caption, then export.++CJK and other non-Latin text: libass and drawtext need a font that has the+glyphs. Check with `fc-list | grep -i cjk`. Then either name it+(`caption.py --font "Noto Sans CJK JP"`) or point at the file+(`overlay.py --font-file /usr/share/fonts/opentype/noto/NotoSansCJK-Regular.ttc`,+`caption.py --fonts-dir ./fonts --font "Noto Sans CJK JP"`). Without a matching+font you get boxes, not an error. Install: `apt install fonts-noto-cjk`,+`brew install --cask font-noto-sans-cjk`.++Windows drawtext crashes on some real builds (#100): the drawtext tools resolve a+concrete `--font-file` by default, which avoids it; if one still crashes, pass+`--font-file` explicitly. Details: `references/ci-platform-pitfalls.md`.++### Reframing, fps and duration+`--fit crop` to reach 9:16 from 16:9 throws away 70 % of the width: a wide shot+loses people at the edges. Check the sheet; pad (bars), `--crop-x`/`--crop-y`+toward the subject, or a reframe is often the honest answer — a silent centre+crop is a guess, not a decision.++Conforming 60 fps to 30 halves the motion samples: fine for a talking head,+visibly choppy for sports, gaming, drone pans. Keep 60 when the platform allows.++"Make it 60 seconds" on a 3-minute talk by speed change is unwatchable (3×); by+trim it drops two thirds of the words. Ask which, or propose a highlight cut with+`scenes.py`.++### Dimensions and rotation+`yuv420p` needs even width/height; `fit.py` and `export.py` round to even values+automatically. Phone footage often carries a `rotation` tag; `probe.py` reports+it and `fit.py` accounts for it when computing the output frame.++## Planning++### Highlights+`scenes.py --highlights` defaults to the loudest scenes (`--rank-by audio`): a+quiet but important moment (a confession, a punchline landing in silence) is+skipped, and pure crowd noise or a mic bump can outrank it. `--rank-by duration`+picks the longest unbroken scenes instead. Neither is "the best parts" — check+the contact sheet (`--sheet`) before treating the picks as final.++### Chaining and speed+Anything chained by hand through three re-encodes should be one `render.py`+project instead, so the plan is one file and the user can change one number.+Re-encodes use x264 `medium`; for long files add `--preset veryfast` to+intermediates and keep the default for the final export.++## Audio-only files++Audio files are a first-class input, not a special case. `probe.py`, `cut.py`,+`silence.py`, `loudness.py`, `audio.py`, `sync.py` and `check.py --platform+podcast` all accept WAV, FLAC, MP3, M4A/AAC, OGG and Opus (any container ffmpeg+can read) and write the codec that fits the output extension, so the same+commands work with `talk.wav` in place of `talk.mp4`. What changes:++- The output extension picks the format: `-o out.mp3` converts, `-o out.wav`+ keeps PCM, `-o out.m4a` writes AAC. `audio.py in.wav -o out.mp3` with no+ other flag is a plain conversion.+- `cut.py` stream-copies audio too, so trims land on a packet boundary+ (`precision: packet`, a few ms; the JSON reports `duration_error_ms`). Pass+ `--accurate` for a sample-exact trim: `precision: sample` when the output is+ PCM or FLAC, `codec_frame` when a lossy codec (AAC, MP3, Opus) frames it+ again. A `.wav` output is always PCM, never AAC packets inside a WAV.+- `join.py` joins audio-only clips as audio (`acrossfade` or a butt join) at+ one sample rate and channel layout; the output must have an audio extension.+ Video and audio clips cannot be mixed in one join.+- An audio extension on a video input (`audio.py talk.mp4 -o talk.wav`,+ `cut.py talk.mp4 --start 1:00 --end 2:00 -o part.wav`) extracts the audio; the+ output has no video stream. `audio.py --audio-stream N` picks a track when+ `probe` lists several under `audio_streams`.+- `Look: not needed` in the report; `Check:` still applies for loudness+ (`check.py file.wav --platform podcast` measures LUFS and true peak).+- Scripts that need a picture (`fit`, `caption`, `overlay`, `graphics`,+ `color`, `export`, `scenes`, `look`) refuse an audio file with+ "input has no video stream". Say so instead of forcing a video wrapper.++### Audio-only recipes++| User says (audio file) | Do |+|-----------|----|+| "normalise this WAV to -14 LUFS", "podcast levels" | `loudness.py talk.wav -I -14 --tp -1 -o talk_norm.wav` (`-I -16 --tp -1.5` podcast) |+| "remove the silence from this recording" | `silence.py talk.wav -o talk_tight.wav` |+| "clean up the noise in this M4A" | `audio.py talk.m4a --voice -o talk_clean.m4a` (speech) or `--denoise` |+| "convert this WAV to MP3" | `audio.py talk.wav -o talk.mp3` |+| "trim this audio from 00:30 to 02:00" | `cut.py talk.wav --start 0:30 --end 2:00 -o talk_cut.wav` (`--accurate` for sample-exact) |+| "join these recordings", "intro + episode + outro" | `join.py intro.wav episode.m4a outro.wav -o full.flac` (`--transition none` for a butt join) |+| "extract the audio from the video" | `audio.py talk.mp4 -o talk.wav` (`--voice -o talk.m4a` to clean it on the way) |+| "compress / limit / gate the voice" | `audio.py talk.wav --compress --comp-threshold -20 --comp-ratio 4 --limit --limit-ceiling -1 -o talk_dyn.wav` |+| "is this loud enough for Apple Podcasts?" | `check.py talk.m4a --platform podcast` |diff --git a/references/scripts.md b/references/scripts.mdindex be94ad8..9fba8a4 100644--- a/references/scripts.md+++ b/references/scripts.md@@ -1,6 +1,6 @@# Script reference-Every script prints the same information with `--help`; this file exists so the agent can read several at once. All scripts accept `--dry-run`, `--json`, `--fast`, `--progress`, `--timeout SECONDS`, `--overwrite`, `--plan FILE` (the dry run written as a plan document that `render.py FILE` executes later; see render.py), `-o OUT`; every editing tool that re-encodes (not `export.py`, whose preset decides the codec) also takes `--codec h264|hevc|av1|prores` (the encoder for the re-encode; default x264 for SDR, x265 Main10 for HDR, unchanged) and `--quality N` (CRF scale, overrides `--crf`; up to 63 for av1; ignored by prores). `--crf` is deprecated since 1.10.0 (it warns on stderr and is removed in 2.0): use `--quality`, except on `export.py`, whose `--crf` is not an alias and stays. With `FFMPEG_SKILL_NO_OVERWRITE=1` in the environment, any tool refuses (`kind: input`) to replace an existing output unless `--overwrite` is given. `--codec hevc` on SDR writes 8-bit BT.709 HEVC (`hvc1`), `av1` uses SVT-AV1 (libaom fallback), `prores` is 422 HQ and needs an explicit `-o NAME.mov` (or `.mkv`), `h264` refuses an HDR source (`kind: input`, run `color.py --to-sdr` first). `export.py` keeps choosing the codec from its preset and has neither flag; a `render.py` project cannot choose a codec either -- but `--dry-run` only guarantees nothing is written for writing tools: `probe` (read-only, `--dry-run` changes nothing) still runs ffprobe, `check`/`sync`/`multicam`/`scenes`/`cropdetect`/`report`/`silence`/`loudness`/`stabilize` still run their ffmpeg/ffprobe measurements (a dry-run plan rests on real numbers; they just don't write the final artifact), and `verify` accepts the flag but ignores it entirely. Exact per-tool semantics: `contract --json`'s `dry_run` field (or `docs/contract.md`).+Every script prints the same information with `--help`; this file exists so the agent can read several at once. All scripts accept `--dry-run`, `--json`, `--json-brief` (since 1.10.2: the same JSON result trimmed to `status`, `output`, `dry_run`, `verified`, a compact `summary` of the output probe -- duration_s, width, height, fps, vcodec, acodec, channels, and lufs when measured -- the tool's own keys, and the count of commands instead of the command lines; it implies `--json`, leaves `--json`'s own output untouched, and failures print the usual full failure document), `--fast`, `--progress`, `--timeout SECONDS`, `--overwrite`, `--plan FILE` (the dry run written as a plan document that `render.py FILE` executes later; see render.py), `-o OUT`; every editing tool that re-encodes (not `export.py`, whose preset decides the codec) also takes `--codec h264|hevc|av1|prores` (the encoder for the re-encode; default x264 for SDR, x265 Main10 for HDR, unchanged) and `--quality N` (CRF scale, overrides `--crf`; up to 63 for av1; ignored by prores). `--crf` is deprecated since 1.10.0 (it warns on stderr and is removed in 2.0): use `--quality`, except on `export.py`, whose `--crf` is not an alias and stays. With `FFMPEG_SKILL_NO_OVERWRITE=1` in the environment, any tool refuses (`kind: input`) to replace an existing output unless `--overwrite` is given. `--codec hevc` on SDR writes 8-bit BT.709 HEVC (`hvc1`), `av1` uses SVT-AV1 (libaom fallback), `prores` is 422 HQ and needs an explicit `-o NAME.mov` (or `.mkv`), `h264` refuses an HDR source (`kind: input`, run `color.py --to-sdr` first). `export.py` keeps choosing the codec from its preset and has neither flag; a `render.py` project cannot choose a codec either -- but `--dry-run` only guarantees nothing is written for writing tools: `probe` (read-only, `--dry-run` changes nothing) still runs ffprobe, `check`/`sync`/`multicam`/`scenes`/`cropdetect`/`report`/`silence`/`loudness`/`stabilize` still run their ffmpeg/ffprobe measurements (a dry-run plan rests on real numbers; they just don't write the final artifact), and `verify` accepts the flag but ignores it entirely. Exact per-tool semantics: `contract --json`'s `dry_run` field (or `docs/contract.md`).## Time grammar (every time-taking flag, 1.9)diff --git a/scripts/_common.py b/scripts/_common.pyindex 3eb20b5..3590871 100755--- a/scripts/_common.py+++ b/scripts/_common.py@@ -7,6 +7,7 @@ error reporting, and provides a compact media probe used by every script.from __future__ import annotationsimport json+import mathimport osimport platformimport argparse@@ -236,7 +237,7 @@ class Context:makes it obvious what run()/emit() depend on and lets tests reset it with ``STATE.reset()``."""- __slots__ = ("dry_run", "json", "progress", "fast", "duration_hint", "commands", "timeout", "overwrite", "written", "preexisting", "plan", "plan_written", "plan_inputs", "codec")+ __slots__ = ("dry_run", "json", "json_brief", "progress", "fast", "duration_hint", "commands", "timeout", "overwrite", "written", "preexisting", "plan", "plan_written", "plan_inputs", "codec")def __init__(self) -> None:self.reset()@@ -244,6 +245,7 @@ class Context:def reset(self) -> None:self.dry_run = False # print ffmpeg commands, run nothing (ffprobe still runs)self.json = False # emit() prints a JSON document instead of the output path+ self.json_brief = False # --json-brief: the same document trimmed to the fields a caller acts onself.progress = False # run() streams percent / ETA to stderr for ffmpegself.fast = False # x264 preset forced to veryfastself.duration_hint: Optional[float] = None # expected output length, for the progress percent@@ -277,6 +279,8 @@ def add_common(ap: "argparse.ArgumentParser", codec: bool = True) -> None:g = ap.add_argument_group("agent options")g.add_argument("--dry-run", action="store_true", help="print the ffmpeg commands that would run, run nothing")g.add_argument("--json", action="store_true", help="print a JSON result (output, probe, commands) on stdout instead of the path")+ g.add_argument("--json-brief", action="store_true",+ help="like --json but trimmed: status, output, dry_run, verified, a compact summary of the output probe, this tool's own keys, and the command count instead of the command lines (failures print the full failure document, unchanged)")g.add_argument("--progress", action="store_true", help="show percent / ETA on stderr while ffmpeg encodes")g.add_argument("--fast", action="store_true", help="preview quality: x264 preset veryfast (overrides --preset) for quick iterations")if "--timeout" not in ap._option_string_actions: # verify.py defines its own per-step --timeout; apply_common reads either@@ -329,7 +333,10 @@ def apply_common(args: "argparse.Namespace") -> None:# tools without --json) still get their plan written, at exit, unless die() ran (review 6)import atexitatexit.register(_plan_at_exit)- STATE.json = bool(getattr(args, "json", False))+ STATE.json_brief = bool(getattr(args, "json_brief", False))+ # --json-brief is a shorter --json, not a second output mode: it implies it, so a caller that+ # passes only --json-brief still gets a JSON document (and --json --json-brief is the brief one).+ STATE.json = bool(getattr(args, "json", False)) or STATE.json_briefSTATE.progress = bool(getattr(args, "progress", False))STATE.fast = bool(getattr(args, "fast", False))STATE.overwrite = bool(getattr(args, "overwrite", False))@@ -455,13 +462,64 @@ def emit(output: Optional[str], *, ctx: "Optional[Context]" = None, **extra: Anydoc["result_v2"] = _result_v2(output, meta, dict(extra, verified=doc["verified"], verification=steps))if ctx.plan:doc["plan"] = write_plan(ctx.plan, output, extra, ctx=ctx)- print_json(doc)+ print_json(_brief(doc, meta) if ctx.json_brief else doc)elif ctx.plan:print(write_plan(ctx.plan, output, extra, ctx=ctx))elif output:print(output)+# Keys the brief document replaces or drops: the full probe (summarised), the command lines+# (counted), the per-step verification list (its verdict stays as `verified`) and the 2.0 preview.+_BRIEF_DROP = ("probe", "commands", "verification", "result_v2")+++def _brief_summary(meta: Dict[str, Any], extra: Dict[str, Any]) -> Dict[str, Any]:+ """The handful of output facts a caller reports or branches on, from the probe this tool+ already ran -- plus the measured loudness when the tool measured one. Keys whose value is+ unknown are left out rather than emitted as null."""+ video = (meta or {}).get("video") or {}+ audio = (meta or {}).get("audio") or {}+ summary: Dict[str, Any] = {}+ duration = (meta or {}).get("duration")+ if duration is not None:+ summary["duration_s"] = round(float(duration), 3)+ for key, value in (("width", video.get("width")), ("height", video.get("height")), ("fps", video.get("fps")),+ ("vcodec", video.get("codec")), ("acodec", audio.get("codec")), ("channels", audio.get("channels"))):+ if value is not None:+ summary[key] = value+ lufs = None+ for source, key in ((extra.get("result"), "input_i"), (extra.get("measured"), "input_i")):+ if lufs is None and isinstance(source, dict):+ lufs = _to_float(source.get(key))+ for step in extra.get("verification") or []:+ if lufs is None and isinstance(step, dict):+ lufs = _to_float(step.get("lufs"))+ # a silent file measures -inf, which json.dumps writes as the non-standard -Infinity: the+ # brief document stays valid JSON by leaving the key out instead (the full document's own+ # `measured`/`result` still carries whatever the tool reported).+ if lufs is not None and math.isfinite(lufs):+ summary["lufs"] = round(lufs, 2)+ return summary+++def _brief(doc: Dict[str, Any], meta: Dict[str, Any]) -> Dict[str, Any]:+ """--json-brief: the same success document with the bulky parts replaced by what a caller+ acts on. Same keys, same meanings -- `commands` becomes the count of the command lines,+ `probe` becomes `summary` -- plus every tool-specific key the tool itself passed to emit().+ Failures are untouched: die() prints the full failure document either way."""+ brief: Dict[str, Any] = {"status": doc["status"], "output": doc["output"], "dry_run": doc["dry_run"],+ "verified": doc.get("verified", False)}+ summary = _brief_summary(meta, doc)+ if summary:+ brief["summary"] = summary+ brief["commands"] = len(doc.get("commands") or [])+ for key, value in doc.items():+ if key not in brief and key not in _BRIEF_DROP:+ brief[key] = value+ return brief++PLAN_VERSION = 1_PLAN_STRIP = ("--plan", "--dry-run", "--json")@@ -1047,7 +1105,6 @@ def rms_envelope(samples: Sequence[float], step: int, *, full_blocks_only: bool"""RMS per block of `step` samples. full_blocks_only drops a short tail block (sync.py: everyblock must be the same length for the correlation); remove_mean subtracts the envelope's mean(sync.py: so silence does not correlate). scenes.py keeps the tail and the absolute level."""- import mathstep = max(1, int(step))n = len(samples)stop = n - step + 1 if full_blocks_only else ndiff --git a/scripts/_contract.py b/scripts/_contract.pyindex 2f69f7b..ac01c78 100644--- a/scripts/_contract.py+++ b/scripts/_contract.py@@ -930,6 +930,8 @@ def tool_spec(name: str, version: str) -> Dict[str, Any]:"semantics": "prints the ffmpeg command lines that would run; no output file is written",**({"note": DRY_RUN_ANALYSIS.get(name) or DRY_RUN_NOTES[name]} if name in DRY_RUN_ANALYSIS or name in DRY_RUN_NOTES else {})},"supports_json": "json" in schema["properties"],+ # additive mirror of supports_json (1.10.2): --json-brief is the same document trimmed+ "supports_json_brief": "json_brief" in schema["properties"],"mutates_input": False,"produces_artifact": meta["produces_artifact"],"verification": {"required": bool(meta["verify"]), "tools": [f"{SKILL_ID}/{t}" for t in meta["verify"]]},@@ -1132,7 +1134,14 @@ def main() -> int:else:print(f"ffmpeg-skill {d['version']} (this installed copy; re-run `npx ffmpeg-skill` to refresh it -- copies are not updated automatically)")print(f"python {d['python']}; ffmpeg {d['ffmpeg'] or 'MISSING'}; ffprobe {d['ffprobe'] or 'MISSING'}")- print(f"available: {', '.join(d['available'])}")+ # counts, not the full capability list: the names of the ~60 available capabilities+ # answer no question a caller has (they are in `doctor --json .available` when one+ # does), while what is MISSING is the whole reason to run doctor (1.10.2 token diet).+ head = (f"{'ok' if d['ok'] else 'NOT ok'}: {len(d['available'])} capabilities available, "+ f"{len(d['missing'])} required missing, {len(d['missing_optional'])} optional missing")+ if d["unknown"]:+ head += f", {len(d['unknown'])} unknown"+ print(head)print(f"missing required: {', '.join(d['missing']) or 'none'}")print(f"missing optional: {', '.join(d['missing_optional']) or 'none'}")if d["unknown"]:@@ -1142,9 +1151,11 @@ def main() -> int:print(f"note: overall 'ok' means nothing REQUIRED BY EVERY TOOL is missing -- {len(not_usable)} tool(s) still can't run today: {', '.join(not_usable)} (see doctor --json .tools for why)")gpu = d["gpu_encoders"]if gpu["status"] == "parsed":- print(f"GPU-backed encoders in this build: {', '.join(gpu['present']) or 'none'} (no tool here uses one yet; this build-presence check does not prove the GPU/driver will accept a job)")+ print(f"GPU-backed encoders in this build: {len(gpu['present'])} (no tool here uses one; names in doctor --json)")fonts = d["fonts"]- print(f"default drawtext font '{fonts['default_font']}': {fonts['status']} ({fonts['detail']})")+ print(f"default drawtext font '{fonts['default_font']}': {fonts['status']}"+ + (f" ({fonts['detail']})" if fonts["status"] != "available" else ""))+ print("full detail: doctor --json (capability lists, per-tool `usable`, fix hints)")for err in d["errors"]:print(f"detection error: {err}", file=sys.stderr)if d["ok"]:diff --git a/tests/fixtures/mcp_tools.json b/tests/fixtures/mcp_tools.jsonindex 7aca5d2..d6e922f 100644--- a/tests/fixtures/mcp_tools.json+++ b/tests/fixtures/mcp_tools.json@@ -31,6 +31,7 @@"gate_threshold","input","json",+ "json_brief","limit","limit_attack","limit_ceiling",@@ -66,6 +67,7 @@"gradient","height","json",+ "json_brief","output","overwrite","plan",@@ -86,6 +88,7 @@"folder","force","json",+ "json_brief","overwrite","plan","progress",@@ -112,6 +115,7 @@"input","insert","json",+ "json_brief","output","overwrite","pad_color",@@ -146,6 +150,7 @@"highlight_color","input","json",+ "json_brief","karaoke","karaoke_timing","language",@@ -181,6 +186,7 @@"fast","input","json",+ "json_brief","lufs","max_duration","max_mb",@@ -213,6 +219,7 @@"gamma","input","json",+ "json_brief","levels_in_black","levels_in_white","levels_out_black",@@ -250,6 +257,7 @@"height","input","json",+ "json_brief","output","overwrite","plan",@@ -271,6 +279,7 @@"fast","input","json",+ "json_brief","limit","overwrite","plan",@@ -295,6 +304,7 @@"fast","input","json",+ "json_brief","output","overwrite","plan",@@ -319,6 +329,7 @@"fast","input","json",+ "json_brief","mode","only_interlaced","output",@@ -346,6 +357,7 @@"fps","input","json",+ "json_brief","luma_spatial","luma_temporal","output",@@ -370,6 +382,7 @@"fit","input","json",+ "json_brief","list","no_scale","normalize",@@ -405,6 +418,7 @@"height","input","json",+ "json_brief","max_speed","method","output",@@ -435,6 +449,7 @@"hold","input","json",+ "json_brief","mode","output","overwrite",@@ -462,6 +477,7 @@"font_file","input","json",+ "json_brief","name","output","overwrite",@@ -501,6 +517,7 @@"gap","inputs","json",+ "json_brief","label","output","overwrite",@@ -527,6 +544,7 @@"height","input","json",+ "json_brief","output","overwrite","pan",@@ -556,6 +574,7 @@"height","inputs","json",+ "json_brief","output","overwrite","pad_color",@@ -580,6 +599,7 @@"fast","input","json",+ "json_brief","no_timecode","output","overwrite",@@ -602,6 +622,7 @@"fast","input","json",+ "json_brief","output","overwrite","plan",@@ -622,6 +643,7 @@"fast","input","json",+ "json_brief","lra","lufs","measure_only",@@ -650,6 +672,7 @@"genre","input","json",+ "json_brief","output","overwrite","plan",@@ -675,6 +698,7 @@"height","inputs","json",+ "json_brief","max_offset","offsets_only","output",@@ -715,6 +739,7 @@"image","input","json",+ "json_brief","logo","margin","opacity",@@ -746,6 +771,7 @@"fast","input","json",+ "json_brief","output","overwrite","plan",@@ -768,6 +794,7 @@"field","inputs","json",+ "json_brief","overwrite","plan","progress",@@ -786,6 +813,7 @@"fps","input","json",+ "json_brief","no_audio","output","overwrite",@@ -813,6 +841,7 @@"height","input","json",+ "json_brief","mode","output","overwrite",@@ -835,6 +864,7 @@"fast","init","json",+ "json_brief","keep","overwrite","plan",@@ -856,6 +886,7 @@"dry_run","fast","json",+ "json_brief","no_sheets","notes","output",@@ -878,6 +909,7 @@"fast","input","json",+ "json_brief","no_audio","output","overwrite",@@ -899,6 +931,7 @@"highlights","input","json",+ "json_brief","max_scene","min_scene","no_timecode",@@ -926,6 +959,7 @@"fps","height","json",+ "json_brief","output","overwrite","pattern",@@ -950,6 +984,7 @@"fast","input","json",+ "json_brief","list","margin","min_keep",@@ -975,6 +1010,7 @@"fast","input","json",+ "json_brief","output","overwrite","plan",@@ -1002,6 +1038,7 @@"input_projection","interp","json",+ "json_brief","output","overwrite","pitch",@@ -1029,6 +1066,7 @@"fast","input","json",+ "json_brief","output","overwrite","plan",@@ -1058,6 +1096,7 @@"fps","input","json",+ "json_brief","output","overwrite","plan",@@ -1081,6 +1120,7 @@"fine_ms","fix_drift","json",+ "json_brief","max_offset","output","overwrite",@@ -1103,6 +1143,7 @@"dry_run","fast","json",+ "json_brief","keep","out","overwrite",@@ -1131,6 +1172,7 @@"height","input","json",+ "json_brief","output","overwrite","plan",diff --git a/tests/test_all.py b/tests/test_all.pyindex ab6e71f..d28bc6c 100644--- a/tests/test_all.py+++ b/tests/test_all.py@@ -3531,6 +3531,56 @@ class FFmpegSkillTests(unittest.TestCase):helptext = " ".join(script("cut.py", "--help").stdout.split())self.assertIn("(deprecated: use --quality)", helptext)+ def test_json_brief_is_a_shorter_json_with_the_same_verdict(self):+ """1.10.2 token diet: `--json-brief` is additive -- the same success document with the+ probe summarised, the command lines counted and the per-step verification list dropped.+ `--json` itself must be untouched, so both are run on the same edit and compared."""+ full = json.loads(script("cut.py", self.src, "--start", "0", "--end", "2", "-o", str(OUT / "brief_full.mp4"), "--json").stdout)+ brief = json.loads(script("cut.py", self.src, "--start", "0", "--end", "2", "-o", str(OUT / "brief_short.mp4"), "--json-brief").stdout)+ self.assertEqual(set(full) - set(brief), {"probe", "verification"}, "only the bulky keys go")+ self.assertEqual(set(brief) - set(full), {"summary"})+ self.assertEqual(brief["status"], "completed")+ self.assertEqual(brief["dry_run"], full["dry_run"])+ self.assertEqual(brief["verified"], full["verified"])+ self.assertNotIn("probe", brief)+ self.assertNotIn("verification", brief)+ self.assertEqual(brief["commands"], len(full["commands"]), "commands is the count, not the list")+ summary = brief["summary"]+ self.assertEqual(summary["width"], full["probe"]["video"]["width"])+ self.assertEqual(summary["height"], full["probe"]["video"]["height"])+ self.assertEqual(summary["vcodec"], full["probe"]["video"]["codec"])+ self.assertEqual(summary["acodec"], full["probe"]["audio"]["codec"])+ self.assertAlmostEqual(summary["duration_s"], full["probe"]["duration"], places=2)+ for key in ("precision", "reencoded", "expected_duration"):+ self.assertEqual(brief[key], full[key], f"{key}: the tool's own keys survive the diet")+ self.assertLess(len(json.dumps(brief)), len(json.dumps(full)) / 2, "the point of the flag is fewer bytes")++ def test_json_brief_failure_is_the_usual_failure_document(self):+ """A failure must not be trimmed: die() prints the same document with or without the flag,+ so a caller never loses the error kind, message or hint by asking for brevity."""+ proc = script("cut.py", str(OUT / "does_not_exist.mp4"), "--start", "0", "--end", "1", "--json-brief", expect_fail=True)+ doc = json.loads(proc.stdout)+ self.assertEqual(doc["status"], "failed")+ self.assertEqual(doc["error"]["kind"], "input")+ self.assertTrue(doc["error"]["message"])+ self.assertNotIn("summary", doc)++ def test_skill_md_stays_within_the_agent_reading_budget(self):+ """1.10.2: SKILL.md is the file every session loads, so its size is a real per-run cost.+ The two-tier split (long-form prose in references/gotchas.md, one line plus an anchor+ here) brought it from 362 lines / 37.8 KB to under this ceiling; a new rule belongs in a+ references/ file with a one-line pointer, not in an ever-growing SKILL.md."""+ text = (ROOT / "SKILL.md").read_text(encoding="utf-8")+ lines, size = len(text.splitlines()), len(text.encode("utf-8"))+ self.assertLessEqual(lines, 220, f"SKILL.md is {lines} lines; move detail to references/")+ self.assertLessEqual(size, 30000, f"SKILL.md is {size} bytes; move detail to references/")+ gotchas = (ROOT / "references" / "gotchas.md").read_text(encoding="utf-8")+ # every "details:" pointer resolves to a real heading in the file it names+ for anchor in re.findall(r"references/gotchas\.md#([a-z0-9-]+)", text):+ headings = ["".join(ch for ch in h.lower().replace(" ", "-") if ch.isalnum() or ch == "-")+ for h in re.findall(r"(?m)^#+ (.+)$", gotchas)]+ self.assertIn(anchor, headings, f"SKILL.md points at references/gotchas.md#{anchor}, which has no such heading")+def test_every_script_has_help(self):for name in sorted(p.name for p in SCRIPTS.glob("*.py") if not p.name.startswith("_")):with self.subTest(script=name):diff --git a/tests/test_contract.py b/tests/test_contract.pyindex b3d97c2..f114dd9 100644--- a/tests/test_contract.py+++ b/tests/test_contract.py@@ -530,6 +530,15 @@ class ContractTests(unittest.TestCase):self.assertIn("doctor", workflow)self.assertIn("contract", workflow)+ def test_supports_json_brief_mirrors_the_real_flag(self):+ """1.10.2: `--json-brief` is declared the same way `supports_json` is -- measured from the+ parser, never hand-written -- so a tool that somehow lost the shared flag shows up here."""+ for t in self.contract["tools"]:+ with self.subTest(tool=t["name"]):+ self.assertEqual(t["supports_json_brief"], "json_brief" in t["input_schema"]["properties"])+ self.assertTrue(t["supports_json_brief"], "every tool takes --json-brief")+ self.assertEqual(t["supports_json"], t["supports_json_brief"])+def test_verification_metadata_matches_skill_workflow(self):for t in self.contract["tools"]:v = t["verification"]