Skip to content
All writing ‹ Part 01 of 08 · Designing Agents and Agent Loops: Split FR and NFR First
Engineering · 3 min read

Write the Intent Before the Prompt

When an agent does badly, the prompt is often fine. Write one sentence of intent first, then answer five questions: workflow, boundary, knowledge, cost, trust.

I helped my team design a knowledge base agent. Its job was to collect knowledge that sat in code, documents, and chat history. After I wrote the first goal, I added a note next to it: “The purpose is still not clear enough.”

That note reminded me of something. When an agent does badly, the prompt is often fine. The real problem is that nobody said clearly why the agent exists.

Intent, plus five questions

The intent is one sentence: “This agent exists so that someone can do something.” With that sentence in hand, answer the five questions from the talk by 「大大帶我飛」:

Intentwhy it exists WorkflowWhich part of the work? Who asks?Who gets the result? BoundaryWhat can it read or change?When does a human approve? KnowledgeWhere is the knowledge?How is it found, filtered, put in context? CostWhich step costs most?Cache, a cheaper model, or later? TrustWhat trace does it leave?How is it verified so the team uses it?
One sentence of intent on top, and five questions under it.

How I found the intent

I did not rewrite the goal directly. First, I listed what each kind of user wanted from the agent. The people who write code wanted it to read code and logs. The people who maintain knowledge wanted one source of truth and access control. The people who only look things up wanted answers that were current, correct, and sourced.

After that list, the intent became clear. Each need also fell into one of the five questions. After that, it was much easier to decide which steps become scripts and which go to the LLM. I cover that step in Agent Design Is the FR/NFR Split.

Exercise

Someone asks, “Why did the activation rate of new users drop last week?” The agent must find the data definition and query the related tables. Then it writes SQL, checks the result, and sums up the conclusion and its limits. Write one sentence of intent first. Then use the five questions to design the smallest version that works.

If you cannot write one sentence of intent, you are not ready to write the prompt.


References:

  • A talk by 「大大帶我飛」

Related: see how a clear intent drives the FR/NFR split, or go back to the series overview: Design an Agent.

// connect

Be brave | Be wise | Be grateful

21 BreakinCode

// elsewhere
LinkedInMedium (lang: en)Life RecordYoutube
wh:~$William Hung· © 2026 Taipei · GMT+8 · ● Available for collaboration
↑↓ navigate ↵ open esc close