How the workshop works
How the workshop works
Section titled “How the workshop works”Each checkpoint follows the same four-part loop. The repetition is deliberate: it turns an unfamiliar agent framework into a predictable engineering workflow.
flowchart TD accTitle: Four-part workshop checkpoint loop accDescr: Each checkpoint moves from understanding to building, proving the result, and recovering if time expires. understand["01 · Understand<br/>Know the behavior and why"] --> build["02 · Build<br/>Copy the complete files"] build --> prove["03 · Prove<br/>Deploy and test the live agent"] prove --> recover["04 · Recover<br/>Jump to the tested branch if needed"]
Use your editor for files and your terminal for commands
Section titled “Use your editor for files and your terminal for commands”You’ll use two different parts of your computer during the workshop:
| Where | What to do there | Example |
|---|---|---|
| Code editor / IDE, such as VS Code | Create or open files, paste the supplied code into them, and save. | Edit src/agents/field-trip.ts. |
| Terminal A or B | Run the command blocks labelled Terminal window. | Run npm run deploy. |
In VS Code, use File → Open Folder to open field-trip-agent. The Explorer
sidebar shows its folders and files. Click a file to edit it in the main pane;
right-click a folder and choose New File or New Folder to create one.
A path such as src/agents/field-trip.ts means the file field-trip.ts inside
the agents folder inside src, within your project.
VS Code can also show a terminal panel at the bottom. Paste file contents into the open file in the editor pane; paste commands into the terminal panel. You can use the editor’s menus to create and modify every workshop source file.
Copy each checkpoint’s complete files
Section titled “Copy each checkpoint’s complete files”Every file block starts with a file tree showing exactly where the file belongs, then opens on Complete file. This is the full code that file should contain when you finish the step.
- Open the named file in your code editor, such as VS Code. If the block says Create this file, create it at that path, including any missing folders.
- Use the copy button in Complete file.
- Paste the code into the new file, or select all and replace the contents of an existing file. Each block contains the whole file, so you only paste once.
- Save the file. Repeat for the other file blocks in this checkpoint, then run its verification commands.
Want to see what changed? Choose the second tab, Changes, for a comparison
with the previous checkpoint. In that view, + marks added lines, − marks
removed lines, and @@ marks the location of each change. Return to Complete
file when copying code into your editor.
Choose the third tab, Change explained, for a guided deeper dive. It walks through the important additions in that specific file, connects them to the runtime behavior, and tells you what to look for during verification. You can read it while building or return to it after the checkpoint works.
Deploy and test each checkpoint
Section titled “Deploy and test each checkpoint”Every verification section opens on Live deploy. Run npm run deploy after
applying that checkpoint’s file changes, wait for deployment to finish, then run
the smoke tests against the exact workers.dev URL printed by the command.
Keep the claimed temporary account’s CLOUDFLARE_ACCOUNT_ID exported in the
deployment terminal. Use this same account for every checkpoint and dashboard
visit. The --temporary --event-code command in Session setup creates the
account once; later checkpoints use the normal npm run deploy commands.
Save your workers.dev subdomain once so the guide fills every live command and browser-test link. Open live chat in your browser takes you to the same conversation as the smoke test; you can inspect its history and try the prompts interactively. Select New conversation for a clean browser test. After redeploying, reload an already-open chat page to use the latest checkpoint.
The second tab, Local dev, keeps the local workflow available. Start
npm run dev in Terminal A and run its http://localhost:5173 smoke tests in
Terminal B. Local and deployed conversations have separate storage, even when
their IDs match. The dev server uses a strict port; if 5173 is occupied, restart
with npm run dev -- --port 5180 and use http://localhost:5180 for the local
commands and browser instead.
The recovery promise
Section titled “The recovery promise”Every lab includes two recovery branches:
- Restart this exercise switches to the previous known-good branch.
- Catch up with the room switches to the completed checkpoint branch.
Both flows stash tracked and untracked changes first. Your experiment remains in
git stash list, and a backup branch preserves the current commit.
If a dev server is
running, stop it with Ctrl+C before switching. After npm ci, return to the
selected checkpoint’s Live deploy tab to deploy and verify it. For Local dev,
restart the server so its code, bindings, and container configuration match the branch.
git stash push --include-untracked -m "workshop recovery"git fetch origingit branch -f workshop-backup HEADgit switch --no-track -C workshop origin/cp/3-api-toolsnpm ciKnowledge check: Why run npm ci after switching checkpoints?
A later checkpoint may add or change a dependency. Re-installing reconciles
node_modules with the lockfile on the branch you just selected.
Generate safe forecast dates once
Section titled “Generate safe forecast dates once”Open-Meteo only forecasts the near future. The guide automatically fills trip dates five and six days ahead in every smoke-test command and its copy button. Copy and paste the commands as shown — no date editing is needed.
Your dates are:
START="<START>"END="<END>"The guide saves this pair in your browser and reuses it across checkpoints. On a later visit, it generates a new pair if the saved dates are outside the forecast window. Do not reuse dates shown in screenshots; those become stale.
Timeboxes protect the finish line
Section titled “Timeboxes protect the finish line”Complete the code change and the first verification sequence inside each checkpoint’s timebox. Checks labelled Optional depth check are useful after the room moves on, but they repeat slower model, subagent, or container work and are not required to continue.
| Checkpoint | Branch | Topic | Time |
|---|---|---|---|
| 1 | cp/1-hello-agent |
First agent and deploy | 9 min |
| 2 | cp/2-hooks-state |
Persistent state | 6 min |
| 3 | cp/3-api-tools |
Open-Meteo API tools | 9 min |
| 4 | cp/4-subagent |
Venue-scout subagent | 8 min |
| 5 | cp/5-sandbox |
Cloudflare Sandbox | 8 min |
| 6 | cp/6-iterate-observe |
Agent tracing | 7 min |
When a checkpoint’s timer ends, move forward. A working reference point teaches more than spending the rest of the session debugging an early typo.