Week 3: Agent skills and the CLI
Learning objectives
By the end of this lesson you can:
- run a repeated command-line workflow by hand and describe the inputs, decisions, and checks it actually needs;
- package that workflow in a small
SKILL.md, keeping the description specific enough to select and the body short enough to load; - write three requests that should trigger the skill and one near miss (a similar request that should stay quiet), then compare your predictions with an observed run; and
- preserve command output, the exact request, the repository revision, and the final verification result as evidence.
The skill is a workflow description, not a permission grant. A skill can suggest a command; the normal shell, repository policy, and your review still decide whether it runs. The course wrote the examples on this page. They are not observations of a real model.
Minimal example
Do the workflow once by hand
Suppose a project has a repeated release-check routine. Before writing a skill, do one run without an agent:
git status --short
git diff --check
python -m pytest -q
The first command tells you whether unrelated edits are present, the second catches
whitespace errors, and the last command is the project's check. Record the revision with
git rev-parse --short HEAD and keep the output. If the check fails, write the failure
and stop; do not hide it behind a skill.
Encode the procedure
A skill is a directory containing a SKILL.md. Its YAML front matter names the skill and
describes when it applies. The body explains steps, judgement, and verification.
This small example is deliberately narrower than “help with this repository”:
---
name: release-check
description: Run the repository's release checks and report evidence when a change is ready for review.
---
## Steps
1. Read the requested boundary and run `git status --short`.
2. Run `git diff --check`, then the repository's test command.
## Judgement
- If unrelated files are modified, stop and report them before testing.
- If a check fails, keep its output and do not call the change ready.
## Verification
Run `git diff --check` and `python -m pytest -q`; include the revision and output.
The description is the selection surface: the agent reads it to decide whether to use the skill. The format uses progressive disclosure: metadata is available before activation, while the body is loaded after selection and bundled resources only when needed (tools/agent-skills; as_of: 2026-10-07; Source 1). A long explanation in the description makes unrelated requests look like matches. A vague description makes the skill invisible. Compare the hand run with the skill line by line: which step is new, which evidence is preserved, and which decision would be impossible from the output alone?
Test selection, including a near miss
The course kit contains three complete examples: research-codebase,
plan-change and review-diff.
First read only the description in each SKILL.md. For research-codebase, predict
before you look at its trigger record. From the course checkout, print the
description and the four requests without their recorded values. Write trigger or quiet
for each request before you read on:
grep '^description:' capstone/kit/skills/research-codebase/SKILL.md
grep 'prompt:' capstone/kit/skills/research-codebase/trigger-test.yaml
Here is one worked prediction to compare with yours, with the requests shortened:
| Request | Prediction | Reason |
|---|---|---|
| “Trace this request and cite the files and lines you observed.” | trigger | It asks for a read-only path record. |
| “Tell me what the handlers and tests do before we discuss edits.” | trigger | It asks for current facts before a change. |
| “Build a read-only call-path record for this unfamiliar module.” | trigger | It names the same bounded research job in new words. |
| “Implement the change and add a regression test.” | stay quiet | It asks for implementation, the near miss. |
Now open trigger-test.yaml. Besides id and prompt, each row has should_trigger (the
intended boundary), predicted (written before the run) and observed. Compare your prediction
with observed. When observed differs from should_trigger, keep the row instead of
rewriting history, describe the description change under revision, and recheck only
those prompts. Sometimes only your prediction was wrong and the boundary held. That
row stays as it is and needs no revision.
Then run the checker on the kit example, from the course checkout:
python lectures/week-03/fixture/skill_check.py \
capstone/kit/skills/research-codebase/SKILL.md \
capstone/kit/skills/research-codebase/trigger-test.yaml
The last line is Structure checked. The checker needs the PyYAML package. The course
environment from the setup page includes it. Without
it, the command stops at ModuleNotFoundError: No module named 'yaml'. The checker
verifies the record's shape. It also checks that the record contains at least three
positive prompts and one negative prompt. It cannot observe a model's hidden selection.
Run the same check for the other two kit examples. Their trigger records are synthetic course examples, so label them as such in your notes. A passing structure check is not evidence that a particular agent selected the skill.
Evidence from a CLI run
A command-line session is evidence only when another reader can identify what happened. Save these fields for each run that uses your skill:
| Field | Example evidence |
|---|---|
| Request | the exact prompt, copied before the run |
| Revision | git rev-parse HEAD |
| Selection | the CLI's skill-selection line, or “not shown” |
| Calls and output | the command, exit status, and relevant stdout/stderr |
| Verification | the exact check command and its result |
| Boundary | git status --short after the run: files edited and files created |
Keep each exact request and its CLI output in A3-work/agent-run.txt, separate from the
repository's product files. A3 cites that file as evidence. Never put a key in a prompt,
screenshot, transcript, or repository. Follow the course safety practices
when you run an agent.
Hands-on exercise
Use your own project or the smallest repository you are currently working on. Choose a
workflow you have already performed at least twice. Examples are a focused test-and-review
check, a release-note check, or a read-only status report. Do not choose a destructive
workflow. Work in the A3-work/ directory of your own project repository. Keep the
repository revision fixed while you compare predictions.
- Hand run (15 minutes). Write the workflow as shell commands. Run it once by hand, save the output, and mark each line as input, decision, action, or check.
- Write (20 minutes). Create
A3-work/skills/<skill-name>/SKILL.mdwith the same three sections as the example. The directory name must be the same asnamein the front matter. The studio page usesmy-workflow. The description must say what the skill does and when it applies. Keep the body below 500 lines. - Predict (10 minutes). Add three requests that should trigger and one near miss to
A3-work/trigger-test.yaml. Fillpredictedbefore you run the agent. Use a neutralobserver_detailsuch as the CLI name and date. Do not invent a classmate or teacher. - Run and observe (15 minutes). First make the skill visible to your agent, as step 4
of the studio page describes. Then send the four requests to the
coding-agent CLI provided for you, one at a time. Start a new session for each request,
and keep all of them on the same fixed revision. Keep each exact request and its output
in
A3-work/agent-run.txtunder the prompt'sid. Setobservedtotrueorfalse, based only on the selection evidence the CLI actually reports. If the CLI does not show selection, writeselection: not showninA3-work/agent-run.txt. Then explain the basis for each boolean inobserver_detail. Do not put that phrase in the YAML boolean field. Put theobserver_detailvalue in double quotes and keep it to at most 200 characters. An unquoted colon followed by a space, as inselection: not shown, is not valid YAML there. The checker then stops with a Python error instead of aFAILline. - Check (10 minutes). Run the structure checker and compare prediction with
observation. Record one correction or a justified “no change.” The decision line at the
end of A3 must say accept, narrow, recheck, or
stop, followed by the evidence ID that supports it: the
idof anevidenceentry in A3'sreport.json. The studio page shows where each studio file goes in that record.
Verification
Run the checker from the course checkout, with paths that point to the files in your
project. The git -C lines read your project from any directory. These commands work
offline. They read files and do not call a model. Replace release-check with your skill's
directory name. First create the directory:
PROJECT_ROOT=/path/to/your/project
mkdir -p "$PROJECT_ROOT/A3-work/skills/release-check"
Write A3-work/skills/release-check/SKILL.md and A3-work/trigger-test.yaml in your
project, then run the check in the same terminal:
python lectures/week-03/fixture/skill_check.py \
"$PROJECT_ROOT/A3-work/skills/release-check/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" diff --name-only
git -C "$PROJECT_ROOT" status --short
The checker must print Structure checked. and no FAIL line. It also 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. Then inspect the trigger table yourself. It must have at least three
should_trigger: true prompts and one near miss, and observed must record what the CLI
showed. A successful checker run does not prove that the agent selected the skill. A
failed checker run is also useful evidence. Fix the smallest structural problem, rerun
the same command, and keep both outcomes in your A3 record.
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.
Common mistakes
- Starting with a description instead of a hand run. Re-run the workflow manually and
record the command and output before editing
SKILL.md. - Making the description a slogan. Replace “helps with code” with a task and a
whenclause. Then test the near miss again. - Calling the near miss a failure. A skill staying quiet for an implementation request is the expected result. Keep the prediction and observation side by side.
- Treating
skill_check.pyas an agent. It reads files only. It checks structure and consistency, not selection. Do not report its output as a model run. - Saving only a final summary. Keep the request, revision, command, exit status, and verification result so another person can reproduce the claim.
- Putting credentials in evidence. Stop, remove the secret, revoke it with the provider, and tell the teaching team. Follow the safety practices in the course tools and model access guidance before continuing.