Skip to content

Week 3: Agent skills and the CLI studio

Learning objectives

This studio turns one repeated workflow into a tested skill. You will run it by hand and write a SKILL.md. You will predict three matches and one near miss (a similar request that should not trigger the skill). Then you run the supplied checker and keep the evidence from four command-line agent requests. The work supports LO2 and is the main preparation for A3.

Minimal example

Use the release-check example in the lecture notes. The hand run is the baseline. The skill is a proposal. The trigger table records a prediction and an observation. The checker reports structure. It does not show whether an agent really selected the skill.

Hands-on exercise

Build and test one skill

Time: 70 minutes. Format: individual work with a ten-minute peer check. Materials: your project repository, the course checkout, and the read-only checker in lectures/week-03/fixture/skill_check.py. No special runner or paid account is required for the file check. The checker needs the PyYAML package, which the course environment from the setup page includes.

1. Choose and run a workflow (15 minutes)

Choose a non-destructive workflow you have already done twice. Write its shell commands and run them once by hand. Run steps 1 to 3 from the root of your own project repository. git rev-parse needs a Git repository, and every studio file goes in an A3-work/ directory there. The commands below are one such workflow. Each line saves a command's output and then that command's own exit status:

mkdir -p A3-work/hand-run
echo "revision: $(git rev-parse --short HEAD)" > A3-work/hand-run/run.txt
git status --short >> A3-work/hand-run/run.txt 2>&1; echo "git status --short exit: $?" >> A3-work/hand-run/run.txt
git diff --check >> A3-work/hand-run/run.txt 2>&1; echo "git diff --check exit: $?" >> A3-work/hand-run/run.txt
cat A3-work/hand-run/run.txt

The status output lists ?? A3-work/. That line is this record, not an unrelated edit. Add the project's focused test command in the same form, so that its output and exit status are in the file too. If a command fails, preserve the failure and explain whether the skill should stop or continue. Do not run model-generated unknown commands in a directory containing employer, cloud, or other real credentials.

2. Write the skill (20 minutes)

Still in your project root, create the directory:

mkdir -p A3-work/skills/my-workflow

Then write A3-work/skills/my-workflow/SKILL.md, starting from the three-section example in the notes. A3 asks you to have your agent draft this file. Give the agent your hand-run record and treat its draft as a proposal. Then, in your normal editor, remove any step you did not run by hand.

The front matter name must match my-workflow (or your chosen hyphenated directory). The description must say what the workflow does and include when. In Steps, name the commands. In Judgement, state at least one stop or branch as a condition (if, unless or when). In Verification, name the exact check command in backticks and the evidence it leaves.

3. Predict four requests (10 minutes)

Copy this starter into A3-work/trigger-test.yaml and replace the prompts with your own:

skill: my-workflow
observer: agent
observer_detail: "CLI run on the fixed revision of my project; each boolean is tied to the saved selection evidence."
prompts:
  - id: matching-request
    prompt: Run my repeated workflow and report the check output.
    should_trigger: true
    predicted: true
    observed: false
  - id: matching-words
    prompt: Inspect the same workflow before we review the change.
    should_trigger: true
    predicted: true
    observed: false
  - id: matching-paraphrase
    prompt: Perform the repository check I have used twice and preserve evidence.
    should_trigger: true
    predicted: true
    observed: false
  - id: near-miss
    prompt: Implement a new feature and add its tests.
    should_trigger: false
    predicted: false
    observed: false

The observed values are placeholders only. Fill them after the agent run. Until you fill in observed, the checker reports A mismatch needs 'revision' with description_change, rechecked. for these placeholders. That is expected, and it is no reason to change them. If any observation differs from should_trigger, add a revision section naming the description change and recheck exactly those IDs. Do not rewrite the original prediction or the first observation. First change the description and send those prompts again. Then append a block like this one to trigger-test.yaml. It shows the shape for one mismatch: a matching-paraphrase request that stayed quiet at first.

revision:
  description_change: Added the words repository check to the when clause.
  rechecked:
    - id: matching-paraphrase
      observed: true

List exactly the mismatched ids under rechecked, each with what you observed when you sent that prompt again.

4. Run the CLI and preserve evidence (15 minutes)

First make the skill visible to your agent. Copy the A3-work/skills/my-workflow/ directory to the place your agent's documentation names for skills. Copy it again after every edit, so that the file the agent loads is the file you hand in. Copy the directory; do not link it. The A3 check does not accept a skill file reached through a symbolic link. Start a new session. Confirm that the agent lists the skill, in the way that documentation describes. Write the location and how you confirmed it at the top of A3-work/agent-run.txt. If you cannot confirm it, stop and ask the teaching team before you send any request. If the agent never loaded the skill, four quiet results say nothing about your description.

Then use the coding-agent command supplied for your seat. Send the four requests one at a time. Start a new session for each one, and keep all of them on the same fixed revision of your project. Keep each exact request and its output in A3-work/agent-run.txt under the prompt's id. Do not include secrets. If the CLI does not print skill selection, record selection: not shown there. Keep each YAML observed value a boolean (true or false), and explain its evidence in observer_detail. Put the observer_detail value in double quotes and keep it to at most 200 characters. An unquoted colon followed by a space, as in selection: not shown, is not valid YAML there. The checker then stops with a Python error instead of a FAIL line. Put any longer explanation in agent-run.txt.

Then change to the course checkout, where the checker is stored. Run the checker with paths that point into your project. The redirection (>>) saves what the checker prints, and the next line adds its exit status:

PROJECT_ROOT=/path/to/your/project
python lectures/week-03/fixture/skill_check.py \
  "$PROJECT_ROOT/A3-work/skills/my-workflow/SKILL.md" \
  "$PROJECT_ROOT/A3-work/trigger-test.yaml" \
  >> "$PROJECT_ROOT/A3-work/skill-check.txt" 2>&1
echo "skill_check.py exit: $?" >> "$PROJECT_ROOT/A3-work/skill-check.txt"
cat "$PROJECT_ROOT/A3-work/skill-check.txt"

Every run is added to A3-work/skill-check.txt, so a failed run stays in the record beside the passing one. The command reads YAML and Markdown only. It does not execute your skill or claim that the agent selected it. Besides any FAIL lines, it prints an Advisory block that lists the words each prompt shares with your description. That block is for information only. It does not report a problem and does not change the exit status.

5. Compare and decide (10 minutes)

Make a four-row prediction-versus-observation table and save it as A3-work/comparison.md. Cite the hand-run file, the CLI run, the checker output, and the revision. Write one sentence at the end: accept, narrow, recheck, or stop, plus the evidence ID that supports it. An evidence ID is the id of an evidence entry in A3's report.json. The A3 handoff below shows that list. A peer checks two things: that the near miss is really close to a match, and that no observation was invented.

Verification

Your studio record is complete when the following commands run from the course checkout. The git -C commands read your project wherever you run them.

PROJECT_ROOT=/path/to/your/project
python lectures/week-03/fixture/skill_check.py \
  "$PROJECT_ROOT/A3-work/skills/my-workflow/SKILL.md" \
  "$PROJECT_ROOT/A3-work/trigger-test.yaml"
git -C "$PROJECT_ROOT" rev-parse HEAD
git -C "$PROJECT_ROOT" diff --check
git -C "$PROJECT_ROOT" status --short

The expected evidence is:

  • Structure checked.;
  • the fixed revision;
  • a clean diff check, or the failure you recorded;
  • a status listing in which you can explain every line; and
  • the four-row table.

git diff reads only tracked files. New files appear only in git status --short. This includes everything under A3-work/ that you have not committed. If the structure check fails, repair the files and rerun it. A failure is not a reason to change observed to make the table look better.

Common mistakes

  • Writing the skill before doing the workflow by hand.
  • Using four prompts that all contain the skill name. At least three positive prompts must test the description in natural language.
  • Calling a near miss an error rather than evidence about the description boundary.
  • Filling observed from expectation when the CLI did not show selection.
  • Running an agent outside the course safety practices or leaving a key in the transcript.

A3 handoff

You hand in A3 as a record, report.json, together with the files it cites. The A3 page says what it requires. Copy practice/a3/starter/report.json from the course checkout into A3-work/ and fill it in. You do not need the starter's SKILL.md and manual-workflow.md. skills/my-workflow/SKILL.md and the top of hand-run/run.txt take their place. A3-work/ is the submission directory, so paths in the record are relative to it.

Field in report.json What goes there from this studio
evidence One entry with an id, a path and an observation for each file you cite: hand-run/run.txt, agent-run.txt, trigger-test.yaml, and skill-check.txt and comparison.md if you cite them.
manual_evidence A list holding the id of the hand-run/run.txt entry. A3 also asks for the hand run's request, inputs, steps, expected output and verification command. Write them at the top of that file.
skill_path skills/my-workflow/SKILL.md. A3's trigger is the when clause of the description. The non-trigger is the kind of request the skill stays out of. Put the non-trigger and the skill's limits under Judgement, as the A3 starter's SKILL.md shows. Write the non-trigger there as a condition, the form step 2 asks for.
trials Exactly two: one of the three matching prompts with "case": "trigger" and the near miss with "case": "near_miss". In each, request is the prompt, expected_trigger is its should_trigger, actual_trigger is its observed (JSON true or false, without quotes) and evidence cites the id of the agent-run.txt entry. The other two prompts stay in trigger-test.yaml as supporting evidence.
revision One or two sentences for A3's task 5. Say what you tightened after the peer check, what the rerun of both cases showed, and who gave the feedback on which date. Or say why nothing changed. This field is not the YAML revision block.
decision Step 5's word as action, the evidence ids behind it as because, and your next action as next.
explanation The result in your own words.
ai_use_note One AI-use note ID, as the A3 page asks.
predicted_time, actual_time Not in the starter. Add these two fields yourself, as the A3 page asks: the time you predicted for A3 and the time it took.

Then run the A3 check from the course checkout, with PROJECT_ROOT set as in step 4:

python practice/a3/check.py "$PROJECT_ROOT/A3-work"

PASS: record is internally consistent; inspect the evidence yourself. means that the record is consistent. It does not mean that the agent selected the skill. Your CLI may show no selection marker. In that case, the A3 page tells you not to count a plausible activation as proof and to ask for support before you record a trial. A3 is due this week.