4 min read
Slicing work so the AI stops inventing things
The single habit that made an AI coding tool useful on a real project instead of a confident liar.
The most common way people get burned by an AI coding tool is to ask it for too much at once. You say build me the directory, and it writes four hundred lines that look right, compile, and quietly invent a database schema that does not exist, a function that was never defined, and an API that the library does not have. It is not lying on purpose. It fills gaps with the most plausible thing, and plausible is not the same as true.
The habit that fixed this for me is boring: slice the work down until each piece is small enough that the tool cannot get creative. Not build the listings page, but write the one function that takes a neighborhood slug and returns the dentists in it, given this exact table. Give it the real shape of the data. Give it the real names. Then the gap it would have invented is already filled, so it has nothing to make up.
Small slices also mean you can actually check the work. A fifty-line change with one job is something a person can read and verify. A four-hundred-line change that touches eight files is something you skim, approve, and regret. The whole point of going fast with these tools is lost the moment you stop being able to tell whether the output is correct.
The dataset for this project came from eight separate scrapers, pulling from Google, Yelp, the national provider registry, practice websites, and reviews. Every one of those was a small, checkable slice with a single source and a single shape. None of them were write the scraper. They were get these fields from this one source, then I validate, then the next one.
It is slower to write the prompt this way. It is much faster to get something that works and that you trust. The code was never the scary part. The scary part was always the data, and the only way through it was one honest slice at a time.