← ClaudeAtlas

mycobackup-restore-async-reliabilitylisted

Activate this skill when working on the Myco backup/restore subsystem — including restore UX changes, async job architecture, daemon thread safety, or concurrency correctness in restore operations — even if the user doesn't explicitly ask about reliability or async patterns. Covers four major procedures: (1) restructuring the restore UI around a modal-based guided flow, (2) offloading long-running DB operations to a child process + async job registry, (3) parsing dump header metadata for preview without SQL execution, and (4) hardening the job registry against temp-path collisions and memory leaks.
goondocks-co/myco · ★ 13 · API & Backend · score 79
Install: claude install-skill goondocks-co/myco
# Backup/Restore Async Architecture and Reliability The Myco backup/restore subsystem handles SQLite dumps that can reach 800 MB+. These operations must never block the daemon's single main thread. This skill covers the full domain: restore UX design, async job execution, preview correctness, and concurrency safety. ## Prerequisites - The daemon runs in a single-threaded event loop; any blocking call in a request handler wedges all other endpoints. - Backup files are SQLite dump format with per-table header comments (`-- Table: X (N rows)`). - Key files: `packages/myco/src/backup/restore-runner.ts`, `packages/myco/src/backup/restore-jobs.ts`, and the daemon HTTP handlers for `/api/restore` and `/api/restore/preview` (`packages/myco/src/daemon/api/backup.ts`). ## Procedure A: Restore UX — Modal-Based Guided Flow **Problem shape:** Showing a long backup list (22+ items: ~14 daily + ~8 weekly) inline in Settings causes the preview to render off-screen with no visual feedback. The confirmation step is bolted on after the fact rather than built into the flow. **Design principle:** Separate two distinct user intents with distinct UI surfaces. | Surface | User intent | Contents | |---|---|---| | Settings → Backup (inline) | "Are my backups healthy?" | Last backup timestamp, total count, "Backup Now" button — **no list** | | "Restore" button → Modal | "I need to restore" | Guided flow: (1) pick a backup, (2) preview its contents, (3) confirm and restore with progress | **Why