npx skills add ...
npx skills add factory-ai/factory-plugins --skill droid-control
npx skills add factory-ai/factory-plugins --skill droid-control
Control terminal TUIs and web/Electron apps for testing, demos, QA, and computer-use tasks. Use when you need to automate a CLI, drive a browser, record a demo, or capture proof artifacts.
Automate terminals and browsers. Three routing decisions, then atoms guide you the rest of the way.
wait / wait-idle. Never substitute fixtures or mocked data.tctl is the ONLY way to launch recorded sessions. tctl manages recording by wrapping asciinema rec around the PTY — raw tuistory has no recording capability and never will. Never call tuistory launch directly; unknown flags crash tuistory-relay. Always resolve TCTL to its absolute filesystem path before use, especially when delegating to workers (they don't inherit ${DROID_PLUGIN_ROOT})./tmp/tctl-sessions/). At the start of every workflow, generate a run ID (RUN_ID=$(date +%s)-$$ or similar) and use it as a prefix for all session names and a scoped temp directory for all output files:
-s demo, -s before, -s after — they will collide with concurrent runs.Three independent lookups. Do all three, then load the union of skills they produce.
| Target | Load these skills |
|---|---|
Droid CLI (droid-dev, droid exec) | droid-cli + tuistory backend via ${DROID_PLUGIN_ROOT}/bin/tctl |
| Droid CLI (real terminal proof) | true-input + droid-cli |
| Other terminal TUI | tuistory backend via ${DROID_PLUGIN_ROOT}/bin/tctl |
| Other terminal TUI (real terminal proof) | true-input |
| Web page or Electron app | agent-browser |
| Native desktop GUI app | desktop-control |
| Raw terminal byte sequences | true-input + pty-capture |
tuistory is the default for terminal work. Use true-input only when you need real terminal rendering evidence. On Linux, desktop-control rides upstream's pre-release tier -- its platform file documents the Wayland/AT-SPI/input caveats and when to fall back to agent-browser or true-input.
Every workflow passes through stages. Load the atoms for each stage you'll use.
| Stage | Skill | When to load |
|---|---|---|
| Capture | capture | Always -- every workflow records or captures something |
| Compose | compose | When the deliverable is a produced artifact (video, annotated screenshots, comparison image) |
| Verify | verify | Always -- every deliverable gets checked against commitments |
Only relevant when compose is loaded.
| Artifact need | Also load |
|---|---|
| Showcase polish (window chrome, branded frame, cinematic background) | showcase |
| Effects and keystroke overlays | (compose handles this — they're fields in the Remotion props JSON) |
Commands declare what to produce. Atoms own how.
Default: single. One clip showing the target/final state. Pick this unless the deliverable is fundamentally a comparison.
| Case | Layout |
|---|---|
| Brand-new feature (no meaningful prior state) | single |
| Bug fix, single-clip proof of the working path | single |
| Walkthrough / tutorial / readme hero | single |
| Regression proof (broken vs fixed) | side-by-side |
| Behavior-preserving refactor (visual parity is the point) | side-by-side |
| User explicitly asks for a comparison | side-by-side |
Do not synthesize a "before" state to justify side-by-side. If there is no real baseline, use single.
The parent agent plans and orchestrates. Mechanical work runs in worker subagents via the Task tool. This keeps the parent's context clean and enables parallelism.
| Task | Delegate? | Why |
|---|---|---|
| Capture clip (single layout) | YES | Worker runs the interaction script end-to-end and returns the .cast path |
| Capture both clips (comparison layout) | YES — run_in_background=true for each | Branches are independent; run in parallel |
| Remotion render | YES | Needs only props JSON, clip paths, output path. Runs render-showcase.sh (handles .cast conversion, fidelity profiles, duration detection, cleanup) |
| Planning, interaction scripting | NO — parent | Requires PR context and editorial judgment |
| Layout and prop construction | NO — parent | Requires editorial decisions about effects, timing, labels |
| Verification | NO — parent | Requires commitment context |
| Single ffprobe / file-existence check | NO — inline | Too trivial for subagent overhead |
Step 0: Resolve paths and generate a run ID. Workers don't inherit ${DROID_PLUGIN_ROOT}. Resolve once, paste everywhere:
Use ${RUN_DIR} for all output files (recordings, props, rendered video). Use ${RUN_ID}- as a prefix for all session names. Never use bare names like -s before or hardcoded paths like /tmp/before.cast.
Give workers exact commands with the resolved absolute paths — not abstract instructions, not tuistory, not ${DROID_PLUGIN_ROOT}. The parent does the thinking; the worker executes:
Only applicable when the Layout default table above selects side-by-side. For a single layout, launch one capture worker and skip this section.
For before/after comparison demos, launch both capture workers simultaneously:
Terminal drivers use the unified tctl wrapper. agent-browser and desktop-control have their own CLIs (agent-browser, cua-driver) and do not use tctl.
Drivers can be combined in one workflow — e.g., tctl for a CLI and agent-browser for a web UI it interacts with.
Deterministic recipe for reproducing degraded transcript tails in the droid CLI — stranded live tool rows and queued steering messages — without waiting for a slow model turn. The trick: a slow PreToolUse hook pins a tool in its executing state for as long as you need.
Scratch project. Create a throwaway directory (never a real repo — the hook fires on every matching tool call) with a project-local hook that sleeps:
Pick a sleep long enough to interact mid-hook (60–180s) and a matcher for a tool the prompt will reliably trigger (TodoWrite fires on any multi-step ask).
Launch with --cwd pointed at the scratch project — --repo-root stays on your dev worktree so droid-dev provenance still records the code under test:
Trigger the hook, then degrade the tail while the tool row shows executing:
press escape) — strands the live tool row: it never resolves to a completed/canceled state in the transcript tail.type "..." + press enter) — the steering message queues behind the executing tool instead of interleaving.Gotcha: dev-scope hook settings can silently disable project hooks. If the tool completes instantly, run /hooks in the session and check the "Hooks enabled" toggle before debugging the hook config itself.
| Stage | Platform | Required | Optional |
|---|---|---|---|
| tuistory | All | tuistory, asciinema, agg | tmux |
| true-input | Linux/Wayland | cage, wtype, Wayland terminal, /dev/dri/* | grim, wf-recorder |
| true-input | Windows (KVM) | libvirt, qemu, KVM VM with SPICE + SSH, DROID_VM_* env vars | virt-manager |
| true-input | macOS (QEMU) | qemu, socat, macOS VM with SSH, DROID_MAC_* env vars | — |
| agent-browser | All | agent-browser (+ agent-browser install) | — |
| desktop-control | All | cua-driver (+ daemon via cua-driver serve; macOS also cua-driver permissions grant) | upstream skill pack (cua-driver skills install) |
| compose | All | ffmpeg, ffprobe, agg | — |
| showcase | All | Node.js (>= 18), Chrome/Chromium | — |