A reusable prompt library is a shared set of tested prompts for tasks that your team repeats. Examples are adding a vendor integration, onboarding a new data source, and setting up a client workspace. To build one, start with prompts that worked on real runs. Review each run, and generalize each prompt from many past examples. Then give each prompt an owner, and feed what each run teaches back into the prompt.
The best public evidence comes from Stripe. Stripe built its payment method factory from over 100 reusable prompts. It "hardened" the prompts with agents that observed implementation runs. It kept the prompts current by feeding back what each run taught.
What Stripe Reports
All the numbers below come from one Stripe engineering post, dated 30 September 2026. Stripe reports them itself.
| Measure | Stripe's figure |
|---|---|
| Reusable prompts in the factory | Over 100 |
| Past implementations used as the base of the prompt | Over 125 |
| Engineering effort, vanilla Claude Code | About 20 days |
| Engineering effort, Claude Code with reusable prompts | 4 days |
| Integration timeline, before and after | Up to 6 months, then 2 to 6 weeks |
| Output so far | 3 new payment method integrations, 10 migrated integrations |
The 20-day and 4-day figures come from one test. It compared two engineers on one task. The ratio is 20 รท 4 = 5, so the prompts cut effort by 80% in that test. Do not use this number as a general benchmark. It shows that the method can work, not how much it will save your team.
Stripe gives four lessons. It says it was valuable to "harden our prompts to make them reusable, keep them up to date as the codebase evolved, orchestrate the agents in a human-guided workflow, and get agents testing their own changes." This article covers the first two lessons.
Why a Prompt That Worked Once Is Not Proven
A successful run does not prove that the prompt is good. The agent can reach the correct result in spite of the prompt. Stripe states this directly: "Even in a successful 'one-shot' run, we can still see the agent perform unnecessary investigations or repeatedly attempt to fix failing tests."
A weak prompt costs you in three ways:
- The agent uses more tokens and time than necessary.
- The result depends on luck, so the next run can fail.
- A person must watch the run and steer the agent.
For this reason, the library needs a review step. A prompt goes into the library only after a person or an agent has examined how the run went, not only the result.
The Workflow: Five Steps
The steps below combine Stripe's method with practices from software engineering. Stripe's post supports steps 1 to 3. Steps 4 and 5 are our recommendations for team ownership.
- Save the prompt and the full transcript after each real run.
- Review the transcript for wasted steps and steering.
- Generalize the prompt from many examples into a template.
- Package the prompt with an owner, a version, and a clear description.
- Feed each run's lessons back, and measure each change against a baseline.
Step 1: Save the Prompt and the Transcript
A transcript is the full record of a run. It includes the prompt, each tool call, each tool result, and each message from a person. Save it next to the prompt version that produced it.
Without the transcript, you can see only the result. With the transcript, you can see where the agent hesitated, repeated work, or needed help. Our guide to agent traces and tool calls lists the fields to capture.
Step 2: Review the Transcript
Stripe's rule is simple: "If the agent needs steering, we can refine the original prompt until it completes the task without our help." A reviewer can be an engineer or a second agent that reads the transcript. Stripe uses agents that observe implementation runs. Its post does not give the full method, so the checklist below is our own.
Observer review checklist
- Find each message where a person steered the agent. Write down what the prompt could have said instead.
- Find files or documents that the agent read but did not use. If the prompt sent the agent there, remove that pointer.
- Find each fix that the agent tried more than twice. Add the correct approach, or a stop rule, to the prompt.
- Find each question that the agent asked a person. Add the answer to the prompt or to its inputs.
- Find each path, API name, or command that was out of date. Update it, and record the date.
- Compare the result with the "Done when" list. If the agent skipped an item, make that item more specific.
- Record the number of steps, tokens, and minutes for the run. You need these numbers to compare versions.
Each finding becomes one of three things: a change to the prompt, a change to the task inputs, or a note that no change is necessary. Do not add every finding to the prompt. A long prompt with many special cases is hard to maintain.
Step 3: Generalize From Many Examples
A prompt built from one run fits that run. Stripe did not do this. It "began with over 125 past implementations of payment methods as the base of our prompt." It gave the agent these examples and a template, refined the output by hand, and designed the result "to be payment-method agnostic so it could be reused."
Use the same method at a smaller scale:
- Collect 5 to 20 past examples of the task, if you have them.
- Give the examples and the template below to a capable model.
- Ask the model to write one prompt that covers all the examples.
- Edit the draft by hand. Remove any detail that applies to only one example.
- Move each detail that changes per task into an input slot.
The template below separates the fixed part of the prompt from the inputs. The example task is hypothetical.
# Add a vendor integration
## Library metadata
- Owner: integrations team (named person: <name>)
- Version: 1.3.0
- Last reviewed: 2026-10-26
- Eval set: evals/vendor-integration/
## Goal
Add a new vendor API integration to the billing service.
## Inputs (fill in for each task)
- {vendor_name}
- {api_docs_url}
- {auth_type}: api_key | oauth2
- {ticket_id}
## Read first
- docs/integrations/README.md
- One reference integration: src/vendors/example_vendor/
## Steps
1. Read the vendor API docs at {api_docs_url}.
2. Copy the structure of the reference integration.
3. Write the client, the mapper, and the tests.
4. Run the test suite. If a test fails three times, stop and report.
## Done when
- All tests pass.
- The new vendor appears in config/vendors.yml.
- The pull request description links {ticket_id}.
## Do not
- Change shared billing code.
- Add new dependencies without a note in the pull request.
## Known pitfalls (from past runs)
- 2026-09-14: Agent searched the whole repo for auth helpers. They are in src/auth/vendor_auth.py.
The "Known pitfalls" section is where the review findings go. Each line has a date, so a reviewer can delete lines that no longer apply.
Step 4: Package the Prompt So People and Agents Can Find It
A library is useful only if people can find the correct prompt. For agents, the description field controls this.
Anthropic's Agent Skills documentation explains the mechanism. A Skill is a folder with a SKILL.md file, plus optional code and reference files. The YAML frontmatter has a name and a description. The docs say the description "must say both what the Skill does and when to use it," because Claude matches requests against it.
Skills help with a large library. The docs state that "until a Skill is triggered, only its name and description occupy context." So 100 Skills do not put 100 full prompts into each request. Our post on Agent Skills over prompts covers this design in more detail.
You have three common options:
| Option | How it loads | Good fit |
|---|---|---|
| Markdown files in a Git folder | A person or script copies the prompt into the run | Any model, small library, first version |
| Agent Skills | Name and description always loaded; instructions loaded when triggered | Claude-based agents, large library |
| GitHub Copilot prompt files | Called from a supported editor | Teams that use Copilot; check the current feature status in GitHub's prompt files docs |
Our recommendation: start with Markdown files in Git, in the template format above. If your agents run on Claude and the library grows past about 20 prompts, convert the files to Skills. If you use Skills, keep the owner and version in the body, as in the template.
Treat these files as source code. The same rules apply as for AGENTS.md and CLAUDE.md files: review each change in a pull request, and keep the history.
Step 5: Keep Each Prompt Current
Stripe kept its prompts "up to date as the codebase evolved" by feeding back each run's learnings. A team needs a clear process for this. We recommend these rules:
- Give each prompt one named owner. The owner approves all changes.
- After each run, add review findings to the prompt within one week.
- If a code change makes a prompt out of date, change the prompt in the same pull request.
- Review each prompt on a fixed schedule, for example every month. Remove pitfalls that no longer apply.
- If no one has used a prompt for 90 days, archive it.
A weekly review meeting is a good place for steps 2 and 4. Our post on the weekly edge-case review describes how to run one without causing drift.
Measure Before You Change a Prompt
Each prompt change is a hypothesis. A change can fix one case and break another. The Claude cost optimization guide gives the correct order: "get it working on a capable model, build an eval, and measure a baseline".
An eval is a fixed set of test tasks with a way to score the results. For a prompt library, the eval set can be past tasks with known correct outputs. Use this procedure for each change:
- Run the current prompt version on the eval set. Record the pass rate, steps, and tokens.
- Run the new version on the same eval set.
- If the pass rate goes down, do not merge the change.
- If the pass rate is the same but steps or tokens go down, merge the change.
- Run each version more than once. Agent results vary from run to run.
Our post on harness A/B testing explains how to tell a real improvement from noise. Each production failure is also a candidate for a new eval case.
For multi-step work, keep the orchestration in code, not only in prompts. Anthropic's dynamic workflows guide notes that when the plan lives in code, "every item gets the same treatment," and the script is a file you can read, edit, save, and run again. A script plus library prompts is easier to review than one very long prompt.
When a Prompt Library Is Not Worth It
A library has a cost. Each prompt needs an owner, reviews, and an eval set. Build a library entry only when these conditions are true:
- The team does the task at least a few times each month.
- The task has a clear "done" state that you can check.
- The task is similar enough between cases that one template fits.
If a task happens once a quarter, a short note in a wiki is enough. If each case is very different, a template will be either too general to help or too long to maintain. Start with the two or three tasks that your team repeats most often.
How OpenNash Helps Teams Build Prompt Libraries
A tested prompt library turns one engineer's good run into a repeatable result for the whole team. OpenNash puts forward-deployed engineers on the client's team and works with Fortune 2000 companies. A typical engagement follows these steps:
- Find the AI-assisted tasks that your team repeats most, and collect past examples.
- Pick the right model for each task.
- Build eval sets and measure a baseline before any prompt goes into the library.
- Write and review the prompts, and package them as files or Skills with owners and versions.
- Train your team to run transcript reviews and keep the library current.
At the end, you own the prompt library, the eval sets, the review process, and all the code around them.
Book a call with an OpenNash forward-deployed engineer or email us at [email protected]. In the first session, we review your top AI use cases and data, and show which ones give the highest business value and the fastest ROI.