Building with AI, one demo at a time

There is a feature on YouTube I use a lot. When there is a long video I don’t want to watch, I click a button and get a summary, plus a few follow-up questions I can ask about it. I wanted the same thing for articles.

I read a lot of long posts, and many of them I close half read. What I really want is the main idea, and then a way to ask about the parts I care about.

So I built Distill. It’s a small Firefox and Zen extension. You click a button on the article you’re reading, it opens a new tab with a summary and key points, and then you can keep asking questions about that article. Everything runs on a local model on my Mac.

But I had a second reason for building it. I wanted to get better at the whole process of building software with AI - not only putting a model inside an app, but using AI to build the app, from the first idea to something I use every day.

Why my earlier attempts didn’t work

I had tried this before, and it didn’t go well. I was too ambitious.

I would describe the whole product upfront, let the agent generate a lot of code, and then spend days trying to make it work. When something broke, I couldn’t tell which part was wrong. The first useful result was always far away, and I usually lost interest before I got there.

There was a second mistake, and I only saw it later. I went from specs straight to implementation. No wireframes, no UI design, no idea how the thing would actually feel to use. The specs described features, and the code followed the specs. Only when I could finally click around did I see that parts of it didn’t work the way I wanted. Then I had to go back and change both.

The tools were fine. The steps were too big, and they started in the wrong place.

Start with a prototype

This time I started somewhere else. Before writing a roadmap or a single spec, I used Claude Design to build a working prototype of Distill. Not a mockup - something I could click through in the browser and see how it would work.

The prototype answered questions that specs are bad at answering. What do you see while the model is thinking? Where do the follow-up questions go? What happens when the article can’t be read? How does an answer show that a part of it is an example and not from the article?

I went back and forth on it until I liked it. Only after I had reviewed and approved it did I start on the roadmap and the implementation specs.

Without this step, you can go very fast in the wrong direction. AI makes building cheap, so it’s easy to build a lot of the wrong thing before you notice. Then you have to backtrack. With the prototype in place, every later step had a picture to aim for. The specs described how to get there, not what “there” looks like.

For me this is now the first step when building a product.

Small steps with something to show

The prototype told me what to build. I still needed a way to build it without repeating my old mistakes. That’s when I found Mitchell Hashimoto’s post My Approach to Building Large Technical Projects. His idea is simple: break the work into small pieces where each piece ends with something you can see and try. Build each part just far enough for the next demo, not for the finished product. The demos keep you motivated, and they also show you early if you’re going in the wrong direction.

So I started with a roadmap. Each milestone has a column called “Done when I can…”:

# Milestone Done when I can…
1 First local AI response Read a useful summary and key points produced on my Mac and understand how the request works.
2 First working browser loop Click once on an article and see its title, summary, and key points without copying text.
3 Conversation Ask for a longer summary, click a suggestion, and continue the conversation.
4 Make it pleasant to use Understand what is happening and recover when capture or the model fails.
5 Use it for real Reach for it naturally on articles I actually read.
6 Security hardening Know that captured articles, links, and model output can’t be turned against me.

Every milestone describes something I can do, not something the code has. “Implement the Ollama client” is a task. “Read a useful summary produced on my Mac” is a result I can check.

A plan for the next slice only

The roadmap gives the direction, but it doesn’t tell the agent what to build today. For that I used OpenSpec.

Each milestone is one OpenSpec change. A change has a short proposal, a design, a spec, and a list of tasks. The flow is the same every time:

  • propose the change
  • review it
  • apply it
  • try the demo
  • archive it

This could easily turn into waterfall - a big design document written once and then defended forever. What kept it from that was one rule: I only plan the next slice.

When I wrote the proposal for Milestone 1, there was no browser extension in it, no chat, and no UI. The proposal said so in an “out of scope” section. I wrote the design for Milestone 2 only after Milestone 1 was done, and it was shaped by what I learned there.

It’s a rolling plan. Plan a slice, build it, look at it, then plan the next one.

OpenSpec lets you add project rules that apply to every change. Mine were short:

  • Tie the change to a milestone and state its demo (“done when I can…”)
  • Always state what is out of scope
  • Keep tasks small enough to finish in one sitting
  • End with a task to try the demo and note what I learned

The last one turned out to be the most useful.

The specs grew the same way. When I archived a change, its requirements were merged into the main specs. Today there are six of them - article capture, distillation, conversation, local model access, the Distill page, and its look. I didn’t design any of them upfront. Each one showed up when a slice needed it.

How I knew it worked

For me a demo wasn’t enough. I also wanted to write down how I tested it.

Every milestone has a notes file next to the code with what I checked, how I checked it, and what surprised me. The testing had three levels:

  • Unit tests for everything that doesn’t need a model: building the prompt, the error messages, validating the result, the Markdown renderer. They run with node --test and no dependencies.
  • Runs against the real model from a script, using the same requests as the extension, with timings and token counts.
  • Hands-on checks in the browser, written as a checklist before I started. Quit Ollama in the middle of an answer. Open a page that isn’t an article. Make the context window so small that the article doesn’t fit. Each check had an expected result.

After that came the demo, on articles I was actually reading.

Computers are good at checking that the code does what I said. I still have to check that what I said was the right thing.

What each slice taught me

Looking back, every milestone had at least one surprise. Because the slices were small, each surprise was easy to spot and cheap to fix.

Milestone 1 was just a command-line script. One article in a text file, one request to a local model, one structured answer back. I compared two models on a real article and checked every key point against the text. gemma3:12b stuck to the article. llama3:8b was about twice as fast, but it added a point about creativity that the article never makes. That made the choice of default model easy. I also found that Ollama quietly cuts prompts that don’t fit the context window. No error, just half of the article missing. I don’t think I would have noticed this inside a browser extension. In a small script with a verbose flag, it was obvious.

Milestone 2 moved the same request into the browser. One click captures the article with Mozilla’s Readability (the code behind Firefox’s Reader View) and opens a new tab with the overview. It worked, but it took about 60 seconds, not the 30 I had measured with the script. The tab was promising a wait time it couldn’t keep, so I removed the promise and wrote down streaming as the next thing to fix.

Milestone 3 added the conversation. Before building any UI, I measured how Ollama handles the same prompt sent twice. If the follow-up sends the article unchanged, Ollama reuses it from its cache - reading the article drops from about 12 seconds to under one. Short answers came back in 3 to 6 seconds. That one measurement decided how the whole chat works.

Milestone 4 was about making it pleasant: answers that stream in, progress steps with a clock, and a clear screen with a way out for every failure I could cause on purpose. This is also where the prototype came back. Its look - the reading layout, fonts, light and dark themes, icons - had been waiting since the beginning. The first three milestones were about making it work. Milestone 4 made it look and feel the way I had already decided it should. Because those decisions were made upfront, this milestone was mostly copying, not designing. A smaller lesson: Zen ignores the setting for dark-mode toolbar icons, so the icon now adapts itself.

Milestone 5 had no spec at all. The goal was to reach for it naturally. I used it for about two weeks, and at some point I noticed I was doing exactly that.

Milestone 6 came from a security review of the whole codebase. The most interesting finding was prompt injection. I wrote a test article with a hidden instruction to the model. It couldn’t change the overview, but it took over the conversation. My first two fixes didn’t help. What finally worked was a reminder placed before each question, together with an example of this kind of attack in the system prompt.

This milestone also had the lesson I liked least. Twice my fix seemed to work, and twice I was wrong. Ollama still had an old setting from Milestone 2, so the requests were getting through for the wrong reason. Only a clean setup and reading the server log showed what was really happening. Now I test security fixes against a clean setup, not against whatever is on my machine.

The trade-offs

This way of working has a cost. Too much process, and you spend more time writing proposals than code. Some of my tasks were so small that the proposal felt like ceremony. Too little, and you’re back to a pile of generated code and no idea which part is broken.

For me the sweet spot was one change per milestone, tasks I could finish in one sitting, and a demo at the end of each milestone.

A rolling plan also doesn’t give you the final architecture upfront. Some code had to move when a later slice needed it - in Milestone 2, the shared code moved from src/ into the extension. At the time it felt like rework. In practice it took a few minutes, and it was much cheaper than designing the wrong architecture at the start.

Where it is now

Distill is now part of how I read.

I click the button, and a new tab opens with the summary and key points, usually within a minute for a real article. Then I ask for a longer summary, click one of the suggested questions, or type my own. Answers stream in, stay grounded in the article, and say so when the article doesn’t cover something.

Everything runs locally through Ollama. The article and my questions never leave my Mac. There are no accounts and no tracking.

I’m happy with it. It’s not finished, but I know what it does, how I tested it, and where its limits are. A cleverer prompt injection might still get through. The model still sometimes adds an analogy without labeling it as one. Both are written down in the notes.

And that was the real goal - not to build faster with AI, but to build in steps small enough that I understand each one.

About the author: Mirko Borivojevic is Team Lead & Senior Software Engineer at Hygraph, with 15+ years of experience across startups, biotech, and SaaS companies. He writes about engineering leadership at Behind the notebook.

Connect:LinkedIn • GitHub