agentleFS
Konadu-Akwasi-AkuokoKonadu-Akwasi-Akuoko/katto/.claude/skills/add-tauri-command/SKILL.md

add-tauri-command

Skill2 starsChanged 5 months agoMITView on GitHub

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.

4 other projects use a version of this.

Adopted by

Most recently taken up by

  • Other versions4 projects use a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 4

    1. openfootmanager/openfootmanager★ 1.2ksame name
    2. Mooshieblob1/MooshieUI★ 225same name
    3. devlint/GitWand★ 198same name
    4. kevinlin/cowork-z★ 13same name

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

  • In this repository5 other files it gives its agents.

The file

We split this skill into the rules it gives an agent

4 rules. About 0 are common, 0 are distinctive, and 4 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 4

    Very specific

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

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

    Domain module: Add the command to src-tauri/src/commands/<domain>.rs (create the domain file if new — never a catch-all module).

    line 12
  2. Very specific:

    Register: Add to the single generate_handler![...] list in lib.rs (and to tauri_specta::Builder command list).

    line 15
  3. Very specific:

    Regenerate bindings: Run the specta export (see justfile: just bindings) so src/lib/ipc/bindings.gen.ts updates.

    line 16
  4. Very specific:

    Capabilities: If the command needs a plugin permission, add it to the relevant file in src-tauri/capabilities/ (per-concern files, minimum …

    line 19

≈ “Common” is an estimate: at least 1 in 5 of the 372,429 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

Add a Tauri command

End-to-end checklist. A command is not "done" until both sides are typed and tested.

Checklist (todo per item)

  1. 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.
  2. Signature. async fn if it does I/O; owned params; State<'_, AppState> for state; Channel<T> param if it streams. Returns Result<T, Error> (the app error enum — add a variant if no existing one fits; wrap engine errors via #[from]).
  3. 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.
  4. Register. Add to the single generate_handler![...] list in lib.rs (and to tauri_specta::Builder command list). There is exactly one registration site.
  5. Regenerate bindings. Run the specta export (see justfile: just bindings) so src/lib/ipc/bindings.gen.ts updates. Never hand-edit that file.
  6. Typed wrapper. Expose it from src/lib/ipc/<domain>.ts re-exporting the generated function with any ergonomics (query-key helpers for TanStack Query). Feature code imports the wrapper, never the bindings file or raw invoke.
  7. 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 via mockIPC in the colocated test.
  8. Capabilities. If the command needs a plugin permission, add it to the relevant file in src-tauri/capabilities/ (per-concern files, minimum scope).
  9. Gate. just check.

Common mistakes

  • Registering in a second invoke_handler call — Tauri silently keeps only the last one.
  • Returning String errors — the frontend loses the kind discriminant.
  • 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.

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.