tauri-syntax-state

Manage and safely expose Tauri 2.x application state via Mutex and RwLock wrappers.

4|Updated Mar 20, 2026
One-click install
npx skills add https://github.com/OpenAEC-Foundation/OpenAEC-Workspace-Composer --skill tauri-syntax-state
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tauri-syntax-state
Source: https://github.com/OpenAEC-Foundation/OpenAEC-Workspace-Composer/tree/main/.claude/skills/tauri-2/tauri-syntax/tauri-syntax-state
Command: npx skills add https://github.com/OpenAEC-Foundation/OpenAEC-Workspace-Composer --skill tauri-syntax-state

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps you manage and safely expose Tauri application state to commands and UI hooks, preventing runtime panics and state-related pitfalls.

Core Features & Use Cases

  • Centralized registration of state in Tauri 2.x apps (App, AppHandle, Window, Webview) with support for standard wrappers like Mutex and RwLock.
  • Safe access patterns in commands and background tasks, including injection via tauri::State and guarded access with Mutex/RwLock.
  • Clear guidelines and examples for common patterns (immutable config, mutable state, async contexts) to accelerate development and reduce bugs.

Quick Start

Provide a minimal example showing how to register and access a Mutex-wrapped state in a Tauri 2.x app.

Frequently Asked Questions about tauri-syntax-state

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I manage mutable Tauri app state safely across multiple commands?

Tauri app state is managed safely by wrapping shared data in Mutex or RwLock wrappers and injecting it via tauri::State. This approach enforces thread safety across concurrent commands and background tasks, preventing runtime panics.

When do I need RwLock versus Mutex for Tauri state injection?

You need RwLock for Tauri state injection when multiple background tasks require concurrent read access, whereas Mutex is sufficient for exclusive write access. Choosing the correct wrapper prevents deadlocks and ensures safe state sharing across your application contexts.

Can I access Tauri managed state from background tasks and Webview contexts?

Yes, you can access Tauri managed state from background tasks and Webview contexts by passing an AppHandle. This Skill documents safe access patterns for App, AppHandle, Window, and Webview contexts to ensure thread-safe state sharing.

How do I register and access Mutex-wrapped state in a Tauri 2.x app?

To register and access Mutex-wrapped state in a Tauri 2.x app, you centrally register the state during app startup and inject it into commands using tauri::State. This enforces exact type matching for managed state and provides guarded access.

Why does my Tauri command panic when accessing shared application state?

Tauri commands panic when accessing shared application state if thread safety is not enforced or exact type matching fails. Applying Mutex or RwLock wrappers during centralized registration prevents these state-related pitfalls and runtime errors.