# Tauri v2 & Rust Desktop Best Practices (2026): IPC & Agent Skills

- **Topic**: Tauri v2
- **Canonical URL**: https://builderthread.dev/skill/for/tauri
- **Parent Hub**: https://builderthread.dev/skill.md
- **Last Verified**: 2026-11-21

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.

---

## Core Tauri v2 Best Practices Checklist

### 1. 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.

- **Avoid**: `Global wildcard fs:allow-read-file on "**/*" for all windows`
- **Prefer**: `Window-scoped capability JSON granting only $APPDATA/** paths`

### 2. Return 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.

- **Avoid**: `#[tauri::command] fn read(p: String) -> String { fs::read_to_string(p).unwrap() }`
- **Prefer**: `#[tauri::command] fn read(path: PathBuf) -> Result<String, AppError>`

### 3. 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.

- **Avoid**: `#[tauri::command] fn index_files() { slow_sync_walk(); }`
- **Prefer**: `#[tauri::command] async fn index_files() -> Result<Stats, AppError> { tokio::task::spawn_blocking(walk).await?? }`

### 4. 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.

- **Avoid**: `static mut GLOBAL_DB: Option<Connection> = None;`
- **Prefer**: `fn query(state: tauri::State<'_, AppState>) -> Result<Rows, AppError>`

### 5. 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.

- **Avoid**: `"csp": null with unsigned auto-update JSON endpoints`
- **Prefer**: `Strict CSP + minisign updater pubkey + signed GitHub Releases manifest`

### 6. Check 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.

- **Avoid**: `Testing only pnpm dev without cargo clippy`
- **Prefer**: `pnpm tsc --noEmit && cargo clippy --manifest-path src-tauri/Cargo.toml -- -D warnings`

---

## Verified Skills for Tauri v2 (3)

| Skill | Publisher | License | Stars | GitHub Source | Install Command |
|---|---|---|---|---|---|
| [tauri-app-planning](https://builderthread.dev/skill/full-stack-skills/tauri-skills/tauri-app-planning.md) | Full Stack Skills | Apache-2.0 | 33 | [GitHub](https://github.com/full-stack-skills/tauri-skills/tree/main/skills/tauri-app-planning) | `npx skills add full-stack-skills/tauri-skills --skill tauri-app-planning` |
| [tauri-app-updater](https://builderthread.dev/skill/full-stack-skills/tauri-skills/tauri-app-updater.md) | Full Stack Skills | Apache-2.0 | 33 | [GitHub](https://github.com/full-stack-skills/tauri-skills/tree/main/skills/tauri-app-updater) | `npx skills add full-stack-skills/tauri-skills --skill tauri-app-updater` |
| [tauri-v2](https://builderthread.dev/skill/nodnarbnitram/claude-code-extensions/tauri-v2.md) | nodnarbnitram | See Repo | - | [GitHub](https://github.com/nodnarbnitram/claude-code-extensions) | `npx skills add nodnarbnitram/claude-code-extensions --skill tauri-v2` |

---

## Frequently Asked Questions

### 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

- [Rust](https://builderthread.dev/skill/for/rust.md) ([Web](https://builderthread.dev/skill/for/rust)): Rust Best Practices (2026): Idiomatic Rules & Agent Skills
- [TypeScript](https://builderthread.dev/skill/for/typescript.md) ([Web](https://builderthread.dev/skill/for/typescript)): TypeScript Best Practices (2026): Strict Types & Agent Skills
- [Security](https://builderthread.dev/skill/for/security.md) ([Web](https://builderthread.dev/skill/for/security)): Best Agent Skills for Application Security & Audits
- [Testing](https://builderthread.dev/skill/for/testing.md) ([Web](https://builderthread.dev/skill/for/testing)): Best Agent Skills for Automated Testing & Playwright CLI

---

## Ship With a Private Starter Repo, Living PRD & MCP Tasks

Builderthread generates a private Tauri v2 + Rust GitHub repo with native menus, OS keychain, auto-updates, living PRD, and MCP build tasks.

- Supported languages: Rust, TypeScript, React Native (Expo), Python
- Starter stacks: Next.js SaaS, Hono API, FastAPI AI, Expo mobile, Tauri Rust desktop, WXT Chrome extension
- Start now: https://builderthread.dev/auth/signup
