agentleFS
pinkpixel-devpinkpixel-dev/tauri-skills/skills/tauri-app-builder/SKILL.md

tauri-app-builder

Skill1 starsChanged 3 months agoApache-2.0View on GitHub

Build, refactor, debug, harden, and package production-grade Tauri 2 desktop applications. Use for new Tauri apps or existing Tauri projects involving Rust commands and managed state, custom or transparent windows, tray-first utilities, Linux StatusNotifierItem behavior, popup positioning, custom titlebars, close-to-tray lifecycle, single-instance handling, native file dialogs, clipboard access, file drag-and-drop, frontend-to-Rust IPC, capability/CSP security, secrets, local persistence, icons, or Linux DEB/RPM/AppImage delivery.

We split this skill into the rules it gives an agent

27 rules. About 0 are common, 21 are distinctive, and 6 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈21

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 6

    Very specific

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

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

    Read repository instructions and inspect the entire native surface before editing: src-tauri/Cargo.toml, Tauri configuration, capabilities, …

    line 13
  2. Distinctive:

    Write a short lifecycle and trust-boundary design before implementation.

    line 20
  3. Very specific:

    Run the project audit script and the project's complete lint/test/build gates.

    line 23
  4. Distinctive:

    Verify the compiled desktop app on every target platform available.

    line 24
  5. Distinctive:

    Do not run an existing development server when project instructions reserve that for the user.

    line 27
  6. Distinctive:

    Use an already-running app for interactive verification.

    line 28
  7. Distinctive:

    Keep privileged behavior in Rust commands.

    line 32
  8. Very specific:

    Keep TypeScript IPC wrappers typed and centralized.

    line 34
  9. Very specific:

    Use platform application config/data/cache directories through app.path().

    line 39
  10. Distinctive:

    Write persistent configuration atomically with a sibling temporary file and rename.

    line 42
  11. Distinctive:

    Keep full binary payloads in Rust when practical.

    line 43
  12. Distinctive:

    Read security-and-ipc.md for any privileged command, secret, filesystem scope, child process, or persistence work.

    line 49
  13. Very specific:

    Use Tauri's TrayIconBuilder first on Windows and macOS.

    line 56
  14. Distinctive:

    If the app only needs a context menu, Tauri's tray is sufficient.

    line 61
  15. Very specific:

    If reliable left-click activation and separate right-click menu behavior are required, use a StatusNotifierItem implementation such as ksni.

    line 62
  16. Distinctive:

    Keep a single tray owner. Do not create both Tauri and StatusNotifierItem icons.

    line 65
  17. Distinctive:

    Keep tray callbacks lightweight.

    line 66
  18. Distinctive:

    Treat activation coordinates as hints, constrain the popup to the selected monitor, then show and focus it.

    line 67
  19. Distinctive:

    Read tray-and-popup.md completely for tray-first or menu-bar apps.

    line 70
  20. Distinctive:

    Read window-lifecycle-and-input.md before implementing custom chrome, auto-hide, Escape behavior, native dialogs, clipboard, or file …

    line 92
  21. Distinctive:

    Do not confuse a transient loss of focus with user intent to close the popup.

    line 106
  22. Distinctive:

    Use a strict CSP; begin with bundled content and IPC only, then add the smallest required image, font, or network sources.

    line 120
  23. Distinctive:

    Never disable TLS validation, SSH host-key checks, code signing checks, or equivalent security to make setup easier.

    line 125
  24. Distinctive:

    Never place secrets in process arguments, logs, profile JSON, temporary scripts, or durable environment configuration.

    line 127
  25. Distinctive:

    Keep tray icon, package icon, window favicon, and in-app logo roles separate.

    line 140
  26. Distinctive:

    Read configuration-icons-packaging.md for current configuration, icon, Linux runtime, and release guidance.

    line 142
  27. Distinctive:

    Read verification.md for the full matrix.

    line 171

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

Build the native behavior as deliberately as the product UI. Treat the webview, Rust core, operating-system services, and package format as separate trust and lifecycle boundaries.

Working method

  1. Read repository instructions and inspect the entire native surface before editing: src-tauri/Cargo.toml, Tauri configuration, capabilities, Rust entrypoints, IPC wrappers, window hooks, package scripts, tests, and release configuration.
  2. Fetch current Tauri documentation with Context7 before relying on API names, plugin setup, permissions, or platform support. Tauri and its plugins evolve independently.
  3. Identify target platforms and interaction model: normal window, menu-bar/tray utility, transient popup, background service, or multi-window app.
  4. Write a short lifecycle and trust-boundary design before implementation.
  5. Implement narrow vertical slices: native setup, typed IPC, frontend state, lifecycle edge cases, then packaging.
  6. Run the project audit script and the project's complete lint/test/build gates.
  7. Verify the compiled desktop app on every target platform available. Web-only preview is not proof of tray, focus, drag/drop, clipboard, transparency, or close-to-tray behavior.

Do not run an existing development server when project instructions reserve that for the user. Use an already-running app for interactive verification.

Architecture rules

  • Keep privileged behavior in Rust commands. Expose task-specific commands, never a generic shell or arbitrary filesystem bridge.
  • Keep TypeScript IPC wrappers typed and centralized. Match Rust serde(rename_all = "camelCase") fields and Tauri invoke argument names exactly.
  • Move filesystem, image decoding, keyring, process execution, and potentially blocking clipboard work off the async runtime thread with tauri::async_runtime::spawn_blocking.
  • Store shared native state with app.manage(...); protect mutable state with a suitable lock.
  • Use platform application config/data/cache directories through app.path(). Do not invent dot-directories unless the product explicitly requires them.
  • Bound file sizes, record counts, preview dimensions, diagnostic lengths, and cleanup lifetimes.
  • Write persistent configuration atomically with a sibling temporary file and rename.
  • Keep full binary payloads in Rust when practical; send bounded previews or opaque IDs to the webview.
  • Validate identifiers and paths again in Rust even when the frontend validates them.
  • Preserve operating-system security boundaries: keychain/Secret Service for recoverable secrets, native dialogs for user-selected paths, and least-privilege capabilities.

Read security-and-ipc.md for any privileged command, secret, filesystem scope, child process, or persistence work. Read native-data-and-background-work.md for files, images, caches, long-running operations, or managed state.

Tray and popup decision

Use Tauri's TrayIconBuilder first on Windows and macOS. It supports menus and show_menu_on_left_click(false).

On Linux, make a deliberate choice:

  • If the app only needs a context menu, Tauri's tray is sufficient.
  • If reliable left-click activation and separate right-click menu behavior are required, use a StatusNotifierItem implementation such as ksni. Tauri's official documentation currently says tray mouse events are unsupported on Linux even though the icon and context menu work.
  • Keep a single tray owner. Do not create both Tauri and StatusNotifierItem icons.
  • Keep tray callbacks lightweight; emit an app event or update state for expensive work.
  • Treat activation coordinates as hints, constrain the popup to the selected monitor, then show and focus it.

Read tray-and-popup.md completely for tray-first or menu-bar apps.

Popup window contract

For a compact tray popup, start hidden and normally use:

  • decorations: false
  • transparent: true only when shaped/rounded edges are required
  • visible: false
  • alwaysOnTop: true when the product expects a popover
  • skipTaskbar: true
  • explicit width, height, and useful minimums
  • disabled minimize/maximize when those states make no sense
  • dragDropEnabled: true when accepting native file drops

Clip and round every layer: html, body, #root, and the visible shell. Keep the document background transparent and avoid webview shadows bleeding beyond the rounded shell. Native shadow support is platform-dependent; Linux does not honor Tauri's window shadow setting.

Apply data-tauri-drag-region only to elements that should drag. The attribute is not inherited, which protects child buttons. Use startDragging() only for custom gesture logic.

Read window-lifecycle-and-input.md before implementing custom chrome, auto-hide, Escape behavior, native dialogs, clipboard, or file drag/drop.

Lifecycle contract

  • Register the single-instance plugin first. On a second launch, show and focus the existing window.
  • Distinguish hide, close, and exit:
    • window close requests may be prevented and converted to hide;
    • normal application exit requests may be prevented for a tray-resident app;
    • an explicit Quit menu item must call app.exit(...);
    • final RunEvent::Exit must shut down background services and clean cache state.
  • Hide on blur only after a short delay and only when no native interaction owns focus.
  • Suppress auto-hide during file drags, native dialogs, clipboard operations that open UI, and the brief focus transition after showing the window.
  • Do not confuse a transient loss of focus with user intent to close the popup.

Native file drag contract

Tauri drag/drop emits enter, over, drop, and leave. Start the protected drag session on both enter and over. Handling only over creates a race where the initial enter can let hide-on-blur close the window.

On drop, keep suppression active until the path has been imported, refocus the window, then release suppression after a short grace period. On leave, release after a grace period. Clear timers and unlisten on teardown. Add a regression test for the exact four-event classification.

Security baseline

  • Use a strict CSP; begin with bundled content and IPC only, then add the smallest required image, font, or network sources.
  • Scope capabilities to exact window or webview labels. Avoid remote webview capabilities unless the threat model explicitly requires them.
  • Grant only APIs used by the frontend. Rust code is not protected from itself by capabilities.
  • Never disable TLS validation, SSH host-key checks, code signing checks, or equivalent security to make setup easier.
  • Never place secrets in process arguments, logs, profile JSON, temporary scripts, or durable environment configuration.
  • Be honest: recoverable credentials cannot be "impossible to decrypt." Their boundary is the unlocked operating-system account and credential vault.

Icons and themes

  • Generate the standard application iconset with tauri icon from a large square source, then inspect small sizes manually. Small tray icons often need a simpler dedicated mark.
  • Preserve transparency and padding; do not use a detailed marketing logo at 16–24 px.
  • Provide high-contrast light and dark artwork where the desktop cannot recolor the icon.
  • StatusNotifierItem IconPixmap is ARGB32. When starting from RGBA bytes on little-endian Linux, convert to the byte order expected by the tray library; verify visually rather than assuming.
  • Keep tray icon, package icon, window favicon, and in-app logo roles separate.

Read configuration-icons-packaging.md for current configuration, icon, Linux runtime, and release guidance.

Verification gate

Run:

python3 ~/.codex/skills/tauri-app-builder/scripts/audit_tauri_project.py .

Then run the repository's full checks. For Rust, require formatting, Clippy with warnings denied, and tests. For the frontend, require lint, typecheck, tests, and production build.

Interactively verify the native build:

  • left and right tray clicks;
  • second-instance activation;
  • show, focus, blur, Escape, close, explicit Quit, and restart;
  • popup placement at every screen edge and on multiple monitors;
  • custom titlebar dragging without breaking controls;
  • native dialog open/cancel;
  • drag enter, repeated over, drop, and leave;
  • clipboard success and empty/error cases;
  • dark, light, and system theme changes;
  • 320 px minimum-width layout with no corner bleed;
  • clean console and native logs;
  • install/launch/uninstall for each produced bundle.

Read verification.md for the full matrix. Do not claim a native behavior works when only the browser version was tested.

Reference routing

  • Tray, Linux SNI, menus, positioning: tray-and-popup.md
  • Focus, hide, close, custom chrome, drag/drop: window-lifecycle-and-input.md
  • Capabilities, CSP, commands, secrets: security-and-ipc.md
  • State, storage, files, previews, blocking work: native-data-and-background-work.md
  • Configuration, plugins, icons, releases: configuration-icons-packaging.md
  • Native test matrix and debugging: verification.md
  • Current upstream evidence and platform caveats: research-sources.md

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.