Desktop Integration
ASecurityMake a web-built desktop app (Tauri, Electron) behave like it belongs to the operating system — a second launch focuses the running window instead of opening another copy, deep links and opened files reach the running instance, unsaved changes survive closing and quitting, a dock/taskbar badge shows pending items, long work shows taskbar progress, files can be dragged out to Finder or Explorer, notifications are native and only when the app is in the background, document windows show the file...
- 2 stars
- 0 votes
- 0 copies
- 0 views
- Added December 3, 2026
Works with
Security analysis
100/100Pro scans all 2 files and shows the line behind each finding
npx -y skills add agmmnn/desktop-feel --skill desktop-integration --agent claude-codeAre you the author of Desktop Integration?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/agmmnn-desktop-integration)---
name: desktop-integration
description: Make a web-built desktop app (Tauri, Electron) behave like it belongs to the operating system — a second launch focuses the running window instead of opening another copy, deep links and opened files reach the running instance, unsaved changes survive closing and quitting, a dock/taskbar badge shows pending items, long work shows taskbar progress, files can be dragged out to Finder or Explorer, notifications are native and only when the app is in the background, document windows show the file name and edited state, launch at login is opt-in, and updates never interrupt. Use when adding any of these, or when the app "doesn't act like a real app" around launching, closing, files, notifications or updates. Not for the window frame (window-chrome) or menus (native-menus).
---
# Desktop Integration
## Initial Response
When this skill is first invoked without a specific question, respond only with:
> Ready to connect your app to the OS. Tell me what you're adding — launching, closing, files, notifications, badges or updates.
A build-and-fix skill for the places where the app meets the operating system: launch, close, files, the dock and taskbar, notifications, login items, updates. It does not cover the window frame (`window-chrome`), menus (`native-menus`) or packaging, signing and distribution.
## Operating Posture
A web app lives in a tab: it opens again in another tab, closes without asking, and has no presence outside its page. A desktop app is one instance that the OS knows about. Users notice the difference the first time they double-click the icon twice and get two windows, or close a window and lose their work.
Two failure modes, and the first is worse:
1. **Ignoring the OS.** Second instances, lost edits on quit, a progress spinner that's only visible inside the window.
2. **Pushing into the OS.** Notification permission asked on first launch, launch-at-login turned on silently, a badge for every event, an update dialog in the middle of work. Integration is a privilege; overusing it is worse than not having it.
## Hard Rules
1. **One instance, unless multiple instances are a feature.** A second launch hands its arguments to the running app and focuses it.
2. **Never lose the user's work.** Closing a window and quitting the app both pass through the same unsaved-changes check.
3. **Ask at the moment of need.** Permissions (notifications) and opt-ins (launch at login) are requested when the user does something that needs them, never at first launch.
4. **Foreground is the app's, background is the OS's.** When the window is focused, feedback stays in the app (toasts, inline progress). OS surfaces (notifications, badges, taskbar progress) are for when the user is elsewhere.
5. **Shell code in [TAURI.md](TAURI.md).** Read it when `src-tauri/` exists. If the project uses Electron (an `electron` dependency, a main-process file that creates `BrowserWindow`), there is no ELECTRON.md yet: apply the shell-agnostic fixes in this file, and for shell-level fixes use only Electron APIs you can confirm against the installed version: its type definitions (`node_modules/electron/electron.d.ts`) first, then its docs. Name the version you checked, and mark anything you couldn't confirm as verify in the output.
## The Symptom Table
| Problem | Solution | Rule |
| --- | --- | --- |
| Double-clicking the app icon opens a second copy | Single instance, focus the running window | DI-01 |
| A link or opened file starts a new app on Windows/Linux | Route arguments to the running instance | DI-02 |
| Quitting loses unsaved changes | One unsaved-changes check for close and quit | DI-03 |
| Unread count only visible inside the window | Dock/taskbar badge | DI-04 |
| Export progress hidden when the window is in the background | Taskbar/dock progress | DI-05 |
| Can't drag a file from the app to the desktop | Native drag out | DI-06 |
| Toasts nobody sees, or notifications while the app is in front | Native notifications in the background only | DI-07 |
| Window title says the app name, not the document | Document title and edited state | DI-08 |
| App starts at login without being asked | Launch at login is opt-in | DI-09 |
| Update dialog interrupts work, or the app restarts by itself | Updates wait for the user | DI-10 |
## The Fixes
### DI-01 Second launch focuses the running window
Without a single-instance guard, every launch starts a new process with its own window and its own state. Two copies then fight over the same files and settings. Register a single-instance handler first, and in it restore and focus the main window: unminimize, show, focus — a minimized or hidden window must come back too.
Multiple instances are right only when the user expects separate copies (some editors, profile-based tools); then say so in the PR.
### DI-02 Deep links and opened files reach the running instance
On macOS the OS delivers URLs and opened files to the running app. On Windows and Linux they arrive as command-line arguments to a **new** process. Without forwarding, clicking `myapp://…` or double-clicking an associated file launches a second copy (DI-01) or is ignored.
Forward the second instance's arguments to the running one, then handle a URL or file path the same way regardless of how it arrived: one `openUrl(url)` / `openFile(path)` path used by deep links, file associations, drag-and-drop onto the window and File → Open.
### DI-03 Unsaved changes survive close and quit
Closing a window with unsaved changes must ask: Save, Don't Save, Cancel (macOS order and labels; follow PC-01 on Windows). Quitting the app must ask for every dirty window.
Two separate paths reach "close": the window's close button (window close-requested event) and quitting the app (⌘Q, the Quit menu item, the tray's Quit). Route both through one check. On macOS, a predefined Quit menu item can exit without passing through window close events; replace it with a custom Quit item that runs the check, then exits.
Prefer autosave where the data model allows it — then there is nothing to ask.
### DI-04 Pending items on the dock/taskbar badge
When the app has something waiting for the user (unread messages, items to review), show a count on the dock icon (macOS), launcher entry (Linux, where supported) or a taskbar overlay icon (Windows). Clear it when the count is zero. Only counts the user acts on — not "new things happened". A failed export the user must retry counts; a finished one doesn't.
### DI-05 Long work shows on the taskbar/dock
An export, sync or download that takes more than a few seconds should show progress on the taskbar button (Windows) or dock (macOS, Linux where supported), so the user can switch away and still see it. Use an indeterminate state when progress is unknown, an error state when it fails, and clear it when done.
### DI-06 Files can be dragged out
If the app shows files (attachments, exports, assets), users expect to drag them to the desktop or another app. An HTML drag carries a URL or text, not a file. Start a native drag with the file's path and an icon. For files that don't exist on disk yet, write them to a temporary location first, or use file promises on macOS.
### DI-07 Native notifications, in the background only
When the window is focused, use in-app feedback (toast, inline state). When the app is in the background or minimized, use a native notification for things the user asked to be told about. Ask for notification permission the first time the user turns on something that needs it ("Notify me when the export finishes"), not on launch. Clicking a notification focuses the app on the related item.
### DI-08 Document windows show the document
In a document-based app the window title is the document's name, not the app's name, and the edited state is visible.
| | macOS | Windows / Linux |
| --- | --- | --- |
| Title | `Report.md` | `Report.md - App` |
| Unsaved | "Edited" shown with the title; dot in the close button (native document APIs) | Leading `*` or a dot: `*Report.md - App` |
Set the title whenever the active document or its state changes. Tauri has no API for the macOS represented-file icon or the close-button dot; use the title. Electron has `setRepresentedFilename` and `setDocumentEdited` for both.
### DI-09 Launch at login is opt-in
Starting at login is the user's decision, made in Settings ("Open at login"), off by default. Turning it on silently at first launch is the fastest way to be uninstalled. Reflect the real OS state in the toggle; the user may have removed the login item in System Settings.
### DI-10 Updates wait for the user
Check for updates in the background. Download quietly or after a single consent. Then offer "Restart to update" in a non-modal way (a menu item, a small banner) and apply it when the user chooses or at the next launch. Never restart while there are unsaved changes (DI-03), never show a modal update dialog over work, and never ask again on every launch after "Later".
## Never Ship
| Never | Instead |
| --- | --- |
| A second process on every launch | Single instance, focus the running window |
| Deep links handled only on macOS | Forward arguments on Windows and Linux |
| Close or quit that discards edits | One unsaved-changes check for both |
| Notification permission prompt at launch | Ask when the user enables a notification |
| Native notifications while the window is focused | In-app feedback in the foreground |
| Launch at login enabled by default | Opt-in setting |
| Automatic restart to update | "Restart to update", user's choice |
| Badge counts for things the user doesn't act on | Badge only actionable counts |
## Output
| Rule | File | Change | Verified |
| --- | --- | --- | --- |
Almost everything here needs the built app on each OS: launch it twice, open a deep link while it runs, quit with unsaved changes, background it during an export. List those checks per OS.
Files in this skill
- SKILL.md
- TAURI.md
Attribution
Related skills
View all in ai-agents →Comments
Loading comments…
Newsletter
Get the weekly list of safe new skills, and the ones we pulled.