Skip to content

Program 03 · Module 02 of 10

Module 02: Agent Design and Instruction Engineering

Turn an agent map into a written specification. You define objectives and success criteria, write instructions with clear roles, constraints and output contracts, and plan what context the agent needs at each step.

Suggested study time
7-8 hours
Prerequisites
Module 1, or equivalent understanding of the agent loop.; Python 3.10 or later.

Sign in to track your progress. Every lesson stays free to read without an account.

Learning outcomes

By the end of this module you will be able to:

  • Define an objective, scope and measurable success criteria for an agent.
  • Write system instructions that separate role, rules, scope and output format.
  • Specify structured output contracts that your code can validate.
  • Decompose a task into steps and choose a planning strategy.
  • Decide what context the agent needs at each step and what to leave out.

Lessons

  1. 2.1

    Define the Agent's Objective, Scope and Success Criteria

    Give an AI agent one clear goal, write down what it may and may not do, and turn "do a good job" into checks you can test on a single conversation.

    40 min
  2. 2.2

    System Instructions, Role, Constraints and Output Contracts

    Turn your objective card into system instructions with a role, rules, scope and format, then fix the shape of the agent's answer so code can check it.

    45 min
  3. 2.3

    Task Decomposition and Planning Strategies

    Split a big goal into small steps, then choose between a fixed plan, an adaptive plan and no explicit plan, and put the limits in code.

    40 min
  4. 2.4

    Context Design: What the Agent Needs at Each Step

    Decide what an AI agent should see at each step, keep secrets and old clutter out, and filter the data in code before the model reads anything.

    40 min
  5. 2.5

    Exercise: Write and test an agent specification

    Bring your objective, instructions, output contract and context plan together in one written agent specification, then test it with at least six written scenarios.

    1 h
  6. 2.6

    Practical Lab: Build and Test Your First AI Agent, Step by Step

    Build the Quillfeather order-status agent from your specification: sign in, create an API key, set up Python, add instructions and a tool, then test and fix it.

    1 h 30 min

About 5 h 15 min of lessons in total.

Practical assignment

Exercise: Write and test an agent specification

Write a specification for the agent you mapped in Module 1, including instructions and an output contract, then run it against at least six written scenarios.

Deliverables

  • A specification document with objective, scope, success criteria and instructions.
  • A JSON Schema or equivalent for the agent's structured output.
  • A table of at least six scenarios with expected behaviour and the observed result.

Validation checklist

Use this to check your assignment before you move on.

Knowledge check

  1. 1.Where should a rule such as "never exceed 300 characters" be enforced?
    Show the answer and explanation

    Answer: A. A length limit is checkable by code, so code should check it. Instructions help the model comply, but they cannot guarantee it.

  2. 2.Which success criterion is most useful?
    Show the answer and explanation

    Answer: B. It can be checked on a single run. The other two are goals, but you cannot verify them from one output.

PromptFable is independent and is not affiliated with, endorsed by or sponsored by Anthropic, Google, OpenAI or any other vendor. Claude, Gemini, Google AI Studio and other product names are trademarks of their respective owners.