[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M77JJ2TJC60R402FB065Q749":3,"skill-same:01M77JJ2TJC60R402FB065Q749":62},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":39,"commitSha":40,"skillDirectory":41,"forksCount":42,"repositoryHtmlUrl":43,"repositoryHomepageUrl":44,"ownerHtmlUrl":45,"ownerBlogUrl":6,"ownerDescription":46,"updatedAt":47,"install":48,"resources":61},"01M77JJ2TJC60R402FB065Q749","inkos",null,"Autonomous novel writing CLI agent with web workbench (InkOS Studio) - use for creative fiction writing, novel generation, style imitation, chapter continuation\u002Fimport, EPUB export, AIGC detection, and fan fiction. Native English support with 10 built-in English genre profiles (LitRPG, Progression Fantasy, Isekai, Cultivation, System Apocalypse, Dungeon Core, Romantasy, Sci-Fi, Tower Climber, Cozy Fantasy). Also supports Chinese web novel genres (xuanhuan, xianxia, urban, horror, other). Multi-agent pipeline, two-phase writer (creative + settlement), stronger long-form chapter craft rules, hook-ledger payoff checks, 33-dimension auditing, token usage analytics, creative brief input, structured logging (JSON Lines), multi-model routing, custom OpenAI-compatible provider support, and InkOS Studio web UI for visual book management, chapter review, real-time writing progress, market radar, and analytics.","Lord1Egypt\u002Fawesome-skill-forge","Lord1Egypt","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F99746359?v=4","01M7592YDNT0XK9WJ0T2MQVPDN","Mohamed Mounir Ali AL Keshita","01M75GRFNHC8VZNWEB8DKDE433",3,"MIT","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fcommunity\u002Fclawhub\u002Fi\u002Finkos-novel-writer\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: inkos\ndescription: Autonomous novel writing CLI agent with web workbench (InkOS Studio) - use for creative fiction writing, novel generation, style imitation, chapter continuation\u002Fimport, EPUB export, AIGC detection, and fan fiction. Native English support with 10 built-in English genre profiles (LitRPG, Progression Fantasy, Isekai, Cultivation, System Apocalypse, Dungeon Core, Romantasy, Sci-Fi, Tower Climber, Cozy Fantasy). Also supports Chinese web novel genres (xuanhuan, xianxia, urban, horror, other). Multi-agent pipeline, two-phase writer (creative + settlement), stronger long-form chapter craft rules, hook-ledger payoff checks, 33-dimension auditing, token usage analytics, creative brief input, structured logging (JSON Lines), multi-model routing, custom OpenAI-compatible provider support, and InkOS Studio web UI for visual book management, chapter review, real-time writing progress, market radar, and analytics.\nversion: 2.3.3\nmetadata: { \"openclaw\": { \"emoji\": \"📖\", \"requires\": { \"bins\": [\"inkos\", \"node\"], \"env\": [\"OPENAI_API_KEY\"] }, \"primaryEnv\": \"OPENAI_API_KEY\", \"homepage\": \"https:\u002F\u002Fgithub.com\u002FNarcooo\u002Finkos\", \"install\": [{ \"id\": \"npm\", \"kind\": \"node\", \"package\": \"@actalk\u002Finkos\", \"label\": \"Install InkOS (npm)\" }] } }\n---\n\n# InkOS - Autonomous Novel Writing Agent\n\nInkOS 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.\n\nThe pipeline operates in three phases:\n- **Phase 1 (Creative Writing, temp 0.7)**: Planner generates chapter intent with hook agenda, Composer selects relevant context, Writer produces prose with length governance, first-screen hooks, semantic density, hook-ledger payoff, and mobile paragraph rhythm guidance.\n- **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\u002Fmention\u002Fresolve\u002Fdefer semantics.\n- **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.\n\nTruth files are persisted as schema-validated JSON (`story\u002Fstate\u002F*.json`) with markdown projections for human readability. SQLite temporal memory database (`story\u002Fmemory.db`) enables relevance-based retrieval on Node 22+.\n\n## When to Use InkOS\n\n- **English novel writing**: Native English support with 10 genre profiles (LitRPG, Progression Fantasy, Isekai, etc.). Set `--lang en`\n- **Chinese web novel writing**: 5 built-in Chinese genres (xuanhuan, xianxia, urban, horror, other)\n- **Fan fiction**: Create fanfic from source material with 4 modes (canon, au, ooc, cp)\n- **Batch chapter generation**: Generate multiple chapters with consistent quality\n- **Import & continue**: Import existing chapters from a text file, reverse-engineer truth files, and continue writing\n- **Style imitation**: Analyze and adopt writing styles from reference texts\n- **Spinoff writing**: Write prequels\u002Fsequels\u002Fspinoffs while maintaining parent canon\n- **Quality auditing**: Detect AI-generated content and perform 33-dimension quality checks\n- **Genre exploration**: Explore trends and create custom genre rules\n- **Analytics**: Track word count, audit pass rate, and issue distribution per book\n\n## Initial Setup\n\n### First Time Setup\n```bash\n# Initialize a project directory (creates config structure)\ninkos init my-writing-project\n\n# Configure your LLM provider (OpenAI, Anthropic, or any OpenAI-compatible API)\n# Prefer --api-key-env so the key never appears in shell history:\nexport OPENAI_API_KEY=sk-xxx\ninkos config set-global --provider openai --base-url https:\u002F\u002Fapi.openai.com\u002Fv1 --api-key-env OPENAI_API_KEY --model gpt-4o\n# For compatible\u002Fproxy endpoints, use --provider custom and point ONLY to trusted endpoints:\n# inkos config set-global --provider custom --base-url https:\u002F\u002Fyour-trusted-proxy.com\u002Fv1 --api-key-env OPENAI_API_KEY --model gpt-4o\n```\n\n### Multi-Model Routing (Optional)\n```bash\n# Assign different models to different agents — balance quality and cost\ninkos config set-model writer claude-sonnet-4-20250514 --provider anthropic --base-url https:\u002F\u002Fapi.anthropic.com --api-key-env ANTHROPIC_API_KEY\ninkos config set-model auditor gpt-4o --provider openai\ninkos config show-models\n```\nAgents without explicit overrides fall back to the global model.\n\n### View System Status\n```bash\n# Check installation and configuration\ninkos doctor\n\n# View current config\ninkos status\n```\n\n## Common Workflows\n\n### Workflow 1: Create a New Novel\n\n1. **Initialize and create book**:\n   ```bash\n   inkos book create --title \"My Novel Title\" --genre xuanhuan --chapter-words 3000\n   # Or with a creative brief (your worldbuilding doc \u002F ideas):\n   inkos book create --title \"My Novel Title\" --genre xuanhuan --chapter-words 3000 --brief my-ideas.md\n   ```\n   - Genres: `xuanhuan` (cultivation), `xianxia` (immortal), `urban` (city), `horror`, `other`\n   - Returns a `book-id` for all subsequent operations\n\n2. **Generate initial chapters** (e.g., 5 chapters):\n   ```bash\n   inkos write next book-id --count 5 --words 3000 --context \"young protagonist discovering powers\"\n   ```\n   - The `write next` command runs the full pipeline: draft → audit → revise\n   - `--context` provides guidance to the Architect and Writer agents\n   - Returns JSON with chapter details and quality metrics\n\n3. **Review and approve chapters**:\n   ```bash\n   inkos review list book-id\n   inkos review approve-all book-id\n   ```\n\n4. **Export the book** (supports txt, md, epub):\n   ```bash\n   inkos export book-id\n   inkos export book-id --format epub\n   ```\n\n### Workflow 2: Continue Writing Existing Novel\n\n1. **List your books**:\n   ```bash\n   inkos book list\n   ```\n\n2. **Continue from last chapter**:\n   ```bash\n   inkos write next book-id --count 3 --words 2500 --context \"protagonist faces critical choice\"\n   ```\n   - InkOS maintains 7 truth files (world state, character matrix, emotional arcs, etc.) for consistency\n   - If only one book exists, omit `book-id` for auto-detection\n\n3. **Review and approve**:\n   ```bash\n   inkos review approve-all\n   ```\n\n### Workflow 2.5: Shared Natural-Language Control (Recommended For OpenClaw)\n\nWhen InkOS is being driven by OpenClaw or another external agent, prefer the shared interaction executor instead of stitching together many ad-hoc CLI calls:\n\n```bash\ninkos interact --json --message \"continue the current book, but keep the pacing tighter\"\ninkos interact --json --message \"rewrite chapter 3\"\ninkos interact --json --book my-book --message \"switch to auto mode\"\n```\n\nThis returns a structured payload containing:\n- the routed request\n- assistant response text\n- updated interaction session\n- execution state\n- pending decision\n- recent interaction events\n\nUse this as the primary OpenClaw entry because it shares the same control layer as the project TUI.\n\n### Workflow 2.6: Steering Chapter Focus Before Writing\n\nUse 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\".\n\n1. **Update the book-level control docs when needed**:\n   - Use `update_author_intent` to change the long-horizon identity of the book\n   - Use `update_current_focus` to change the next 1-3 chapters' focus\n\n2. **Compile the next chapter intent**:\n   ```text\n   plan_chapter(bookId, guidance?)\n   ```\n   - Generates `story\u002Fruntime\u002Fchapter-XXXX.intent.md`\n   - Use this to verify what the system thinks the next chapter should do\n\n3. **Compose the actual runtime input package**:\n   ```text\n   compose_chapter(bookId, guidance?)\n   ```\n   - Generates `story\u002Fruntime\u002Fchapter-XXXX.context.json`\n   - Generates `story\u002Fruntime\u002Fchapter-XXXX.rule-stack.yaml`\n   - Generates `story\u002Fruntime\u002Fchapter-XXXX.trace.json`\n\n4. **Only then write**:\n   - `write_draft` if the user wants intermediate review\n   - `write_full_pipeline` if they want the usual write → audit → revise flow\n\nRecommended orchestration:\n- user asks to redirect focus\n- `update_current_focus`\n- `plan_chapter`\n- `compose_chapter`\n- inspect the resulting intent\u002Fpaths\n- `write_draft` or `write_full_pipeline`\n\n### Workflow 3: Import Existing Chapters & Continue\n\nUse this when you have an existing novel (or partial novel) and want InkOS to pick up where it left off.\n\n1. **Import from a single text file** (auto-splits by chapter headings):\n   ```bash\n   inkos import chapters book-id --from novel.txt\n   ```\n   - Automatically splits by `第X章` pattern\n   - Custom split pattern: `--split \"Chapter\\\\s+\\\\d+\"`\n\n2. **Import from a directory** of separate chapter files:\n   ```bash\n   inkos import chapters book-id --from .\u002Fchapters\u002F\n   ```\n   - Reads `.md` and `.txt` files in sorted order\n\n3. **Resume interrupted import**:\n   ```bash\n   inkos import chapters book-id --from novel.txt --resume-from 15\n   ```\n\n4. **Continue writing** from the imported chapters:\n   ```bash\n   inkos write next book-id --count 3\n   ```\n   - InkOS reverse-engineers all 7 truth files from the imported chapters\n   - Generates a style guide from the existing text\n   - New chapters maintain consistency with imported content\n\n### Workflow 4: Style Imitation\n\n1. **Analyze reference text**:\n   ```bash\n   inkos style analyze reference_text.txt\n   ```\n   - Examines vocabulary, sentence structure, tone, pacing\n\n2. **Import style to your book**:\n   ```bash\n   inkos style import reference_text.txt book-id --name \"Author Name\"\n   ```\n   - All future chapters adopt this style profile\n   - Style rules become part of the Reviser's audit criteria\n\n### Workflow 5: Spinoff\u002FPrequel Writing\n\n1. **Import parent canon**:\n   ```bash\n   inkos import canon spinoff-book-id --from parent-book-id\n   ```\n   - Creates links to parent book's world state, characters, and events\n   - Reviser enforces canon consistency\n\n2. **Continue spinoff**:\n   ```bash\n   inkos write next spinoff-book-id --count 3 --context \"alternate timeline after Chapter 20\"\n   ```\n\n### Workflow 6: Fine-Grained Control (Draft → Audit → Revise)\n\nIf you need separate control over each pipeline stage:\n\n1. **Generate draft only**:\n   ```bash\n   inkos draft book-id --words 3000 --context \"protagonist escapes\" --json\n   ```\n\n2. **Audit the chapter** (33-dimension quality check):\n   ```bash\n   inkos audit book-id chapter-1 --json\n   ```\n   - Returns metrics across 33 dimensions including pacing, dialogue, world-building, outline adherence, and more\n\n3. **Revise with specific mode**:\n   ```bash\n   inkos revise book-id chapter-1 --mode polish --json\n   ```\n   - Modes: `polish` (minor), `spot-fix` (targeted), `rewrite` (major), `rework` (structure), `anti-detect` (reduce AI traces)\n\n### Workflow 7: Monitor Platform Trends\n\n```bash\ninkos radar scan\n```\n- Analyzes trending genres, tropes, and reader preferences\n- Informs Architect recommendations for new books\n\n### Workflow 8: Detect AI-Generated Content\n\n```bash\n# Detect AIGC in a specific chapter\ninkos detect book-id\n\n# Deep scan all chapters\ninkos detect book-id --all\n```\n- Uses 11 deterministic rules (zero LLM cost) + optional LLM validation\n- Returns detection confidence and problematic passages\n\n### Workflow 9: View Analytics\n\n```bash\ninkos analytics book-id --json\n# Shorthand alias\ninkos stats book-id --json\n```\n- Total chapters, word count, average words per chapter\n- Audit pass rate and top issue categories\n- Chapters with most issues, status distribution\n- **Token usage stats**: total prompt\u002Fcompletion tokens, avg tokens per chapter, recent trend\n\n### Workflow 10: Write an English Novel\n\n```bash\n# Create an English LitRPG novel (language auto-detected from genre)\ninkos book create --title \"The Last Delver\" --genre litrpg --chapter-words 3000\n\n# Or set language explicitly\ninkos book create --title \"My Novel\" --genre other --lang en\n\n# Set English as default for all projects\ninkos config set-global --lang en\n```\n- 10 English genres: litrpg, progression, isekai, cultivation, system-apocalypse, dungeon-core, romantasy, sci-fi, tower-climber, cozy\n- Each genre has dedicated pacing rules, fatigue word lists (e.g., \"delve\", \"tapestry\", \"testament\"), and audit dimensions\n- Use `inkos genre list` to see all available genres\n\n### Workflow 11: Fan Fiction\n\n```bash\n# Create a fanfic from source material\ninkos fanfic init --title \"My Fanfic\" --from source-novel.txt --mode canon\n\n# Modes: canon (faithful), au (alternate universe), ooc (out of character), cp (ship-focused)\ninkos fanfic init --title \"What If\" --from source.txt --mode au --genre other\n```\n- Imports and analyzes source material automatically\n- Fanfic-specific audit dimensions and information boundary controls\n- Ensures new content stays consistent with source canon (or deliberately diverges in au\u002Fooc modes)\n\n### Workflow 12: Rename Characters or Entities Across Entire Book\n\n```bash\n# Via interact\ninkos interact --json --message \"把林烬改成张三\"\ninkos interact --json --message \"rename Lin Jin to Zhang San\"\n\n# Via slash command\ninkos interact --json --message \"\u002Frename 林烬 => 张三\"\n```\n- Scans all chapters + all truth files (story_bible, current_state, character_matrix, etc.)\n- Replaces every occurrence in one pass\n- Returns count of files touched\n\n### Workflow 13: Patch Specific Text in a Chapter\n\n```bash\ninkos interact --json --message \"\u002Freplace 5 旧文本 => 新文本\"\n```\n- Precisely replaces text in chapter 5 only\n- Marks chapter for review after patching\n\n### Workflow 14: Interactive TUI Dashboard\n\n```bash\ninkos\n```\n- Launches a full-screen Ink + React dashboard with conversational creation\n- Slash command autocomplete (Tab), input history (arrow keys)\n- Themed activity animations per operation (writing, auditing, revising, planning)\n- Bilingual i18n (Chinese \u002F English)\n- Shares the same interaction kernel as `inkos interact` and Studio\n\n## InkOS Studio (Web Workbench)\n\n`inkos studio` launches a local web UI (default port 4567) that provides a visual interface for all InkOS operations:\n\n- **Book management** — create, delete, export (TXT\u002FMD\u002FEPUB), configure per-book settings\n- **Chapter review & editing** — approve\u002Freject drafts, edit content inline, multi-mode revision (polish\u002Fspot-fix\u002Frewrite\u002Fanti-detect)\n- **Real-time writing progress** — SSE-based live updates during chapter generation\n- **Market radar** — AI-powered trend analysis with platform\u002Fgenre recommendations\n- **Analytics** — word count, audit pass rate, chapter ranking, token usage\n- **AI detection** — scan chapters for AI-generated content\n- **Style analysis** — analyze reference texts and import writing styles\n- **Genre management** — create\u002Fcustomize genre profiles with fatigue words, pacing rules, audit dimensions\n- **Daemon control** — start\u002Fstop background writing with event log\n- **Truth file editor** — view and edit canonical knowledge base per book\n- **Config editor** — LLM provider, model routing, notifications\n\n```bash\ninkos studio              # Start on default port 4567\ninkos studio -p 8080      # Start on custom port\n```\n\nThe right-side **AI Assistant panel** in Studio shares the same interaction kernel as TUI and `inkos interact`. You can type natural language commands (rename entities, write chapters, audit, export) directly in the assistant panel.\n\n## Advanced: Natural Language Agent Mode\n\nFor flexible, conversational requests:\n\n```bash\ninkos agent \"写一部都市题材的小说，主角是一个年轻律师，第一章三千字\"\n```\n- Agent interprets natural language and invokes appropriate commands\n- Useful for complex multi-step requests\n\n## Input Governance Tools\n\nThese tools are the preferred control surface for chapter steering:\n\n- `plan_chapter(bookId, guidance?)`\n  - Generates chapter intent for the next chapter\n  - Use before writing when the user wants to change focus\n\n- `compose_chapter(bookId, guidance?)`\n  - Generates runtime context\u002Frule-stack\u002Ftrace artifacts\n  - Use after planning and before writing\n\n- `update_author_intent(bookId, content)`\n  - Rewrites `story\u002Fauthor_intent.md`\n  - Use for long-horizon changes to the book's identity\n\n- `update_current_focus(bookId, content)`\n  - Rewrites `story\u002Fcurrent_focus.md`\n  - Use for local steering over the next 1-3 chapters\n\n`write_truth_file` remains available for broad file edits, but prefer the dedicated control tools above for input-governance changes.\n\n## Key Concepts\n\n### Book ID Auto-Detection\nIf your project contains only one book, most commands accept `book-id` as optional. You can omit it for brevity:\n```bash\n# Explicit\ninkos write next book-123 --count 1\n\n# Auto-detected (if only one book exists)\ninkos write next --count 1\n```\n\n### --json Flag\nAll content-generating commands support `--json` for structured output. Essential for programmatic use:\n```bash\ninkos draft book-id --words 3000 --context \"guidance\" --json\n```\n\n### Truth Files (Long-Term Memory)\nInkOS maintains 7 files per book for coherence:\n- **World State**: Maps, locations, technology levels, magic systems\n- **Character Matrix**: Names, relationships, arcs, motivations\n- **Resource Ledger**: In-world items, money, power levels\n- **Chapter Summaries**: Events, progression, foreshadowing\n- **Subplot Board**: Active and dormant subplots, hooks\n- **Emotional Arcs**: Character emotional progression\n- **Pending Hooks**: Unresolved cliffhangers and promises to reader\n\nAll agents reference these to maintain long-term consistency. Since 0.6.0, truth files are backed by schema-validated JSON in `story\u002Fstate\u002F` with automatic bootstrap from markdown for legacy books. During `import chapters`, these files are reverse-engineered from existing content via the ChapterAnalyzerAgent.\n\n### Multi-Phase Writer Architecture\nThe Writer operates across multiple phases with specialized agents:\n- **Planner**: Generates chapter intent with structured hook agenda (mustAdvance, eligibleResolve, staleDebt) based on memory retrieval.\n- **Composer**: Selects relevant context from truth files by relevance scoring, compiles rule stack and runtime artifacts.\n- **Phase 1 (Creative, temp 0.7)**: Generates prose with length governance, English variance brief (anti-repetition), and dialogue-driven guidance.\n- **Phase 2a (Observer, temp 0.5)**: Over-extracts 9 categories of facts from the chapter text.\n- **Phase 2b (Reflector, temp 0.3)**: Outputs a JSON delta with hookOps (upsert\u002Fmention\u002Fresolve\u002Fdefer), currentStatePatch, and chapterSummary. Code-layer validates via Zod schema and applies immutably.\n- **Normalizer**: Single-pass compress\u002Fexpand to bring chapter length into the target band. Safety net rejects destructive normalization (>75% content loss).\n- **Auditor**: 33-dimension check including hook health analysis (stale debt, burst detection, no-advance warnings).\n- **Reviser**: Auto-fixes critical issues, self-correction loop until clean.\n\nTruth files use structured JSON (`story\u002Fstate\u002F*.json`) as the authoritative source, with markdown projections for human readability. Hook admission control prevents duplicate\u002Ffamily hooks from inflating the hook table.\n\n### Context Guidance\nThe `--context` parameter provides directional hints to the Writer and Architect:\n```bash\ninkos write next book-id --count 2 --context \"protagonist discovers betrayal, must decide whether to trust mentor\"\n```\n- Context is optional but highly recommended for narrative coherence\n- Supports both English and Chinese\n\n## Genre Management\n\n### View Built-In Genres\n```bash\ninkos genre list\ninkos genre show xuanhuan\n```\n\n### Create Custom Genre\n```bash\ninkos genre create my-genre --name \"My Genre\"\n# Options: --numerical, --power, --era\ninkos genre create dark-xuanhuan --name \"Dark Xuanhuan\" --numerical --power\n```\n\n### Copy Built-in Genre for Customization\n```bash\ninkos genre copy xuanhuan\n# Copies to project genres\u002F directory for editing\n```\n\n## Command Reference Summary\n\n| Command | Purpose | Notes |\n|---------|---------|-------|\n| `inkos init [name]` | Initialize project | One-time setup |\n| `inkos book create` | Create new book | Returns book-id. `--brief \u003Cfile>`, `--lang en\u002Fzh`, `--genre litrpg\u002Fprogression\u002F...` |\n| `inkos book list` | List all books | Shows IDs, statuses |\n| `inkos write next` | Full pipeline (draft→audit→revise) | Primary workflow command |\n| `inkos draft` | Generate draft only | No auditing\u002Frevision |\n| `inkos audit` | 33-dimension quality check | Standalone evaluation |\n| `inkos revise` | Revise chapter | Modes: polish\u002Fspot-fix\u002Frewrite\u002Frework\u002Fanti-detect |\n| `inkos agent` | Natural language interface | Flexible requests |\n| `inkos style analyze` | Analyze reference text | Extracts style profile |\n| `inkos style import` | Apply style to book | Makes style permanent |\n| `inkos import canon` | Link spinoff to parent | For prequels\u002Fsequels |\n| `inkos import chapters` | Import existing chapters | Reverse-engineers truth files for continuation |\n| `inkos detect` | AIGC detection | Flags AI-generated passages |\n| `inkos export` | Export finished book | Formats: txt, md, epub |\n| `inkos analytics` \u002F `inkos stats` | View book statistics | Word count, audit rates, token usage |\n| `inkos radar scan` | Platform trend analysis | Informs new book ideas |\n| `inkos config set-global` | Configure LLM provider | OpenAI\u002FAnthropic\u002Fcustom (any OpenAI-compatible) |\n| `inkos config set-model \u003Cagent> \u003Cmodel>` | Set model override for a specific agent | `--provider`, `--base-url`, `--api-key-env` for multi-provider routing |\n| `inkos config show-models` | Show current model routing | View per-agent model assignments |\n| `inkos doctor` | Diagnose issues | Check installation |\n| `inkos update` | Update to latest version | Self-update |\n| `inkos up\u002Fdown` | Daemon mode | Background processing. Logs to `inkos.log` (JSON Lines). `-q` for quiet mode |\n| `inkos review list\u002Fapprove-all` | Manage chapter approvals | Quality gate |\n| `inkos fanfic init` | Create fanfic from source material | `--from \u003Cfile>`, `--mode canon\u002Fau\u002Fooc\u002Fcp` |\n| `inkos genre list` | List all available genres | Shows English and Chinese genres with default language |\n| `inkos genre create \u003Cid>` | Create custom genre profile | `--name`, `--numerical`, `--power`, `--era` |\n| `inkos genre copy \u003Cid>` | Copy built-in genre to project | For customization |\n| `inkos write rewrite \u003Cbook> \u003Cch>` | Rewrite a specific chapter | Deletes chapter and later, rewrites from that point |\n| `inkos book update [book-id]` | Update book settings | `--chapter-words`, `--target-chapters`, `--status`, `--lang` |\n| `inkos book delete \u003Cbook-id>` | Delete book and all chapters | `--force` to skip confirmation |\n| `inkos plan chapter [book-id]` | Generate chapter intent | Preview what next chapter will do before writing |\n| `inkos compose chapter [book-id]` | Generate runtime artifacts | Context, rule-stack, trace for next chapter |\n| `inkos consolidate [book-id]` | Consolidate chapter summaries | Reduces context for long books (volume-level summaries) |\n| `inkos eval [book-id]` | Quality evaluation report | `--json`, `--chapters \u003Crange>`. Composite quality score |\n| `inkos studio` | Start web workbench | `-p` for port. Local web UI for book management |\n| `inkos fanfic show [book-id]` | Display parsed fanfic canon | Shows imported source material analysis |\n| `inkos fanfic refresh [book-id]` | Re-import and regenerate fanfic canon | `--from \u003Cfile>` for updated source material |\n| `inkos interact` | Shared interaction endpoint | `--json`, `--message`, `--book`. Primary entry for OpenClaw |\n| `inkos` (no args) | Launch TUI dashboard | Full-screen Ink + React interactive dashboard |\n\n## Error Handling\n\n### Common Issues\n\n**\"book-id not found\"**\n- Verify the ID with `inkos book list`\n- Ensure you're in the correct project directory\n\n**\"Provider not configured\"**\n- Run `inkos config set-global` with valid credentials\n- Check API key and base URL with `inkos doctor`\n\n**\"Context invalid\"**\n- Ensure `--context` is a string (wrap in quotes if multi-word)\n- Context can be in English or Chinese\n\n**\"Audit failed\"**\n- Check chapter for encoding issues\n- Ensure chapter-words matches actual word count\n- Try `inkos revise` with `--mode rewrite`\n\n**\"Book already has chapters\" (import)**\n- Use `--resume-from \u003Cn>` to append to existing chapters\n- Or delete existing chapters first\n\n### Running Daemon Mode\n\nFor long-running operations:\n```bash\n# Start background daemon\ninkos up\n\n# Stop daemon\ninkos down\n\n# Daemon auto-processes queued chapters\n```\n\n## Tips for Best Results\n\n1. **Provide rich context**: The more guidance in `--context`, the more coherent the narrative\n2. **Start with style**: If imitating an author, run `inkos style import` before generation\n3. **Import first**: For existing novels, use `inkos import chapters` to bootstrap truth files before continuing\n4. **Review regularly**: Use `inkos review` to catch issues early\n5. **Monitor audits**: Check `inkos audit` metrics to understand quality bottlenecks\n6. **Use spinoffs strategically**: Import canon before writing prequels\u002Fsequels\n7. **Batch generation**: Generate multiple chapters together (better continuity)\n8. **Check analytics**: Use `inkos analytics` to track quality trends over time\n9. **Export frequently**: Keep backups with `inkos export`\n\n## Security & Trust\n\n- **License**: the ClawHub skill descriptor is MIT-0 per platform policy, but the underlying `@actalk\u002Finkos`, `@actalk\u002Finkos-core`, and `@actalk\u002Finkos-studio` npm packages are **AGPL-3.0-only**. Running InkOS and distributing modified versions are governed by AGPL. Full source on GitHub for auditability.\n- **No install hooks**: npm package has no `preinstall`\u002F`postinstall`\u002F`install` scripts. Install is inert.\n- **Local-only file I\u002FO**: all read\u002Fwrite stays inside the project directory (`books\u002F*`, `inkos.json`, `inkos.log`). No writes outside the working directory.\n- **No telemetry**: InkOS does not phone home, collect usage stats, or ship any data to InkOS-controlled servers. The only outbound traffic is to the LLM provider endpoint you explicitly configure.\n- **Credential handling**: always prefer `--api-key-env \u003CVAR_NAME>` over `--api-key \u003Cliteral>` so keys never hit shell history. Keys are stored in `inkos.json` under your project directory — treat it like a secret and add it to `.gitignore` if you commit the project.\n- **Custom provider base-URL**: `--provider custom` forwards your API key to whatever URL you specify. Only point it at endpoints you trust (your own proxy or an audited reverse-proxy). Never paste an untrusted `--base-url`.\n- **No elevated privileges**: InkOS requires no sudo, no global state mutation, no network listening port (Studio binds `localhost:4567` only).\n\n## Support & Resources\n\n- **Homepage**: https:\u002F\u002Fgithub.com\u002FNarcooo\u002Finkos\n- **Configuration**: Stored in project root after `inkos init`\n- **Truth files**: Located in `books\u002F\u003Cid>\u002Fstory\u002F` per book, with structured JSON in `story\u002Fstate\u002F`\n- **Logs**: Check output of `inkos doctor` for troubleshooting\n","# InkOS - Autonomous Novel Writing Agent\n\nInkOS 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.\n\nThe pipeline operates in three phases:\n- **Phase 1 (Creative Writing, temp 0.7)**: Planner generates chapter intent with hook agenda, Composer selects relevant context, Writer produces prose with length governance, first-screen hooks, semantic density, hook-ledger payoff, and mobile paragraph rhythm guidance.\n- **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\u002Fmention\u002Fresolve\u002Fdefer semantics.\n- **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.\n\nTruth files are persisted as schema-validated JSON (`story\u002Fstate\u002F*.json`) with markdown projections for human readability. SQLite temporal memory database (`story\u002Fmemory.db`) enables relevance-based retrieval on Node 22+.\n\n## When to Use InkOS\n\n- **English novel writing**: Native English support with 10 genre profiles (LitRPG, Progression Fantasy, Isekai, etc.). Set `--lang en`\n- **Chinese web novel writing**: 5 built-in Chinese genres (xuanhuan, xianxia, urban, horror, other)\n- **Fan fiction**: Create fanfic from source material with 4 modes (canon, au, ooc, cp)\n- **Batch chapter generation**: Generate multiple chapters with consistent quality\n- **Import & continue**: Import existing chapters from a text file, reverse-engineer truth files, and continue writing\n- **Style imitation**: Analyze and adopt writing styles from reference texts\n- **Spinoff writing**: Write prequels\u002Fsequels\u002Fspinoffs while maintaining parent canon\n- **Quality auditing**: Detect AI-generated content and perform 33-dimension quality checks\n- **Genre exploration**: Explore trends and create custom genre rules\n- **Analytics**: Track word count, audit pass rate, and issue distribution per book\n\n## Initial Setup\n\n### First Time Setup\n```bash\n# Initialize a project directory (creates config structure)\ninkos init my-writing-project\n\n# Configure your LLM provider (OpenAI, Anthropic, or any OpenAI-compatible API)\n# Prefer --api-key-env so the key never appears in shell history:\nexport OPENAI_API_KEY=sk-xxx\ninkos config set-global --provider openai --base-url https:\u002F\u002Fapi.openai.com\u002Fv1 --api-key-env OPENAI_API_KEY --model gpt-4o\n# For compatible\u002Fproxy endpoints, use --provider custom and point ONLY to trusted endpoints:\n# inkos config set-global --provider custom --base-url https:\u002F\u002Fyour-trusted-proxy.com\u002Fv1 --api-key-env OPENAI_API_KEY --model gpt-4o\n```\n\n### Multi-Model Routing (Optional)\n```bash\n# Assign different models to different agents — balance quality and cost\ninkos config set-model writer claude-sonnet-4-20250514 --provider anthropic --base-url https:\u002F\u002Fapi.anthropic.com --api-key-env ANTHROPIC_API_KEY\ninkos config set-model auditor gpt-4o --provider openai\ninkos config show-models\n```\nAgents without explicit overrides fall back to the global model.\n\n### View System Status\n```bash\n# Check installation and configuration\ninkos doctor\n\n# View current config\ninkos status\n```\n\n## Common Workflows\n\n### Workflow 1: Create a New Novel\n\n1. **Initialize and create book**:\n   ```bash\n   inkos book create --title \"My Novel Title\" --genre xuanhuan --chapter-words 3000\n   # Or with a creative brief (your worldbuilding doc \u002F ideas):\n   inkos book create --title \"My Novel Title\" --genre xuanhuan --chapter-words 3000 --brief my-ideas.md\n   ```\n   - Genres: `xuanhuan` (cultivation), `xianxia` (immortal), `urban` (city), `horror`, `other`\n   - Returns a `book-id` for all subsequent operations\n\n2. **Generate initial chapters** (e.g., 5 chapters):\n   ```bash\n   inkos write next book-id --count 5 --words 3000 --context \"young protagonist discovering powers\"\n   ```\n   - The `write next` command runs the full pipeline: draft → audit → revise\n   - `--context` provides guidance to the Architect and Writer agents\n   - Returns JSON with chapter details and quality metrics\n\n3. **Review and approve chapters**:\n   ```bash\n   inkos review list book-id\n   inkos review approve-all book-id\n   ```\n\n4. **Export the book** (supports txt, md, epub):\n   ```bash\n   inkos export book-id\n   inkos export book-id --format epub\n   ```\n\n### Workflow 2: Continue Writing Existing Novel\n\n1. **List your books**:\n   ```bash\n   inkos book list\n   ```\n\n2. **Continue from last chapter**:\n   ```bash\n   inkos write next book-id --count 3 --words 2500 --context \"protagonist faces critical choice\"\n   ```\n   - InkOS maintains 7 truth files (world state, character matrix, emotional arcs, etc.) for consistency\n   - If only one book exists, omit `book-id` for auto-detection\n\n3. **Review and approve**:\n   ```bash\n   inkos review approve-all\n   ```\n\n### Workflow 2.5: Shared Natural-Language Control (Recommended For OpenClaw)\n\nWhen InkOS is being driven by OpenClaw or another external agent, prefer the shared interaction executor instead of stitching together many ad-hoc CLI calls:\n\n```bash\ninkos interact --json --message \"continue the current book, but keep the pacing tighter\"\ninkos interact --json --message \"rewrite chapter 3\"\ninkos interact --json --book my-book --message \"switch to auto mode\"\n```\n\nThis returns a structured payload containing:\n- the routed request\n- assistant response text\n- updated interaction session\n- execution state\n- pending decision\n- recent interaction events\n\nUse this as the primary OpenClaw entry because it shares the same control layer as the project TUI.\n\n### Workflow 2.6: Steering Chapter Focus Before Writing\n\nUse 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\".\n\n1. **Update the book-level control docs when needed**:\n   - Use `update_author_intent` to change the long-horizon identity of the book\n   - Use `update_current_focus` to change the next 1-3 chapters' focus\n\n2. **Compile the next chapter intent**:\n   ```text\n   plan_chapter(bookId, guidance?)\n   ```\n   - Generates `story\u002Fruntime\u002Fchapter-XXXX.intent.md`\n   - Use this to verify what the system thinks the next chapter should do\n\n3. **Compose the actual runtime input package**:\n   ```text\n   compose_chapter(bookId, guidance?)\n   ```\n   - Generates `story\u002Fruntime\u002Fchapter-XXXX.context.json`\n   - Generates `story\u002Fruntime\u002Fchapter-XXXX.rule-stack.yaml`\n   - Generates `story\u002Fruntime\u002Fchapter-XXXX.trace.json`\n\n4. **Only then write**:\n   - `write_draft` if the user wants intermediate review\n   - `write_full_pipeline` if they want the usual write → audit → revise flow\n\nRecommended orchestration:\n- user asks to redirect focus\n- `update_current_focus`\n- `plan_chapter`\n- `compose_chapter`\n- inspect the resulting intent\u002Fpaths\n- `write_draft` or `write_full_pipeline`\n\n### Workflow 3: Import Existing Chapters & Continue\n\nUse this when you have an existing novel (or partial novel) and want InkOS to pick up where it left off.\n\n1. **Import from a single text file** (auto-splits by chapter headings):\n   ```bash\n   inkos import chapters book-id --from novel.txt\n   ```\n   - Automatically splits by `第X章` pattern\n   - Custom split pattern: `--split \"Chapter\\\\s+\\\\d+\"`\n\n2. **Import from a directory** of separate chapter files:\n   ```bash\n   inkos import chapters book-id --from .\u002Fchapters\u002F\n   ```\n   - Reads `.md` and `.txt` files in sorted order\n\n3. **Resume interrupted import**:\n   ```bash\n   inkos import chapters book-id --from novel.txt --resume-from 15\n   ```\n\n4. **Continue writing** from the imported chapters:\n   ```bash\n   inkos write next book-id --count 3\n   ```\n   - InkOS reverse-engineers all 7 truth files from the imported chapters\n   - Generates a style guide from the existing text\n   - New chapters maintain consistency with imported content\n\n### Workflow 4: Style Imitation\n\n1. **Analyze reference text**:\n   ```bash\n   inkos style analyze reference_text.txt\n   ```\n   - Examines vocabulary, sentence structure, tone, pacing\n\n2. **Import style to your book**:\n   ```bash\n   inkos style import reference_text.txt book-id --name \"Author Name\"\n   ```\n   - All future chapters adopt this style profile\n   - Style rules become part of the Reviser's audit criteria\n\n### Workflow 5: Spinoff\u002FPrequel Writing\n\n1. **Import parent canon**:\n   ```bash\n   inkos import canon spinoff-book-id --from parent-book-id\n   ```\n   - Creates links to parent book's world state, characters, and events\n   - Reviser enforces canon consistency\n\n2. **Continue spinoff**:\n   ```bash\n   inkos write next spinoff-book-id --count 3 --context \"alternate timeline after Chapter 20\"\n   ```\n\n### Workflow 6: Fine-Grained Control (Draft → Audit → Revise)\n\nIf you need separate control over each pipeline stage:\n\n1. **Generate draft only**:\n   ```bash\n   inkos draft book-id --words 3000 --context \"protagonist escapes\" --json\n   ```\n\n2. **Audit the chapter** (33-dimension quality check):\n   ```bash\n   inkos audit book-id chapter-1 --json\n   ```\n   - Returns metrics across 33 dimensions including pacing, dialogue, world-building, outline adherence, and more\n\n3. **Revise with specific mode**:\n   ```bash\n   inkos revise book-id chapter-1 --mode polish --json\n   ```\n   - Modes: `polish` (minor), `spot-fix` (targeted), `rewrite` (major), `rework` (structure), `anti-detect` (reduce AI traces)\n\n### Workflow 7: Monitor Platform Trends\n\n```bash\ninkos radar scan\n```\n- Analyzes trending genres, tropes, and reader preferences\n- Informs Architect recommendations for new books\n\n### Workflow 8: Detect AI-Generated Content\n\n```bash\n# Detect AIGC in a specific chapter\ninkos detect book-id\n\n# Deep scan all chapters\ninkos detect book-id --all\n```\n- Uses 11 deterministic rules (zero LLM cost) + optional LLM validation\n- Returns detection confidence and problematic passages\n\n### Workflow 9: View Analytics\n\n```bash\ninkos analytics book-id --json\n# Shorthand alias\ninkos stats book-id --json\n```\n- Total chapters, word count, average words per chapter\n- Audit pass rate and top issue categories\n- Chapters with most issues, status distribution\n- **Token usage stats**: total prompt\u002Fcompletion tokens, avg tokens per chapter, recent trend\n\n### Workflow 10: Write an English Novel\n\n```bash\n# Create an English LitRPG novel (language auto-detected from genre)\ninkos book create --title \"The Last Delver\" --genre litrpg --chapter-words 3000\n\n# Or set language explicitly\ninkos book create --title \"My Novel\" --genre other --lang en\n\n# Set English as default for all projects\ninkos config set-global --lang en\n```\n- 10 English genres: litrpg, progression, isekai, cultivation, system-apocalypse, dungeon-core, romantasy, sci-fi, tower-climber, cozy\n- Each genre has dedicated pacing rules, fatigue word lists (e.g., \"delve\", \"tapestry\", \"testament\"), and audit dimensions\n- Use `inkos genre list` to see all available genres\n\n### Workflow 11: Fan Fiction\n\n```bash\n# Create a fanfic from source material\ninkos fanfic init --title \"My Fanfic\" --from source-novel.txt --mode canon\n\n# Modes: canon (faithful), au (alternate universe), ooc (out of character), cp (ship-focused)\ninkos fanfic init --title \"What If\" --from source.txt --mode au --genre other\n```\n- Imports and analyzes source material automatically\n- Fanfic-specific audit dimensions and information boundary controls\n- Ensures new content stays consistent with source canon (or deliberately diverges in au\u002Fooc modes)\n\n### Workflow 12: Rename Characters or Entities Across Entire Book\n\n```bash\n# Via interact\ninkos interact --json --message \"把林烬改成张三\"\ninkos interact --json --message \"rename Lin Jin to Zhang San\"\n\n# Via slash command\ninkos interact --json --message \"\u002Frename 林烬 => 张三\"\n```\n- Scans all chapters + all truth files (story_bible, current_state, character_matrix, etc.)\n- Replaces every occurrence in one pass\n- Returns count of files touched\n\n### Workflow 13: Patch Specific Text in a Chapter\n\n```bash\ninkos interact --json --message \"\u002Freplace 5 旧文本 => 新文本\"\n```\n- Precisely replaces text in chapter 5 only\n- Marks chapter for review after patching\n\n### Workflow 14: Interactive TUI Dashboard\n\n```bash\ninkos\n```\n- Launches a full-screen Ink + React dashboard with conversational creation\n- Slash command autocomplete (Tab), input history (arrow keys)\n- Themed activity animations per operation (writing, auditing, revising, planning)\n- Bilingual i18n (Chinese \u002F English)\n- Shares the same interaction kernel as `inkos interact` and Studio\n\n## InkOS Studio (Web Workbench)\n\n`inkos studio` launches a local web UI (default port 4567) that provides a visual interface for all InkOS operations:\n\n- **Book management** — create, delete, export (TXT\u002FMD\u002FEPUB), configure per-book settings\n- **Chapter review & editing** — approve\u002Freject drafts, edit content inline, multi-mode revision (polish\u002Fspot-fix\u002Frewrite\u002Fanti-detect)\n- **Real-time writing progress** — SSE-based live updates during chapter generation\n- **Market radar** — AI-powered trend analysis with platform\u002Fgenre recommendations\n- **Analytics** — word count, audit pass rate, chapter ranking, token usage\n- **AI detection** — scan chapters for AI-generated content\n- **Style analysis** — analyze reference texts and import writing styles\n- **Genre management** — create\u002Fcustomize genre profiles with fatigue words, pacing rules, audit dimensions\n- **Daemon control** — start\u002Fstop background writing with event log\n- **Truth file editor** — view and edit canonical knowledge base per book\n- **Config editor** — LLM provider, model routing, notifications\n\n```bash\ninkos studio              # Start on default port 4567\ninkos studio -p 8080      # Start on custom port\n```\n\nThe right-side **AI Assistant panel** in Studio shares the same interaction kernel as TUI and `inkos interact`. You can type natural language commands (rename entities, write chapters, audit, export) directly in the assistant panel.\n\n## Advanced: Natural Language Agent Mode\n\nFor flexible, conversational requests:\n\n```bash\ninkos agent \"写一部都市题材的小说，主角是一个年轻律师，第一章三千字\"\n```\n- Agent interprets natural language and invokes appropriate commands\n- Useful for complex multi-step requests\n\n## Input Governance Tools\n\nThese tools are the preferred control surface for chapter steering:\n\n- `plan_chapter(bookId, guidance?)`\n  - Generates chapter intent for the next chapter\n  - Use before writing when the user wants to change focus\n\n- `compose_chapter(bookId, guidance?)`\n  - Generates runtime context\u002Frule-stack\u002Ftrace artifacts\n  - Use after planning and before writing\n\n- `update_author_intent(bookId, content)`\n  - Rewrites `story\u002Fauthor_intent.md`\n  - Use for long-horizon changes to the book's identity\n\n- `update_current_focus(bookId, content)`\n  - Rewrites `story\u002Fcurrent_focus.md`\n  - Use for local steering over the next 1-3 chapters\n\n`write_truth_file` remains available for broad file edits, but prefer the dedicated control tools above for input-governance changes.\n\n## Key Concepts\n\n### Book ID Auto-Detection\nIf your project contains only one book, most commands accept `book-id` as optional. You can omit it for brevity:\n```bash\n# Explicit\ninkos write next book-123 --count 1\n\n# Auto-detected (if only one book exists)\ninkos write next --count 1\n```\n\n### --json Flag\nAll content-generating commands support `--json` for structured output. Essential for programmatic use:\n```bash\ninkos draft book-id --words 3000 --context \"guidance\" --json\n```\n\n### Truth Files (Long-Term Memory)\nInkOS maintains 7 files per book for coherence:\n- **World State**: Maps, locations, technology levels, magic systems\n- **Character Matrix**: Names, relationships, arcs, motivations\n- **Resource Ledger**: In-world items, money, power levels\n- **Chapter Summaries**: Events, progression, foreshadowing\n- **Subplot Board**: Active and dormant subplots, hooks\n- **Emotional Arcs**: Character emotional progression\n- **Pending Hooks**: Unresolved cliffhangers and promises to reader\n\nAll agents reference these to maintain long-term consistency. Since 0.6.0, truth files are backed by schema-validated JSON in `story\u002Fstate\u002F` with automatic bootstrap from markdown for legacy books. During `import chapters`, these files are reverse-engineered from existing content via the ChapterAnalyzerAgent.\n\n### Multi-Phase Writer Architecture\nThe Writer operates across multiple phases with specialized agents:\n- **Planner**: Generates chapter intent with structured hook agenda (mustAdvance, eligibleResolve, staleDebt) based on memory retrieval.\n- **Composer**: Selects relevant context from truth files by relevance scoring, compiles rule stack and runtime artifacts.\n- **Phase 1 (Creative, temp 0.7)**: Generates prose with length governance, English variance brief (anti-repetition), and dialogue-driven guidance.\n- **Phase 2a (Observer, temp 0.5)**: Over-extracts 9 categories of facts from the chapter text.\n- **Phase 2b (Reflector, temp 0.3)**: Outputs a JSON delta with hookOps (upsert\u002Fmention\u002Fresolve\u002Fdefer), currentStatePatch, and chapterSummary. Code-layer validates via Zod schema and applies immutably.\n- **Normalizer**: Single-pass compress\u002Fexpand to bring chapter length into the target band. Safety net rejects destructive normalization (>75% content loss).\n- **Auditor**: 33-dimension check including hook health analysis (stale debt, burst detection, no-advance warnings).\n- **Reviser**: Auto-fixes critical issues, self-correction loop until clean.\n\nTruth files use structured JSON (`story\u002Fstate\u002F*.json`) as the authoritative source, with markdown projections for human readability. Hook admission control prevents duplicate\u002Ffamily hooks from inflating the hook table.\n\n### Context Guidance\nThe `--context` parameter provides directional hints to the Writer and Architect:\n```bash\ninkos write next book-id --count 2 --context \"protagonist discovers betrayal, must decide whether to trust mentor\"\n```\n- Context is optional but highly recommended for narrative coherence\n- Supports both English and Chinese\n\n## Genre Management\n\n### View Built-In Genres\n```bash\ninkos genre list\ninkos genre show xuanhuan\n```\n\n### Create Custom Genre\n```bash\ninkos genre create my-genre --name \"My Genre\"\n# Options: --numerical, --power, --era\ninkos genre create dark-xuanhuan --name \"Dark Xuanhuan\" --numerical --power\n```\n\n### Copy Built-in Genre for Customization\n```bash\ninkos genre copy xuanhuan\n# Copies to project genres\u002F directory for editing\n```\n\n## Command Reference Summary\n\n| Command | Purpose | Notes |\n|---------|---------|-------|\n| `inkos init [name]` | Initialize project | One-time setup |\n| `inkos book create` | Create new book | Returns book-id. `--brief \u003Cfile>`, `--lang en\u002Fzh`, `--genre litrpg\u002Fprogression\u002F...` |\n| `inkos book list` | List all books | Shows IDs, statuses |\n| `inkos write next` | Full pipeline (draft→audit→revise) | Primary workflow command |\n| `inkos draft` | Generate draft only | No auditing\u002Frevision |\n| `inkos audit` | 33-dimension quality check | Standalone evaluation |\n| `inkos revise` | Revise chapter | Modes: polish\u002Fspot-fix\u002Frewrite\u002Frework\u002Fanti-detect |\n| `inkos agent` | Natural language interface | Flexible requests |\n| `inkos style analyze` | Analyze reference text | Extracts style profile |\n| `inkos style import` | Apply style to book | Makes style permanent |\n| `inkos import canon` | Link spinoff to parent | For prequels\u002Fsequels |\n| `inkos import chapters` | Import existing chapters | Reverse-engineers truth files for continuation |\n| `inkos detect` | AIGC detection | Flags AI-generated passages |\n| `inkos export` | Export finished book | Formats: txt, md, epub |\n| `inkos analytics` \u002F `inkos stats` | View book statistics | Word count, audit rates, token usage |\n| `inkos radar scan` | Platform trend analysis | Informs new book ideas |\n| `inkos config set-global` | Configure LLM provider | OpenAI\u002FAnthropic\u002Fcustom (any OpenAI-compatible) |\n| `inkos config set-model \u003Cagent> \u003Cmodel>` | Set model override for a specific agent | `--provider`, `--base-url`, `--api-key-env` for multi-provider routing |\n| `inkos config show-models` | Show current model routing | View per-agent model assignments |\n| `inkos doctor` | Diagnose issues | Check installation |\n| `inkos update` | Update to latest version | Self-update |\n| `inkos up\u002Fdown` | Daemon mode | Background processing. Logs to `inkos.log` (JSON Lines). `-q` for quiet mode |\n| `inkos review list\u002Fapprove-all` | Manage chapter approvals | Quality gate |\n| `inkos fanfic init` | Create fanfic from source material | `--from \u003Cfile>`, `--mode canon\u002Fau\u002Fooc\u002Fcp` |\n| `inkos genre list` | List all available genres | Shows English and Chinese genres with default language |\n| `inkos genre create \u003Cid>` | Create custom genre profile | `--name`, `--numerical`, `--power`, `--era` |\n| `inkos genre copy \u003Cid>` | Copy built-in genre to project | For customization |\n| `inkos write rewrite \u003Cbook> \u003Cch>` | Rewrite a specific chapter | Deletes chapter and later, rewrites from that point |\n| `inkos book update [book-id]` | Update book settings | `--chapter-words`, `--target-chapters`, `--status`, `--lang` |\n| `inkos book delete \u003Cbook-id>` | Delete book and all chapters | `--force` to skip confirmation |\n| `inkos plan chapter [book-id]` | Generate chapter intent | Preview what next chapter will do before writing |\n| `inkos compose chapter [book-id]` | Generate runtime artifacts | Context, rule-stack, trace for next chapter |\n| `inkos consolidate [book-id]` | Consolidate chapter summaries | Reduces context for long books (volume-level summaries) |\n| `inkos eval [book-id]` | Quality evaluation report | `--json`, `--chapters \u003Crange>`. Composite quality score |\n| `inkos studio` | Start web workbench | `-p` for port. Local web UI for book management |\n| `inkos fanfic show [book-id]` | Display parsed fanfic canon | Shows imported source material analysis |\n| `inkos fanfic refresh [book-id]` | Re-import and regenerate fanfic canon | `--from \u003Cfile>` for updated source material |\n| `inkos interact` | Shared interaction endpoint | `--json`, `--message`, `--book`. Primary entry for OpenClaw |\n| `inkos` (no args) | Launch TUI dashboard | Full-screen Ink + React interactive dashboard |\n\n## Error Handling\n\n### Common Issues\n\n**\"book-id not found\"**\n- Verify the ID with `inkos book list`\n- Ensure you're in the correct project directory\n\n**\"Provider not configured\"**\n- Run `inkos config set-global` with valid credentials\n- Check API key and base URL with `inkos doctor`\n\n**\"Context invalid\"**\n- Ensure `--context` is a string (wrap in quotes if multi-word)\n- Context can be in English or Chinese\n\n**\"Audit failed\"**\n- Check chapter for encoding issues\n- Ensure chapter-words matches actual word count\n- Try `inkos revise` with `--mode rewrite`\n\n**\"Book already has chapters\" (import)**\n- Use `--resume-from \u003Cn>` to append to existing chapters\n- Or delete existing chapters first\n\n### Running Daemon Mode\n\nFor long-running operations:\n```bash\n# Start background daemon\ninkos up\n\n# Stop daemon\ninkos down\n\n# Daemon auto-processes queued chapters\n```\n\n## Tips for Best Results\n\n1. **Provide rich context**: The more guidance in `--context`, the more coherent the narrative\n2. **Start with style**: If imitating an author, run `inkos style import` before generation\n3. **Import first**: For existing novels, use `inkos import chapters` to bootstrap truth files before continuing\n4. **Review regularly**: Use `inkos review` to catch issues early\n5. **Monitor audits**: Check `inkos audit` metrics to understand quality bottlenecks\n6. **Use spinoffs strategically**: Import canon before writing prequels\u002Fsequels\n7. **Batch generation**: Generate multiple chapters together (better continuity)\n8. **Check analytics**: Use `inkos analytics` to track quality trends over time\n9. **Export frequently**: Keep backups with `inkos export`\n\n## Security & Trust\n\n- **License**: the ClawHub skill descriptor is MIT-0 per platform policy, but the underlying `@actalk\u002Finkos`, `@actalk\u002Finkos-core`, and `@actalk\u002Finkos-studio` npm packages are **AGPL-3.0-only**. Running InkOS and distributing modified versions are governed by AGPL. Full source on GitHub for auditability.\n- **No install hooks**: npm package has no `preinstall`\u002F`postinstall`\u002F`install` scripts. Install is inert.\n- **Local-only file I\u002FO**: all read\u002Fwrite stays inside the project directory (`books\u002F*`, `inkos.json`, `inkos.log`). No writes outside the working directory.\n- **No telemetry**: InkOS does not phone home, collect usage stats, or ship any data to InkOS-controlled servers. The only outbound traffic is to the LLM provider endpoint you explicitly configure.\n- **Credential handling**: always prefer `--api-key-env \u003CVAR_NAME>` over `--api-key \u003Cliteral>` so keys never hit shell history. Keys are stored in `inkos.json` under your project directory — treat it like a secret and add it to `.gitignore` if you commit the project.\n- **Custom provider base-URL**: `--provider custom` forwards your API key to whatever URL you specify. Only point it at endpoints you trust (your own proxy or an audited reverse-proxy). Never paste an untrusted `--base-url`.\n- **No elevated privileges**: InkOS requires no sudo, no global state mutation, no network listening port (Studio binds `localhost:4567` only).\n\n## Support & Resources\n\n- **Homepage**: https:\u002F\u002Fgithub.com\u002FNarcooo\u002Finkos\n- **Configuration**: Stored in project root after `inkos init`\n- **Truth files**: Located in `books\u002F\u003Cid>\u002Fstory\u002F` per book, with structured JSON in `story\u002Fstate\u002F`\n- **Logs**: Check output of `inkos doctor` for troubleshooting\n",{"name":5,"version":24,"metadata":25,"description":7},"2.3.3",{"openclaw":26},{"emoji":27,"install":28,"homepage":34,"requires":35,"primaryEnv":37},"📖",[29],{"id":30,"kind":31,"label":32,"package":33},"npm","node","Install InkOS (npm)","@actalk\u002Finkos","https:\u002F\u002Fgithub.com\u002FNarcooo\u002Finkos",{"env":36,"bins":38},[37],"OPENAI_API_KEY",[5,31],"master","4aa004da461d820f4ea5499e58eb8d196cf99016","community\u002Fclawhub\u002Fi\u002Finkos-novel-writer",0,"https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge","https:\u002F\u002Fskill-explorer-rho.vercel.app","https:\u002F\u002Fgithub.com\u002FLord1Egypt","Unbreakable. Unstoppable. Unmatched⚡.\r\n Speaker of machine tongues 🤖  | World-builder of decentralized dreams 🌐 | Defender of the digital realm🛡️.","2026-06-10 08:21:01",{"source":8,"skillName":5,"commands":49,"prompt":59,"zipAvailable":60},[50,53,56],{"tool":51,"command":52},"npx","npx skills add Lord1Egypt\u002Fawesome-skill-forge --skill inkos",{"tool":54,"command":55},"bunx","bunx skills add Lord1Egypt\u002Fawesome-skill-forge --skill inkos",{"tool":57,"command":58},"pnpm","pnpm dlx skills add Lord1Egypt\u002Fawesome-skill-forge --skill inkos","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fcommunity\u002Fclawhub\u002Fi\u002Finkos-novel-writer\u002FSKILL.md",true,[],[63,70,77,84,91,98],{"skillNo":64,"name":65,"nameZh":6,"description":66,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":67,"categories":68,"keywords":69,"publishedAt":19},"01M785WKJB99G3STR1NF9NRTJW","youtube-content","YouTube transcripts to summaries, threads, blogs.","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fskills\u002Fyoutube-content\u002FSKILL.md",[],[],{"skillNo":71,"name":72,"nameZh":6,"description":73,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":74,"categories":75,"keywords":76,"publishedAt":19},"01M785WEFHB0G2S9YA6EPR3H0E","xurl","X\u002FTwitter via xurl CLI: post, search, DM, media, v2 API.","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fskills\u002Fxurl\u002FSKILL.md",[],[],{"skillNo":78,"name":79,"nameZh":6,"description":80,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":81,"categories":82,"keywords":83,"publishedAt":19},"01M785W98EDN4EFJXJPMQEHCRC","touchdesigner-mcp","Control a running TouchDesigner instance via twozero MCP — create operators, set parameters, wire connections, execute Python, build real-time visuals. 36 native tools.","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fskills\u002Ftouchdesigner-mcp\u002FSKILL.md",[],[],{"skillNo":85,"name":86,"nameZh":6,"description":87,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":88,"categories":89,"keywords":90,"publishedAt":19},"01M785W5S9FP3QBH2V191E025P","test-driven-development","TDD: enforce RED-GREEN-REFACTOR, tests before code.","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fskills\u002Ftest-driven-development\u002FSKILL.md",[],[],{"skillNo":92,"name":93,"nameZh":6,"description":94,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":95,"categories":96,"keywords":97,"publishedAt":19},"01M785W2AS08NSSH9YATCV6FJB","teams-meeting-pipeline","Operate the Teams meeting summary pipeline via Hermes CLI — summarize meetings, inspect pipeline status, replay jobs, manage Microsoft Graph subscriptions.","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fskills\u002Fteams-meeting-pipeline\u002FSKILL.md",[],[],{"skillNo":99,"name":100,"nameZh":6,"description":101,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":102,"categories":103,"keywords":104,"publishedAt":19},"01M785VXKW4T34BTP1SCHW1R7F","systematic-debugging","4-phase root cause debugging: understand bugs before fixing.","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fskills\u002Fsystematic-debugging\u002FSKILL.md",[],[]]