Working with Models
Practice the craft of working with AI: review, specify, budget your turns, pick context, build tools
9 challenges
Start here1. Review: a paginated fetch that drops a page
intermediateThe pagination helper below was generated, reviewed by its own tests, and shipped. It loses records. Find out which ones and why.
TypeScript
2. Pin it down: the cases that make a slug unambiguous
intermediateSix implementations of slugify. One is right and five are subtly wrong, and every one of them satisfies a careless reading of the request. Write the cases that tell them apart.
TypeScript
3. Three messages: a retry that has to give up
intermediateGet a model to write a retry helper in three messages. The suite you are graded against is hidden until you submit, and it checks the two things people forget to ask for.
TypeScript
4. Give it what it needs: a query against a schema it has never seen
intermediateA model cannot write this query without being shown something. Four things are on offer and only one is necessary. Handing over all four is allowed, costs sixteen times as much, and is what most people do.
TypeScript
5. Build the tool: find the tests that assert nothing
intermediateA test with no assertion passes as long as the code compiles. Reviewing for it by hand does not scale. Write the check that finds them across a whole corpus.
TypeScript
6. Review: a save-all that returns before saving
advancedThe batch-save helper below passes its tests — every item gets saved. It also returns an empty array to every caller. Find the async seam.
TypeScript
7. Three messages: a duration parser that refuses politely
intermediateGet a model to write a duration parser in three messages. The hidden suite checks the two refusals people never ask for — and a model never volunteers.
TypeScript
8. Give it what it needs: a call against an API you have not read
intermediateA model asked to cancel an order will guess the obvious endpoint, and the obvious endpoint deletes the order instead. One source on the menu prevents that. It is the cheapest one.
TypeScript
9. Build the tool: find the template that breaks hydration
intermediateOne bare template element inside a Vue page made the server and the client disagree about the whole page. Reading did not find it. Write the rule that does.
TypeScript