Skills

Autonomous novel writing CLI agent - use for creative fiction writing, novel generation, style imitation, chapter continuation/import, EPUB export, AIGC dete...

MIT-0 · Free to use, modify, and redistribute. No attribution required.
1 · 1.5k · 8 current installs · 8 all-time installs
MIT-0
Security Scan
VirusTotalVirusTotal
Benign
View report →
OpenClawOpenClaw
Benign
medium confidence
Purpose & Capability
Name/description, required binaries (inkos, node), and the npm install (@actalk/inkos) align with an LLM-driven CLI writing agent. Features (multi-agent pipeline, export, auditing, multi-provider support) are coherent with requiring LLM provider credentials at runtime.
Instruction Scope
SKILL.md instructs the agent to create and read local project files (story/state/*.json, story/memory.db), configure LLM providers, and run pipelines — all consistent with a novel-writing CLI. It also shows examples that accept API keys on the command line or via env vars (e.g., --api-key sk-xxx, --api-key-env ANTHROPIC_API_KEY). Those examples are expected but carry operational risks (shell-history leakage, local storage of potentially sensitive content).
Install Mechanism
Install is via an npm package (@actalk/inkos), which is the expected distribution method for a Node CLI. NPM packages have moderate trust risk — the installer will write code to disk and create the 'inkos' binary. Verify the package/source before installing.
Credentials
The SKILL.md clearly expects OpenAI/Anthropic or custom OpenAI-compatible API keys and shows using env vars, but the skill metadata lists no required env vars. Requesting LLM API keys is proportionate to the functionality, but the metadata could be clearer about required credentials. The examples also encourage passing secrets on the command line (insecure).
Persistence & Privilege
always: false and normal autonomous invocation settings. The tool persists project files (JSON, sqlite) within its project directory, which is expected behavior and limited in scope.
Assessment
This appears to be a legitimate CLI for autonomous novel writing, but take these precautions before installing: 1) Inspect the npm package and the GitHub repo (https://github.com/Narcooo/inkos) to confirm origin and reputation. 2) Do not pass API keys directly on the command line (they can end up in shell history); prefer environment variables or a secure credential store. 3) Review what local files it will create (story/state/*.json, story/memory.db) and avoid placing sensitive texts you don't want persisted. 4) If you use a custom provider base URL, be sure you trust that endpoint because all generated/imported content and project data may be sent there. 5) Consider running npm installs in an isolated environment (container or dedicated VM) if you want to reduce risk from untrusted packages.

Like a lobster shell, security has layers — review code before you run it.

Current versionv2.1.0
Download zip
latestvk976y0gq20bdm2z6xtgw72nvh183t3c8

License

MIT-0
Free to use, modify, and redistribute. No attribution required.

Runtime requirements

📖 Clawdis
Binsinkos, node

Install

Install InkOS (npm)npm i -g @actalk/inkos

SKILL.md

InkOS - Autonomous Novel Writing Agent

InkOS is a CLI tool for autonomous fiction writing powered by LLM agents. It orchestrates a multi-agent pipeline (Radar → Planner → Composer → Architect → Writer → Observer → Reflector → Normalizer → Auditor → Reviser) to generate, audit, and revise novel content with zero human intervention per chapter.

The pipeline operates in three phases:

  • Phase 1 (Creative Writing, temp 0.7): Planner generates chapter intent with hook agenda, Composer selects relevant context, Writer produces prose with length governance and dialogue-driven guidance.
  • Phase 2 (State Settlement, temp 0.3): Observer over-extracts 9 categories of facts, Reflector outputs a JSON delta (not full markdown), code-layer applies Zod schema validation and immutable state update. Hook operations use upsert/mention/resolve/defer semantics.
  • Phase 3 (Quality Loop): Normalizer adjusts chapter length, Auditor runs 33-dimension check including hook health analysis, Reviser auto-fixes critical issues. Self-correction loop runs until all critical issues clear.

Truth files are persisted as schema-validated JSON (story/state/*.json) with markdown projections for human readability. SQLite temporal memory database (story/memory.db) enables relevance-based retrieval on Node 22+.

When to Use InkOS

  • English novel writing: Native English support with 10 genre profiles (LitRPG, Progression Fantasy, Isekai, etc.). Set --lang en
  • Chinese web novel writing: 5 built-in Chinese genres (xuanhuan, xianxia, urban, horror, other)
  • Fan fiction: Create fanfic from source material with 4 modes (canon, au, ooc, cp)
  • Batch chapter generation: Generate multiple chapters with consistent quality
  • Import & continue: Import existing chapters from a text file, reverse-engineer truth files, and continue writing
  • Style imitation: Analyze and adopt writing styles from reference texts
  • Spinoff writing: Write prequels/sequels/spinoffs while maintaining parent canon
  • Quality auditing: Detect AI-generated content and perform 33-dimension quality checks
  • Genre exploration: Explore trends and create custom genre rules
  • Analytics: Track word count, audit pass rate, and issue distribution per book

Initial Setup

First Time Setup

# Initialize a project directory (creates config structure)
inkos init my-writing-project

# Configure your LLM provider (OpenAI, Anthropic, or any OpenAI-compatible API)
inkos config set-global --provider openai --base-url https://api.openai.com/v1 --api-key sk-xxx --model gpt-4o
# For compatible/proxy endpoints, use --provider custom:
# inkos config set-global --provider custom --base-url https://your-proxy.com/v1 --api-key sk-xxx --model gpt-4o

Multi-Model Routing (Optional)

# Assign different models to different agents — balance quality and cost
inkos config set-model writer claude-sonnet-4-20250514 --provider anthropic --base-url https://api.anthropic.com --api-key-env ANTHROPIC_API_KEY
inkos config set-model auditor gpt-4o --provider openai
inkos config show-models

Agents without explicit overrides fall back to the global model.

View System Status

# Check installation and configuration
inkos doctor

# View current config
inkos status

Common Workflows

Workflow 1: Create a New Novel

  1. Initialize and create book:

    inkos book create --title "My Novel Title" --genre xuanhuan --chapter-words 3000
    # Or with a creative brief (your worldbuilding doc / ideas):
    inkos book create --title "My Novel Title" --genre xuanhuan --chapter-words 3000 --brief my-ideas.md
    
    • Genres: xuanhuan (cultivation), xianxia (immortal), urban (city), horror, other
    • Returns a book-id for all subsequent operations
  2. Generate initial chapters (e.g., 5 chapters):

    inkos write next book-id --count 5 --words 3000 --context "young protagonist discovering powers"
    
    • The write next command runs the full pipeline: draft → audit → revise
    • --context provides guidance to the Architect and Writer agents
    • Returns JSON with chapter details and quality metrics
  3. Review and approve chapters:

    inkos review list book-id
    inkos review approve-all book-id
    
  4. Export the book (supports txt, md, epub):

    inkos export book-id
    inkos export book-id --format epub
    

Workflow 2: Continue Writing Existing Novel

  1. List your books:

    inkos book list
    
  2. Continue from last chapter:

    inkos write next book-id --count 3 --words 2500 --context "protagonist faces critical choice"
    
    • InkOS maintains 7 truth files (world state, character matrix, emotional arcs, etc.) for consistency
    • If only one book exists, omit book-id for auto-detection
  3. Review and approve:

    inkos review approve-all
    

Workflow 2.5: Steering Chapter Focus Before Writing

Use this when the user says things like "pull focus back to the mentor conflict", "pause the merchant guild subplot", or "change what the next chapter should prioritize".

  1. Update the book-level control docs when needed:

    • Use update_author_intent to change the long-horizon identity of the book
    • Use update_current_focus to change the next 1-3 chapters' focus
  2. Compile the next chapter intent:

    plan_chapter(bookId, guidance?)
    
    • Generates story/runtime/chapter-XXXX.intent.md
    • Use this to verify what the system thinks the next chapter should do
  3. Compose the actual runtime input package:

    compose_chapter(bookId, guidance?)
    
    • Generates story/runtime/chapter-XXXX.context.json
    • Generates story/runtime/chapter-XXXX.rule-stack.yaml
    • Generates story/runtime/chapter-XXXX.trace.json
  4. Only then write:

    • write_draft if the user wants intermediate review
    • write_full_pipeline if they want the usual write → audit → revise flow

Recommended orchestration:

  • user asks to redirect focus
  • update_current_focus
  • plan_chapter
  • compose_chapter
  • inspect the resulting intent/paths
  • write_draft or write_full_pipeline

Workflow 3: Import Existing Chapters & Continue

Use this when you have an existing novel (or partial novel) and want InkOS to pick up where it left off.

  1. Import from a single text file (auto-splits by chapter headings):

    inkos import chapters book-id --from novel.txt
    
    • Automatically splits by 第X章 pattern
    • Custom split pattern: --split "Chapter\\s+\\d+"
  2. Import from a directory of separate chapter files:

    inkos import chapters book-id --from ./chapters/
    
    • Reads .md and .txt files in sorted order
  3. Resume interrupted import:

    inkos import chapters book-id --from novel.txt --resume-from 15
    
  4. Continue writing from the imported chapters:

    inkos write next book-id --count 3
    
    • InkOS reverse-engineers all 7 truth files from the imported chapters
    • Generates a style guide from the existing text
    • New chapters maintain consistency with imported content

Workflow 4: Style Imitation

  1. Analyze reference text:

    inkos style analyze reference_text.txt
    
    • Examines vocabulary, sentence structure, tone, pacing
  2. Import style to your book:

    inkos style import reference_text.txt book-id --name "Author Name"
    
    • All future chapters adopt this style profile
    • Style rules become part of the Reviser's audit criteria

Workflow 5: Spinoff/Prequel Writing

  1. Import parent canon:

    inkos import canon spinoff-book-id --from parent-book-id
    
    • Creates links to parent book's world state, characters, and events
    • Reviser enforces canon consistency
  2. Continue spinoff:

    inkos write next spinoff-book-id --count 3 --context "alternate timeline after Chapter 20"
    

Workflow 6: Fine-Grained Control (Draft → Audit → Revise)

If you need separate control over each pipeline stage:

  1. Generate draft only:

    inkos draft book-id --words 3000 --context "protagonist escapes" --json
    
  2. Audit the chapter (33-dimension quality check):

    inkos audit book-id chapter-1 --json
    
    • Returns metrics across 33 dimensions including pacing, dialogue, world-building, outline adherence, and more
  3. Revise with specific mode:

    inkos revise book-id chapter-1 --mode polish --json
    
    • Modes: polish (minor), spot-fix (targeted), rewrite (major), rework (structure), anti-detect (reduce AI traces)

Workflow 7: Monitor Platform Trends

inkos radar scan
  • Analyzes trending genres, tropes, and reader preferences
  • Informs Architect recommendations for new books

Workflow 8: Detect AI-Generated Content

# Detect AIGC in a specific chapter
inkos detect book-id

# Deep scan all chapters
inkos detect book-id --all
  • Uses 11 deterministic rules (zero LLM cost) + optional LLM validation
  • Returns detection confidence and problematic passages

Workflow 9: View Analytics

inkos analytics book-id --json
# Shorthand alias
inkos stats book-id --json
  • Total chapters, word count, average words per chapter
  • Audit pass rate and top issue categories
  • Chapters with most issues, status distribution
  • Token usage stats: total prompt/completion tokens, avg tokens per chapter, recent trend

Workflow 10: Write an English Novel

# Create an English LitRPG novel (language auto-detected from genre)
inkos book create --title "The Last Delver" --genre litrpg --chapter-words 3000

# Or set language explicitly
inkos book create --title "My Novel" --genre other --lang en

# Set English as default for all projects
inkos config set-global --lang en
  • 10 English genres: litrpg, progression, isekai, cultivation, system-apocalypse, dungeon-core, romantasy, sci-fi, tower-climber, cozy
  • Each genre has dedicated pacing rules, fatigue word lists (e.g., "delve", "tapestry", "testament"), and audit dimensions
  • Use inkos genre list to see all available genres

Workflow 11: Fan Fiction

# Create a fanfic from source material
inkos fanfic init --title "My Fanfic" --from source-novel.txt --mode canon

# Modes: canon (faithful), au (alternate universe), ooc (out of character), cp (ship-focused)
inkos fanfic init --title "What If" --from source.txt --mode au --genre other
  • Imports and analyzes source material automatically
  • Fanfic-specific audit dimensions and information boundary controls
  • Ensures new content stays consistent with source canon (or deliberately diverges in au/ooc modes)

Advanced: Natural Language Agent Mode

For flexible, conversational requests:

inkos agent "写一部都市题材的小说,主角是一个年轻律师,第一章三千字"
  • Agent interprets natural language and invokes appropriate commands
  • Useful for complex multi-step requests

Input Governance Tools

These tools are the preferred control surface for chapter steering:

  • plan_chapter(bookId, guidance?)

    • Generates chapter intent for the next chapter
    • Use before writing when the user wants to change focus
  • compose_chapter(bookId, guidance?)

    • Generates runtime context/rule-stack/trace artifacts
    • Use after planning and before writing
  • update_author_intent(bookId, content)

    • Rewrites story/author_intent.md
    • Use for long-horizon changes to the book's identity
  • update_current_focus(bookId, content)

    • Rewrites story/current_focus.md
    • Use for local steering over the next 1-3 chapters

write_truth_file remains available for broad file edits, but prefer the dedicated control tools above for input-governance changes.

Key Concepts

Book ID Auto-Detection

If your project contains only one book, most commands accept book-id as optional. You can omit it for brevity:

# Explicit
inkos write next book-123 --count 1

# Auto-detected (if only one book exists)
inkos write next --count 1

--json Flag

All content-generating commands support --json for structured output. Essential for programmatic use:

inkos draft book-id --words 3000 --context "guidance" --json

Truth Files (Long-Term Memory)

InkOS maintains 7 files per book for coherence:

  • World State: Maps, locations, technology levels, magic systems
  • Character Matrix: Names, relationships, arcs, motivations
  • Resource Ledger: In-world items, money, power levels
  • Chapter Summaries: Events, progression, foreshadowing
  • Subplot Board: Active and dormant subplots, hooks
  • Emotional Arcs: Character emotional progression
  • Pending Hooks: Unresolved cliffhangers and promises to reader

All agents reference these to maintain long-term consistency. Since 0.6.0, truth files are backed by schema-validated JSON in story/state/ with automatic bootstrap from markdown for legacy books. During import chapters, these files are reverse-engineered from existing content via the ChapterAnalyzerAgent.

Multi-Phase Writer Architecture

The Writer operates across multiple phases with specialized agents:

  • Planner: Generates chapter intent with structured hook agenda (mustAdvance, eligibleResolve, staleDebt) based on memory retrieval.
  • Composer: Selects relevant context from truth files by relevance scoring, compiles rule stack and runtime artifacts.
  • Phase 1 (Creative, temp 0.7): Generates prose with length governance, English variance brief (anti-repetition), and dialogue-driven guidance.
  • Phase 2a (Observer, temp 0.5): Over-extracts 9 categories of facts from the chapter text.
  • Phase 2b (Reflector, temp 0.3): Outputs a JSON delta with hookOps (upsert/mention/resolve/defer), currentStatePatch, and chapterSummary. Code-layer validates via Zod schema and applies immutably.
  • Normalizer: Single-pass compress/expand to bring chapter length into the target band. Safety net rejects destructive normalization (>75% content loss).
  • Auditor: 33-dimension check including hook health analysis (stale debt, burst detection, no-advance warnings).
  • Reviser: Auto-fixes critical issues, self-correction loop until clean.

Truth files use structured JSON (story/state/*.json) as the authoritative source, with markdown projections for human readability. Hook admission control prevents duplicate/family hooks from inflating the hook table.

Context Guidance

The --context parameter provides directional hints to the Writer and Architect:

inkos write next book-id --count 2 --context "protagonist discovers betrayal, must decide whether to trust mentor"
  • Context is optional but highly recommended for narrative coherence
  • Supports both English and Chinese

Genre Management

View Built-In Genres

inkos genre list
inkos genre show xuanhuan

Create Custom Genre

inkos genre create my-genre --name "My Genre"
# Options: --numerical, --power, --era
inkos genre create dark-xuanhuan --name "Dark Xuanhuan" --numerical --power

Copy Built-in Genre for Customization

inkos genre copy xuanhuan
# Copies to project genres/ directory for editing

Command Reference Summary

CommandPurposeNotes
inkos init [name]Initialize projectOne-time setup
inkos book createCreate new bookReturns book-id. --brief <file>, --lang en/zh, --genre litrpg/progression/...
inkos book listList all booksShows IDs, statuses
inkos write nextFull pipeline (draft→audit→revise)Primary workflow command
inkos draftGenerate draft onlyNo auditing/revision
inkos audit33-dimension quality checkStandalone evaluation
inkos reviseRevise chapterModes: polish/spot-fix/rewrite/rework/anti-detect
inkos agentNatural language interfaceFlexible requests
inkos style analyzeAnalyze reference textExtracts style profile
inkos style importApply style to bookMakes style permanent
inkos import canonLink spinoff to parentFor prequels/sequels
inkos import chaptersImport existing chaptersReverse-engineers truth files for continuation
inkos detectAIGC detectionFlags AI-generated passages
inkos exportExport finished bookFormats: txt, md, epub
inkos analytics / inkos statsView book statisticsWord count, audit rates, token usage
inkos radar scanPlatform trend analysisInforms new book ideas
inkos config set-globalConfigure LLM providerOpenAI/Anthropic/custom (any OpenAI-compatible)
inkos config set-model <agent> <model>Set model override for a specific agent--provider, --base-url, --api-key-env for multi-provider routing
inkos config show-modelsShow current model routingView per-agent model assignments
inkos doctorDiagnose issuesCheck installation
inkos updateUpdate to latest versionSelf-update
inkos up/downDaemon modeBackground processing. Logs to inkos.log (JSON Lines). -q for quiet mode
inkos review list/approve-allManage chapter approvalsQuality gate
inkos fanfic initCreate fanfic from source material--from <file>, --mode canon/au/ooc/cp
inkos genre listList all available genresShows English and Chinese genres with default language
inkos genre create <id>Create custom genre profile--name, --numerical, --power, --era
inkos genre copy <id>Copy built-in genre to projectFor customization
inkos write rewrite <book> <ch>Rewrite a specific chapterDeletes chapter and later, rewrites from that point
inkos book update [book-id]Update book settings--chapter-words, --target-chapters, --status, --lang
inkos book delete <book-id>Delete book and all chapters--force to skip confirmation
inkos plan chapter [book-id]Generate chapter intentPreview what next chapter will do before writing
inkos compose chapter [book-id]Generate runtime artifactsContext, rule-stack, trace for next chapter
inkos consolidate [book-id]Consolidate chapter summariesReduces context for long books (volume-level summaries)
inkos eval [book-id]Quality evaluation report--json, --chapters <range>. Composite quality score
inkos studioStart web workbench-p for port. Local web UI for book management
inkos fanfic show [book-id]Display parsed fanfic canonShows imported source material analysis
inkos fanfic refresh [book-id]Re-import and regenerate fanfic canon--from <file> for updated source material

Error Handling

Common Issues

"book-id not found"

  • Verify the ID with inkos book list
  • Ensure you're in the correct project directory

"Provider not configured"

  • Run inkos config set-global with valid credentials
  • Check API key and base URL with inkos doctor

"Context invalid"

  • Ensure --context is a string (wrap in quotes if multi-word)
  • Context can be in English or Chinese

"Audit failed"

  • Check chapter for encoding issues
  • Ensure chapter-words matches actual word count
  • Try inkos revise with --mode rewrite

"Book already has chapters" (import)

  • Use --resume-from <n> to append to existing chapters
  • Or delete existing chapters first

Running Daemon Mode

For long-running operations:

# Start background daemon
inkos up

# Stop daemon
inkos down

# Daemon auto-processes queued chapters

Tips for Best Results

  1. Provide rich context: The more guidance in --context, the more coherent the narrative
  2. Start with style: If imitating an author, run inkos style import before generation
  3. Import first: For existing novels, use inkos import chapters to bootstrap truth files before continuing
  4. Review regularly: Use inkos review to catch issues early
  5. Monitor audits: Check inkos audit metrics to understand quality bottlenecks
  6. Use spinoffs strategically: Import canon before writing prequels/sequels
  7. Batch generation: Generate multiple chapters together (better continuity)
  8. Check analytics: Use inkos analytics to track quality trends over time
  9. Export frequently: Keep backups with inkos export

Support & Resources

  • Homepage: https://github.com/Narcooo/inkos
  • Configuration: Stored in project root after inkos init
  • Truth files: Located in books/<id>/story/ per book, with structured JSON in story/state/
  • Logs: Check output of inkos doctor for troubleshooting

Files

1 total
Select a file
Select a file to preview.

Comments

Loading comments…