I keep a learning journal while I build: what changed, what broke, what I learned. I wanted it to become a blog that publishes on a steady rhythm, without depending on me remembering to post.
I build with Claude as the engineer. I set the direction, make the product calls and review what ships. This post is about those calls.
The constraints
Three constraints shaped everything:
- Writing a post should mean writing a text file. No CMS, no database.
- Nothing goes live under my name that I haven't read.
- The site stays static and on Vercel's free tier. It's a portfolio; it shouldn't need a server.
So posts are Markdown files in a posts/ folder, with a small header for title, date and summary, rendered at build time with marked. A draft: true flag shows a post when previewing locally and keeps it out of production builds. Pushing to main deploys.
A bug that published a draft
The first real test failed. A test post marked draft: true showed up in the production build.
The cause was a byte order mark: an invisible character some Windows tools write at the very start of a file. The header parser expected --- as the first three characters, saw the BOM instead, and treated the whole file as body text. No header meant no draft flag, so the draft shipped.
let raw = fs.readFileSync(file, "utf8").replace(/\r\n/g, "\n");
if (raw.charCodeAt(0) === 0xfeff) raw = raw.slice(1); // drop the BOM
The fix was one line. The way it failed matters more: silently, and open. A slightly malformed file didn't stop the build, it published. We found it because the test checked that a draft stayed hidden, not only that a live post appeared.
Scheduling without a scheduler
My first picture of the automation was a robot: something on a timer that wakes every few days, picks the next post and publishes it. That means a cron job, credentials with push access, and a process that has to work at 3am with nobody watching.
We went the other way. The publish date is just the post's date. Every approved post is already in the repo, and the site only shows what's due:
.filter((p) => preview || (!p.draft && !p.scheduled))
Nothing runs on a timer. On the day, the filter stops hiding the post.
Static pages are frozen at build time, though. A page built on Monday doesn't know a post is due on Thursday. Incremental static regeneration solves that: the blog pages stay pre-built but revalidate hourly, and a post's own page is generated on the first request after its date.
Two details made it work in production. "Today" is computed in Pacific/Auckland, so posts go live at midnight here rather than midnight wherever Vercel's server happens to be. And the posts/ folder is explicitly traced into the serverless bundle with outputFileTracingIncludes, because revalidation reads it at runtime, long after the build.
We tested it by running a production build locally, changing a future post's date while the server was up, and watching its page go from 404 to live.
Spacing that survives a slow reviewer
I wanted posts 3 to 5 days apart, and I asked specifically that they never land in a burst. Fixed dates would break that the moment drafts sat unread for a fortnight: everything overdue would go live at once.
So dates are recalculated at the moment of approval, starting from today or the last scheduled post, whichever is later. Approving a subset pushes the remaining drafts behind them. A post can be put back on hold any time before its date, but not after: the script refuses to take down something already live.
The date maths lives in a small script rather than in the skill's instructions, so the model writes the posts and plain code counts the days.
A review step adds a delay
Later I made every change to the site go through a pull request, so approving posts now opens one too, with each post's go-live date and a Vercel preview link. I read the posts on the real site before they're scheduled.
That broke the spacing in a new way. Dates are set when I approve, starting at least 3 days out. If the pull request then sits unmerged, those dates pass, and merging it late releases every overdue post at once: the exact burst the spacing exists to prevent.
So the skill checks before it merges. If the earliest approved date is today or earlier, it restores the posts from main, re-runs the approval so the dates start from now, rebuilds and pushes, and only then merges. Holding a post is the one exception: it has to land before the post's date, so it still pushes straight to main.
From journal to draft
The drafting is a Claude skill, /journal-to-posts. It finds journal entries no post has used yet, groups them by theme, and drafts each post. Each post records its source entries in a from: header, which is how the next run knows what's left.
The journal records what happened, not what I thought about it. So before writing, the skill asks me one question per post, and my answers set the angle. It doesn't invent opinions for me.
The first batch it produced read like a beginner's tutorial, stopping to explain what Git is. I sent it back. The rules it writes from now name the reader, set the depth, and require every post to lead with the problem and the outcome. This post is the second draft.
Two choices that did the work
The schedule lives in the posts' own dates, so there's no job that can fail overnight and miss a slot. And my review happens once, when I read a batch of drafts, rather than every time something publishes.