Desktop-Speicher und Zugangsdaten
Trennt Anwendungsdaten, zuverlässige lokale Schreibvorgänge und systemgeschützte Zugangsdaten in geeignete Speicherorte.
desktop-storage-credentials
Teammitglieder mit diesem Skill
Wann ist der Skill hilfreich?
Nutze dies für konsistente Verantwortung für lokale Datenbanken, Einstellungen und Tokens.
Wobei hilft er dir?
- Verwendet Systemverzeichnisse für dauerhafte Daten, Caches und Protokolle.
- Schützt SQLite-Verantwortung und Konfigurationsersetzung gegen unterbrochene Schreibvorgänge.
- Speichert Geheimnisse im System-Zugangsspeicher mit ausdrücklicher Fehlerbehandlung.
Das könntest du fragen
Verschiebe API-Tokens in den Systemschlüsselbund und erhalte gültige Einstellungen bei unterbrochenem Schreiben. Unterbrich den Austausch der Einstellungsdatei und verweigere Schlüsselbundzugriff. Gültige Einstellungen bleiben erhalten; der Zugangsdatenfehler ist klar und Logs enthalten kein Token.
Ausführliche Dokumentation
Hier findest du die ursprüngliche Anleitung, Beispiele und Prüfschritte des Skills in ihrer Originalsprache.
Weniger anzeigen
Desktop Storage & Credentials
User data on a desktop machine must survive application updates, unexpected power loss, and multi-window access without corruption, while sensitive tokens stay encrypted by the OS credential store.
OS-Standard Directory Layout
Always store files in their designated OS directories—never inside the application installation folder (Program Files or /Applications/App.app), which is read-only for standard users and overwritten on every update:
| Data Category | macOS | Windows | Linux (XDG) |
|---|---|---|---|
| User Data & SQLite DB | ~/Library/Application Support/<App> |
%APPDATA%\<App> |
~/.config/<App> or ~/.local/share/<App> |
| Disposable Cache | ~/Library/Caches/<App> |
%LOCALAPPDATA%\<App>\Cache |
~/.cache/<App> |
| Diagnostic Logs | ~/Library/Logs/<App> |
%APPDATA%\<App>\logs |
~/.local/state/<App>/logs |
SQLite & Config File Integrity on Desktop
- Single-Process SQLite Ownership & WAL Mode:
- Never open and write to the same SQLite database file simultaneously from multiple renderer processes and background workers without coordination (
SQLITE_BUSY/ lock contention). Route all database writes through the single backend/main owner process. - Enable Write-Ahead Logging (
PRAGMA journal_mode = WAL; PRAGMA synchronous = NORMAL; PRAGMA foreign_keys = ON; PRAGMA busy_timeout = 5000;) at connection startup, and runPRAGMA wal_checkpoint(TRUNCATE)on clean shutdown.
- Never open and write to the same SQLite database file simultaneously from multiple renderer processes and background workers without coordination (
- Atomic JSON Config Writes:
- Never overwrite
settings.jsonin place withfs.writeFileSync(configPath, data)—if the OS crashes or battery dies mid-write, the file is truncated to0bytes and the app fails to boot on restart! - Write to
settings.json.tmp.<pid>, flush (fsync), andfs.renameSyncatomically oversettings.json. Keep a.bakfallback or schema recovery when parsing fails.
- Never overwrite
Secret & Token Storage via OS Keychain
- Never store API keys, OAuth tokens, or session secrets in plaintext
localStorageor unencrypted JSON:- In Electron: use
safeStorage.encryptStringAsync()/safeStorage.decryptStringAsync()(backed by macOS Keychain, Windows DPAPI, and Linuxlibsecret/kwallet) and store the encrypted base64 ciphertext on disk, or store local server auth tokens in owner-only (mode: 0o600) files. - In Tauri: use
tauri-plugin-strongholdor thekeyringcrate to store secrets in the native OS credential manager.
- In Electron: use
Enthaltene Dateien 1
SKILL.md
