Tools: I built a local-first AI prompt manager — here is why offline-first was worth the extra complexity

Tools: I built a local-first AI prompt manager — here is why offline-first was worth the extra complexity

Source: Dev.to

Why local-first instead of just building a simple cloud app ## How the sync works ## The browser extension ## The AI features ## Try it Every developer I know who uses AI tools daily has the same problem. You write a prompt that works perfectly. You get exactly the output you needed from Claude or Cursor or ChatGPT. You close the tab. Next week the same problem comes up. You spend 20 minutes trying to reconstruct that prompt from memory. I got fed up with this and built PromptVault — a local-first prompt manager that works offline, has a browser extension for any AI tool, and includes AI features to help you write better prompts. The obvious approach was to build a database, a backend, user accounts, and store everything server-side. I chose not to for two reasons. First — developers do not trust tools that store their prompts in someone else's database. Your prompts contain your entire thinking process, your preferred approaches, your project context. That is sensitive. Second — a local-first app is faster. There is no round trip to a server. Search is instant. The vault opens immediately. It works on a plane. The trade-off is complexity. Offline-first means you have to handle sync conflicts, queued operations, and cases where the same data gets modified on two devices. Every write operation (create, update, delete) gets added to a local sync queue stored in IndexedDB. Each entry records the operation type, the entity ID, and the full payload. When the app comes online it flushes the queue to Supabase in order. If a sync operation fails it retries up to 3 times with exponential backoff. After 3 failures it removes the entry and logs the error. Conflict resolution is Last-Write-Wins based on the updatedAt timestamp. This is simple and correct for this use case — you are almost never editing the same prompt on two devices at the exact same moment. The extension uses Chrome MV3. It injects a small ⚡ button into text fields on claude.ai, chatgpt.com, and any other page with a textarea or contenteditable element. Clicking the button opens a mini search popup that reads from PromptVault's local IndexedDB. You search, click a prompt, it pastes directly into the active field. No switching windows. Everything AI-related uses BYOK — Bring Your Own Key. You configure your provider (Claude, GPT-5, Gemini, Groq, or any OpenAI-compatible endpoint) in Settings. The app calls your provider directly. No data goes through PromptVault's infrastructure. The main AI features: Vibe Mode (rough idea to structured prompt), Prompt Improver (4 modes), Variant Generator (Concise, Detailed, Reframed versions), and a Debugger that runs 5 checks on any prompt. promptvault-wilxai.vercel.app — free tier is 100 prompts with all features. No account required to start. Pro is $9/month for unlimited prompts and cross-device sync. Happy to answer questions about the architecture in the comments. Templates let you quickly answer FAQs or store snippets for re-use. Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink. Hide child comments as well For further actions, you may consider blocking this person and/or reporting abuse