Session 03 · Thursday 17 September 2026

The model as a service, and skills

The API, the harness
and the file that teaches an agent a trick.

16.S893AI Agents for Engineering Research
Today · 90 minutes

Today

  • The rest of the portfolio sites, picking up where we stopped
  • The model as a service
  • The harness
  • Skills: what they are, and how to write one
Part 01 · About 20 minutes

Your portfolio sites, continued

Picking up where we left off · ~2 min each

Show us

  • The site, and the thing that moves
  • One thing you asked the agent for and did not get
  • Any thing you had to fix yourself
  • Fail of the week
  • The Easter egg, if you are willing
Part 02 · About 20 minutes

The model as a service

API calls exposed

The entire interface, by hand

curl -s https://parley.api.mit.edu/v1/chat/completions \
  -H "Authorization: Bearer $PARLEY_API_KEY" \
  -H "Content-Type: application/json" \
  -d @1-duck.json | jq .
1-duck.json               # a list of messages in, one message out
2-name-alone.json         # "What is my name?"  It has no idea
3-name-with-history.json  # same question, earlier turns resent. Now it knows
4-tool-offer.json         # a tool on offer. It replies with a request to run it
ls . → 5-tool-result.json # we run the tool, send the result back. It answers
The crux of the session

The model asks. It cannot act.
Whoever runs the tool and sends the transcript back is the harness.

Different system prompts

What did we change? Not the model.

pi --no-tools --no-session --system-prompt "You are a duck. Only quack."
pi --no-tools --no-session
pi --no-session
> what files are in this folder?

1. Quack.
2. I can't see your files. Could you paste a listing?
3. [bash: ls]  There are 14 files: 1-duck.json, 2-name-alone.json, ...
The harness · what pi puts in front of the model

What is in the context

  • The system prompt, and every AGENTS.md pi found on the way up
  • One line per skill it found. The full skill, only once it is loaded
  • Your messages
  • Every tool result, in full: every ls, every file, every test log
  • Its own earlier replies and tool calls
  • It fills up. It is resent on every call. It never changes the weights.
Part 03 · About 35 minutes

Skills

The whole definition

A skill is a file. The harness says it exists.
The model reads it when the task matches.

Anatomy · one file, two parts

Anatomy of a skill

Always in the context
 # SKILL.md, the front matter between the --- fences
 name: grill-me
 description: Interview the user relentlessly about a
   plan or design, resolving the full decision tree.
   Use when user says "grill me" or asks for
   rigorous design review. ...

Two lines per skill in the system prompt: name, description, and where the file is. The description is the trigger.

Loaded on demand
grill-me/
└── SKILL.md       the instructions

research-figures/
├── SKILL.md       when and how
├── scripts/       export helper, examples
├── references/    journal specs, recipes
└── assets/        .mplstyle, palettes

Where pi looks: ~/.pi/agent/skills/, the project’s .pi/skills/, --skill <folder>. Or /skill:name by hand.

Demo 0 · the plumbing, 3 minutes

What the model sees before you say anything

head -5 ~/.pi/agent/skills/grill-me/SKILL.md   # in the shell: the front matter
pi --no-session                                # start pi; nothing saved to disk
> What skills do you have, and how do you know?      # typed at pi's prompt
<available_skills>
  <skill>
    <name>grill-me</name>
    <description>Interview the user relentlessly about a plan ...</description>
    <location>/Users/you/.pi/agent/skills/grill-me/SKILL.md</location>
  </skill>
  ...
</available_skills>
Demo 1 · a process skill, 10 minutes

Grill a one-pager

Volunteer. Your draft, on screen, for ten minutes.

Watch for: the read that loads the skill; the decision tree; questions that arrive in batches with a recommended answer.

Demo 2 · a knowledge skill, 10 minutes

Same prompt, with and without

# left: no skills at all
pi --no-session --no-skills "$(cat prompt.txt)"

# right: exactly one
pi --no-session --no-skills --skill ~/codes/AI_skills/skills/research-figures "$(cat prompt.txt)"
prompt.txt: Make a figure of the drag polar data in polar.csv for an AIAA
journal paper: C_L against C_D, and L/D against alpha, with both
configurations on each panel. Put the script and the output in figures/.
What the two demos showed

Two kinds, one mechanism

Process skills

grill-me, fight-me, tdd. No scripts. They change what the model does next: interview first, attack the premise, write the failing test before the code.

Knowledge skills

research-figures, research-schematics. Journal widths, palettes, an export helper, a recipe per figure type. They carry judgment someone wrote down once.

The model does not learn from its mistakes. The agent can, if you write them down. A skill is the smallest unit of that.

Write your own skill
  1. Pick a behaviour you want. How plots look, a check to always run, a fix you keep making by hand.
  2. Have the agent write it. .pi/skills/<name>/SKILL.md, from the template.
  3. Read it. A markdown file. Fix what is wrong.
  4. Start a new session. It is now in the list.
Three things to keep in mind

Before you collect fifty of them

  • A skill is context. Loaded once, resent on every call after. Short ones are nearly free
  • The description is the trigger. “Helps with plots” never fires. Say when, not just what
  • A skill can instruct the model to do anything, including running the scripts in its folder. Read one before you install it. Tuesday: sandboxing
Before Tuesday

Do

Write one skill for a behaviour you want from your agent: how you like plots made, a check it should always run, a fix you kept making by hand. Put it in your portfolio repo under .pi/skills/<name>/SKILL.md, commit it, and note in your dev-log what it does. Template: skills-demo/skill-template/SKILL.md in the session folder.

Read

Simon Willison, Hoard things you know how to do (5 min), and the Agent Skills specification (5 min).

Project one-pager

Email me, cc your advisor, ask them to reply-all. Tuesday 22 September.

Next →
Back to course home