An autonomous agent that writes fanfiction under a pen name, publishes on AO3, collects reader feedback, and learns from it. The agent develops its own voice, taste, and creative identity through real interaction with real readers.
The goal is not "write a novel." The goal is "become an author." An author has voice, taste, a relationship with readers, and a reputation that evolves over time. The agent must develop all of these -- and it must never look like AI writing, or the fanbase will turn on it.
Built on top of autonovel, an autonomous
novel-writing pipeline. The fanfic agent reuses the slop-detection core
(evaluate.py:slop_score) and the craft / anti-pattern reference docs;
the rest of the original novel-pipeline scripts have been retired in
favor of the in-harness fanfic write loop. The agentic layer adds
identity, publishing, feedback, and learning on top.
The agent runs two parallel loops (see .claude/refs/methodology.md):
Engineering loop -- builds the harness:
/spec --> /review --> /test --> /impl --> /release
Creative loop -- develops the author:
/conceive --> /write --> /evaluate --> /publish --> /feedback --> /learn
The creative loop drives engineering priorities: when writing hits a limitation, that becomes an engineering bead.
Pre-launch, the creative loop runs in calibration mode (no publish/feedback):
/conceive --> /write --> /evaluate --> /learn
-
Identity (
identity/) -- The agent's creative self. Aself.mddocument that evolves after each feedback cycle, quantified voice priors, pen name, and literary inspirations. -
Conceive -- Generate story ideas balancing exploitation vs exploration. Each idea becomes an experiment bead with a hypothesis. Output:
briefs/*.json. -
Write (
write/) -- A state machine that takes a story brief from idea to publication-ready draft. States: BRIEF, CONTEXT, DRAFT, EVALUATE, REVISE, PREPARE, QUEUE, DONE. Uses the autonovel engine for drafting and evaluation, with anti-slop and anti-pattern detection to avoid AI tells. -
Publish -- The write loop prepares AO3-formatted output (tags, summary, author's notes) and queues it for human review. A human posts manually -- AO3 TOS prohibits automated posting, and human review is a quality gate.
-
Feedback -- Metrics collection from AO3: kudos, bookmarks, hits, subscriptions, comments. Comment parsing extracts what resonated and what fell flat.
-
Learn -- The agent updates its identity based on what readers responded to. Prompt evolution, few-shot bank curation, evaluation weight adjustment, and self-reflection entries in
self.md. Closes experiment beads with results.
# --- agentic author ---
api/ -- Local AO3 API proxy (FastAPI, mock mode available)
identity/ -- Creative identity: self.md, voice priors, pen name
write/ -- Write loop state machine, briefs, evaluation, revision
specs/ -- Authoritative technical specifications (see below)
tests/ -- Test suite
# --- autonovel engine (writing foundation) ---
evaluate.py -- Mechanical slop detection (slop_score + tier banks)
CRAFT.md -- Narrative craft frameworks (plot, character, world, prose)
ANTI-SLOP.md -- Word-level AI tell detection
ANTI-PATTERNS.md -- Structural AI pattern detection
typeset/ -- LaTeX typesetting and ePub generation
# --- configuration ---
.env.example -- API keys
pyproject.toml -- Python dependencies (managed by uv)
Three specs serve as the authoritative technical documentation:
| Spec | What it covers |
|---|---|
| specs/identity.md | Identity system: self.md schema, voice priors, drift limiting, feedback digests |
| specs/write-loop.md | Write loop state machine: states, transitions, evaluation gates, revision cycles |
| specs/api-proxy.md | AO3 API proxy: endpoints, publish queue, mock mode, metrics collection |
For the two-loop methodology (engineering vs creative), see .claude/refs/methodology.md.
# Clone and install
87AD
git clone <repo-url> && cd autonovel
cp .env.example .env # Add your API keys (see below)
uv sync
# Start the AO3 API proxy (mock mode -- no real AO3 requests)
uv run python -m api.server --mock
# Start in real mode (requires AO3 credentials in .env)
uv run python -m api.server
# Creative loop (the core workflow):
# /conceive -- generate a story idea and brief
# /write -- draft, evaluate, revise from the brief
# /feedback -- collect reader metrics after publishing
# /learn -- update identity from what readers responded to
# Run the write loop (programmatic -- see write/loop.py)
# Create a StoryBrief, then call write.loop.run(brief)The API proxy runs at http://127.0.0.1:8000 and provides endpoints for
browsing fandoms, reading metrics, fetching comments, and queuing works for
human review. See specs/api-proxy.md for the full
endpoint reference.
| Service | Environment Variable | Used for |
|---|---|---|
| Anthropic | ANTHROPIC_API_KEY |
Writing, evaluation, revision (Sonnet + Opus) |
| AO3 | AO3_USERNAME, AO3_PASSWORD |
Metrics scraping via unofficial API |
| fal.ai | FAL_KEY |
Cover art generation (optional) |
| ElevenLabs | ELEVENLABS_API_KEY |
Audiobook generation (optional) |
Only ANTHROPIC_API_KEY is required for the core write loop. AO3 credentials
are needed for live metrics collection (the API proxy can run in mock mode
without them). Art and audiobook keys are for the autonovel engine's export
pipeline and are optional.
This project has irreversible decisions. Unlike autonovel's keep/discard loop, published work cannot be unpublished without consequences. Readers remember. Reputation accumulates.
Decisions that must be gotten right:
- Pen name -- permanent identity, chosen once
- First fandom -- sets initial audience expectations
- First published work -- the first impression
- Voice and style -- readers bond with consistency; sudden shifts lose trust
- Posting frequency -- sets reader expectations
- Author's note voice -- part of the persona
Mitigation: a human reviews every publication before posting. Early works are lower-stakes one-shots to calibrate before committing to multi-chapter series.
-
Anti-AI detection is the top priority. If readers suspect AI, the project is dead. Every piece of writing passes mechanical slop detection (ANTI-SLOP.md, ANTI-PATTERNS.md) and must read as human-written.
-
Human-in-the-loop for publishing. The agent prepares, the human posts. This respects AO3 TOS and serves as a quality gate.
-
The agent learns from real readers, not from itself. Self-evaluation is a bootstrap. The real gradient comes from AO3 engagement metrics and comments.
The autonovel pipeline originally shipped 27 Python scripts for end-to-end
novel generation. The fanfic agent kept what generalizes -- mechanical slop
detection (evaluate.py:slop_score), the craft frameworks (CRAFT.md), and
the AI-tell databases (ANTI-SLOP.md, ANTI-PATTERNS.md) -- and replaced
the bespoke per-novel CLI tools with an in-harness write loop (write/)
that operates from a StoryBrief instead of a fixed directory layout.
The writing engine produced its first novel, The Second Son of the House of
Bells (19 chapters, 79,456 words), through 6 automated revision cycles and
6 Opus review rounds. See the autonovel/bells branch.
- karpathy/autoresearch -- the autonomous research loop that inspired autonovel
- Brandon Sanderson's writing lectures (Laws of Magic, character sliders)
- K.M. Weiland's Creating Character Arcs
- Blake Snyder's Save the Cat
- Ursula K. Le Guin's "From Elfland to Poughkeepsie"
- slop-forensics and EQ-Bench Slop Score