← All writing

AI Didn't Architect This. I Did.

  • ai
  • architecture
  • process

Everyone thinks AI replaces architects. I used it to prove the opposite.

The store was running 4,000+ discount codes at once, and only four to six ever applied to a given product. I designed the system that collapsed that down to a single API call — the full build is in the discount engine case study. What’s worth talking about here isn’t the discount engine itself. It’s where AI helped in building it, and where it very much didn’t.

The core problem was never the code

It was data flow: how do you find which coupons apply to one product, one cart, one customer, in real time, without hammering Shopify’s API on every page view. I mapped that architecture before writing a line, and AI pressure-tested each step as I went. Solo, working it out by trial and error, the same twenty minutes would have been a day of dead ends.

Then came the actual hard part

Combo discounts that stack differently depending on cart contents. Bank offers that don’t exist as real Shopify codes. Priority logic for when multiple codes could apply and only one should win.

Every decision point, I pressure-tested with AI first. Server-side or edge? How do you detect a combo without creating a real order to check? Where does priority logic actually live so it’s not buried in application code the next person can’t find?

AI didn’t architect any of this. I did. It caught weak assumptions before they turned into expensive rewrites, the same way a sharp colleague reviewing a design doc catches the thing you glossed over because you were too close to it.

What this changes, and what it doesn’t

Anyone can generate code now. That was never the scarce skill. Knowing what to build, where it breaks under real load, and which decisions are expensive to undo later, that skill just got more valuable, not less, because the cost of writing the wrong thing quickly went down and the cost of architecting the wrong thing didn’t move at all.

The build was easy. The thinking was the job. It still is.