Blog — AI Agents

A reusable agent skill is not a prompt file.
Here is how to test and ship one.

Saving a repeated instruction as a markdown file feels like progress. In production it fails the way other AI systems fail: nobody wrote down what it takes in, what it must return, which tools it may call, or how you would know a change made it worse.

Rajeish Mata Dec 5, 2026

Why does a saved prompt file fail in production?

Because a file of instructions has no contract, no test set, and no record of which version the agent actually used.

The pattern is familiar. An agent keeps missing the same step. Someone writes the correction into a system prompt, a note, or a file the agent can open. The next session looks better. Later the file has grown. The agent loads it on tasks it should leave alone, or skips it on the task the file was written for. A later edit fixes the case in front of you and quietly breaks an older one. Nothing in the trace says which wording ran.

That is a prompt file doing the job of a production component. The model may see it. Nothing checks the result. Nothing stops the next sentence from landing in the same file the same afternoon. Writing the instruction down is the start. Shipping it is a loop: capture it from traces, give it a contract, put it in a dataset, run an eval, deploy a version, and keep watching that version online.

What does a skill have that a prompt file does not?

A name the agent can match, a version you can point at, a boundary on tools, and a way to fail a change before users see it.

Treat the skill as a small product. At minimum, write these down before you polish the prose:

PartWhat to write
When it appliesA short description the agent sees before it loads the rest. Take the wording from how people actually ask, which you will find in traces, rather than from the phrasing you would have chosen.
When it does notThe nearby tasks that look similar and must leave this skill unloaded.
InputsWhat the skill expects to already know, and what it must ask for before it acts.
OutputWhat “done” means: a draft, a structured result, a handoff to a person. “Be helpful” is not an output.
Tool scopeThe tools this skill may call, and the tools it must leave alone even when the agent already has them.
HandoffThe cases that stop and go to a person.
VersionAn immutable snapshot. An edit publishes a new version. The previous snapshot stays addressable.

Keep the part the agent sees up front short. Long reference material, such as a policy extract, a field list, or a worked example, stays beside the skill and is read only when this task needs it. If every turn carries the whole file, the instruction you cared about gets crowded out by text the task does not need.

The tool list is the part teams skip. A skill that drafts a customer reply may look up the order and the policy section. It does not send the email, issue the refund, or open records the task never named. Scope is written on the skill. The agent’s other tools stay out of reach unless this skill names them. We write that boundary down the same way when we build agents that take action. The agent permission matrix is the worksheet for the list, before anyone argues about it in a review.

How do you find the instruction worth saving?

Read traces for a correction that keeps coming back, then separate “the rule was never written down” from “the rule was written down and never reached the model.”

A repeated instruction is a candidate. It is not automatically a skill. Look for the same human fix across sessions: ask for the order id before a refund, do not email the customer, cite the policy section, do not invent a price. One annoyed correction is an anecdote. The same correction, from different people, on different tasks, is the instruction the team has been paying to retype.

Before you add a file, split the traces:

  • The rule was never written down. The agent proceeds without it, and a person adds it in the next message. That is a skill candidate.
  • The rule was already in context and the agent ignored it. Another sentence in the file will not help. The description does not match how people ask, or the model is choosing a different path.
  • The file never arrived. The model asked for it and the load failed, or the skill was never offered on that turn. Editing the prose sends you after the wrong bug.

Each of those is a different repair. Check them in the trace before you touch the wording. Redact the trace before it becomes source material. Customer data, secrets, and internal identifiers do not belong in a skill file or in a dataset row.

What belongs in the dataset?

The case that prompted the skill, the cases where it must stay unloaded, and enough older cases that a new edit can lose.

Each row is a task. Take it from a redacted trace where you can, and write the edges the traces have not shown yet. A usable row has:

  • The task, in words a user actually used.
  • Whether this skill should load.
  • Which tools are in bounds on this row.
  • What a correct result must contain, and what it must not do.
  • The context the agent would have had: the record, the policy excerpt, the prior turn. If the real task depends on that context, the row is incomplete without it.

Include the negatives. A refund skill that is only tested on refund requests will look finished while it loads on billing questions, password resets, and anything with the word “charge.” The negative rows are how you find a description that is too wide.

Keep the original failure as a row you do not delete when the wording changes. The dataset exists so today’s fix can fail yesterday’s case while you can still refuse the change. This is the same shape as any other agent eval: known inputs, a check decided before you look at the new output, and a set you do not trim down to the cases the change happens to pass. AI agent testing and evaluation is that discipline on the whole agent. A skill is a smaller unit of the same job.

What has to pass before you ship?

The candidate has to hold up against the current version on the whole dataset, including the rows it was not written to fix. A single good chat does not clear a skill for production.

Run the comparison with the skill removed, with the version that is live now, and with the candidate. The run with the skill removed tells you whether the file is doing any work. If the agent already passes with the skill removed, the file is leftover prompt. Leave it out.

Score the things the contract named:

  • Load. The skill loaded when the row says it should, and stayed unloaded when the row says it should not.
  • Tools. Every call stayed inside the allow-list. A correct-looking answer that called a forbidden tool is a failure.
  • Output. The result met the contract: the fields, the handoff, the refusal.
  • Regression. The candidate still passes the rows the current version already passed.

A candidate that fixes the new row and drops an old one stays unshipped. Narrow the change, or split the skill. A win on the new row does not cancel a loss on an old one.

Run the check in the harness you will actually deploy, or as close as you can get. Agents do not load files the same way. One exposes a skill tool, another reads a path, another injects the text as a message the trace barely shows. A pass in a chat window, or in a different product’s loader, does not tell you what your production agent will do. If you cannot run the real loader, say so in the result and treat the gap as open.

Agree the bar before you look at the candidate. Otherwise the threshold moves to fit the run.

What do you watch once it is live?

The same checks, on real traces, tied to the version that ran. An offline pass starts the watching. It does not finish the job.

On each trace, record the following:

  • Offered. Was this skill shown to the model on this turn?
  • Requested. Did the model ask to load it?
  • Loaded. Did the body enter context, and which version?
  • In scope. Did the tools stay inside the list you wrote down?

Offered and ignored usually means the description does not match how people ask. Requested and not loaded means a path, a permission, an error, or a loader that swallowed the failure and returned something that looks like success. Never offered means the catalog, the context budget, or the deploy step dropped it. Folding those into “the skill did not help” sends you to edit the prose when the file never arrived.

Pin the version. If the trace does not name it, you cannot tell whether a bad session ran the wording you just shipped or the previous one. Roll forward and roll back by version. A shared file that every session picks up the moment you save it gives you no rollback.

Keep scoring what you scored offline: wrong loads, out-of-scope tool calls, missing handoffs. A drop is a release problem. When a person corrects the agent, that correction is the next dataset row. It does not go into the skill the same day. It goes through the experiment first. That is the loop. Trace, dataset, experiment, deploy, then trace again.

LLMOps is the operating side of this. A trace that stops at the final answer will not show you whether a skill loaded. Versioning that covers the chat prompt and ignores the skill file will not tell you what changed.

Other teams have published how they run a loop like this inside their own product. Langfuse’s notes are a useful view of one implementation, tracing whether a skill was available, requested, and loaded, then evaluating a candidate before it is published: how they test and ship their skill and how they trace skill use across loaders. You do not need their stack to do the work. You need a version, a dataset, a harness that matches production, and traces that name the version.

Which failures should you expect?

These are the ones we look for before a skill is allowed to stay in production. Each row is a symptom, the usual cause, and the change that actually addresses it.

What you seeWhat it usually isWhat to change
The same correction, and the file already contains itThe skill is not reaching the modelCheck offered, requested, and loaded before you add a sentence
The skill loads on the wrong tasksThe “when” is too wideNarrow the description, and add negative rows to the dataset
A rephrased request never loads itThe description matches the author, and the traces say something elseRewrite the description from the phrasings you captured
A drafting skill sends, refunds, or reads too farTool scope is whatever the agent can already doAllow-list tools on the skill, and fail the eval when a forbidden tool is called
A bad trace has no versionThe file was overwritten in placePin a version and write it on the trace
Today’s fix breaks an older caseThe eval was one chatCompare the candidate with the current version on the full set
It passed offline and slipped after launchNobody is scoring live tracesWatch the same checks after deploy, and feed corrections back into the dataset

What do you do with a pile of prompt files?

Pick the one instruction that shows up in traces, write the contract, and refuse to ship the edit until the dataset has seen it.

Leave the rest of the pile where it is. One skill with a version, a dataset, and a trace is worth more than a directory of files nobody tests. Write the “when,” the output, and the tool allow-list before you polish the prose. Build the dataset from the traces you already have, including one task where the skill must stay unloaded. Run the current wording against the candidate. Ship only when the candidate still passes the rows the current wording passed.

Then leave the scores on. The next correction goes into the dataset. It waits for the experiment.

If the agent can take an action the skill did not name, stop and write the boundary first. The questions in what to ask before an agent acts on production are the right companion: inputs, privileges, handoffs, and blast radius. A skill that skips that review is a prompt file with a nicer filename.

Where this fits.

Putting a skill through a dataset and a release gate is part of AI agent testing and evaluation. Keeping the version, the trace, and the live scores together after launch is LLMOps. The tools a skill may call should be written down before the eval, which is what the agent permission matrix is for.

Get started

Got an instruction the agent
keeps needing?

Book a 30-minute call. We will take one repeated instruction from your traces and walk through the contract, the dataset, and what would have to pass before it ships.