DEV Community

Willy Nelson
Willy Nelson

Posted on

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

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.

Why local-first instead of just building a simple cloud app

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.

How the sync works

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 browser extension

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.

The AI features

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.

Try it

https://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.

Top comments (0)