tauri
Assists with building lightweight cross-platform desktop (and mobile) applications using Tauri. Use when creating small, fast, secure apps with a web frontend and Rust backend that use the system webview instead of bundling Chromium. Trigger words: tauri, rust desktop, system webview, tauri commands, tauri plugins.
What this skill does
# Tauri ## Overview Tauri is a framework for building cross-platform desktop and mobile applications using any web framework for the frontend and Rust for the backend. By using the system webview instead of bundling Chromium, Tauri produces binaries under 10MB with 30-80MB memory usage, featuring capability-based security, type-safe IPC commands, and a plugin ecosystem for native APIs. ## Instructions - When setting up the architecture, build the UI with any web framework (React, Vue, Svelte, Solid) rendered in the system webview, and implement system access and heavy computation in Rust backend commands. - When implementing IPC, define Rust functions with `#[tauri::command]` for request-response patterns (called via `invoke()` from JS), and use events for push-style communication from backend to frontend. - When accessing native APIs, use Tauri plugins (`@tauri-apps/plugin-fs`, `@tauri-apps/plugin-dialog`, `@tauri-apps/plugin-shell`, `@tauri-apps/plugin-notification`) and define allowed capabilities in the `capabilities/` directory. - When managing security, define capability-based permissions to restrict which APIs the frontend can access, set CSP headers, and use the isolation pattern for sandboxed environments. - When building for distribution, use `cargo tauri build` to produce platform-specific installers (NSIS/MSI for Windows, DMG for macOS, AppImage/deb for Linux) with code signing and notarization. - When implementing auto-updates, use `@tauri-apps/plugin-updater` with GitHub Releases or a custom server, with signature verification to prevent tampering. ## Examples ### Example 1: Build a note-taking app with encrypted local storage **User request:** "Create a Tauri note-taking app with local file storage and encryption" **Actions:** 1. Set up a Svelte frontend with the Tauri project scaffolding 2. Implement Rust commands for reading, writing, and encrypting note files using the `aes-gcm` crate 3. Use `@tauri-apps/plugin-store` for app settings and `@tauri-apps/plugin-dialog` for file dialogs 4. Configure capability permissions to allow only the required file system paths **Output:** A lightweight note-taking app with encrypted local storage and native file dialogs, under 10MB. ### Example 2: Build a system monitoring dashboard **User request:** "Create a desktop app that shows CPU, memory, and disk usage in real time" **Actions:** 1. Define Rust commands using the `sysinfo` crate to collect system metrics 2. Use Tauri events to push metric updates from backend to frontend every second 3. Build a React dashboard with real-time charts displaying CPU, memory, and disk usage 4. Add system tray icon with quick-view menu using `@tauri-apps/plugin-tray` **Output:** A real-time system monitor with tray icon, using under 50MB of memory. ## Guidelines - Use commands for request-response patterns and events for push notifications; do not mix them. - Define all allowed APIs in `capabilities/` following the principle of least privilege. - Use `tauri::State<Mutex<T>>` for shared mutable state since Rust enforces thread safety. - Use `@tauri-apps/plugin-store` over `localStorage` for persistent data since it survives app updates. - Handle errors in Rust with `Result<T, String>` so error messages surface as rejected promises in JS. - Keep the frontend framework-agnostic since Tauri works with any web framework. - Use the auto-updater with signature verification for production apps.
Related in Web Dev
generating-lwc-components
IncludedLightning Web Components with PICKLES methodology and 165-point scoring. Use this skill when the user creates or edits LWC components, builds wire service patterns, or writes Jest tests for LWC. TRIGGER when: user creates/edits LWC components, touches lwc/**/*.js, .html, .css, .js-meta.xml files, or asks about wire service, SLDS, or Jest LWC tests. DO NOT TRIGGER when: Apex classes (use generating-apex), Aura components, or Visualforce.
tanstack-query
IncludedManage server state in React with TanStack Query v5. Set up queries with useQuery, mutations with useMutation, configure QueryClient caching strategies, implement optimistic updates, and handle infinite scroll with useInfiniteQuery. Use when: setting up data fetching in React projects, migrating from v4 to v5, or fixing object syntax required errors, query callbacks removed issues, cacheTime renamed to gcTime, isPending vs isLoading confusion, keepPreviousData removed problems.
document-processor-api
IncludedProcess documents with Nutrient DWS. Use when the user wants to generate PDFs from HTML or URLs, convert Office/images/PDFs, assemble or split packets, OCR scans, extract text/tables/key-value pairs, redact PII, watermark, sign, fill forms, optimize PDFs, or produce compliance outputs like PDF/A or PDF/UA. Triggers include convert to PDF, merge these PDFs, OCR this scan, extract tables, redact PII, sign this PDF, make this PDF/A, or linearize for web delivery.
nutrient-document-processing
IncludedProcess documents with Nutrient DWS. Use when the user wants to generate PDFs from HTML or URLs, convert Office/images/PDFs, assemble or split packets, OCR scans, extract text/tables/key-value pairs, redact PII, watermark, sign, fill forms, optimize PDFs, or produce compliance outputs like PDF/A or PDF/UA. Triggers include convert to PDF, merge these PDFs, OCR this scan, extract tables, redact PII, sign this PDF, make this PDF/A, or linearize for web delivery.
tanstack-query
IncludedManage server state in React with TanStack Query v5. Covers useMutationState, simplified optimistic updates, throwOnError, network mode (offline/PWA), and infiniteQueryOptions. Use when setting up data fetching, fixing v4→v5 migration errors (object syntax, gcTime, isPending, keepPreviousData), or debugging SSR/hydration issues with streaming server components.
accelint-nextjs-best-practices
IncludedNext.js performance optimization and best practices. Use when writing Next.js code (App Router or Pages Router); implementing Server Components, Server Actions, or API routes; optimizing RSC serialization, data fetching, or server-side rendering; reviewing Next.js code for performance issues; fixing authentication in Server Actions; or implementing Suspense boundaries, parallel data fetching, or request deduplication.