Skip to content

Open source CapCut alternative.

TypeScript

docs(guides): tighten the skills and background-input guides

David Le27a4116005ae
diff --git a/docs/guides/authoring-skills.md b/docs/guides/authoring-skills.md
index 974580ad..7a6be072 100644
--- a/docs/guides/authoring-skills.md
+++ b/docs/guides/authoring-skills.md
@@ -42,7 +42,7 @@ three are discovered the same way. The folder name is the skill id; keep it the
clean app or capability name (`music`), not a description
(`play-music-in-apple-music-with-search`).
-## Install & distribution
+## Install & Distribution
A skill does not have to ship inside the app. The same folder — `SKILL.md` plus
an optional `scripts/` — is also the installable unit: it can be downloaded and
@@ -56,14 +56,15 @@ manifest never duplicates it, and a skill with no manifest still installs (its
identity then comes from the `id:` frontmatter).
On install the bundle is verified before it touches the live tree: the content
-checksum must match the manifest, a present signature must verify against a
-trusted key, then the skill is placed under
+checksum must match the manifest, and a signature, if present, must verify
+against a trusted key. Only then is the skill placed under
`…/Skills/Installed/<id>/<version>/` with a `current` symlink. A failed
-verification leaves any previously installed version untouched. Discovery merges
-installed skills between built-in and learned, and a built-in always wins an id
-collision — installing a skill can never shadow a curated one. Installed scripts
-are treated as validated (they were verified at install), but still run through
-the normal per-action consent gates.
+verification leaves any previously installed version untouched.
+
+Discovery merges installed skills between built-in and learned, and a built-in
+always wins an id collision — installing a skill can never shadow a curated one.
+Installed scripts are treated as validated, since they were verified at install,
+but they still run through the normal per-action consent gates.
## Frontmatter
@@ -111,9 +112,11 @@ Three kinds of app-specific facts deserve explicit statements:
## Compactness
Several skills can load in the same turn, so every line costs context. Be
-ruthless: a skill is the few things an expert knows about THIS app that aren't
-obvious, not a tutorial. Built-in packs run 11–65 lines; treat ~65 as a ceiling,
-not a target, and if you're adding to the longest skill, cut something first.
+ruthless: a skill is the few things an expert knows about *this* app that aren't
+obvious, not a tutorial. Most built-in packs stay under 65 lines; only the
+richest few run longer, and even those fight for every line. Treat 65 as a soft
+ceiling, not a target — if you're adding to one of the longest packs, cut
+something first.
Prefer short rules, exact commands, known pitfalls, and script statuses; cut
long examples (one beats five), edge-case inventories, restated tool schemas,
@@ -142,8 +145,9 @@ A skill may ship validated scripts in a `scripts/` subfolder — discovery picks
them up automatically, with no frontmatter line. The script id is the slugged
relative path without extension
(`scripts/save-note.applescript` → `scripts-save-note`).
-AppleScript, shell, and JavaScript files are recognized; bundled scripts count
-as validated, learned ones start as pending validation.
+AppleScript, shell, JavaScript, Python, and Swift files are recognized. Bundled
+and installed scripts count as validated; learned ones start as pending
+validation.
The agent runs scripts with `skill_run` instead of reinventing the steps, so
the body documents each one: id, expected input, what it does, the statuses it
@@ -153,7 +157,7 @@ allowed:
```text
`skill_run` with `scriptID=scripts-save-note`, input = the note body.
`status=saved` → verified, report the note title.
-`status=error` → read `hint=`; do not rerun the same input.
+`status=error` → the script's output says why; do not rerun the same input.
```
Scripts are bounded and deterministic: one search-and-play, one note created,
diff --git a/docs/guides/background-input.md b/docs/guides/background-input.md
index 37bb0ad6..7e7a9e5d 100644
--- a/docs/guides/background-input.md
+++ b/docs/guides/background-input.md
@@ -20,23 +20,22 @@ returns a typed preference the rest of the system obeys.
```text
understand the turn ──► preference: background (default) or foreground
│
- per action:
- ▼
- guard: is background safe for this target? ┌─ no ─► foreground: raise the
- • the turn asked for background │ app (one recovery), act
- • the window is a safe surface │ through the real cursor
- • it is on-screen (so on the active Space) │
- │ yes │
- ▼ │
- deliver to the target, no raise, no cursor move ◄─┘ (foreground is always available)
+ ▼ per action
+ guard: is background safe for this target?
+ • the turn asked for background
+ • the window is a safe surface
+ │
+ ├─ no ──► foreground: raise the app (one recovery), act through the cursor
+ │
+ ▼ yes
+ deliver to the target — no raise, no cursor move
• Accessibility action — for a control that advertises one
• event to the process — for clicks, scroll, drag, keystrokes
```
The understanding step decides *whether* to run in the background; the guard
decides *whether that is safe* for the resolved window; the delivery lane
-decides *how* the action reaches the app. A reader who remembers only that
-split makes correct decisions.
+decides *how* the action reaches the app.
Because a target window is resolved from the on-screen window list, a resolved
target is already on the active desktop and not minimized — so the guard needs
@@ -57,11 +56,11 @@ control regardless of where it sits on screen. The event lane covers everything
the Accessibility lane can't express, including web-page content and text
entry.
-## Delivery Falls Back, Never Flags
+## Delivery Fallback
Background event delivery tries the richest path first and degrades on its own.
-There is no switch to turn it on; it is enabled by detecting whether the system
-entry points it needs are present.
+There is no switch to turn it on: it runs when the system entry points it needs
+resolve, and steps down a path when they don't.
1. The SkyLight path — cursor-neutral delivery that carries the live-input
signal and the key-authentication envelope some apps (Chromium, Electron)