/fused-render:fused-render-authoringfrom Fused Render
Guides authoring fused-render apps with paired .html view and .py data files, covering runPython wiring, URL params, preview mode, and traceback debugging.
Ships in Fused Render. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
View = sibling pair: .html (UI) + .py (data). Explorer renders html in iframe, injects window.fused (never <script src> runtime), page calls local Python via fused.runPython. UI state lives in URL params → refresh-proof, bookmarkable. Plain HTML/CSS/JS. No framework, no build step.
When free to start on either side, write the .html first. User sees layout + controls within minutes; a .py is invisible until wired.
draw() over stub/placeholder data, no runPython yet. Calling a .py that doesn't exist = traceback overlay or blank view — opposite of feedback./explorer/embed/<path>, see Testing) so they can watch it grow.main(), then swap stub → fused.runPython. Wiring discipline (Canonical wiring) holds from the first pass — stub data only changes WHERE values come from, not the param flow._preview=1 placeholder — keep it cheap.<head>, first 4 KiB)<meta name="fused-app" />
<meta name="fused-api-version" content="N" />
fused-app = ONLY thing making folder an app. No marker → never in /apps, never registered.fused-api-version: copy N from fused_render/app_starter/index.html. Missing tag = version 0. Migration → fused-render-api-migration.fused-app-id (optional, content="<kebab name>-<8 hex>"): app's stable identity, written at app creation (older apps: on first .fused export) by fused_render/app_id.py, same id across every later export = "update of this app". Never write, edit or copy it by hand.icon.svg (or icon.png, lower priority, clipped to rounded square) beside entry page = sidebar glyph + card mark + favicon → fused-render-app-icon.main()One plain fn main(**params). Rules:
limit: int, bool accepts "true/1/yes/on"). Unannotated = raw string.df.to_dict("records"); datetime/Decimal/numpy → cast..py.DEFAULT_TIMEOUT, fused_render/executor.py), no override. Longer work → fused-render-jobs.print() → browser console as [python].A bot (OpenBot's py action) can run a .py beside the page without the page, through the same /api/run the page uses. It learns what each file does from the app's SKILL.md at the folder root, beside index.html — nothing parses the code. No SKILL.md, or no section for a file → a bot cannot call it. Every app with a .py that has a main ships one.
---
name: expense-tracker
description: Local expense ledger. Add an entry, total spend by category or month.
approve: [add_entry.py] # optional: own-build bots still ask before these
---
# Expense tracker
Data lives in .fused/data/ledger.json; the page and these files share it.
## summary.py
Totals per category for one month. Reads the ledger; writes nothing.
- Args: `month` (str, "YYYY-MM", default: current month)
- Returns: `{"month": str, "total": float, "by_category": {name: float}}`
- Example: `{"action":"py","app":"expense-tracker","file":"summary.py","args":{"month":"2026-09"}}`
## add_entry.py
Appends one expense to the ledger. Writes .fused/data/ledger.json.
- Args: `amount` (float, required), `category` (str, required), `note` (str, default "")
- Returns: `{"ok": true, "id": str}`
- Example: `{"action":"py","app":"expense-tracker","file":"add_entry.py","args":{"amount":12.5,"category":"food"}}`
name (folder slug), description (one line a bot reads in its app list: what the app does for it). approve: lists files that change or delete something the user cares about; it only adds a pause, never removes one.## <file>.py heading per callable file — the exact filename; that heading is the only thing a bot parses. Helpers without main get no heading.main's signature — the runner silently drops an arg main does not take and fails a missing required one (ParamError), so a stale section means a bot call that quietly does the wrong thing..py. Add, rename or delete a file → add, rename or delete its section.main(**params) (the runner binds only main; annotations coerce), defaults on every param, JSON-native return, ≤ 60 s, secrets never in params (read them from .fused/data or the keychain inside main). A resident daemon (fused-render-background-apps) is not callable this way — say so in prose.Run: the page's own POST /api/run {py, html, params} → {ok, result, error, stdout, duration_ms}.
A pyproject.toml is always expected — App Doctor's pyproject row fails a folder that lacks one. Without one, the app interpreter falls back to stdlib plus exactly this bundled set (repo pyproject.toml [bundled] extra minus botocore/google-auth, plus pyarrow/duckdb/httpx from core [project] deps). dependencies should list the app's own third-party imports — NOT this bundled set; an app that only imports from it declares an empty dependencies list, which keeps it on that zero-install interpreter.
numpy pandas pyarrow duckdb openpyxl msgpackpillowpython-pptx fpdf2 (import name fpdf)requests httpxdrain3Same set the standalone Render App (fused-render-app, LEGACY_DEPS in fused_render_app/env.py) gives a pyproject.toml-less app — keep the two in step. botocore / google-auth are on fused-render's interpreter but NOT in this list: Render App lacks them, so always declare them in a folder pyproject.toml.
Anything else needs folder pyproject.toml (project root only; add [tool.uv] package = false). Facts:
pyproject.toml counts.uv.lock.uv sync by hand — skips readiness marker + consent (fused_render/projectenv.py).# /// script headers IGNORED. Delete; move deps into pyproject.toml.POST /api/run with throwaway main() returning importlib.metadata.version(...). Don't guess..fused/Auto-created at app root. Convention, no helper API — build paths off os.path.dirname(os.path.abspath(__file__)):
.fused/data/ — state app owns, cannot rebuild. NOT beside index.html, NOT ~/.myapp, NOT tmp..fused/cache/ — rebuildable derived bytes. Deleting must cost only time. No auto-sweep — cap yourself..fused/meta.json — {version, app_dir, created_at}. app_dir ≠ actual path → folder moved; distrust stored absolute paths.Cache aggressively. Fresh subprocess + 60 s kill → memoize fetches/parses/aggregations to .fused/cache/. Key = hash of all inputs with version segment (bump on shape change). Write atomic (os.replace temp file — calls overlap). Unreadable entry = miss. Cache expensive step, not main() wholesale. Bytes (PNG/parquet) → cache file, hand page fused.rawUrl(path).
window.fused| Call | Notes |
|---|---|
await fused.runPython(py, params, opts?) | Runs main(**params); path relative to html. Rejects with Error carrying .type/.message/.traceback/.stdout. Stale-cancel by default, keyed per pyPath: new call aborts prior in-flight one, superseded promise never settles. opts.key regroups; opts.key: null = full concurrency; opts.signal = own AbortSignal. |
fused.params.get/getAll/set/onChange | Strings only — set("n", 5) THROWS, do String(n). set = replaceState then onChange. _-prefixed keys are shell's: set throws, get undefined (_file readable exception). |
await fused.readFile(path) | UTF-8 text. |
await fused.stat(path) | {path, name, is_dir, size, mtime, writable, remote, templates} (+ template_error). Size-guard big reads; grab mtime before edits; check remote. |
await fused.writeFile(path, text, opts?) | Atomic. opts.expectedMtime → rejects .type==="conflict" on stale disk; opts.create → rejects .type==="exists" (race-free create); readonly → .type==="readonly". Resolves with fresh stat — keep its mtime. |
fused.rawUrl(path) | Sync URL for raw bytes — img/video/embed/download. Also resolves relative sibling assets (pitfall below). |
fused.ai.* | → fused-render-ai. |
fused.fileIndex.search/query | Machine-wide file index — use instead of walking fs → fused-render-index. Full fused-render only (Render App below). |
fused.capture.* | Native screen/mic/screenshot → fused-render-capture. |
await fused.s3.sign("s3://bucket/key") | {url, expires_at}: HTTPS URL that reads that one object (Range works; bucket answers CORS) — stream it (DuckDB read_parquet(url), GDAL /vsicurl/, fetch) instead of downloading. Server decides what is signed; today only fused-asset, public, expires_at: null. Keep the s3:// address as identity (fused.params, cache keys). Sign in the page and pass the URL to your runPython (it lands in the call log — fine for today's public URLs); a long-lived Python process signs itself with templates/shared/fused_s3.py (fused_s3.sign, is_s3, expired). Re-sign on 403 or near expires_at. Rejects with .status/.code (disabled = Canvases off). |
fused.workbench.udf(ref).run(params?, {format, cache}) | Run a Fused UDF with the user's fused login (local only). ref: {file: "/abs/udf.py"} (canvas node file; any other .py adds env), {canvas, name, env} or "canvas/udf". The run: await run.saved (last good answer, at once, or null), await run (fresh Result: url, contentType, source, json(), text(), blob()). format: auto (Fused's html/png), html, png, json (rows, geometry as WKT), parquet. cache: auto / prefer-saved / fresh. Batch/map UDFs and results over 50 MB are asked about by the runtime itself; {confirm: false} declines instead. Errors carry .code (udf_error has .line). handle.schema() = its params. Show url HTML only in a sandboxed frame. |
fused.trackJob(spec) | Report long work to download manager; never rejects → fused-render-jobs. |
fused.tasks.* | List/create/follow up/cancel/watch the app's Claude tasks (headless, returns a handle); ui() gives an iframe URL of the shell's Tasks page → fused-render-tasks. |
fused.bots.* | See the Bots on this Mac (Super Bot and the experts included) and give one a message with images; the turn handle follows that task to its result → fused-render-bots. |
fused.daemon.* | Folder's warm worker / resident daemon → fused-render-background-apps. |
fused.terminal.open({cwd}?) / .run(command, {cwd}?) | Opens the shell's terminal drawer, optionally cd'd into cwd and/or running command. Rejects (Error) with no shell host (standalone/embed page, hosted export). |
fused.env | "local" vs "hosted" (exported). |
fused.autoReload(false) | Kill reload-on-file-change (in-page editors). Render App: autoReload(true) THROWS (no live reload there). |
Render App (standalone fused-render-app: same bridge, subset runtime). Session is on it when the system prompt says so, the app is a .fused bundle or a folder under ~/Fused/local/, or a call throws <name> is not supported on Render App. There: fused.fileIndex and fused.snapshot do not exist (no stubs — reading them throws that sentence); fused.autoReload(true) throws; fused.capture is macOS-only, no browser client recorder; runPython cap is 600 s, not 60; no fused-render calls CLI (Verifying below) — read the browser console. Everything else in the table is identical. App that needs the missing members belongs in full fused-render; don't polyfill.
runPython rejection → red traceback overlay (good default). Catch for custom UI./api/fs/* yourself (writes rejected, unstable contract)./render?path=..., NOT own dir: bare <script src="./app.js"> 404s silently (no overlay, page inert). Use fused.rawUrl("app.js"). Blank dead view → check console for 404 first.Params ARE state. Controls write params; onChange = single re-render path; draw() reads params (never control) → refresh/bookmark reproduces view. Values to runPython stay strings — annotations coerce. Worked example: fused_render/templates/fusedapp/template.html.
_preview=1)Shell renders pages nobody opened: /apps cards, listing peeks, hovers — stamped _preview=1 (+_nofocus=1), many boot at once. Ungated boot = N cold starts on home page.
location.search alone answers false for a framed page and boots it. Copy this (the runtime's own selfOrAncestorHasFlag, fused_render/static/runtime.js):function isPreview() {
if (new URLSearchParams(location.search).get("_preview") === "1") return true;
try {
let w = window;
while (w.parent && w.parent !== w) {
w = w.parent;
if (new URLSearchParams(w.location.search).get("_preview") === "1") return true;
}
} catch (e) { /* cross-origin ancestor: the climb ends here */ }
return false;
}
?_preview=1&_nofocus=1 to iframes you mount._noopen=1 ≠ preview — real interactive surface, just not counted as "open". Ignore in isPreview().fused.daemon.* rejection + URL writes; rest is yours to gate.Iframe = blank canvas; shell follows OS/pref light-dark. Quick answer: data-fused-theme="shell" on <html>, two :root token blocks against data-theme. Simple apps (forms, dashboards, tools): define colours as var(--fused-bg, fallback) etc. so they follow the selected colour preset too. Full rules → fused-render-theming.
Same html, opened FOR target file: read-only _file param carries path. Reader .py only when Python adds value; text → readFile, media → rawUrl. Built-in sources: fused_render/templates/<name>/ (see xlsx/; server serves staged copy ~/.fused-render/.core-templates/). Extension → mode list: fused_render/templates/registry.json. User overrides → fused-render-custom-templates.
Real browser against the server that is ALREADY running. Never assume a port — 1777 is only a bare fused-render on main; the desktop app picks a free port, a worktree gets a per-branch one, Render App (fused-render-lite) uses 2777. Find the origin:
$FUSED_RENDER_ORIGIN — exported by both servers to every process they spawn (a session opened from the app has it).~/.fused-render/server.json (Render App: ~/.fused-render-app/server.json) — origin field, for a terminal session. Probe <origin>/api/config before trusting it; a crashed server leaves the file behind.fused-render --no-browser --port <free>; Fused Render: open -a "Fused Render", it writes server.json).URLs under that origin:
/explorer/embed/<abs path, leading slash dropped, segments URL-encoded> — chrome-free. Default for testing./explorer/view/<path> — full shell chrome.?_file=<abs target>.Render App only (no fused-render installed — origin on 2777, server.json under ~/.fused-render-app): its embed equivalent is /render?path=<abs html> — path is the entry FILE (<app dir>/index.html), never the bare folder; any absolute .html, runtime.js injected, relative .py resolved against it, env picked from the folder's pyproject.toml, params after path in the URL. /explorer/* there is the chat shell, not a view. Same render → interact → refresh loop; verification is the browser console (see below).
Loop: render → interact → URL updates → hard refresh → identical view.
Cannot run page JS from terminal. Full fused-render only — Render App keeps no call log; there, ask the user for the browser console (uncaught errors and unhandled runPython rejections land there) and treat a blank page as JS died. After user opens page:
fused-render calls --page <abs html> --since 15m # --failed, --json, --follow
Read digest. Zero records + visible placeholder = preview-gated, fine. Zero records + blank page = JS died pre-boot (look for page error = window.onerror). error = Python raised (traceback + params in record). Way more calls than interactions = onChange/set render loop. High stale = normal for slider drags only. Raw store: ~/.fused-render/logs/<app>/*.calls.jsonl.
params.set non-string → throws. _-prefixed page param → throws/collides.history.replaceState → drops shell _ keys, breaks pane.open(...,"w") cache write; unversioned cache key; irreplaceable bytes in cache/.pyproject.toml.fused.fileIndex.query (fused-render-index). Render App has no index: walk in the .py, cache the result.fused.ai.text( in a page meant for HOSTED export → exporter rejects textually, env guard no help. A .fused app file allows it (fused-render-ai).fused-render calls (Render App: without the console) — blank-JS and failing-Python look identical without log.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub fusedio/fused-render --plugin fused-render14 skills in this plugin
/fused-render-aiUse when page or .py calls fused.ai (text/image/video/speech/transcribe/embed/decide/vision), picks model/provider, or AI call rejects./fused-render-api-migrationUse when migrating app to current fused page API — Migrate task, stale/missing fused-api-version meta, "fused.ai is not a function" after upgrade./fused-render-app-doctorUse when reviewing or sharing an app — checking for secrets, hardcoded paths, stray generated files, missing structure, or a stale API version./fused-render-app-iconUse when adding/changing/fixing app's icon.svg or icon.png — sidebar glyph, app card mark, browser-tab favicon./fused-render-background-appsUse when app folder needs Python alive after page closes — warm worker, resident daemon, [tool.fused-render.app], fused.daemon, autostart, worker "dying" after idle./fused-render-botsUse when a page lists the Bots on this Mac, sends one a message or an image, follows that task to its result, or needs to know why a send was refused — fused.bots. Not for fused.tasks (Claude Code sessions) or fused.ai (one model call).Other plugins' skills for the same job