Tauri v2 & Rust Desktop Best Practices (2026): IPC & Agent Skills
Tauri v2 replaced v1 allowlists with scoped capability JSON files, separate plugin crates, and strict IPC serialization. Use these rules and audited Tauri plus Rust SKILL.md repositories so coding agents ship safe cross-platform desktop apps.
Updated: 2026-11-21 · Works with Claude Code, Cursor, Codex, and Windsurf
Core Tauri v2 Best Practices
Scope every plugin permission inside src-tauri/capabilities/
Grant least-privilege capability grants per window label instead of enabling broad shell or filesystem wildcards in Tauri v2.
Global wildcard fs:allow-read-file on "**/*" for all windowsWindow-scoped capability JSON granting only $APPDATA/** pathsReturn serializable typed Result<T, AppError> from #[tauri::command]
Implement serde::Serialize on a typed error enum for Tauri commands instead of returning raw String errors or panicking inside IPC handlers.
#[tauri::command] fn read(p: String) -> String { fs::read_to_string(p).unwrap() }#[tauri::command] fn read(path: PathBuf) -> Result<String, AppError>Keep heavy Rust work off the main UI thread
Declare slow file, network, or database commands as async fn (or spawn_blocking) so the WebView stays responsive during background operations.
#[tauri::command] fn index_files() { slow_sync_walk(); }#[tauri::command] async fn index_files() -> Result<Stats, AppError> { tokio::task::spawn_blocking(walk).await?? }Manage shared Rust state via tauri::State and clean locks
Register app state with app.manage(...) and drop lock guards quickly rather than stashing global mutable statics across commands.
static mut GLOBAL_DB: Option<Connection> = None;fn query(state: tauri::State<'_, AppState>) -> Result<Rows, AppError>Verify signed updater artifacts and strict CSP before release
Sign release bundles with tauri-plugin-updater keys and configure Content-Security-Policy in tauri.conf.json before shipping binaries.
"csp": null with unsigned auto-update JSON endpointsStrict CSP + minisign updater pubkey + signed GitHub Releases manifestCheck both Rust and frontend targets on every change
Run Cargo Clippy/test in src-tauri and frontend type-checking together so IPC command signatures never drift between Rust and TypeScript.
Testing only pnpm dev without cargo clippypnpm tsc --noEmit && cargo clippy --manifest-path src-tauri/Cargo.toml -- -D warningsOpen-Source Tauri v2 Agent Skills (3)
| Skill & Publisher | Stars | Install |
|---|---|---|
Audited Apache-2.0 Tauri v2 skill guiding agents through requirements breakdown, Rust command boundaries, capability permissions, and cross-platform desktop structure. | ★ 33 | |
Audited Apache-2.0 Tauri v2 skill covering updater plugin setup, minisign key generation, latest.json release manifests, and safe update checks in macOS, Windows, and Linux builds. | ★ 33 | |
Tauri v2+ cross-platform app development with Rust backend. Use when configuring tauri.conf.json, implementing Rust commands (#[tauri::command]), setting up IPC patterns (invoke, emit, channels), configuring permissions/capabilities, troubleshooting build issues, or deploying desktop/mobile apps. Triggers on Tauri, src-tauri, invoke, emit, capabilities.json. | - |
Building with Tauri v2 and an AI coding agent?
Builderthread pairs verified skills with a private GitHub starter repo, living PRD, and MCP task board for Claude Code, Cursor, and Codex.
Questions about Tauri v2 Best Practices & Skills
How do Tauri v2 agent skills improve desktop apps built with AI?
Tauri v2 changed permissions to capabilities files, moved plugins into separate crates, and tightened IPC rules. Tauri v2 skills stop coding agents from writing obsolete Tauri v1 allowlist configs.
Should I pair Tauri skills with Rust best-practices skills?
Yes. Combine a Tauri v2 architecture or updater skill with a Rust skill like morganlinton/BeautifulRust or leonardomso/rust-skills so your coding agent writes clean Rust command handlers and valid capability manifests.
Related Skill Guides
Tauri v2 starter + MCP tasks
Ship a cross-platform Tauri app from commit one
Skip wiring native menus, deep links, auto-updates, and release builds by hand. Builderthread creates a private Tauri v2 GitHub repo with this skill installed, a living PRD, and ordered build tasks your coding agent completes over MCP.