agentleFS
fxckcodefxckcode/tauri-skills/skills/tauri-rust/SKILL.md

tauri-rust

Skill3 starsChanged 3 months agoMITView on GitHub

Implement Tauri 2 Rust commands, managed state, validation, errors, and native integrations. Use when changing `src-tauri`, exposing commands, or reviewing Rust-side application logic.

The file

We split this skill into the rules it gives an agent

5 rules. About 0 are common, 2 are distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Read src-tauri/Cargo.toml, lib.rs/main.rs, command registration, state setup, and existing error conventions.

    line 10
  2. Distinctive:

    Use managed state for shared application state.

    line 12
  3. Very specific:

    Prefer standard Rust error handling and typed domain errors over unwrap() in command paths.

    line 18
  4. Distinctive:

    Keep blocking work off the UI thread and use async only where the operation and runtime support it.

    line 20
  5. Very specific:

    Use the Tauri 2.0 API reference for signatures matching the crate actually installed.

    line 21

≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Tauri Rust

Workflow

  1. Read src-tauri/Cargo.toml, lib.rs/main.rs, command registration, state setup, and existing error conventions.
  2. Define a narrow command with serializable arguments and return values. Validate paths, URLs, sizes, identifiers, and authorization context before side effects.
  3. Use managed state for shared application state; choose synchronization deliberately and avoid holding locks across slow I/O or callbacks.
  4. Return structured, user-safe errors to the frontend while logging diagnostic context without secrets.
  5. Register the command exactly where the application already registers commands, then run cargo fmt --check, cargo check, and relevant tests.

Safe defaults

  • Prefer standard Rust error handling and typed domain errors over unwrap() in command paths.
  • Canonicalize and constrain filesystem paths before access; do not accept a frontend path as trusted.
  • Keep blocking work off the UI thread and use async only where the operation and runtime support it.
  • Use the Tauri 2.0 API reference for signatures matching the crate actually installed; verify newer crate versions against their corresponding docs.rs version.

A command is a security boundary, not merely a convenience wrapper. Pair implementation changes with capability/permission review.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.