Skip to main content
Plexara
Product9 min read

402 - Letting the agent write the prompt

The cheapest way to save a procedure is to not write it yourself. The agent that just spent an hour producing your report still holds the tool order, the corrections, and the values worth turning into arguments. Ask it to author the prompt, review the draft, and save it. This article covers the move, why the agent is the better author, and how to read what it produces.

What you will take away from this lesson

Article 401 made the case that the report you went back and forth on is a procedure worth saving. This article is about who writes it down. The short answer is that you should not, at least not from scratch.

Writing a prompt by hand means reconstructing an hour of decisions from memory: the order you did things, the join you got wrong the first time, the annotation source you settled on, the values that changed between tries. The agent in that session was holding all of it. Asking it to author the prompt turns the chore into a sentence.

Learning Objectives

  1. 01Use the move that makes saving a prompt nearly free: ask the agent that just did the work to write the prompt that repeats it.
  2. 02Understand why the agent is the better author here. It still holds the tool order, the corrections, and the values worth turning into arguments, because it just lived through them.
  3. 03Read the prompt record the agent produces: an ordinary personal prompt, the same shape and the same record you would get by typing it yourself.
  4. 04Review the draft before it ships. An agent-authored prompt is a first draft with your name on it, not a finished standard.

The whole move is one sentence

When the report is right, you do not open a separate prompt editor and start typing. You stay in the session and ask the agent to write the prompt that reproduces what you just did. The work of distilling an hour of conversation into a clean, parameterized template is exactly the kind of work the agent is good at, and it is sitting on the full context required to do it.

From a finished session to a saved procedure

  1. 1

    The session that just worked

    An hour of back and forth ending in a report you are happy with. The full record of what was tried, corrected, and kept is in the conversation.

  2. 2

    You ask for the prompt

    "Write a reusable prompt that produces this report for any period and region, and save it." One instruction, no transcription.

  3. 3

    The agent drafts it

    It distills the conversation into a template: the steps in the order that worked, the gotchas as explicit instructions, the values that changed as named arguments.

  4. 4

    You review and save

    You read the draft, fix anything off, and confirm the save. It is stored as your personal prompt, ready to run by name.

What it looks like in the chat

The interaction is short. You describe the goal once, in plain language, and the agent reports back what it is encoding and what it is making variable before it commits anything. That readback is the important part: it is the moment to correct a default or add a step you forgot, while the original session is still in front of you.

Asking the agent to author the prompt

You

This report is exactly what I needed. Write a reusable prompt that produces this same report for any period and region, and save it so I can run it again next quarter.

Agent

I will turn this session into a prompt. Here is what I am encoding from what we did: pull the period revenue and the same period a year earlier for the year-over-year cut, annotate with US public holidays from the calendar reference, recall any store-closure events for the period from memory and mark them, and save the result as an interactive dashboard named for the period and region. I am making period and region arguments. Saving it as your personal prompt annotated-sales-review. Review it before you rely on it.

Notice the agent named what it was encoding and which values it was turning into arguments before saving. That summary is your chance to catch a missing step or a wrong default while the context is still on screen.

Reading the prompt it produced

The output is an ordinary prompt record, the same shape covered in 308: a personal prompt no different from one you would type by hand. The detail worth pointing at is how it handles the one-time facts. Instead of baking the spring storm closures into the text, it instructs the agent to recall closure events from memory at run time. That single choice is what keeps the procedure reusable for a period with entirely different closures.

The prompt the agent drafted

{
  "name": "annotated-sales-review",
  "display_name": "Annotated Sales Review",
  "description": "Year-over-year sales review for a period and region, annotated with US public holidays and any known store-closure events for the period.",
  "content": "Produce an annotated sales review for {period} in the {region} region.\n\n1. Pull revenue for {period} and for the same period one year earlier; align them for a year-over-year comparison.\n2. Annotate the timeline with US public holidays from the calendar reference.\n3. Recall any store-closure events affecting {region} during {period} from memory and mark them on the chart with a short label.\n4. Build an interactive dashboard, not a chat reply.\n5. Save it as an asset named '{period} {region} annotated sales review'.",
  "arguments": [
    { "name": "period", "description": "The period to report on, e.g. Q2 2026 or May 2026", "required": true },
    { "name": "region", "description": "Sales region name, e.g. Southwest", "required": true }
  ],
  "category": "analysis",
  "scope": "personal",
  "source": "operator",
  "enabled": true
}

The detail worth pointing at is step 3. It does not hard-code the spring storms; it tells the agent to recall closure events from memory at run time, so the procedure keeps working in a period with different closures, or none. The one-time fact stays in knowledge; the repeatable instruction to consult it stays in the prompt. The record itself is nothing exotic: an ordinary personal prompt, the same shape and origin you would get by typing it yourself.

A prompt page for My Weekly Summary marked Personal and Approved, with a Details card of name, description, owner, category, and updated time, the prompt content under Preview, an Attached materials list, a Run from chat box, and Copy, Feedback, and Save as Asset buttons.
Once you save the draft, this is the page it becomes: an ordinary personal prompt. Read it here the way you read the JSON above. The Details card, the content, and the attached materials are the parts to check before anyone else runs it.

Why hand it to the agent at all

The instinct to write the prompt yourself comes from a good place, which is wanting the procedure to be correct. But correctness here depends on details that are freshest in the agent’s context and stalest in yours: the order of operations, the mistakes already corrected, and which values actually varied across your attempts.

Why the agent is the better author here

  • It knows the order that worked. You may remember the report; the agent remembers that it pulled the prior-year figures before the current ones because the join was cleaner that way. Order is half of a good procedure.

  • It knows the gotchas, because it hit them. The correction you made on the second pass is in the conversation. A hand-written prompt three weeks later is unlikely to include the mistake you have since forgotten you made.

  • It can tell a constant from a variable. The agent just saw which values you changed across tries (the period, the region) and which stayed fixed (the annotation sources, the output shape). That is exactly the line between an argument and a hard-coded step.

Then read it like you mean it

Letting the agent draft the prompt does not move the responsibility for the procedure off you. It moves the typing. The prompt now carries your name and your team will run it, so the draft earns a real review before it becomes the standard.

A good prompt wants an audience

You now have a reviewed, parameterized procedure saved as a personal prompt. The next return on that work comes from getting it into other people’s hands and letting their use of it make it better.

Key terms

Three terms specific to agent-authored prompts: what the agent produces, and the two judgments it applies while drafting.

Key Terms

Agent-authored prompt
A prompt the agent drafts and saves for you by calling manage_prompt. It is an ordinary personal prompt, the same record you would get by typing it yourself; the win is that the agent did the authoring from the session it just ran, not that the prompt carries any special marker.
Argument extraction
The agent’s judgment, when authoring a prompt, about which values changed between runs (and should become named arguments) and which stayed fixed (and should be written into the steps).
Recall from memory
A step that tells the agent to consult stored knowledge at run time rather than hard-coding a fact into the prompt. Keeps one-time facts in the knowledge layer and out of the procedure. See 206.