add-tauri-command
Standardizes the addition and typing of Tauri IPC commands.
Install
mkdir -p .claude/skills/add-tauri-command && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/16755" && unzip -o skill.zip -d .claude/skills/add-tauri-command && rm skill.zipInstalls to .claude/skills/add-tauri-command
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
Use when adding, renaming, or changing the signature of a Tauri command in src-tauri — any new IPC surface between the Rust core and the React UI.Key capabilities
- →Add commands to `src-tauri/src/commands/<domain>.rs`
- →Define command signatures with `async fn`, owned params, and `Result<T, Error>` returns
- →Register commands in `generate_handler![...]` and `tauri_specta::Builder`
- →Regenerate type-safe bindings in `src/lib/ipc/bindings.gen.ts`
- →Expose generated functions with typed wrappers in `src/lib/ipc/<domain>.ts`
How it works
The skill guides the process of adding a Tauri command by defining its Rust implementation, registering it, regenerating type-safe bindings, and creating a typed wrapper for the React frontend.
Inputs & outputs
When to use add-tauri-command
- →Add new IPC command
- →Update Tauri command signature
- →Sync IPC bindings
About this skill
Add a Tauri command
End-to-end checklist. A command is not "done" until both sides are typed and tested.
Checklist (todo per item)
- Domain module. Add the command to
src-tauri/src/commands/<domain>.rs(create the domain file if new — never a catch-all module). Name: snake_case verb phrase, one command per user-facing action. - Signature.
async fnif it does I/O; owned params;State<'_, AppState>for state;Channel<T>param if it streams. ReturnsResult<T, Error>(the app error enum — add a variant if no existing one fits; wrap engine errors via#[from]). - Thin shell. Body = unwrap args → call engine /
db/repository / jobs layer → map errors. If you're writing SQL or business logic inside the command, stop and move it down a layer. - Register. Add to the single
generate_handler![...]list inlib.rs(and totauri_specta::Buildercommand list). There is exactly one registration site. - Regenerate bindings. Run the specta export (see
justfile:just bindings) sosrc/lib/ipc/bindings.gen.tsupdates. Never hand-edit that file. - Typed wrapper. Expose it from
src/lib/ipc/<domain>.tsre-exporting the generated function with any ergonomics (query-key helpers for TanStack Query). Feature code imports the wrapper, never the bindings file or rawinvoke. - Tests, both sides. Rust: unit test for the layer the command delegates to (the command itself stays thin enough not to need one); if the command has branching, test it with a test
AppState. TS: if a hook/component consumes it, mock viamockIPCin the colocated test. - Capabilities. If the command needs a plugin permission, add it to the relevant file in
src-tauri/capabilities/(per-concern files, minimum scope). - Gate.
just check.
Common mistakes
- Registering in a second
invoke_handlercall — Tauri silently keeps only the last one. - Returning
Stringerrors — the frontend loses thekinddiscriminant. - Streaming via events instead of
Channel<T>— events are broadcast and unordered per docs; channels are the streaming path. - Forgetting
clearMocks()in the TS test — IPC mocks leak across tests.
When not to use it
- →When the change is not an IPC surface between Rust and React
- →When modifying existing commands without changing their signature or domain
Limitations
- →The skill is specific to Tauri commands for Rust and React integration.
- →The skill requires manual adherence to the checklist steps.
How it compares
This skill provides a structured, end-to-end checklist for adding Tauri commands, ensuring type safety and proper integration between Rust and React, unlike an ad-hoc approach that might lead to inconsistencies.
Compared to similar skills
add-tauri-command side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| add-tauri-command (this skill) | 0 | 1mo | No flags | Intermediate |
| tauri | 76 | 1mo | Review | Advanced |
| rust-errors | 5 | 1mo | No flags | Advanced |
| hula-skill | 3 | 7mo | Review | Intermediate |
Try saying
Example prompts that trigger this skill in your AI assistant.
You might also like
tauri
EpicenterHQ
Tauri path handling, cross-platform file operations, and API usage. Use when working with file paths in Tauri frontend code, accessing filesystem APIs, or handling platform differences in desktop apps.
rust-errors
EpicenterHQ
Rust to TypeScript error handling patterns for Tauri apps. Use when defining Rust errors that will be passed to TypeScript, handling Tauri command errors, or creating discriminated union error types.
hula-skill
HuLaSpark
HuLa project skill for frontend (Vue 3 + Vite + UnoCSS + Naive UI/Vant), backend (Tauri v2 + Rust + SeaORM/SQLite), full-stack flows, and build/release work. Use when the user mentions hula or HuLa or requests changes in this repository; after triggering, ask which scope (frontend/backend/fullstack/build-release) to enable.
waller-wallpaper-session
gvastethecreator
Extend or debug the Wallpaper Session, monitor drafts, preview flows, editor flow, and profile composition across React, Tauri, and Rust. Use for monitor wallpaper features, profile bugs, preview issues, or domain-model changes.
tauri-syntax-permissions
OpenAEC-Foundation
>
openui-forge-rust
OthmanAdi
OpenUI generative UI with Rust Axum backend. Async SSE streaming with reqwest and async-stream.