tauri-development_skill

This skill assists in implementing and wiring Tauri commands, Rust backends, and frontend bindings to enable seamless tauri integration.
  • Python

0

GitHub Stars

1

Bundled Files

2 months ago

Catalog Refreshed

4 months ago

First Indexed

Readme & install

Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.

Installation

Preview and clipboard use veilstrat where the catalogue uses aiagentskills.

npx veilstrat add skill cacr92/wereply --skill tauri-development

  • SKILL.md2.6 KB

Overview

This skill provides practical guidance and templates for adding or modifying Tauri commands, wiring Rust backend logic to the frontend, and exporting types for safe TypeScript bindings. It enforces consistent command signatures, error handling, and use of generated bindings for reliable frontend/backend integration. The goal is predictable APIs, type safety across Rust and TS, and clear service-based error reporting.

How this skill works

The skill inspects command implementations and DTOs to ensure every Tauri command is annotated for both tauri and specta, and that input/output types implement specta::Type. It prescribes returning a uniform Result<ApiResponse<T>, String> pattern and using helper wrappers (api_ok, api_err, with_service) for service access and error messaging. Frontend callers must use the generated bindings.ts commands layer rather than invoking Tauri directly.

When to use it

  • Adding a new Tauri command that will be called from the frontend.
  • Changing an existing command’s signature or its DTOs shared with TypeScript.
  • Implementing or debugging Rust backend ↔ frontend command calls.
  • Exporting types for TypeScript via specta so bindings.ts stays in sync.
  • Integrating database reads/writes inside a command with explicit query patterns.

Best practices

  • Annotate every command with #[tauri::command] and #[specta::specta].
  • Ensure all command parameters and return DTOs implement specta::Type; use #[specta(inline)] when needed.
  • Return Result<ApiResponse<T>, String> and use api_ok/api_err/with_service for consistent messages.
  • Frontend must call commands from frontend/src/bindings.ts; do not call invoke directly.
  • Prefer sqlx::query_as! with explicit column names for reads and wrap writes in transactions.

Example use cases

  • Expose a get_material_nutritions command that returns typed nutrition DTOs to the UI.
  • Add an initialization status DTO annotated for specta to let the frontend show setup state.
  • Refactor a service to use with_service wrapper so errors surface cleanly to the user.
  • Export new Rust types to TypeScript so bindings.ts includes the new command signatures.
  • Implement a database update inside a command using a transaction and explicit sqlx queries.

FAQ

Every command must include #[tauri::command] and #[specta::specta].

How should I structure return values for frontend consumption?

Return Result<ApiResponse<T>, String> and use api_ok/api_err helpers so the frontend receives a consistent success/error shape.

Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational