Skills Night › Introduction to AI

Lesson 5.7 — Capstone: A Swarm for a Real Job

Introduction to AI · Module 5: AI Agents · About 90 min · Windows PC, PowerShell 5, Claude Code (Max)

Goal: use everything from Module 5 on one real recurring job of yours: instructions, tools, permissions, a plan, subagents and evals. It runs from one command.

Keep it small. A job that takes you 20–40 min each week is perfect. Work on copies of real files, never the originals.

Before you start

Step 1 · Define "done" (⏱ 0:00–0:10)

mkdir $HOME\capstone -Force | Out-Null
cd $HOME\capstone
notepad DONE.md

Write 3–5 checkable lines, e.g. "out\report.md exists", "every input file is mentioned", "total matches".

Step 2 · Inputs and a checker (⏱ 0:10–0:25)

Copy sample inputs into $HOME\capstone\input. Then ask Claude to write the checker for you:

claude
Where am I? Claude's prompt box (>) means you're talking to Claude; PS C:\...> means you're in PowerShell. PowerShell commands only work at the PS prompt, so always /exit Claude first.
Read DONE.md. Write check.ps1 (Windows PowerShell 5) that prints PASS only if
every line in DONE.md is true for the files in out\, otherwise FAIL plus reasons.
Then run it once; it should FAIL because out\ is empty.

Step 3 · Design the team (⏱ 0:25–0:40)

Still in Claude:

Design 2-3 subagents for this job (see DONE.md, input\). Write them to
.claude\agents\ with name, description, tools (least needed) and instructions.
Also write CLAUDE.md for the orchestrator: never modify input\, outputs go
to out\, finish by running .\check.ps1 and fix until PASS (max 3 rounds).
Show me the plan before writing files.

Read the plan and approve it. Then /agents to confirm (press Esc to close it).

Now leave Claude, because the next step is PowerShell: **type /exit and press Enter. Wait until you see PS C:\...> before the next command.**

Step 4 · Safety rails (⏱ 0:40–0:45)

mkdir .claude -Force | Out-Null
$json = '{"permissions":{"deny":["Bash(rm:*)","PowerShell(Remove-Item:*)","PowerShell(rm:*)"]}}'
[IO.File]::WriteAllText("$HOME\capstone\.claude\settings.json", $json)

Step 5 · One-command run (⏱ 0:45–1:00)

@'
Remove-Item out -Recurse -ErrorAction SilentlyContinue
claude -p "Do the job described in CLAUDE.md using your subagents. Report PASS or FAIL." --allowedTools "Read,Write,Edit,Glob,Grep,Task,PowerShell,Bash,WebFetch"
.\check.ps1
'@ | Out-File run.ps1 -Encoding utf8
.\run.ps1

You should see a summary from Claude, then PASS.

Step 6 · Mini eval: 5 cases (⏱ 1:00–1:25)

Make 5 variations of input (e.g. one extra file, one odd format, one empty file) in cases\c1–c5, then:

$pass = 0
foreach ($n in 1..5) {
  Remove-Item input -Recurse -ErrorAction SilentlyContinue
  Copy-Item "cases\c$n" input -Recurse
  $r = (.\run.ps1 | Select-Object -Last 1); Write-Host "case $n : $r"
  if ($r -eq "PASS") { $pass++ }
}
"PASS RATE: $pass / 5"

Step 7 · Show and tell (⏱ 1:25–1:30)

Send Skills Coach: the job, the team (agent names), the pass rate, and one thing you'd improve.

✅ Pass check

Troubleshooting

ProblemFix
Job too big, keeps failingShrink it: fewer inputs, fewer DONE lines. Small and passing beats big and broken.
Subagents not usedMake sure Task is in --allowedTools, and CLAUDE.md says "use the subagents".
check.ps1 is wrongOpen it with notepad check.ps1, or ask Claude to fix it against DONE.md.
Usage limitStop after Step 5. Do the eval another day.
Stuck? Ask Skills Coach. Send a screenshot or paste the error plus the step number. Don't stay stuck on one step for more than 10 minutes.

Finish this lesson

← Previous (5.6)