--- name: comfy description: Generate images, videos, audio, and 3D via ComfyUI — CLI surface, workflow creation hierarchy (template → fragment → raw JSON), domain gotchas, cloud auth, multi-stage orchestration. --- You have access to `comfy`, a local CLI that drives ComfyUI (local install or Comfy Cloud). The surface splits cleanly in two: - **Discovery** — read-only commands that answer "what's here?" (nodes, schemas, workflow slots, auth state, env). Safe to call freely. - **Execution** — state-changing commands that submit work, edit files, sign in, or install software. Read the **Ground rules** first; they cross both halves. Then the two halves are independent — you can scan only what's relevant to the task. **This is one of a skill family — skim the siblings before a big task so you know what exists, and reach for the right one rather than improvising its job:** `comfy-director` (multi-shot narrative video — story, continuity, conform), `comfy-build` (build a custom ComfyUI environment on the developer platform), `comfy-deploy` (run a build release as a serverless deployment, and stop it costing money), `comfy-custom-nodes` (write or fix a custom node pack — preferred V3, compatible V1, reference routing, widgets, validation and restart/discovery), `comfy-debug` (any failed job: error code → fix), `comfy-relay` (surface a workflow/result in chat, never leave it in /tmp). When a task spans several, load them up front instead of discovering the gap mid-render. Inside the local comfy agent (the `comfy-agent` binary on a user's machine), a permission that blocks you — a folder, a host, a shell — is a question for the user: the `comfy-agent-permissions` skill says what the agent may reach, how the user grants more, and what can never be granted. --- # Ground rules ## Output contract (the envelope) Every command emits the same JSON shape: ```json { "ok": true, "command": "...", "version": "0.0.0", "where": "local" | "cloud" | null, "data": { ... }, "error": null | { "code": "...", "message": "...", "hint": "...", "details": {...} } } ``` When `error` is present, **read the `hint` and act on it**. Don't guess. ## Curated knowledge (`data.knowledge`) Discovery commands (`generate schema|list`, `templates ls|show|get`, `nodes search|ls`, `models search`) may carry a `knowledge` object inside `data`: `models[]` (per-model `status`, `tier`, `route`, `best_for`, `pitfalls`, `routing`, `warnings`, `superseded_by`), `picks[]` (ranked models per capability, rank 1 first), `capabilities_available[]`, and on a query that matched nothing a `nudge`. Enrichment reads the cached bundle only, so a turn never waits on a fetch. `comfy launch` and `comfy skills install` refresh the cache when it has expired, and `comfy knowledge status` refreshes it on demand. An unfiltered listing carries no `knowledge` key at all: its rows are the whole catalog rather than an answer to anything. Five rules: 1. **Which model is a data question.** Ask it before choosing, rather than picking a name out of a listing. Run `comfy --json knowledge pick ""`; spelling, spacing and phrasing are normalized, and a hit is the ranked table with caveats, rank 1 first. Pass the phrase as one argument and escape it first: `$(...)`, backticks and `"` still expand inside double quotes, and those words can come from a channel you do not control. Do not dodge a miss by listing first. A miss records the gap and is still an `ok` envelope: `zero_hit: true`, a `nudge`, and `capabilities[]` carrying the ids to retry with. When the user has already named a model, run `comfy --json knowledge resolve ` instead and build what they asked for: rank is a preference, and their request outranks it. Override an explicit request only for correctness, where `status: deprecated` plus `superseded_by` means say so and use the successor. `knowledge.picks` and `knowledge.models` inside `data` carry the same rows whenever a command includes them. 2. **`available_locally: false` means "not here", not "not curated".** The row or pick is still the right answer; this install lacks the templates or nodes it resolves to. A row flagged this way also pulls in `picks[]` for the capabilities that rank it, so the highest-ranked entry *without* the flag is the runnable alternative. Say what is missing, then name that alternative. When routing is local, add `--check-local` to `knowledge pick`: it also flags an `oss` pick whose model files are missing, with `missing_models` counting them, and `comfy --json templates check