Building a personal prompt library
How to organize the prompts that work so you stop rewriting them — a lightweight system for vibe coders.
After a few months of vibe coding, you notice you keep typing variants of the same prompts. "Refactor this into a hook." "Add Zod validation to this route." "Write a Vitest test for this function." If you do not save them, you rewrite them — and you rewrite them a little worse each time.
A personal prompt library fixes that. Here is the minimum useful version.
What goes in the library
Not every prompt deserves saving. The keepers tend to fall into four buckets:
- Patterns you reach for weekly. Refactor templates, test generators, type-tightening prompts.
- Domain-specific recipes. "Convert a Supabase RLS policy into a Prisma where clause." "Generate a Stripe webhook handler for X event."
- Multi-step procedures. The full prompt for "add a new model end-to-end: schema, migration, route, hook, page."
- Anti-prompts that fix things. "When you generate X, do not also Y" — the explicit constraints that took you a while to learn.
Throwaway prompts (one-line questions, exploratory chats) do not belong. The library is for prompts that compound.
A simple file structure
You do not need a tool. A folder of markdown files works.
prompts/
refactor/
extract-hook.md
split-component.md
tests/
vitest-happy-path.md
playwright-smoke.md
features/
new-crud-resource.md
fixes/
no-any-types.md
Each file has the prompt, a one-line note on when to use it, and an example input/output if it helps. That is it.
Make each prompt do one thing
Long, kitchen-sink prompts fail badly when you reuse them six months later in a different repo. Good library prompts are single-purpose:
- Bad: "Build me a SaaS app with auth and payments and a dashboard."
- Good: "Add a
userstable with email, name, and timestamps to the existing Prisma schema. Generate the migration."
Single-purpose prompts compose. You can chain them. You can hand them to a teammate. You can paste them into a different tool and they still work.
Version the things that matter
Some prompts will earn their keep for years. Those deserve real version control. Put your prompts/ folder in git. When a model behaves differently after a release and you have to tune a prompt, you will be grateful for the history.
Share within reason
If you work in a team, a shared prompt library is a quiet productivity multiplier. New hires can ship the team's patterns without learning them by osmosis. Just be careful about what goes in — domain secrets, customer data, internal API shapes do not belong in a doc you might paste into a third-party chat window.
The compounding effect
The reason this is worth doing is not the time you save on any single prompt. It is the consistency you gain across a year. The same refactor, done the same way, every time. The same test shape, every time. The same constraints, every time. Your codebase ends up feeling like one person wrote it, even though most of it was generated.
That consistency is what separates "I vibe code sometimes" from "I have a craft."