May 23, 2026
How to rewrite your entire blogging platform in one prompt.
How I one shot migrating my Gatsby website to Astro with AI and all of the improvements I am now getting from doing so.
It feels like only yesterday that I took my blogger platform and migrated it over to Gatsby; the up and coming popular choice for statically rendered apps built using the flexible templating library react with Gatsby’s awesome GraphQL data backing.
There was only one problem. It sucked to work on.
A combination of difficulties due to the direction the framework’s owners plus some mistakes I made by choosing to bet the house on the brand new shadowing feature; I had found myself unable to build locally and relied on my build system and preview deployments to write my posts.
The final nail in the coffin was when pages was marked as deprecated and I would have to find a way to get my site up and building again in the new worker v3 platform. I believe this would have been problematic due to my blogging platform’s unwillingness to play ball with core-pack.
But how could I possibly find time to migrate from Gatsby to Astro?
Well obviously the answer is set codex to
yolomode and tell it to migrate it “with no mistakes”
Do mind the sarcasm; but that is genuinely what I did. I have been and likely will remain a sceptic of those who trust AI tooling to do all of their work without taking the time to own the code that it outputs. With that being what it is, the team behind codex had just released a new feature known as goals so why not try out it out and see how far it gets.
One Prompt and an Hour Later
Codex had completely rewrote my entire blogging platform into Astro. Not only that, I had told it to try and be sparing
with it’s use of react components and to prefer rewriting them in Astro. It wrote not a single line of react
How was this possible? Through the magic of a for loop!
Codex’s new goal feature effectively is a for loop that at the start of processing splits up your prompt into a series of tasks and continuously loops over those tasks, narrowing the scope of each context window to the smaller more achievable bite size task until it has looped over all of it’s tasks and concludes that the goal has been met.

This approach is effectively a ralph loop, however it comes with the added bonus of not needing to setup any custom tooling and theoretically it will be maintained as the models improve and therefore be a safer bet than a more diy ralph setup. However if you are looking to roll your own (say for example if your not using codex) then I can whole heartily suggest pi.
So does that mean that we are done?
Unfortunately no.
What LLM’s are really powerful at is figuring out what combination of tokens strung one after the other will get them the maximum reward from their training system.
This is all augmented into a system that is able to create vast quantities of code that will do it’s very best to be exactly what it’s training data would have expected of it. With smaller code changes, this can quite often lead to the exact code you asked for. In other occasions you will get the absolute bare minimum to build a shell that appears to meet the goals;
but once you take a look under the covers you find to be held up with duct tape and rubber bands.
Turns out that due to my request to minimise the amount of react paired with the complexity of rendering react from within astro’s mdx plugin, it had taken the choice to fudge some of the imports with a technically impressive custom plugin it wrote, which hot swapped imports from the existing posts that it was told not to modify.
The eventual fix was to just stop trying to support the gatsby project during a transition period and just migrate all the files to be under astro’s control, however this choice it made broke entire sections of my blog, if I had not been thorough in my testing I could have missed this.
The next fun discovery was how much heavier my new astro site was… Turns out codex didn’t seem to mind if we just used raw
img tags and just decided not to use the in-built astro <Image /> component, likely due to some confusion it was facing trying
to migrate the <GatsbyImage />. This one took a little longer to fix as I had to come up with a new approach in my css
of rendering/sizing the images produced by <Image /> as unlike <GatsbyImage /> does allot of hard work under the hood.
Where Does it Makes Sense to YOLO?
Even though I just mentioned all the ways yolo tried to do me in; I will say this: if you are building a weekend toy
project; a new system in which business rules are desired, but not yet enforced; a silly little tool to automate a
repetitive task that your happy to throw away: YOLO to your hearts content. The biggest downside to LLM generated
content is how convincing it is at writing code that feels and looks correct but either violates the business rules
you provided it OR didn’t ask you to clarify those same requirements.
In this project, does it really matter if my blog that a few people on occasion might stumble across has a visual bug or that one of the older posts that I didn’t check close enough was partially broken due to a mistake during the migration? I mean it sucks, don’t get me wrong, but what would suck more is if the pages deployment platform in cloudflare went down and I had no good way of getting new posts our or even worse, my site just went black and join in with the 65%+ links that have gone dead since January 2013.
The migration from Gatsby to Astro has dropped my page size approximately 40% thanks to no longer needing javascript and the advancements in default compression and format options that came out of the box with Astro. It took my builds that took minuets down to seconds and reduced my dependencies from roughly 30+ to 9.
Final Thoughts
Now that it doesn’t suck so much to be writing these posts I am planning on creating some about how I used LLM’s to generate bespoke scripts that diffed the legacy site to the Astro one along side collecting all the metrics I could as for as such as total page size.
I have also always wanted to get my comments back ever since loosing them to the migration away from blogger. I think that I might have finally found the perfect solution that is both fully free for myself plus allows me to bake in the comments and verify any and all content prior to it’s approval and placement onto my domain. So stay tuned.
I am still of the believe that if you are writing code that matters, you will need to exist and a LLM won’t be taking your job. the value developers bring to an organisation is their love of systems and their talent in taking what the business needs and converting that into processes that achieve those outcomes. Some coding jobs may flip to a more higher abstraction through heavier use of LLM tooling, but I dont see my desire to ever stop building these systems fading.
something not right? Open a PR