Build PromptDrive

YESreplaces $5/mosaves $60/yrback to the verdict

0%0 of 16 items done

Saved on this device only. Tick prerequisites first, then work the phases in order · do not start one until the checks above it pass.

A personal prompt library whose hard problems are filling variables without producing a broken prompt, keeping the version of a prompt that used to work, and copying to the clipboard from a browser that will not give you the clipboard API.

estimated effort one sittingthe files for this build are in the project pack

RuntimeOne Node process serving plain HTML, CSS and JavaScript, no build stepStorageOne SQLite file beside the application, schema created on first runSearchQuery as you type over titles, bodies, notes and tagsVariablesPlaceholders parsed from the body into a generated form, with required checksHistoryEvery save keeps the previous body, with a restore

Before step 1

Everything below is assumed from the first step. Tick each one when you actually have it, not when you plan to.

  1. installfree

    Why Runs the single process that serves the library.

    Get it nodejs.org, or your version manager. open ↗

    Verify node --version prints v20 or higher

  2. installfree

    Why The whole library is one file, and a synchronous driver keeps the code simple for a single user.

    Get it Install a maintained driver as a dependency.

    Verify The database is created on first run and the schema matches

  3. decidefree

    Why One-click copying needs a trustworthy origin, and a plain address on your network is not one, which decides whether you need a certificate.

    Get it Decide between using it only on the machine itself, or setting up a hostname with a certificate for phone access.

    Verify The copy button either works or shows the fallback with an explanation on every device you use

  4. have readyfree

    Why A library built against five invented examples gets the variable handling and the search wrong, because real prompts are long and contain awkward characters.

    Get it Paste in the prompts you currently keep in notes, documents or chat history.

    Verify Search, filling and copying all behave with the real ones

Data model

Create these before the first phase that stores anything. Changing a table later is the expensive kind of change.

- prompts(id, title, body, notes, folder_id, created_at, updated_at, last_used_at, use_count)
- versions(id, prompt_id, ordinal, body, notes, saved_at, label) · the previous body, every time, because editing is destructive
- folders(id, name, parent_id, position)
- tags(id, name) and prompt_tags(prompt_id, tag_id) · flat tags, because a second hierarchy is a second filing system
- variables(prompt_id, name, label, default_value, required, ordinal) · derived from the body on save and editable
- The variables table is derived, so renaming a placeholder in the body renames it here without a migration or a stale row.

Environment variables

These go in a .env file the app reads at startup. The pack's .env.example is this table as a file · copy it, never commit the filled-in version.

VariableNeededExampleWhere the value comes from
DATABASE_PATHrequired./data/prompts.sqliteThe whole library. Copy this file to back it up.
PORTrequired4321Bound to the loopback address by default, which is also what makes copying work.
BIND_ADDRESSrequired127.0.0.1Change it to reach the app from a phone, and read the note about the clipboard first.
EXPORT_DIRrequired./data/exportsWhere JSON and Markdown exports are written.

The build, in order

  1. A library you can search faster than you can retype

    Finding a prompt takes one keystroke to focus and a few to filter.

    1. A setup step is a reason not to open the app.

      Files src/db.jssrc/schema.sql

    2. Instant or it loses to a text file.

      Files src/public/search.jstests/search.test.js

    3. This tool is used between two other windows.

      Files src/public/keys.js

    done when · tick each as it passes
    watch out
    • Reloading the whole result list from the server on every keystroke makes search feel laggy at exactly the moment it needs to feel instant, and the tool loses to a text file. Keep the query snappy with an index, render results without a full page load, and measure the keystroke to update time rather than assuming it.
  2. Variables that fail loudly

    A filled prompt never contains a leftover placeholder, and the form matches the body.

    1. One source of truth, so a rename cannot leave a stale field.

      Files src/variables.jstests/variables.test.js

    2. A second pass substitutes the values themselves.

      Files src/fill.jstests/fill.test.js

    3. Name the field, because the user is mid-task.

      Files src/public/fill.js

    done when · tick each as it passes
    watch out
    • Substituting with a naive replacement pass lets a value that itself contains a placeholder get substituted on the next pass, so a prompt filled with text pasted from another prompt comes out with fragments replaced in ways nobody asked for. Substitute once over the original body in a single scan, never repeatedly until nothing changes.
  3. Copying, including from the phone on the sofa

    The copy button works on the machine and over the network, or explains itself.

    1. On an insecure origin the object is not there at all.

      Files src/public/copy.jstests/copy.test.js

    2. The platform copy gesture always works.

      Files src/public/copy.js

    3. Not in a documentation file the user will not read.

      Files src/templates/prompt.html

    done when · tick each as it passes
    watch out
    • Calling the clipboard write directly assumes the object exists, so on a phone loading the app at a local network address the call throws on the missing object rather than rejecting a promise, and a catch written around a rejected promise never runs. Check for the object before calling, provide the selection fallback, and show a message explaining why the button behaves differently there.
  4. The version that used to work

    Editing a prompt never loses the wording that was working yesterday.

    1. Cheap now, priceless the day you need it.

      Files src/versions.jstests/versions.test.js

    2. Prompt edits are usually a handful of words.

      Files src/public/diff.js

    3. So restoring the wrong one is also reversible.

      Files src/versions.js

    done when · tick each as it passes
    watch out
    • Overwriting the body on save means the afternoon spent tightening a prompt is gone when the tightened version turns out worse, and the only record of the good wording was in a chat window that has since scrolled away. Keep the previous body on every save, which for a library this size costs nothing.
what this build does not replace
after v1, if you want it

Need the files? The project pack on the verdict page hands your agent the whole brief · more ai writing.