Skip to content

Open source CapCut alternative.

TypeScript

docs(app): refresh the media skill and harness guides

David Lef1db6b8a26c7
diff --git a/apps/Donkey/Sources/DonkeyRuntime/Resources/BuiltInSkills/media/SKILL.md b/apps/Donkey/Sources/DonkeyRuntime/Resources/BuiltInSkills/media/SKILL.md
index c91a723f..b65d5b5a 100644
--- a/apps/Donkey/Sources/DonkeyRuntime/Resources/BuiltInSkills/media/SKILL.md
+++ b/apps/Donkey/Sources/DonkeyRuntime/Resources/BuiltInSkills/media/SKILL.md
@@ -11,18 +11,22 @@ by bare name. They are first-party capability tools: downloading from the user's
URL and writing the output file run immediately, with no consent prompt — just
issue the command, and never fall back to a browser to download.
-Never probe for or install Homebrew (or any package manager), and never check
-whether these tools exist first — just run them by bare name. The app installs
-them itself on first launch; if one is briefly missing the command fails with
-`command not found`, in which case say the media tools are still installing and
-stop. Do not try to install anything.
+These are standalone signed binaries, not Python packages: run `yt-dlp` directly,
+never through `python3 -m yt_dlp`, `pip`, or `which`. Never probe for or install
+Homebrew (or any package manager), and never check whether these tools exist
+first — just run them by bare name. The app installs them itself on first launch;
+if one is briefly missing the command fails with `command not found`, in which
+case say the media tools are still installing and stop. Do not try to install anything.
## Download from a URL (yt-dlp)
+- **These calls are slow — always pass `timeoutSeconds`.** Extracting a YouTube page (it solves a JS challenge first) can take ~15s *before any bytes download*, so the default short timeout kills it mid-extract. Pass `timeoutSeconds: 120` on the shell_exec call for every yt-dlp download.
- Always single-quote the URL — `?` and `&` are shell metacharacters: `yt-dlp -P ~/Downloads 'URL'`.
- Default the destination to `~/Downloads`; honor a different folder only if the user names one. yt-dlp already picks the best quality.
+- A specific time range (a clip) downloads just that span: `yt-dlp --download-sections '*15:00-16:00' -P ~/Downloads 'URL'`.
- Audio only: `yt-dlp -x --audio-format mp3 -P ~/Downloads 'URL'`.
- A specific resolution if asked: `yt-dlp -f 'bestvideo[height<=1080]+bestaudio' -P ~/Downloads 'URL'`.
-- `Unable to extract` / `HTTP 403` usually means the bundled yt-dlp is older than the site's latest change, not a bad URL — report that plainly; do not retry blindly.
+- **Issue ONE download command and let yt-dlp do its own retries — never fire several attempts in a row.** A burst of repeated calls from the same IP is what *triggers* YouTube's rate-limiting. Add `--retries 5 --extractor-retries 3` so one command rides out a transient hiccup.
+- `HTTP 403 Forbidden` on the video stream is almost always that transient rate-limiting, not a dead URL — it usually clears on its own. If a download 403s, wait and retry the SAME command at most once, then report it; do not keep firing variations. `Unable to extract` instead means the bundled yt-dlp is older than the site's latest change — report that plainly, don't retry blindly.
## Edit a local file (ffmpeg)
- Transcode by changing the extension: `ffmpeg -i in.mov out.mp4`.
diff --git a/docs/guides/agent-harness.md b/docs/guides/agent-harness.md
index 903bf5a5..98ef9117 100644
--- a/docs/guides/agent-harness.md
+++ b/docs/guides/agent-harness.md
@@ -78,7 +78,10 @@ Storage keeps decisions inspectable:
- **Task snapshots** store execution state.
One turn-trace manager is the single sink every model call and the step loop
-report to — the substrate a later self-correcting pass would learn from.
+report to — the substrate the self-correcting pass learns from. When a run ends,
+a background pass distills its trace into at most one durable operating lesson and
+later runs with a related goal recall it, so the harness improves across runs (see
+"Learning From Finished Runs" in the deep dive).
## Turn Understanding
@@ -181,6 +184,11 @@ Donkey works like an expert terminal user. The planner's first choice is
- reading state: `pmset -g`, `system_profiler`, `defaults read`
- changing settings: `defaults write`, `networksetup`
+Commands run from the user's home directory, not the filesystem root: a file the
+user names ("fill out f1120.pdf") lives somewhere under home, so a relative search
+lands in the right neighborhood instead of walking the whole disk and stalling on
+protected system folders.
+
Driving a GUI is the fallback, used only when the task truly needs it (canvas,
Electron, or proprietary interfaces with no command-line equivalent). This
preference lives in the planner doctrine and a built-in `system-tools` skill.
diff --git a/docs/guides/harness-deep-dive.md b/docs/guides/harness-deep-dive.md
index 40ad183b..0de476e4 100644
--- a/docs/guides/harness-deep-dive.md
+++ b/docs/guides/harness-deep-dive.md
@@ -47,6 +47,34 @@ it. On relaunch, a task that was actively running moments earlier resumes on its
own in the background; one interrupted longer ago, or one that was waiting on the
user, comes back as a row the user resumes with a tap.
+## Learning From Finished Runs
+
+The harness improves itself across runs: a mistake it pays for once should steer
+it the next time, without anyone editing a prompt.
+
+When a run reaches a terminal state, a background pass reads the whole run — its
+goal, its outcome, and the step-by-step trace — and asks the model for at most
+one durable *operating lesson*: a general rule about how to work, like which tool
+to reach for or which trap to avoid. The lesson must be reusable craft, not a
+fact about this one task, file, or person; most clean runs teach nothing, and the
+pass is expected to return nothing for them. A lesson worth keeping is stored as a
+durable memory, deduplicated by its wording so re-learning the same rule refreshes
+one entry instead of piling up copies.
+
+At the start of a later run, the planner recalls the lessons whose subject
+resembles the new goal and reads them near the top of its prompt, before it takes
+the first step. So the agent that once spent a whole run on a search that timed
+out begins the next, similar run already knowing the faster path.
+
+This reuses the agent-memory machinery rather than adding a parallel store: the
+same approval gate (which refuses anything unlinked or sensitive), the same
+durable storage, and the same ranked retrieval that surfaces app and file
+memories. Lessons are just one more kind of memory in it. Two boundaries keep the
+loop honest: distillation only runs on a run that plausibly taught something — a
+failure, or a run long enough to have taken a wrong turn — so a quick success
+spends no model call; and the lesson is general craft only, never this user's
+data.
+
## Working With Files
File work splits into two parts. Understanding a file — figuring out what is