MCPcopy Index your code
hub / github.com/Ckokoski/authorclaw

github.com/Ckokoski/authorclaw @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
1,367 symbols 3,577 edges 118 files 427 documented · 31%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

AuthorClaw

The Autonomous AI Writing Agent — Built for Authors

License: MIT Node Security

AuthorClaw is a security-hardened AI agent purpose-built for fiction and nonfiction authors. It doesn't just write — it runs the entire book production pipeline autonomously, from first idea to KDP-ready manuscript.

Give it an idea and a pen name. It plans, writes, revises, formats, and launches. Pipeline mode chains 6 production phases automatically. Author personas manage multiple pen names with distinct voices. Deep revision runs 21 editing passes. Export produces professional DOCX and EPUB ready for self-publishing.

Tell it what you want. It figures out the steps, picks the right skills, and executes.

"It's not just a writing tool. It's a writing partner, research assistant, editor, and marketing team rolled into one."


What Can It Do?

  • Pipeline — Turn one idea + one pen name into a finished book across 6 automated phases
  • Write — Draft scenes, chapters, and full manuscripts in your persona's voice
  • Revise — 21-step deep revision: 3 passes (structural → scene-level → line-level) + AI beta readers
  • Plan — 6 project templates: Book Planning, Book Bible, Book Production, Deep Revision, Format & Export, Book Launch
  • Personas — Manage multiple pen names with distinct genres, voices, style markers, and bios
  • Research — Deep dives into genres, markets, historical periods, craft techniques
  • Beta Read — AI beta reader panel (romance super-reader, harsh critic, casual reader)
  • Market — Blurbs, ad copy, Amazon descriptions, keywords, social media launch posts
  • Format — KDP-ready DOCX (trim sizes, front/back matter) and valid EPUB3 export
  • Manage — Track projects, pipelines, word counts across pen names
  • Listen — Neural TTS voice engine with 9 author-optimized presets — hear your writing read aloud

How It Works

  1. You say what you want — via Telegram, dashboard, or API
  2. AuthorClaw plans the steps — AI dynamically decomposes your task into executable steps
  3. Skills are auto-selected — 19 focused writing skills get injected into each step's context
  4. Work happens autonomously — each step runs through the AI, output saved to files
  5. Everything is logged — universal activity feed tracks all agent actions in real-time
User: "/novel a small-town romance under pen name Lily Hart"

AuthorClaw: "Pipeline created — 6 phases, 48 steps total"
  Phase 1: Book Planning    (6 steps)  — market analysis, premise, characters, outline, synopsis
  Phase 2: Book Bible       (5 steps)  — world-building, character bible, continuity, themes, style
  Phase 3: Book Production  (20 steps) — write + self-review per chapter
  Phase 4: Deep Revision    (21 steps) — 3-pass editing + AI beta readers
  Phase 5: Format & Export  (4 steps)  — front matter, back matter, DOCX, EPUB
  Phase 6: Book Launch      (6 steps)  — blurb, Amazon description, keywords, ad copy, social posts

  "Phase 1 started. Persona 'Lily Hart' context injected."

Quick Start

# 1. Clone and install
git clone https://github.com/Ckokoski/authorclaw.git
cd authorclaw
npm install

# 2. Start AuthorClaw (auto-generates vault key on first run)
npx tsx gateway/src/index.ts

# 3. Open dashboard: http://localhost:3847
#    Settings (sidebar) → paste your Gemini API key → Save
#    (Free tier — the whole book costs $0)

# 4. Home → chat: "Write me a thriller about rogue AI" → Send
#    OR send /project to your Telegram bot

First run? AuthorClaw auto-generates a vault encryption key and saves it to .env. Your API keys will persist across restarts. For a guided setup, run bash scripts/setup-wizard.sh.

See QUICKSTART.md for the full setup guide.


Architecture

┌─────────────────────────────────────────────────────────────┐
│                    AUTHORCLAW v4 ARCHITECTURE                │
│                                                             │
│  ┌───────────┐   ┌─────────────────┐   ┌────────────────┐  │
│  │ Channels  │   │    Gateway       │   │  AI Router     │  │
│  │           │   │                  │   │                │  │
│  │ Telegram  │──▶│ Auth + Sandbox   │──▶│ Ollama (free)  │  │
│  │ Dashboard │   │ Rate Limiting    │   │ Gemini (free)  │  │
│  │ API       │   │ Injection Detect │   │ DeepSeek ($)   │  │
│  │ WebSocket │   │ Audit Logging    │   │ Claude ($$)    │  │
│  └───────────┘   └─────────────────┘   │ OpenAI ($$)    │  │
│                                         └────────────────┘  │
│  ┌───────────┐   ┌─────────────────┐   ┌────────────────┐  │
│  │ Soul      │   │ Project Engine  │   │ Skills (19)    │  │
│  │           │   │                  │   │                │  │
│  │ SOUL.md   │   │ 6 Templates     │   │ Core (4)       │  │
│  │ STYLE.md  │   │ Pipeline Mode   │   │ Author (13)    │  │
│  │ VOICE.md  │   │ Author Personas │   │ Marketing (2)  │  │
│  │           │   │ DOCX + EPUB     │   │                │  │
│  └───────────┘   └─────────────────┘   └────────────────┘  │
│                                                             │
│  ┌───────────┐   ┌─────────────────┐   ┌────────────────┐  │
│  │ Security  │   │ Smart Agent     │   │ Research Gate  │  │
│  │           │   │                  │   │                │  │
│  │ Vault     │   │ Priority Scoring│   │ Web Search     │  │
│  │ Sandbox   │   │ Self-Improve    │   │ HTML Extraction│  │
│  │ Audit     │   │ Agent Journal   │   │ Domain Allowlist│  │
│  │ Injection │   │ Sub-Projects    │   │ Rate Limiting  │  │
│  └───────────┘   └─────────────────┘   └────────────────┘  │
└─────────────────────────────────────────────────────────────┘

AI Providers

AuthorClaw supports 5 AI providers with tiered routing:

Provider Tier Cost Best For Setup
Ollama FREE $0 Local, private Install Ollama, runs at localhost:11434
Google Gemini FREE $0 General writing, planning Dashboard → Settings → paste Gemini key
DeepSeek CHEAP ~$0.14/M tokens Creative writing Dashboard → Settings → paste DeepSeek key
Anthropic Claude PAID ~$3/M tokens Complex reasoning, editing Dashboard → Settings → paste Anthropic key
OpenAI GPT-4o PAID ~$2.5/M tokens Alternative premium Dashboard → Settings → paste OpenAI key

Task routing is automatic — planning and research use free models, creative writing uses mid-tier, final editing uses premium (when available).


Telegram Command Center

Connect a Telegram bot to control AuthorClaw from your phone:

Command What It Does
/novel [idea] Create a full novel pipeline (premise → characters → world → outline → chapters → revision → assembly)
/project [task] Plan & auto-execute any task — AuthorClaw figures out the steps
/write [idea] Quick writing task (short-form content, scenes, intros)
/projects List all projects with status and progress
/status Quick status check on what's running
/stop Pause the active project immediately
continue Resume a paused project
/research [topic] Research a topic using Wikipedia + Google Books (allowlisted domains)
/files [folder] List output files (numbered for easy /read and /export)
/read [# or name] Preview a file's contents
/export [# or name] [format] Export to Word (.docx), HTML, or TXT
/speak [text or #] Generate a voice message — text or read a file aloud
/voice [on/off/preset] Toggle voice chat responses (all replies become voice + text)
/clean View workspace disk usage and clean up old files

Example Session

You:        /write a short snarky YouTube intro for my channel
AuthorClaw: 📝 On it. Planning "a short snarky YouTube intro"...
AuthorClaw: ✅ Planned 2 steps. Running autonomously...
AuthorClaw: ✅ 1/2: Draft the intro (~400 words)
AuthorClaw: 🎉 All 2 steps complete!

You:        /novel a sci-fi thriller about rogue AI in aviation
AuthorClaw: 📖 Novel pipeline created: 32 steps
            (premise → bible → outline → chapters → revision → assembly)
AuthorClaw: ✅ 1/32: Develop premise (~800 words)
            ⏭ Next: Refine premise...
You:        /stop
AuthorClaw: ⏸ Paused at step 4/32. Say "continue" to resume.

You:        /clean
AuthorClaw: 📊 Workspace Usage: 2.1 MB (67 files)
            📁 projects: 43 files (1.8 MB)
            📁 exports: 2 files (21 KB)
            🧹 /clean projects — delete all project files

Dashboard

Open http://localhost:3847 to access the web dashboard — a sidebar-driven interface with 5 panels:

  • Home — Quick stats (words today, active projects, heartbeat status, personas), active project cards, full chat interface with slash command parity (all Telegram commands work in chat), today's writing progress bar, idle task count
  • Projects — 7 template tiles (Book Planning, Book Bible, Book Production, Deep Revision, Format & Export, Book Launch, Full Novel Pipeline) + Custom AI-planned. Projects auto-execute on creation — no manual start needed. Project list with status filters, inline detail views with step progress, file downloads (MD + DOCX), and compile controls
  • Personas — Author persona card grid with pen names, genres, style tags, and TTS voice. Create manually or generate with AI. Assign personas to projects for voice-consistent writing. Personas persist across updates with auto-backup
  • Library — Document uploads and compiled manuscripts. Download DOCX and EPUB exports
  • Settings — API keys (vault-encrypted), Telegram bot config, voice/TTS presets, research domain allowlist, autonomous heartbeat mode with configurable word goal, editable idle task queue (CRUD)

Voice & Text-to-Speech

AuthorClaw includes a built-in neural voice engine powered by Microsoft Edge TTS — no API keys, no binary installation, no cost.

9 author-optimized voice presets:

Preset Best For
narrator_female Most genres — clear, expressive (default)
narrator_male Literary fiction, thrillers
narrator_deep Epic fantasy, sci-fi, nonfiction
narrator_warm Romance, memoir
british_male Period pieces, cozy mysteries
british_female Elegant literary fiction
storyteller Adventure, YA
snarky_nerd Witty banter, smart humor, sci-fi
curious_kid Full of wonder, MG, picture books, whimsical

Telegram voice features: - /speak Hello world — Generate and send a voice message - /speak narrator_deep In a world... — Use a specific voice - /speak 3 — Read file #3 from your last /files listing aloud - /voice on — Toggle voice mode (all chat replies become voice + text) - /voice narrator_deep — Set voice mode with a specific preset - "Read that back" — Re-read the last response as voice

API: POST /api/audio/generate with { text, voice, rate, pitch, volume }

⚠️ Audio files are automatically deleted after 24 hours. If you generate a voice file you want to keep (e.g., a narration of your chapter), save or download it before the auto-cleanup runs. Use /clean audio to clear them manually, or find them in workspace/audio/.


Document Library & Large Manuscript Support

AuthorClaw supports uploading manuscripts of any size — from short stories to 100K+ word novels.

Two-tier upload system:

Upload Type Size How It Works
Small files (< 15K words) Short stories, chapters, articles Stored inline in project context — full text sent to AI
Large files (15K+ words) Novels, full manuscripts Auto-saved to workspace/documents/ — smart excerpts sent to AI

How smart excerpts work for large manuscripts: - The first ~4,000 words (setup, voice, style) and last ~1,000 words (current state) are sent to the AI - A truncation marker tells the AI the full document is available on disk - This keeps AI context manageable while giving it enough to work with - The full manuscript is always saved in workspace/documents/ for reference

Document Library API: - GET /api/documents — List all documents in the library - POST /api/documents/upload — Upload directly to the library (up to 50MB) - DELETE /api/documents/:filename — Remove a document

Dashboard: Upload files via the Projects tab (Upload button). Large files are automatically saved to both the project and the central library.


Dynamic Task Planning

When you give AuthorClaw a task, it doesn't use hardcoded templates. Instead:

  1. The AI receives a catalog of all available skills (with descriptions and triggers)
  2. The AI receives the list of Author OS tools
  3. The AI dynamically plans the right number of steps, picks the right skills (19 focused) for each
  4. Each step is executed with that skill's full content injected into the AI's context
  5. Results from earlier steps are chained into later steps for continuity

If AI planning fails, the system falls back to template-based planning (6 project types with pre-built step sequences). For pipeline mode, AuthorClaw chains all 6 phases (Planning → Bible → Production → Revision → Format → Launch) into a single automated workflow, passing outputs forward between phases.


Skills

Skills are markdown files that teach the AI how to handle specific writing tasks. V4 ships with 19 focused, author-centric skills:

Core Skills (4): self-improve, after-action-review, prompt-optimizer, error-recovery

Author Skills (13): premise, outline, book-bible, write, revise, dialogue, style-clone, beta-reader, format, research, nonfiction-research, manusc

Extension points exported contracts — how you extend this code

ProviderDefault (Interface)
* Hardcoded default model + fallback pricing per provider. * * `defaultModel` is the last resort in the model-resoluti
gateway/src/ai/router.ts
TelegramConfig (Interface)
* AuthorClaw Telegram Bridge * Secure Telegram bot integration — acts as a command center * Users give orders via Tele
gateway/src/bridges/telegram.ts
CommandHandlers (Interface)
Handler for direct commands that interact with gateway services
gateway/src/bridges/telegram.ts
SleepProjectPort (Interface)
(no doc) [1 implementers]
gateway/src/services/sleep-consolidation.ts
EnginePort (Interface)
(no doc) [1 implementers]
gateway/src/services/step-executor.ts

Core symbols most depended-on inside this repo

push
called by 485
gateway/src/services/orchestrator.ts
round
called by 146
gateway/src/services/style-clone.ts
get
called by 120
gateway/src/services/config.ts
get
called by 117
gateway/src/ai/model-config.ts
info
called by 78
gateway/src/services/logger.ts
sort
called by 76
gateway/src/services/revision-orchestrator.ts
parse
called by 74
gateway/src/services/cron-scheduler.ts
log
called by 73
gateway/src/services/manuscript-hub.ts

Shape

Method 924
Interface 187
Class 148
Function 108

Languages

TypeScript100%

Modules by API surface

gateway/src/index.ts92 symbols
gateway/src/services/projects.ts48 symbols
gateway/src/services/orchestrator.ts38 symbols
gateway/src/services/heartbeat.ts36 symbols
gateway/src/services/image-gen.ts35 symbols
gateway/src/services/sleep-consolidation.ts30 symbols
gateway/src/services/cron-scheduler.ts29 symbols
gateway/src/services/context-engine.ts29 symbols
gateway/src/ai/router.ts29 symbols
gateway/src/services/memory-tier.ts27 symbols
gateway/src/services/author-os.ts27 symbols
gateway/src/services/website-builder.ts25 symbols

For agents

$ claude mcp add authorclaw \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page