tauri-dev

Comprehensive Tauri v2 development skill for building desktop and mobile applications with Rust backends and web frontends. Use when writing, reviewing, or refactoring Tauri v2 code to ensure correct patterns and best practices. Triggers on tasks involving Tauri commands/IPC, tauri.conf.json configuration, permissions/capabilities, plugins (fs, http, shell, dialog, store, sql, updater), window management, mobile development (Android/iOS), app distribution, code signing, performance optimization, or migration from Tauri v1.

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "tauri-dev" with this command: npx skills add zef-computers/drivers/zef-computers-drivers-tauri-dev

Tauri v2 Development

Comprehensive development guide for Tauri v2 desktop and mobile applications. Contains 24 rules across 8 categories prioritized by impact, plus 9 deep-dive reference guides. Tauri apps use Rust backends with web frontends rendered in OS-native webviews. Binary sizes 2.5-6 MB.

When to Apply

Reference these guidelines when:

  • Creating new Tauri v2 projects or adding features
  • Implementing Rust commands and frontend IPC
  • Configuring permissions, capabilities, or CSP
  • Installing or creating Tauri plugins
  • Customizing windows, system tray, or menus
  • Building for mobile (Android/iOS)
  • Distributing apps (bundling, signing, updating)
  • Optimizing binary size, build speed, or runtime performance
  • Debugging or testing Tauri applications

Rule Categories by Priority

PriorityCategoryImpactPrefix
1Commands & IPCCRITICALipc-
2State ManagementCRITICALstate-
3Error HandlingHIGHerror-
4SecurityHIGHsecurity-
5Window ManagementMEDIUMwindow-
6Plugin UsageMEDIUMplugin-
7PerformanceMEDIUMperf-
8DistributionLOW-MEDIUMdist-

Quick Reference

1. Commands & IPC (CRITICAL)

  • ipc-async-commands - Use async commands with owned types (String not &str)
  • ipc-invoke-error-handling - Always handle invoke() rejections on frontend
  • ipc-batch-operations - Batch IPC calls to reduce round-trips
  • ipc-binary-response - Use tauri::ipc::Response for large binary data
  • ipc-channels-streaming - Use Channel<T> for streaming/progress updates

2. State Management (CRITICAL)

  • state-mutex-not-arc - Use Mutex without Arc (Tauri wraps in Arc internally)
  • state-lock-scope - Minimize lock scope, never hold across .await
  • state-rwlock-reads - Use RwLock for read-heavy state

3. Error Handling (HIGH)

  • error-typed-errors - Use thiserror with manual Serialize for structured errors
  • error-frontend-handling - Propagate error context with kind/message to frontend

4. Security (HIGH)

  • security-deny-by-default - Configure capabilities before production deployment
  • security-scope-filesystem - Scope filesystem access to app directories
  • security-platform-capabilities - Use platform-specific capability files
  • security-csp-config - Configure Content Security Policy properly

5. Window Management (MEDIUM)

  • window-async-creation - Create windows asynchronously to avoid deadlocks
  • window-custom-titlebar - Implement custom title bars with drag regions
  • window-hide-to-tray - Hide window to system tray on close

6. Plugin Usage (MEDIUM)

  • plugin-four-step-install - Complete all 4 plugin installation steps
  • plugin-clipboard-permissions - Clipboard has no default permissions
  • plugin-sql-execute - SQL default excludes write operations

7. Performance (MEDIUM)

  • perf-release-profile - Optimize Cargo release profile for small binaries
  • perf-dev-build-speed - Separate rust-analyzer target directory
  • perf-unused-commands - Remove unused commands from binary (Tauri 2.4+)

8. Distribution (LOW-MEDIUM)

  • dist-code-signing - Configure code signing for all target platforms

How to Use

Read individual rule files for detailed explanations and code examples:

rules/ipc-async-commands.md
rules/security-deny-by-default.md
rules/perf-release-profile.md

Each rule file contains:

  • Brief explanation of why it matters
  • Incorrect code example with explanation
  • Correct code example with explanation
  • Impact rating and tags

Deep-Dive References

For comprehensive documentation beyond rules, load these as needed:

ReferenceContent
references/getting-started.mdPrerequisites, project creation, Vite setup, v1→v2 migration
references/commands-ipc.mdAll command patterns, events, channels, state, serialization
references/plugins.mdAll ~35 official plugins, custom plugin creation
references/security.mdPermissions (TOML), capabilities (JSON), CSP, ACL, isolation
references/windows-webview.mdWindowConfig, effects/vibrancy, tray, menus, WebView API
references/mobile.mdAndroid/iOS setup, mobile plugins, signing, app stores
references/distribution.mdBundling, signing, updater, sidecars, CI/CD
references/config-testing.mdtauri.conf.json schema, env vars, mockIPC, WebDriver
references/performance.mdBinary size, memory, startup, IPC speed, build optimization

Essential Patterns

Project Structure

my-app/
├── src-tauri/
│   ├── Cargo.toml              # Rust dependencies
│   ├── tauri.conf.json         # Main config
│   ├── capabilities/           # ACL capability files (JSON)
│   │   └── default.json
│   ├── src/
│   │   ├── lib.rs              # Builder, plugins, commands
│   │   └── main.rs             # Entry point
│   └── icons/
├── src/                        # Frontend (React/Vue/Svelte)
├── package.json
└── vite.config.ts

Minimal Command + Invoke

#[tauri::command]
async fn greet(name: String) -> Result<String, String> {
    Ok(format!("Hello, {}!", name))
}

// lib.rs
tauri::Builder::default()
    .invoke_handler(tauri::generate_handler![greet])
    .run(tauri::generate_context!())
import { invoke } from '@tauri-apps/api/core';
const greeting = await invoke<string>('greet', { name: 'World' });

Plugin Installation (4 Steps)

cargo add tauri-plugin-fs --manifest-path src-tauri/Cargo.toml
bun add @tauri-apps/plugin-fs
// lib.rs
tauri::Builder::default().plugin(tauri_plugin_fs::init())
// capabilities/default.json → permissions array
"fs:default", "fs:allow-read-text-file"

Capability File

{
  "$schema": "../gen/schemas/desktop-schema.json",
  "identifier": "default",
  "windows": ["main"],
  "permissions": [
    "core:default",
    "fs:default",
    { "identifier": "fs:scope", "allow": [{ "path": "$APPDATA/**" }] }
  ]
}

Decision Tables

IPC Method

NeedUse
Request/responseCommand (invoke)
Notify frontendEvent (emit)
Stream dataChannel (Channel<T>)
Large binarytauri::ipc::Response

State Wrapper

PatternUse
Read-heavyRwLock<T>
BalancedMutex<T>
Across .awaittokio::sync::Mutex<T>

Full Compiled Document

For the complete guide with all rules expanded: AGENTS.md

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

Coding

stripe-dev

No summary provided by upstream source.

Repository SourceNeeds Review
General

stripe-connect

No summary provided by upstream source.

Repository SourceNeeds Review
General

stripe-money-management

No summary provided by upstream source.

Repository SourceNeeds Review