Build something real.
A practical first course in working with your own AI agent. Start small, inspect the result, and ship with intention.
6 lessons24 small stepsYour own agent
LESSON 0430 min · AT YOUR PACE
Build a Real Tool
STEP 3 OF 4
Test the tricky cases
Tests earn their place where a plausible answer can silently be wrong.
Your task
Read the bundled check.mjs, then run node check.mjs tool count-tasks.mjs. It checks mixed tasks, empty input, completed-only tasks, indented tasks, missing files, and missing arguments. Diagnose failures and propose minimal fixes.
MAKE THISA counter that passes all bundled cases.
REVIEW BEFORE YOU ACTThe tool checker executes the script. Inspect both files first and run only inside the practice folder.
✓How to check it
Run node check.mjs tool count-tasks.mjs. Require exit code 0. Explain the behavior of at least one failure case.