Back to Home

Why AI Needs Structured Code

I built a structured code platform to optimise the development process and the code it generates. Then AI came along—and it turned out to be the perfect fit.

The (initial) problem I set out to solve

If, like me, you've built web applications, you know the landscape. Dozens of libraries and frameworks, each solving one piece of the puzzle in isolation. Your frontend framework doesn't know about your backend. Your validation library doesn't talk to your database layer. Your state management has no awareness of your API structure.

Every project becomes an exercise in duct-taping independent solutions together and hoping they play nice (for as long as possible).

I wanted a more sustainable, predictable framework—an extension of Laravel that carries its philosophy across the entire stack. One framework that gives you all the capabilities you need, with everything aware of everything else.

I built Stellify for myself, to solve that problem. It was a exercise on achieving structure and standardisation. My solution centered around two core decisions: choosing a single stack and rethinking how code is stored.

The Stack

The first decision I made was choosing a stack and committing to it. I chose Laravel as the backbone because I think it does the best job of any framework at organising and standardising how web applications are built. On the frontend, I created StellifyJS—think of it as Laravel's philosophy applied to JavaScript—with adaptors for Vue, React, and Svelte so developers can choose their preferred reactivity layer (though, in the spirit of having "one stack", Vue is the default).

Picking a set stack isn't a limitation. It's a foundation. It means every Stellify project speaks the same language, follows the same patterns, and that's what makes everything else possible.

Code as Data

The more radical idea I came up with was rethinking how code is stored. In Stellify, your code isn't sitting in text files—it's stored as structured JSON at a granular level. Every method, every statement, every clause is its own piece of data that can be queried, referenced, and reassembled into PHP, JavaScript, HTML—whatever's needed.

Think of it like the difference between editing a Word doc and editing a spreadsheet. Both hold data, but one lets you target a specific cell without touching anything else. That's what Stellify does for code.

Your entire codebase becomes something you can reason about programmatically, not just read line by line.

AI is here (along with some new problems)

And this is where AI arrived. AI is incredible at writing code in isolation. But ask it to change existing code—or understand why that code exists in the first place—and things can fall apart fast. It loses track of what it's building, how decisions were made, how everything connects. It also doesn't produce the same output every time, which makes it hard to build on top of its previous work. In short, it's unpredictable—and unpredictable isn't good!

Stellify aims to solve this through the structure and metadata it provides. Because the code is stored as JSON, we can attach text descriptions that capture nuance and intent—not just what a method does, but why it exists and how it relates to everything else (even which method it is in cases where the same method name is used in multiple classes). AI isn't guessing or searching for answers anymore. It has persistent context.

The predictable structure and metadata keep it on track. If AI is working on a feature, it can update the metadata to reflect what it's done, what it still needs to do, and how it connects to the rest of the system. It can even use the metadata to decide what to work on next based on what's most important or what has the most dependencies—opening the door to feedback loops...

The final piece: Feedback loops

The last piece is what makes it all come alive. Stellify creates feedback loops between AI and your codebase. As AI works, it updates the metadata and references around it—so the next time it runs, it's not starting from scratch. It has a fresh picture of what it achieved, what changed, and what still needs doing.

Say AI creates a new API endpoint. It doesn't just write the route—it updates the metadata (which is persisted) so the next prompt knows that endpoint exists, what it returns, and how it connects to the frontend. The codebase becomes self-documenting as you build (literally, Stellify, along with AI, documents your system for you).

It's the difference between AI as a one-shot code generator and AI as something that genuinely builds alongside you.

The merger and future vision

That's what Stellify is. A contained, structured development process where AI doesn't just write code—it understands the project it's working on.

There's still a long way to go. Speed is an issue, and that ties in with caching (always complex). Feedback loops are still early and need work to be truly seamless. But the foundation is there—and for me, it's already changed how AI builds software.

The last piece of the optimisation puzzle is data, the more people build the more I can analyse and optimise the platform, so go ahead and give Stellify a try for yourself and be sure to let me know what you think, good or bad, I'd like to hear about your experience!

Happy building!

Try it yourself

If you're a developer who's tired of the chaos, come try it. It's free to start.