KO/EN
← Back to posts

Structuring a Service Whose Specs Keep Changing

8 min read

The hired gun who joined mid-flight

MyCREAM is an AI interactive-content platform where real influencers are cast and users take part through conversation and choices. I wasn't there from the start. I was brought in as a hired gun while the service was already deep in development, from mid-July to the end of October 2026.

The codebase I walked into was a monorepo with 8 apps and 12 packages. Not something a person could get their head around by reading it from the top.

So the start was a bit unusual. The moment I joined, the dev lead set up Codex and had it map out the whole project, and I started on the features that were needed that same first day. Instead of understanding all the code before working, I worked from what the agent had mapped and built up my understanding as I went.

How fast the plan changed

The team held meetings three times a week. We'd look at the metrics the product and marketing teams brought in, set the direction for the service, and development moved to match right away.

The criteria were pretty clear.

  • Where is user retention coming from?
  • Where do payments actually happen?

Then we'd strengthen whatever was getting heavy use. Once a meeting set the direction, tickets came out, and as soon as a ticket came out, a developer picked it up.

In an environment like that, code built to fit "this exact plan" easily becomes an obstacle the following week. So in the areas I owned, the key was building structure that would survive the next change of plan without a rewrite.

Splitting media out into a shared service

The biggest thing I worked on was media (photos and video). This is a service built around influencers, so media is the most important content there is.

The problem was that testing against real data was hard in development and staging. Local and staging had no real media, or only some of it, so checking how a screen would actually look, or whether recommendation and display logic really worked, meant copying production data over separately. In effect, every environment was managing its own media.

So I split media out into its own standalone service.

  • The media service has its own database.
  • Production, staging and local all use the same media service.
  • Each environment keeps its own app database and just links its own influencer IDs to people in the shared media service.
  • Each developer gets their own linking space, so several people linking things locally don't overwrite each other.

With that, I could work locally while looking at exactly the same photos and videos as production. Copying media around and keeping environments in sync stopped being a job at all.

Separating what changes from what doesn't

When splitting media out, what I cared about most was the boundary of responsibility.

  • Media service: only answers "what kind of photo is this?" Facts like ingestion, classification, labels and publication state.
  • App: answers "which photo goes where?" The rules creators set, and matching photos to those rules.

When a photo comes in, the media service handles it on its own. AI checks whether a person is the main subject, attaches labels like situation, outfit and place, and once the conditions are met, publishes it as ready for use in chat. The app just looks at those labels and picks photos that fit its rules.

The reason for splitting it this way is simple. When the plan changes, what changes is almost always the "where and how do we use it" side. "What kind of photo is this" barely changes no matter how the plan shifts. Mix the side that changes often with the side that doesn't, and every change shakes parts that never needed to move.

And this structure did survive several changes in direction.

  • July: I first built the media platform, centered on photos.
  • September: A new influencer photo collection feature came in. The media side stayed as it was; I only added a query path just for the collection.
  • October: Video arrived, along with a payment flow for unlocking locked videos. On the media side that ended as an extension adding video upload and playback, while the unlock policy and screens were handled in the app.

I never had to redesign the media structure for a new feature. I only extended it.

The cost of sharing — when versions drift apart

Of course, being shared came with a cost. Staging and production call the same media service, but the two environments aren't always on the same app version. New features land on staging first, and there's always a window where production is still on the previous version.

If you change the media service to fit the new feature during that window, staging works fine but production's media calls blow up. Problems in media API calls during those version gaps did happen from time to time.

So whenever I extended media, the first thing I checked was that production wouldn't be affected. Leave the existing calls as they are, and add whatever the new feature needs as a new path or a new field. Building a separate query path for the photo collection instead of changing the existing query was for the same reason. A shared service has to change based not on "the environment I'm looking at right now" but on every version currently calling it.

Building with an AI coding agent

Nearly all the implementation went through Codex. A codebase too big for any one person to read, and a direction that shifted three times a week. Under those conditions, having the agent map the code and write it while people set the direction and boundaries was simply the best fit. If people had to read and write everything themselves, the plan would have changed again before anyone finished understanding the code.

To keep the agent from writing whatever it liked, we put the rules in writing. There's an agent guide called AGENTS.md at the repository root, written by the team together. A few of the principles that stuck with me:

  • Prefer architecturally complete solutions over temporary patches.
  • Fix root causes, and don't casually add defensive code that hides the problem.
  • Reuse existing code, patterns and helpers before writing new ones.
  • When duplication shows up, extract a shared module, but don't abstract prematurely.
  • When the docs and the code disagree, check the code and fix the docs.

The workflow was set by rules too. Each ticket gets its own short-lived branch, finished work goes up as a PR, and it only merges after passing CI. A merge deploys to staging automatically, and production goes out after approval.

Within that setup, my role was less about writing code line by line and more about deciding what lives where, and checking that the agent respected those boundaries. And that check was the most important part.

Codex has its dumb moments too. Now and then it would build a feature differently from what the plan intended, or touch some unrelated part of the code that had nothing to do with the task. The code looks plausible and the tests pass, so unless someone who knows the intent and the scope looks at it, it goes straight in. So when reviewing PRs, before asking "is the code right?", I first asked "was this built the way the plan intended, and did it stay out of places it shouldn't touch?"

That's how I shipped more than 150 PRs in three and a half months.

What went well, and what I'd do differently

What went well

  • Drawing the media boundary first. Big features kept landing one after another — the photo collection, video, paid unlocks — and the media side held up with extensions alone.
  • Being able to develop against real data. Checking locally with the same media as production meant fewer "it worked on staging but looks off in production" moments.
  • Contributing from day one. With the agent handling code discovery and the rules written down, I could ship features right away with no ramp-up period, even joining mid-project.

What I'd do differently

  • Moving fast also broke existing behavior. A few times, adding a new feature broke something that used to work fine, like dragging a bottom sheet closed or how locked video cards were shown, and I had to go back and restore it separately. The faster an agent writes code, the more regression tests matter.
  • Catching the shared-media version problem sooner. It took a few rounds of media calls blowing up while staging and production versions drifted before "check the production impact first" became a habit. If I'd set up something to verify backward compatibility from the start, it would have saved some pain.

In the end, surviving a service whose plans keep changing came down to two things: separate what changes often from what doesn't, and let things be written fast, but within the rules.