Writing blog posts with the help of LLM agents
All the posts on this blog start with something I built and tested. Once I have something working, I often want to blog about it. I will start writing those posts with the help of LLM agents, and in this post, I will explain how. I use a coding agent that I drive with plain Markdown files. This is an experiment for me: the workflow itself will evolve as I use it.
The style guide
Before I started this workflow, I asked an LLM to read all 19 of my past posts and distill my writing style into a single file. This file is the reference for every post I write now. It describes my voice, the structure of my posts, the conventions I use, and a checklist I run against every draft.
The first version was wrong in a specific way. It repeated my grammatical and syntax errors as if they were part of my style, so I asked the agent to remove those patterns. There is no reason to repeat errors that were never intentional style.
I am not planning to re-distill the file from my future posts. Those posts are LLM-assisted, and I do not want the file to start describing the writing of the AI instead of my voice. If my style changes, I will add to the file myself.
The seed
Every post starts from a working artifact. I build the thing first, and the post comes afterwards. This is what keeps the posts concrete: I describe a result, not a plan.
For each post, I create a folder with a file called seed.md. In the seed file, I point to the working code, usually a public repository or a specific file in one, and I do a brain dump of what the post should be about. The seed file contains rough sentences and lists, structured or not. The seed of this post starts with "I want to create a post that explains how I use LLMs and agents to generate my blog posts", which is exactly the kind of sentence the rest of the pipeline has to tidy up.
The outline
I run the outline skill, blog-post-generator-outline, on seed.md. It reads my style guide and the code I pointed to, and it produces outline.md in the post folder: the planned sections of the post, and what goes in each of them.
I go through the outline, keep what I like, and refine the rest. I make these changes either by prompting the agent, or by marking the exact lines in the file with AGENT_TODO markers. I will explain AGENT_TODO markers in this separate post.
Every decision I make at this stage, the agent records in memory.md next to the outline, so that the next stage can run from the folder alone.
The post
I run the second skill, blog-post-generator-expand. It reads outline.md, memory.md, seed.md, and my style guide, and it writes the full draft of the post as post.md in the same folder.
I then go through the draft section by section and correct it. I correct with the agent, through prompts or AGENT_TODO markers, or I edit the file myself when the change is small. Once I am happy with the result, I publish it.
The post folder
At the end of the process, the post folder contains four files, each produced by a different stage:
seed.md: my rough ideas, written by handoutline.md: the plan, refined by mememory.md: the decisions I made, recorded by the agentpost.md: the published text, corrected section by section
The folders sit in a private repository that is under version control. I keep them for future reference: if I need to make a small correction to a post later, the seed, the decisions, and the text are all there, and an agent that I point at the folder has all the context it needs to make that correction.
The output of the pipeline is the folder itself. The same is true of this post, which was produced by the process it describes: its seed, outline, and memory files sit in its folder, and the corrections it contains were made the same way.
Additional automations
Beyond the outline and the draft, the agent takes care of a few boring but important details while it writes the post. The ones I notice most are the following:
- It reads the files in my repository and copies the code snippets into the post. I do not copy and paste code by hand between my repository and the post.
- It links to the files at the commit the post is written about. My repositories evolve, so a plain link to a file can point at different code, or disappear, a year later. Pinning each link to the commit SHA keeps the links working.
- If I change something in the repository after the post is written, I can tell the agent to sync the post with the new state. The
memory.mdfile records where each snippet came from, so I do not have to go and find a past conversation. - It suggests tags for the post at the top of the file, which I keep or adjust before publishing.
Limitations
- The agent still gets details wrong. Every stage needs a pass by me before the post goes out.
- The style guide is a snapshot of my 19 human-written posts. I deliberately keep it that way: I do not re-distill it from LLM-assisted posts, so the file keeps describing my voice, not the AI's.
- The process is tied to the tools I use, a skill-based coding agent and plain Markdown files. It is a personal workflow, not a general solution.
- Posts written this way can read as AI-generated. This post is the standing disclosure for them.
Future work
There is one gap I have not solved yet: images and screenshots. The process produces text, and I have no plan yet for how screenshots get into the posts. I am considering two options. I add the screenshots together with the seed file, or I ask the agent which screenshots would be useful and I take them myself.
Conclusion
In this post, I described how I will write my future blog posts with the help of LLM agents. I distilled my style into a file from my 19 past posts. Each post starts from a working artifact and a seed file of rough ideas. The outline skill turns the seed into a plan I refine, the expand skill turns the plan into a full draft I correct section by section, and every step stays together in one folder.
The agent produces the first draft, I make the decisions, and the post always describes a working solution that I have already built myself (possibly with the help of agents too).
Comments
Join the discussionNo comments yet. Be the first to comment.