Skip to content

IsaiahN/Serendipity-Engine

Repository files navigation

Serendipity Engine

A structured random story generation system built for humans and LLMs.


Quick Navigation

I want to… Go here
Start generating a story now MetaFiles/Master-Story-Checklist.md
Write as myself, not a generated author MetaFiles/author-profile-template.md
Understand how the system works How to Use It
Use this with an LLM Writing Workshop in a Box
Reverse-engineer an existing story Decomposition
Extend, adapt, or write a sequel Decomposition — Build and Extend / Weaponize sections
Understand why the system is built this way The Three Theoretical Pillars
See all reference files Key Files at a Glance
See why writing is hard Why Writing Is Hard

What This Is

The Serendipity Engine is a reference system for generating fully realized stories from scratch. It works by building a story from the outside in — first the author, then the narrator, then the world, then the characters, then the relationships, then the story itself — using seeded randomization at every step to break creative defaults and produce combinations that wouldn't emerge from deliberate selection.

It is not a writing tool. It does not write the story. It generates the complete architecture — the author's psychology, the world's rules, every character's identity and wound, every relationship's dynamic — so that when writing begins, the structural decisions have already been made by the system rather than by the operator's preferences or blind spots.

The goal is to make the author a stranger to their own story. Strange combinations produce genuine discovery.

The system is medium-agnostic and format-agnostic. The architecture it builds — wound, world, cast, relationships, tonal arc — is the same regardless of what you are making. Novels, screenplays, stage plays, graphic novels, audio dramas, video game narratives, short stories, narrative podcasts, long-form journalism, biography, documentary. The Narrator phase and prose style selection are where medium-specific decisions live; everything else transfers directly. If it has characters, a world, and something at stake, this system can build it.


The Three Theoretical Pillars

The system is built on three interlocking theories. You don't need to read them to use the checklist, but they explain why the system works the way it does.

1. Story Consciousness Theory (MetaFiles/story-consciousness-theory.md) A character is conscious when they are caught between two conflicting knowledge streams — what they've personally lived (Stream A) and what their world tells them is true (Stream B). The story is the weighted integration of those two streams under pressure. Every scene, arc, and climax is a function of which stream wins. Characters without this tension are not conscious — they are props.

2. Story Network Theory (MetaFiles/story-network-theory.md) A story world is a distributed intelligence system. No single character can carry the full intelligence of a theme. The protagonist is one neuron — important, but temporary. What the world learns through the protagonist, and whether that learning persists after they're gone, is the story's true subject. Character diversity isn't a moral goal; it's a structural requirement. Four archetype functions must be distributed across the cast for the network to function.

3. The Seven Story Deaths (MetaFiles/seven-story-deaths.md) The seven conditions that kill intelligence in networks apply equally to stories. A story can be killed by: centralizing everything in one character (The Monolith), letting consequences vanish (Amnesia), treating hierarchy as natural (Hierarchy), severing the cast from each other (Isolation), repeating instead of varying (Monoculture), locking the world in the past (Stasis), or cutting the story off from anything larger than itself (Closure). These aren't writing tips. They are structural failure modes that operate invisibly until the draft is dead.


How to Use It

Start here: MetaFiles/Master-Story-Checklist.md

The checklist walks the full pipeline in order:

  1. Seed the engine — generate a datetime-based seed from MetaFiles/randomization-engine.md. Record it as line 1 of your session file. All rolls derive from it.
  2. Build the Author — the author is the first character. Their psychology, wound, prose style, and worldview become the lens through which every subsequent decision is filtered.
  3. Build the Narrator — the mask the author puts on. The gap between author and narrator is where irony and unreliable narration live.
  4. Build the World — genre, themes, plot structure, world rules, and a check against the seven story deaths.
  5. Build the Cast — define cast architecture first, then roll each character fully. Every character is built the same way the author was.
  6. Map the Relationships — roll dynamics, attachment styles, and structures for every significant pair. Build the relationship graph.
  7. Build the Story — know the ending first. Then the arc, tonal arc, subplot map, and outline.
  8. Review against the MetaFiles and craft reference — Phase 7 checks all three theory files plus the 7-element story diagnostic (Story/story-elements.md) before writing begins.
  9. Cross the bridge — a short dedicated section between Phase 7 and Phase 8 addresses the threshold problem: the gap between a fully built story and the first sentence of the draft. Five orientation questions that are not gatekeeping — they are the act of turning to face the work.
  10. Execute chapter by chapter — with a per-chapter checklist and a running relationship graph.

Writing Workshop in a Box — Using This With an LLM

The Serendipity Engine is designed to be used collaboratively with a large language model. Every reference file is a briefing. Every checklist step is an instruction the LLM can execute, reflect back, or ask you questions from. The system does not require an LLM — but with one, it becomes a full structural writing workshop that runs in a single session.

What you can do with an LLM and this system:

  • Generate complete story architecture — paste the relevant reference files as context and run the checklist phase by phase. The LLM rolls, selects, synthesizes, and produces the output files. You get a complete author profile, world, cast, relationship graph, and outlined story before a single word of prose is written.
  • Generate a first-pass draft — once the architecture exists, the LLM has everything it needs: the author's voice fingerprint, the narrator's type and reliability level, every character's wound and speech pattern, the tonal arc, and the chapter outline. A first-pass chapter is a legitimate output of a fully populated session. Treat it as raw material — not finished prose, but scaffolding with real structure under it.
  • Use the system as a structural editor — paste an existing draft and run the Decomposition Mode. The LLM audits your work against the same framework used to build it, surfacing gaps, missing threads, and structural failures you cannot see from inside your own draft.
  • Run the author questions interactively — instead of filling out MetaFiles/author-profile-template.md alone, have the LLM ask you each question in turn, push back on vague answers, and compile your responses into the final author profile. This turns the template into a real interview.

If you want the story to feel like yours:

Do not generate a randomized author. Make yourself the Author.

Open MetaFiles/author-profile-template.md. Answer every field — your actual wound, your actual voice, your actual blind spots, your actual Big Picture Statement. The system will then build the world, cast, and story around the psychology you brought in, rather than a stranger's. The randomization still operates in every other phase — the world's genre, the characters' attributes, the relationship dynamics — but the lens through which all of it is filtered will be yours.

This is the difference between using the system to explore what a story could be and using it to build the story only you could write.


Folder Structure

MetaFiles/          ← Theory documents, operational tools, and reference files
Characters/         ← Identity, Personality, Development, and Names list files
  Identity/
  Personality/
  Development/
  Names/
Relationships/      ← Relationship types, dynamics, and structures list files
Story/              ← Genres, themes, narrator, plot structure, world building
  World Building/
Creations/          ← Generated stories live here (created per session, not tracked)
  story-{YYYY-MM-DD}/
    author.md
    narrator.md
    abstract.md
    outline.md
    characters/
    relationships/
    world/
    story/
Decomposition/      ← Reverse-engineered existing works (see below)
  story-{title}/
    test-{title}.md       ← the source text
    author.md
    narrator.md
    abstract.md
    outline.md
    characters/
    relationships/
    world/
    story/

Decomposition

The engine can also run in reverse.

Given an existing work — a novel, a play, a screenplay, a short story — you can decompose it using the same phase structure as the checklist, inferring the attributes the author likely set (consciously or not) rather than rolling them fresh. The result is a complete structural audit of the source material in the engine's vocabulary.

What decomposition gives you:

  • Unpack what made a story work — map the architecture beneath the prose, identify what decisions (character type, wound, arc shape, plot structure, tonal arc) were load-bearing, and see the framework the author used even if they never named it

  • Find gaps in the narrative or lore — the audit surfaces threads the story opened and didn't close, world-building that was sketched but not developed, and structural weaknesses the original author may not have noticed or chose to accept

  • Create prequels, sequels, spinoffs, and POV shifts — once the world's architecture is decomposed, you have a blueprint for extending it; the same framework that built the original story tells you what territory it left unexplored; a POV shift (the same story from a different character's perspective) is a direct output of the character and relationship decompositions

  • Build and extend trilogies and multi-installment series — a decomposed first story becomes the structural floor for every installment that follows. The sequel's job is not to repeat the first story — it is to use the established world, cast, and rules as a known ceiling and then push through it: deeper into the world, further along the character arcs, or into territory the first story deliberately left dark. A well-designed series also doubles back — a later installment can make a decision or image from the first story suddenly revelatory, recontextualizing it entirely without contradicting it. This is what authors withhold: not because the material doesn't exist, but because one story cannot hold everything the world contains. Decomposition surfaces what was withheld — the threads planted but not paid off, the characters sketched but not developed, the rules established but never tested to their limit — and those gaps are the sequel's natural territory.

    The test for a revelatory update: it must make prior installments more true, not differently true. When it works, the audience holds the new fact against everything they already knew and feels the click of recognition — the sense that this was always the case and they simply hadn't seen it yet. When it fails, they feel confusion or betrayal instead, because the new fact contradicts the emotional logic of what came before rather than deepening it. Recognition and confusion are not matters of taste — they are structural outcomes. Recognition means the groundwork was in the earlier story. Confusion means it wasn't.

    Why prequels fail: a prequel is not a story set earlier in the timeline — that is a location, not a reason to exist. A prequel earns its existence only if it answers a question the original story raised but could not answer from inside its own frame: what created the conditions the protagonist inherited? What happened to produce the wound that made the villain? What was the world before the rules the original took for granted were established? A prequel built to answer those questions uses the original as its load-bearing ceiling — every scene is in conversation with something the audience already knows, adding depth downward. A prequel built instead to mine audience attachment to a world — to deliver more of a thing people liked — has no structural reason to exist. It can only produce callbacks, never revelation. The framework catches this at Phase 1: if the prequel's Big Picture Statement cannot be stated independently of nostalgia for the original, the story has no wound at its center and no question it exists to answer.

  • Expand the world and weaponize its own logic — a decomposed world carries more than its plot used. The hallmarks, mechanics, societies, and rules that were established in service of one story's argument can be turned, combined, or collided in a subsequent story to produce effects the first installment made possible but never delivered. The most devastating twists in long-form fiction are not invented from nothing — they are made by taking two things the audience already accepts as true about this world and showing them what happens when those two things are in the same room at the same time. The reader already knows both facts. They simply never held them together. Decomposition maps all the world's live wires — the mechanics with untested edge cases, the societies with unresolved contradictions, the hallmarks whose symbolic weight was established but never fully spent — and those are the exact points where a writer can apply pressure to produce shock, grief, revelation, or devastation that lands because it was always structurally inevitable.

  • Generate derivative works in different registers — a decomposed story combined with a different author profile, writing style, tonal arc, or medium (novel → play, play → film adaptation) is the structural engine behind works like Wicked relative to The Wizard of Oz: same world, same characters, different author psychology, different POV, different thematic angle, transformed result

The difference between The Wizard of Oz and Wicked is not that Gregory Maguire wrote about Oz. It is that he decomposed Oz with a different author Enneagram, inverted the POV to the Wicked Witch, shifted the moral alignment of the Wizard from True Neutral to something darker, and changed the tonal register from earnest-wonder to political-cynicism. Every one of those is a Serendipity Engine lever.

Reference decomposition: Decomposition/story-the-wonderful-wizard-of-oz/ The full structural decomposition of L. Frank Baum's The Wonderful Wizard of Oz (1900), including author profile, narrator analysis, world-building audit, chapter-by-chapter outline, full attribute sheets for all six major characters, relationship graph, and a final comparison of what the engine would have generated differently. The source text is included at Decomposition/story-the-wonderful-wizard-of-oz/test-the-wizard-of-oz.md.


Key Files at a Glance

Operational tools:

File Purpose
MetaFiles/Master-Story-Checklist.md Start here. Complete 8-phase workflow
MetaFiles/author-profile-template.md Real Author / Persona template. Use instead of Phase 1 rolls when you are writing as yourself or a deliberate persona. Covers every Phase 1 field through reflection rather than randomization — Identity, Personality, Development, Voice & Craft, Writing Identity, Blind Spots, and Big Picture Statement.
MetaFiles/randomization-engine.md Datetime seeding + roll derivation algorithm
MetaFiles/relationship-graph-template.csv Relationship matrix — copy per story. Three tiers: major characters (full rows/columns), minor characters (append (minor) — sparse cells, load-bearing ones filled), society/group characters (append (society) — governing bodies, oppressed peoples, institutions, collective identities that act as pressure systems on individuals).

Theory documents:

File Purpose
MetaFiles/story-consciousness-theory.md Character consciousness framework
MetaFiles/story-network-theory.md Story-as-network framework
MetaFiles/seven-story-deaths.md Structural failure modes + antagonist design

Author & character reference:

File Purpose
MetaFiles/writing-prose-styles.md Author prose style reference
MetaFiles/language-content.md Content rating + profanity + banter patterns
MetaFiles/tonal-control.md Tonal arc design · tone types · drift check · tone failure modes
Characters/Development/values-code-selfcare.md Core values, personal code, and self-care rolls
Characters/Development/character-voice.md Per-character voice fingerprint · speech rhythm · vocabulary · tic · metaphor family · defensive pattern · subtext default
Characters/Development/cascading-attributes.md Attribute dependency graph · recommended roll order

Story craft reference:

File Purpose
Story/story-elements.md 7-element diagnostic — Theme, Character, Setting, Plot, Conflict, POV, Style
Story/narrative-techniques.md Full craft device taxonomy — 8 groups, 78 techniques
Story/plot-twist-types.md Twist archetype taxonomy — 7 categories, 47 types
Story/plot-structure.md Story structures, conflict types, scene framework, stakes
Story/themes-and-tropes.md Theme clusters and trope patterns
Story/narrator.md Narrator types, POV, reliability, tense, distance
Story/genres.md Genre list — rolled for Author (Phase 1) and Story (Phase 3)
Story/world-hallmarks.md Phase 3 active tool. Read this file during Phase 3 — World Building to build world/hallmarks.md. Defines six hallmark categories (Object / Artifact, Place / Path, Force / Phenomenon, Mechanic / Rule, Symbol / Visual Motif, Event / Moment), the poster test and two supporting tests for qualification, the per-entry format (9 fields), and the boundary rules distinguishing hallmarks (escape the text; recognizable to outsiders) from callbacks (reward the prepared reader; do not survive outside the text). Full step-by-step build instructions in the checklist Phase 3 — World Hallmarks step.

Design Principle

Every list file specifies who rolls (Author / Character / Story), how many times, whether there are probability weights, and what foil or pairing logic applies. The randomization engine is file-agnostic — it only provides the mechanism. The files provide the meaning.

When a roll produces something strange or uncomfortable: keep it. Regression to the mean is not random. The strangeness is the system working correctly.


Why Writing Is Hard

Most would-be authors sit down believing writing is one skill. It isn't. It is six simultaneous disciplines that have to cohere in real time, in every scene, all the way to the last page:

Discipline What it requires
Structural architecture Plot, arc, and subproblem threading — the load-bearing skeleton. Every scene must advance, complicate, or pay off something. A scene that does none of these is structurally absent regardless of how well it is written.
Psychological modeling Every character's inner life, its distortions, and the gap between what they believe and what is true. Characters who behave consistently with their wound — and inconsistently with their stated self-image — feel real. Characters who don't, don't.
Sociological modeling Society as a character. What the world costs the people who live inside it, and what it demands from them in exchange for belonging. Stories without this have characters in a vacuum — technically present, structurally floating.
Sensory and scenic craft Setting doing active work — exerting pressure, externalizing interior state, carrying history, creating contrast. A setting that does none of these things is a stage direction, not a scene.
Voice The prose itself. Sentence rhythm, register, the specific vocabulary a character or narrator reaches for under pressure. The per-character voice fingerprint — speech rhythm, vocabulary register, dialogue tic, metaphor family, defensive speech pattern, subtext default — is rolled the same way any other attribute is.
Tonal control across time Sustaining, escalating, or deliberately breaking the story's emotional register across a draft that may take months or years to write. Tone drifts. The writer's real season leaks into the fictional one. Managing that drift — using it when it serves, correcting it when it doesn't — is craft at the level of the whole work, not the scene. The tonal arc is designed in Phase 6 and checked at the start of every drafting session.

There is a seventh failure mode that operates before any of the six disciplines are engaged: mistaking content for story. A writer who starts from world — from setting, lore, characters, timeline — rather than from wound has no question the story exists to answer. They produce material that is recognizable and internally consistent, sometimes beautiful, but structurally hollow. Readers who already care about the world will enjoy it. Everyone else will call it a tour. The same failure applies to sequels, prequels, and spinoffs that are built from audience attachment to a prior work rather than from a new wound with a new question: they can only produce callbacks, not revelation. The system catches this at Phase 1 — no world, no character, no outline is built until the Big Picture Statement exists. That statement is the wound made explicit. If it cannot be written, the story does not yet exist.

The Serendipity Engine addresses all seven structurally. The quality of what the system produces from that structure is still on the writer — but the ground is load-bearing before the first sentence is written.


Why "Serendipity"

On the surface, the name describes the Author's experience: the system surfaces a story you didn't plan, full of specificity you couldn't have arrived at by deciding. You find something you weren't looking for. That is serendipitous.

But the name holds at every level.

Every character in a generated story arrives at their position the way real people arrive at theirs — through conditions they didn't choose. Family by circumstance. A world with specific rules by birth. Those rules determined what attachments were permitted and which were ruled inadmissible. The character's wound, flaw, and virtue emerged from the collision of those conditions with a psychology they also didn't choose. By the time the story begins, each character is already the product of a long chain of chances they never called.

Their agency — what they do once they arrive — is real. The conditions themselves were serendipitous.

So the name is true at every level simultaneously:

  • The author finds the story — circumstance determines what the story is about
  • The characters find themselves in the plot — born into positions that generate the conflict
  • The reader finds themselves in the story — the mirror structure invites them to become a co-observer, not just a recipient

The characters didn't choose to be there. The author and the reader did — and that choice is what makes the mirror work. The author chose to build a world governed by conditions they didn't control. The reader chose to enter one. What they find inside is still serendipitous.

All of them chose what to do once they arrived.

That is also what stories are about. The engine isn't just a tool for generating them — it is a model of the thing stories have always been trying to describe: the specific territory where circumstance ends and personal will begins.

About

Writing workshop in a box. Structured pipeline for generating complete story architecture — novel, screenplay, play, or any narrative form. Use manually, or with an LLM to automate the process.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors