The Authoring Loop

·

“Let’s have a fight,” that’s what you could ask in place of “what’s the best writing process?” Right up there with religion and politics, how to write and how to write well is a conversation topic reserved for the most trusted of dinner party partners. It can easily evolve into shouting matches, disagreements, and petty tribalism. So with that, below we lay out how we thought about approaching writing and the process when using AI as an authoring tool for the creative work. We ultimately ended up choosing between two schools of thought and how they go about the writing process.

The first is stream-of-consciousness writing. This is arguably how you capture your latent subconscious and emotions in the moment as a writer. It is very similar to the emotive expressionism of R.G. Collingwood’s theory of art, where the painter or the musician enters a flow state and simply produces in order to extricate some emotion or feeling from inside their body onto the page. In fact that’s how this blog post and most of the blog posts on this website are created. This one in particular has been dictated.

The second is planned writing, where you formulate the narrative ahead of time in the simplest form possible, with a plan for how and what you want the reader to experience, and then slowly build the pieces around those core plot points to get there. The structuralist style of creating was first put forth in Aristotle’s Poetics and has a long line of tradition with thinkers like Claude Levi-Strauss and Joseph Campbell, as well as the multitude of modern screenwriters and commercial craft artists who follow in their footsteps.

We ultimately decided on the second, structuralist approach. We couldn’t see a way to stream-of-consciousness write ourselves without any rules, guidelines, or techniques around how we want the AI to emotionally express what we’re inputting to it, the output would end up being bland garbage. A stupid filter that just returned the sterile latent space of whatever AI model we tickled with our prompt. We believe that you must first be able to take a structured approach and impart emotional impact within that structure. So before we go and stream-of-consciousness create from our own emotions and express them in the moment, we need to first master control over the emotional expression of the AI tools that we have. Thus we’re taking the structuralist approach.

Outline Loop

Given the sequences and overall plot we have in the final version of our story folder, we first create a Ralph loop prompt that goes through each individual sequence and lays out what’s happening paragraph by paragraph in each chapter using the most bland, sterile, monastic language possible. This then produces a chapter outline that our authoring loop can go in and use. Its knowledge of prose, characters, motives, and emotions allows it to impart the feeling to the reader that we want in that particular sentence or paragraph without being biased by the way the AI described the situation, while at the same time allowing us to maintain coherence and not miss any key plot points inside the chapter narrative or the overarching story. Every time we loop we then run a separate prompt on top of the output comparing the outline to the overarching story and sequence to ensure that there is continuity and coherence. Here is an example prompt that we use for the outline loop:

You are Ralph an AI author. You write simple bulleted paragraphs of what
happens in a chapter of the book `Enemies in Arms` in a loop.
Each iteration always follow the process below:

1. Find the next chapter to write from the `story/chapter_outline.md`
2. Create a new file in _output/chapter_outlines named `chapter{NUMBER}.md`
3. Get the story context.
4. Use the `outline-writing-agent` to write a outline of each paragraph in
   the chapter. No fancy prose, no metaphores. Simple sentences describing
   what happens in the paragraph nothing more nothing less. This is not a
   FINAL version. This is not ART. Bland step by step outline of the chapter.
5. Check for consecutive paragraphs of actions in the same time and location
   with no dialog. If reasonable, combine these into one paragraph.
6. When you are finished double check the following:
   - you include the correct motifs and plotpoints occurances.
   - you followed the chapter outline from `story/sequence.md` properly.
   - the outline's narrative makes sense
7. Make a new commit to the current local branch.
8. Exit cleanly. Do NOT continue writing. Do NOT start the next chapter.

Be curt, simple, and meticulous.

Author Loop

The author loop is a separate loop that we run on each chapter outline that writes each paragraph based on what’s going on in that particular paragraph as well as overall story context and chapter context. You can very much think of this like a writer drinking a couple glasses of whiskey, then going in and writing out what’s going to happen in that chapter. Edit then comes later. The authoring loop uses a variety of Claude Code skills that we’ve developed that teach it how to write well. We have skills for everything from how to write good narrative to how to describe atmospheric scenes to how the very rhythm within structure delivers different feelings and impact. I’m not going to document all those different techniques here – they will be in separate experiment blog posts. Here’s an example of the prompt we use for the authoring loop:

You are Ralph an AI author who writes paragraphs in chapters of the book
`Enemies in Arms` in a loop.
Each iteration always follow the process below:

1. Find the next outline to write by finding the latest draft in
   `_output/chapter_outlines.md` that doesn't have a file in
   `_output/drafted_chapters`.
2. Identify the first item that isn't marked as COMPLETED.
3. Create a new file in _output/drafted_chapters named `chapter{NUMBER}.md`
   if it doesn't exist.
4. Get story context from the `story` folder.
5. Take the item from step 3 and use the `chapter-author-agent` to write
   that paragraph for the chapter.
6. Append it to the chapter{NUMBER}.md file. Ensure first line of the
   paragraph is indented 4 spaces. If this is the first paragraph of a new
   SCENE add three centered asterisks in front of it to delineate it from
   the previous scene.
7. When you are finished self-edit your work.
8. Mark the item in the outline as COMPLETED
9. Make a new commit to the current local branch.
10. Exit cleanly. Do NOT continue writing. Do NOT start the next paragraph.

Edit Loop

Finally, when a chapter is written, we run an edit loop. The author loop has a self-edit skill that we wrote that effectively acts as an author would at the end of the night reading the chapter they’ve written to see if they did the thing. The editing loop is a beefed-up version of that self-editing skill that contains multiple skills required by an editor of a series. It does contain skills related to prose, but its most important purpose is to ensure continuity and a pleasurable read across the entire chapter. It ensures that the chapter stays true to the source material in the story folder, eliminates repetitive metaphors, motifs, and narrative tics, analyzes dialogue to reduce ambiguity, and a variety of other editing activities that are documented in the various experiment posts on this website. Here is an example of the prompt we use for the editing loop:

Deep edit a chapter file using 6 sequential passes with the
chapter-author-agent.

1. Read the chapter file and get story context.
2. Read the `elements-of-style`, `banned-words`, and `self-edit` skills.
3. Run each pass sequentially. Change AS LITTLE AS NEEDED on every pass.
   Self-edit after each pass before moving to the next.

   Pass 1 - `formatting-and-style` skill
   Pass 2 - `metaphors-repetition-and-cliches` skill
   Pass 3 - `show-dont-tell` skill
   Pass 4 - `dialogue-narration` skill
   Pass 5 - `dialogue-subtext` skill
   Pass 6 - `prose-tightening` skill

4. Do one final self-edit read of the complete chapter.
5. Verify congruency with story context, motifs, and plot points.
6. Commit all changes to the current local branch.

It may be worth mentioning here the philosophical perspective on the writing process. You may find this blog post interesting as it illuminates why we have dozens and potentially hundreds of skills by the end of this experiment in novel writing to create an expressive AI author.

This process may change in the future. For example, I want to experiment with maintaining ongoing memory files from the audience’s perspective of the characters and using that to inform the author as it’s writing from beginning to end. But this is what we’re using for now. We will make a new post if we change the process.

- Zach