ai-infrastructure-hugg…
Hugging Face Inference SDK patterns for TypeScript/Node.js — InferenceClient setup, chat completion, text generation, streaming, embeddings, image generation,…
Tauri 2.x multi-window creation, event system, window state persistence, parent/child and modal windows
$ npx -y skills add agents-inc/skills --skill desktop-multiwindow-tauri --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/desktop-multiwindow-tauriContext preview
The summary Claude sees to decide when to auto-load this skill.
Tauri 2.x multi-window creation, event system, window state persistence, parent/child and modal windows
name: desktop-multiwindow-tauri description: Tauri 2.x multi-window creation, event system, window state persistence, parent/child and modal windows
> **Quick Guide:** Create windows from JS with `new WebviewWindow(label, options)` or from Rust with `WebviewWindowBuilder`. Communicate across windows using events: `emit()` broadcasts globally, `emitTo(label, event, payload)` targets a specific window, `emit_filter()` targets multiple windows by predicate. Always call the unlisten function returned by `listen()`. Use `tauri-plugin-window-state` to persist window position/size across sessions. Window labels must be unique and are used for both event targeting and permission scoping. > > **Current version:** Tauri 2.x (stable). Multi-webview in a single window requires the `unstable` feature flag.
---
<critical_requirements>
> **All code must follow project conventions in CLAUDE.md** (kebab-case, named exports, import ordering, `import type`, named constants)
**(You MUST give every window a unique label -- labels identify windows for event targeting, permissions, and retrieval)**
**(You MUST always call the unlisten function returned by `listen()` / `once()` -- leaked listeners cause memory leaks in long-running apps)**
**(You MUST check if a window already exists before creating it -- duplicate labels cause runtime errors)**
**(You MUST add window labels to capability file `windows` array -- windows without permissions cannot use plugins or core APIs)**
**(You MUST use `@tauri-apps/api/event` for global events and `@tauri-apps/api/webviewWindow` for window-scoped events -- mixing them causes missed events)**
</critical_requirements>
---
**Auto-detection:** WebviewWindow, WebviewWindowBuilder, emit_to, emitTo, emit_filter, EventTarget, window label, multi-window, onCloseRequested, tauri-plugin-window-state, parent window, modal window, WebviewBuilder, add_child, getCurrentWebviewWindow, window.listen, window.emit, cross-window communication
**When to use:**
**When NOT to use:**
**Key patterns covered:**
**Detailed resources:**
---
<philosophy>
Tauri's multi-window architecture is built on two key concepts: **window labels** for identification and **events** for communication.
Every window has a unique string label assigned at creation. This label is used everywhere: event targeting with `emitTo`, permission scoping in capability files, and retrieval with `app.get_webview_window(label)`. Labels are the window's address.
The event system follows a pub-sub model with three tiers of targeting:
1. **Global** (`emit`) -- all listeners in all windows receive the event 2. **Targeted** (`emitTo`) -- only listeners in the specified window receive the event 3. **Filtered** (`emit_filter`) -- listeners matching a predicate receive the event
**When to use multi-window patterns:**
**When NOT to use multi-window:**
</philosophy>
---
<patterns>
Create windows from JavaScript or Rust. Always check if the window exists first to avoid duplicate-label errors.
import { WebviewWindow } from "@tauri-apps/api/webviewWindow";
const SETTINGS_WINDOW_LABEL = "settings";
const SETTINGS_WIDTH = 600;
const SETTINGS_HEIGHT = 400;
// Check if already open, focus it instead of creating duplicate
const existing = await WebviewWindow.getByLabel(SETTINGS_WINDOW_LABEL);
if (existing) {
await existing.setFocus();
return;
}
const settingsWindow = new WebviewWindow(SETTINGS_WINDOW_LABEL, {
url: "settings.html",
title: "Settings",
width: SETTINGS_WIDTH,
height: SETTINGS_HEIGHT,
resizable: false,
center: true,
});
settingsWindow.once("tauri://created", () => {
console.log("Settings window creatThe official skills marketplace for Agents Inc. 150+ skills covering everything from React and Prisma to Redis, ElevenLabs, and infrastructure tooling. Pick the skills that match your stack and install them via Claude Code. Need more control?
Repo: agents-inc/skills
Hugging Face Inference SDK patterns for TypeScript/Node.js — InferenceClient setup, chat completion, text generation, streaming, embeddings, image generation,…
LiteLLM proxy server setup, TypeScript client patterns via OpenAI SDK, model routing, fallbacks, load balancing, spend tracking, virtual keys, and production…
Serverless GPU compute platform for AI model deployment — web endpoints, GPU functions, model serving, and TypeScript client patterns
Local LLM inference with the Ollama JavaScript client -- chat, streaming, tool calling, vision, embeddings, structured output, model management, and…
Replicate SDK patterns for TypeScript/Node.js -- client setup, predictions, streaming, webhooks, file handling, model versioning, deployments, and training
Together AI SDK patterns for TypeScript — client setup, chat completions, streaming, structured output, function calling, embeddings, image generation,…