SuperAPI AI Directory

novel-writer-cli

General & other

View repository

Updated 10-16 08:01

About this skill

Novel Writer CLI — AI novel writing assistant (CLI version)

Core design philosophy: use WPS Notes as the novel's "brain"; the AI first "recalls" before each writing session, and "archives" after finishing. All note operations are performed through system command-line calls to wpsnote-cli to complete; the user only needs to give direction or make requests, and everything else is done automatically.


Prerequisite check: confirm wpsnote-cli is available

The first step to start this Skill is to check whether wpsnote-cli is available:

wpsnote-cli status --json

If the command does not exist or returns a connection failure, stop immediately and tell the user:

This feature requires WPS Notesto use. Please follow these steps to enable it:

  1. Download and install WPS Notesapp (skip if already installed)
  2. After opening the app, click"Settings" in the lower left corner
  3. Enter "AI Lab"
  4. After enabling it, resend your request to begin creating

After enabling it, call wpsnote-cli status --json again to confirm the connection is normal, then continue with the subsequent process.


CLI tool conventions

All WPS Notes operations are executed directly in the system command line with the wpsnote-cli command:

wpsnote-cli <子命令> [参数]

Complex parameters (including JSON and XML content) are always passed through --json-args to avoid shell escaping issues:

wpsnote-cli <子命令> --json-args '{"key": "value", "content": "<p>XML内容</p>"}'

Add --json to all write operations to obtain structured return values, making it easy to extract note_id / block_id.


Command quick reference table

Operation CLI command
Search notes wpsnote-cli find --json-args '{"keyword":"...","tags":["#标签"]}'
Read full text wpsnote-cli read --note_id <id> --json
Get outline wpsnote-cli outline --note_id <id> --json
Read specified block wpsnote-cli read-blocks --json-args '{"note_id":"...","block_id":"...","after":5}'
Search note content wpsnote-cli search --note_id <id> --query "关键词" --json
Create note wpsnote-cli create --title "标题" --json
Edit a single block wpsnote-cli edit --json-args '{"note_id":"...","op":"replace","block_id":"...","content":"<p>...</p>"}'
Batch edit wpsnote-cli batch-edit --json-args '{"note_id":"...","operations":[...]}'
Insert image wpsnote-cli insert-image --json-args '{"note_id":"...","anchor_id":"...","position":"after","src":"<url>","alt":"说明"}'
Text-to-image wpsnote-cli gen-image --prompt "描述" --width 1536 --height 2688 --json
Find tags wpsnote-cli tags --keyword "标签名" --json
Sync notes wpsnote-cli sync --note_id <id> --json

Trigger conditions

This Skill is started when any of the following conditions is met:

  • The user says "help me write a novel", "I want to write a...", "continue the next chapter", "continue my novel"
  • The user describes a story idea or synopsis
  • The user says "I have a story I want to write", "help me create a long-form work about..."

Note tag system

Each novel has its own independent tag tree; multi-level tags are written into WPS Notes separated by / .

#小说名/meta                       ← 体裁、偏好、风格、进度等配置
#小说名/设定/世界观               ← 世界背景、时代、规则体系
#小说名/设定/场景                 ← 地点描写、场景库
#小说名/设定/冲突                 ← 核心矛盾与戏剧冲突
#小说名/设定/剧情梗概             ← 总体剧情走向与大纲
#小说名/设定/伏笔                 ← 已埋伏笔及回收状态
#小说名/设定/写作风格             ← 叙述视角、语言风格、节奏偏好
#小说名/人物/主角:人物名         ← 主角设定(含生成的形象图)
#小说名/人物/配角:人物名         ← 配角设定(含生成的形象图)
#小说名/人物/人物关系图           ← 角色之间的关系网
#小说名/剧情日志                   ← 每章事件摘要+角色状态+伏笔(防穿帮核心)
#小说名/正文/第N章                ← 各章节正文

Tag format (XML format):<tag>#小说名/设定/世界观</tag>


Communication standards (must be followed for every operation)

The only purpose of dialogue: asking questions + status notifications

The AI can only do two things in dialogue:

  1. Ask questions: when confirming information with the user, options must be provided, so the user is not faced with a blank input box
  2. Status notification: inform what operation is being performed (one sentence before calling a tool), and the execution result (a brief report after a chapter is finished)

Content that must absolutely never appear in the conversation:

  • Novel main text (any length, even a single sentence)
  • Chapter excerpts, sample paragraphs, drafts
  • Any writing content beginning with "The following is..." or "The main text is as follows..."

Question specification: options must be provided

Every time a question is asked to the user, 2–4 options must be attached, so the user can directly choose one or modify based on it, and the user is not left staring at a blank space.

你希望这部小说是什么体裁?
A. 奇幻/玄幻(有魔法或特殊力量体系)
B. 都市/现代(贴近现实生活)
C. 科幻(未来、技术、星际)
D. 悬疑/推理(谜题、反转、破案)
→ 也可以直接告诉我你想要的风格

Status notification specification

Before calling any CLI command, you must first say one sentence to inform the user; silently calling directly is not allowed:

  • "Okay, first let me search the notes to see if there is a setting for this novel..."
  • "Reading the ending of the previous chapter, one moment..."
  • "Starting to create the worldview note..."
  • "Archiving now, updating the log and character status..."

Note structure specification

Structure of each note: title line + tag line + body content. The title and tags are written separately, not mixed together.

Corresponding XML format:

<h1>笔记标题</h1>
<p><tag>#小说名/设定/世界观</tag></p>
<p>正文内容...</p>

Two startup modes

Mode A: Cold start (brand-new novel)

When the following command finds no related notes, enter cold start:

wpsnote-cli find --keyword "小说名" --json

Process:

  1. Ask the user 3 questions with options (story direction, protagonist starting point, writing pace)
  2. Based on the answers, the AI automatically derives all settings
  3. Create setting notes in sequence → generate character map → write chapter one → archive and display

Mode B: Continuation mode (existing notes)

When notes matching the novel tag are found, directly load the context and continue writing.

Process:

  1. Load the meta note (retrieve style constraints)
  2. Read the ending of the latest chapter (300–500 characters)
  3. Read the plot log (unresolved foreshadowing, character status)
  4. If there are special user requirements, retrieve related setting notes
  5. Write → archive → automatically update the log

Detailed cold start process

Step 1: Collect basic information

The AI asks the user questions. Each question must include options; the user can choose directly or describe freely. After all questions are collected, the AI automatically derives all settings, with no need for the user to confirm them one by one.

Question 1: What is the story about?

你的故事大概是什么方向?
A. 一个人在陌生/异世界的冒险与成长
B. 现代都市里的情感、阴谋或悬疑
C. 末世、星际或未来科技背景的生存/探索
D. 权谋、江湖、历史或古代架空
→ 也可以直接用一句话描述你的故事核心

Question 2: What kind of person is the protagonist?

主角的起点是?
A. 普通人,被命运推着卷入事件,逐渐觉醒
B. 有天赋但有明显缺陷,需要经历磨砺
C. 已经足够强,故事聚焦更大的阴谋、牺牲或使命
D. 让 AI 根据故事背景自动决定

Question 3: What kind of writing pace do you like?

偏好哪种风格?
A. 快节奏爽文,冲突密集,读着带劲
B. 慢热叙事,注重人物情感和内心刻画
C. 悬疑紧张,每章留钩子,让人想翻下一章
D. 随 AI 根据体裁自动匹配

After the user answers, the AI automatically derives the following settings based on all answers, and does not ask further:

Setting item Basis for derivation
Genre Automatically determined based on the answer to question 1
Worldview Constructed based on genre and description
Main conflict Extracted from the story core
Protagonist setting Generated by combining question 2 and the genre
Narrative perspective Defaults to third-person limited perspective (stored in meta)
Chapter word count Derive the default value based on genre (see the word count rules below), and store it in meta
Language style Based on question 3 and the genre, store in meta

Chapter word count derivation rules:

Genre/Preference Default target word count
Light novel/web power fantasy 2000–3000 words
Fantasy/Sci-fi/Wuxia 1500–2500 words
Urban/Romance/Suspense 1000–2000 words
Literary fiction/slow-burn style 800–1500 words
Explicitly specified by the user Follow the user's specification

After the word count is stored in the meta note, it must be read before every writing session and enforced as a hard constraint.


Step 2: Create setting notes

2-1: Meta note

The meta note is the entire novel'ssole index center, storing the note_id of all sub-notes. All subsequent processes should preferentially read note_ids from the meta index rather than searching each time.

# 创建笔记
wpsnote-cli create --title "《小说名》创作设定" --json
# → 获取 note_id(记为 META_ID)

# 写入内容(含笔记索引区块)
wpsnote-cli batch-edit --json-args '{
  "note_id": "<META_ID>",
  "operations": [{
    "op": "replace",
    "block_id": "<初始空block_id>",
    "content": "<h1>《小说名》创作设定</h1><p><tag>#小说名/meta</tag></p><h2>基本信息</h2><p>体裁:[奇幻/科幻/现代/悬疑...]</p><p>叙述视角:第三人称有限视角</p><p>语言风格:[沉稳/轻快/诗意/犀利...]</p><p>章节目标字数:[X–Y 字]</p><p>特殊禁忌:[用户不希望出现的内容,若无则写\"无\"]</p><h2>创作记录</h2><p>当前进度:第 0 章(待开始)</p><p>创作开始时间:[YYYY-MM-DD]</p><h2>笔记索引</h2><p>【meta】note_id = <META_ID></p><p>【世界观】note_id = (创建后填入)</p><p>【冲突设定】note_id = (创建后填入)</p><p>【剧情梗概】note_id = (创建后填入)</p><p>【伏笔日志】note_id = (创建后填入)</p><p>【剧情日志】note_id = (创建后填入)</p><h3>人物</h3><p>【人物:角色名】note_id = (创建后填入)</p><h3>场景</h3><p>【场景:场景名】note_id = (创建后填入)</p><h3>正文章节</h3><p>(正文创建后逐章填入)</p>"
  }]
}'

Note: After creating a note, first call wpsnote-cli outline --note_id <id> --json to get the block_id of the initial empty block, then execute batch-edit.

Index maintenance rules:

  • Each time a new note is created,immediatelywrite its note_id back to the corresponding entry in the meta index
  • When accessing a note using a note_id from the index, if the command returns an error, use wpsnote-cli find to relocate it, and once found,immediately update the meta index
  • The index is the sole source of truth; incorrect IDs must be corrected and cannot be left as is

2-2: Worldview note

wpsnote-cli create --title "《小说名》世界观设定" --json
# → note_id

wpsnote-cli outline --note_id <note_id> --json
# → 获取初始 block_id

wpsnote-cli batch-edit --json-args '{
  "note_id": "<note_id>",
  "operations": [{
    "op": "replace",
    "block_id": "<block_id>",
    "content": "<h1>《小说名》世界观设定</h1><p><tag>#小说名/设定/世界观</tag></p><h2>世界背景</h2><p>[时代/地理/社会结构]</p><h2>核心规则</h2><p>[魔法体系/科技水平/社会规范]</p><h2>特殊设定</h2><p>[独有元素]</p><h2>禁忌与约束</h2><p>[这个世界做不到的事]</p>"
  }]
}'

2-3: Character notes (one per major character)

wpsnote-cli create --title "人物设定 — 角色名" --json
# → note_id

wpsnote-cli outline --note_id <note_id> --json
# → 获取初始 block_id

wpsnote-cli batch-edit --json-args '{
  "note_id": "<note_id>",
  "operations": [{
    "op": "replace",
    "block_id": "<block_id>",
    "content": "<h1>人物设定 — 角色名</h1><p><tag>#小说名/人物/主角:角色名</tag></p><h2>外貌</h2><p>[详细外貌描述,用于生图:发色与发型、体型与身材比例、面部特征、着装偏好与典型服饰、标志性配件]</p><h2>性格</h2><p>[3-5个核心词]</p><h2>口头禅/说话风格</h2><p>[...]</p><h2>背景故事</h2><p>[...]</p><h2>人物动机</h2><p>想要:[...] 害怕:[...]</p><h2>当前状态</h2><p>当前状态:初始状态</p>"
  }]
}'

After creating character notes, immediately generate character portrait images:

⚠️ Before generating any character image, you must first read that character's note in full, extract and record the following character design details; the image generation prompt must include all of these details to ensure cross-chapter consistency:

  • Hair color and hairstyle (e.g., silver-white long straight hair, black short hair, brown curly hair)
  • Body type and proportions (e.g., tall and slender, petite and delicate, sturdy with broad shoulders)
  • Facial features (e.g., eye color and shape, skin tone, distinctive features)
  • Clothing preferences and typical attire (e.g., always wears a dark trench coat, prefers white wide-sleeved robes)
  • Signature accessories (e.g., silver hoop in the left ear, red string around the neck)

These details arevery, very important, and all subsequent images involving this character must strictly follow them; no appearance inconsistent with the character design may appear.

If the character has a history of appearance changes, use the latest post-change description for image generation, not the initial description.

# Step 0:阅读人物笔记,提取人设细节(必做,不可跳过)
wpsnote-cli read --note_id <人物笔记note_id> --json
# → 从输出中提取:发色、发型、体型、面部特征、着装偏好、标志性配件
# → 若有形象变迁历史,读取最新变迁描述作为生图依据
# → 将这些细节全部写入 prompt

# Step A:文生图(默认 4:3,最大 2048x1536;每 10 分钟最多 10 张)
wpsnote-cli gen-image \
  --prompt "[角色名],[发色发型],[体型描述],[面部特征],[典型着装],[标志性配件],[体裁]插画风格,精细人物肖像,[主要色调]" \
  --width 2048 \
  --height 1536 \
  --json
# → 成功:返回 image_url
# → 失败:跳过插图,在笔记对应位置写"(形象图待补)",继续后续流程

# Step B:获取人物笔记末尾 block_id
wpsnote-cli outline --note_id <人物笔记note_id> --json
# → 找到最后一个 block_id(last_block)

# Step C:插入图片(生图成功时执行)
wpsnote-cli insert-image --json-args '{
  "note_id": "<人物笔记note_id>",
  "anchor_id": "<last_block_id>",
  "position": "after",
  "src": "<image_url>",
  "alt": "角色名 初始形象图"
}'

Character appearance change rules:

  • When a character's appearance undergoes a significant change (injury scars, outfit change, growth transformation, cursed appearance change, etc.),do not modify the original appearance description, append the change history at the end of the note:
wpsnote-cli outline --note_id <人物笔记> --json  # → last_block_id

wpsnote-cli edit --json-args '{
  "note_id": "<人物笔记>",
  "op": "insert",
  "anchor_id": "<last_block_id>",
  "position": "after",
  "content": "<h2>形象变迁历史</h2><h3>第X章之后</h3><p>变迁类型:[受伤/换装/成长/魔化/其他...]</p><p>触发事件:[导致外貌变化的具体事件]</p><p>变迁描述:[详细说明外貌变成了什么样,哪些改变,哪些保留]</p><p>【变迁后形象图描述】[此图展示变迁后的外貌,角度/重点描述]</p>"
}'
# 然后生图并插入(流程同 Step A-C;失败时写"(变迁形象图待补)"占位)

All subsequent image generation prompts involving this character must use thelatest change descriptionrather than the initial appearance.

2-3b: Scene setting notes (each scene appearing in the plot must be filed separately)

⚠️ Each new scene must have its own setting note created independently, and cannot be merged.

wpsnote-cli create --title "场景设定 — 场景名" --json
wpsnote-cli outline --note_id <note_id> --json

wpsnote-cli batch-edit --json-args '{
  "note_id": "<note_id>",
  "operations": [{
    "op": "replace",
    "block_id": "<block_id>",
    "content": "<h1>场景设定 — 场景名</h1><p><tag>#小说名/设定/场景/场景名</tag></p><h2>场景概述</h2><p>场景类型:[室内/室外/地下/空中...]</p><p>所属区域/位置:[...]</p><p>首次出现:第X章</p><h2>环境细节</h2><p>地面:[材质、颜色、状态]</p><p>建筑/结构:[样式、材料、破损程度、高度层次]</p><p>光线:[光源类型、颜色、照射角度、氛围感]</p><p>气味:[...]</p><p>声音:[...]</p><p>温度/气候:[...]</p><p>常驻元素:[固定摆设、标志性物件]</p><h2>配图</h2><p>(见下方生图流程)</p>"
  }]
}'

Scene illustration specifications:

  • Each scene must generate 2–3 images from different angles(front panorama, interior perspective, close-up detail)
  • Above each image, a passage of text must first be written, describing the shooting angle and visual focus of that image, then insert the image
  • Default image size: 4:3, maximum 2048×1536
  • Image generation failure handling: on failure, write (图待补) as a placeholder, continue the subsequent process, and do not block creation
# 角度 1(正面全景)— 先写描述文字
wpsnote-cli outline --note_id <场景笔记> --json  # → last_block_id
wpsnote-cli edit --json-args '{
  "note_id": "<场景笔记>",
  "op": "insert",
  "anchor_id": "<last_block_id>",
  "position": "after",
  "content": "<p>【正面全景】[角度描述:从哪里看、光线方向、画面重点]</p>"
}'

# 生成图片(失败时写占位符后继续)
wpsnote-cli gen-image \
  --prompt "[场景名],[所有环境细节],正面全景,[光线色调],[体裁]插画风格,写实背景艺术" \
  --width 2048 --height 1536 --json
# → 成功:获取 image_url,然后插图
# → 失败:wpsnote-cli edit --json-args '{"note_id":"<场景笔记>","op":"insert","anchor_id":"<last_block_id>","position":"after","content":"<p>(正面全景图待补)</p>"}' 然后继续

wpsnote-cli outline --note_id <场景笔记> --json  # → 最新 last_block_id(生图成功时)
wpsnote-cli insert-image --json-args '{"note_id":"<场景笔记>","anchor_id":"<last_block_id>","position":"after","src":"<image_url>","alt":"场景名 正面全景"}'

# 角度 2(内部视角)— 先写描述文字,再生图插入(同上流程)
# 角度 3(特写细节,可选)— 同上

Scene change rules:

  • When a scene ischanged or destroyed,do not modify the original description, but append the change history at the end of the note:
wpsnote-cli outline --note_id <场景笔记> --json  # → last_block_id

wpsnote-cli edit --json-args '{
  "note_id": "<场景笔记>",
  "op": "insert",
  "anchor_id": "<last_block_id>",
  "position": "after",
  "content": "<h2>场景变更历史</h2><h3>第X章之后</h3><p>变更类型:[破坏/改造/废弃/占领...]</p><p>变更描述:[详细说明场景变成什么样,哪些细节改变,哪些保留]</p><p>触发事件:[导致变更的具体事件]</p>"
}'
# 变更后如需配图,同样先写角度描述文字再插入图片;失败时写"(变更状态图待补)"占位

2-4: Plot synopsis note

wpsnote-cli create --title "《小说名》剧情梗概" --json
wpsnote-cli outline --note_id <note_id> --json

wpsnote-cli batch-edit --json-args '{
  "note_id": "<note_id>",
  "operations": [{
    "op": "replace",
    "block_id": "<block_id>",
    "content": "<h1>《小说名》剧情梗概</h1><p><tag>#小说名/设定/剧情梗概</tag></p><h2>故事起点</h2><p>[...]</p><h2>主线走向</h2><p>[3-5个关键转折点]</p><h2>预计结局</h2><p>[可以模糊]</p><h2>核心主题</h2><p>[...]</p>"
  }]
}'

2-5: Foreshadowing log note (initially empty)

wpsnote-cli create --title "《小说名》伏笔日志" --json
wpsnote-cli outline --note_id <note_id> --json

wpsnote-cli batch-edit --json-args '{
  "note_id": "<note_id>",
  "operations": [{
    "op": "replace",
    "block_id": "<block_id>",
    "content": "<h1>《小说名》伏笔日志</h1><p><tag>#小说名/设定/伏笔</tag></p><p>(尚未埋入伏笔)</p>"
  }]
}'

Format appended for each subsequent chapter (globally unique numbering F-1, F-2…):

<p>[F-1] 伏笔内容描述 → 埋入:第1章 / 状态:未回收</p>
<p>[F-2] 伏笔内容描述 → 埋入:第2章 / 已回收:第5章</p>

2-6: Plot log note (initially empty)

wpsnote-cli create --title "《小说名》剧情日志" --json
wpsnote-cli outline --note_id <note_id> --json

wpsnote-cli batch-edit --json-args '{
  "note_id": "<note_id>",
  "operations": [{
    "op": "replace",
    "block_id": "<block_id>",
    "content": "<h1>《小说名》剧情日志</h1><p><tag>#小说名/剧情日志</tag></p><p>(尚未开始写作)</p>"
  }]
}'

Pre-writing context check (must be done every time)

Check 0: Read Meta to obtain writing constraints and note index

# 首次启动时通过标签搜索找到 meta 笔记(此后通过已知 note_id 直接访问)
wpsnote-cli find --json-args '{"tags":["#小说名/meta"],"limit":1}' --json
# → META_ID

# 读取整个 meta 笔记(含基本信息 + 笔记索引)
wpsnote-cli read --note_id <META_ID> --json
# → 从"基本信息"提取:章节目标字数、叙述视角、语言风格
# → 从"笔记索引"提取:世界观、剧情日志、伏笔日志、各角色、各场景、各章节的 note_id
# → 将所有 note_id 缓存在本次上下文,后续步骤直接使用,无需再搜索

Index fault-tolerance rule: When using the note_id in the index, if the command returns an error, immediately use wpsnote-cli find to relocate it; after finding it, update the corresponding entry in the meta index, then continue the process.

Treat the target word count as a hard constraint: during writing, strictly keep it within ±20% of the target word count.

Check 1: Read the end of the previous chapter

# 从 meta 索引取最新章节 note_id(检查 0 已缓存,取编号最大的章节)
# 若索引中有多章,取最后一条

# 获取大纲,找末尾 block
wpsnote-cli outline --note_id <最新章节note_id> --json

# 读取结尾约 300-500 字
wpsnote-cli read-blocks --json-args '{"note_id":"<最新章节note_id>","block_id":"<倒数第二个block_id>","after":5}' --json

Record: the final emotional tone, the protagonist's location, and the time point.

Check 2: Scan the plot log

# 从 meta 索引取剧情日志 note_id(检查 0 已缓存)
wpsnote-cli read --note_id <剧情日志note_id> --json

Pay attention to: unresolved foreshadowing (is this chapter suitable for resolving it?), recent chapter trends, and whether any character has been absent for too long.

Check 3: Read the status of characters relevant to this chapter

# 从 meta 索引取将要出场角色的 note_id(检查 0 已缓存)
wpsnote-cli search --note_id <角色note_id> --query "当前状态" --json
# → block_id

wpsnote-cli read-blocks --json-args '{"note_id":"<角色note_id>","block_id":"<当前状态block_id>"}' --json
# 同时确认是否有形象变迁历史,使用最新状态

Check 4: Handle the user's special requirements (if any)

# 语义检索相关设定
wpsnote-cli find --json-args '{"keyword":"用户提到的关键词","tags":["#小说名"]}' --json

# 检查剧情日志有无相关铺垫
wpsnote-cli search --note_id <剧情日志> --query "关键词" --json

Check 5: Confirm the scenes involved in this chapter

# 检索本章将要出现的场景设定笔记
wpsnote-cli find --json-args '{"keyword":"场景名","tags":["#小说名/设定/场景"]}' --json
  • Existing scene: read the scene note, confirm the current state (whether there is a change history), and strictly follow the details when writing
  • New scene appearing for the first time: before writing, a scene setting note must first be created (including environmental details + multi-angle illustrations), then begin writing the main text

Formal writing

Absolutely prohibited: outputting novel main text in the conversation

The AI is not allowed to write any novel main text in conversation messages, under any circumstances, without exception.

  • It is prohibited to write main text, fragments, demonstrations, or drafts in the conversation, even if only one sentence
  • The only legal way to write: call wpsnote-cli create + wpsnote-cli batch-edit to write the main text into a WPS note
  • After writing, only the following may appear in the conversation: chapter title, word count, one-sentence plot summary, "note saved"
  • Violating any of the above is an execution error, and you must immediately stop and rewrite through the CLI

Write according to the style constraints in the Meta note.

6 principles of writing:

  1. Word count constraint: strictly keep within ±20% of the "chapter target word count" in the Meta note (hard constraint)
  2. No continuity errors: all details must be consistent with the setting notes
  3. Consistent style: strictly follow the narrative perspective and language style description in the Meta note
  4. Pacing control: each chapter should have ups and downs; do not keep it flat throughout
  5. Ending hook: leave suspense or an emotional hook at the end of each chapter
  6. Variety: Different chapters can shift focus and vary the pacing between tension and relaxation to avoid sameness

Post-writing archiving (must be done every time, fully automatic)

Archive 1: Create main text notes (executed synchronously while writing)

# 创建笔记
wpsnote-cli create --title "第X章 章节名" --json
# → new_note_id

# 获取初始 block_id
wpsnote-cli outline --note_id <new_note_id> --json
# → 初始 block_id

# 写入全文
wpsnote-cli batch-edit --json-args '{
  "note_id": "<new_note_id>",
  "operations": [{
    "op": "replace",
    "block_id": "<初始block_id>",
    "content": "<h1>第X章 章节名</h1><p><tag>#小说名/正文/第X章</tag></p><p>正文第一段...</p><p>正文第二段...</p>..."
  }]
}'

# 写入成功后,立即将新章节 note_id 回写到 meta 索引
wpsnote-cli search --note_id <META_ID> --query "正文章节" --json
# → 找到索引末尾 block_id
wpsnote-cli edit --json-args '{
  "note_id": "<META_ID>",
  "op": "insert",
  "anchor_id": "<章节索引末尾block_id>",
  "position": "after",
  "content": "<p>【第X章】note_id = <new_note_id></p>"
}'

Archive 2: Append plot log (must be done)

# 获取日志末尾 block_id
wpsnote-cli outline --note_id <剧情日志note_id> --json
# → last_block_id

# 追加本章记录
wpsnote-cli edit --json-args '{
  "note_id": "<剧情日志note_id>",
  "op": "insert",
  "anchor_id": "<last_block_id>",
  "position": "after",
  "content": "<h2>第X章《章节标题》</h2><p>主要事件:[本章核心剧情一两句]</p><p>在场角色:[角色名, 角色名, ...]</p><p>角色状态变化:[无 / 角色名:变化描述]</p><p>结尾句:[本章最后一句原文]</p><h3>本章伏笔清单</h3><p>【新埋】[F-X] [伏笔描述] → 状态:未回收</p><p>(本章无新伏笔则写:本章无新伏笔)</p><p>累计未回收伏笔:[F-1、F-3...] 共 N 条</p>"
}'

Foreshadowing numbering rule: globally unique, numbered in the order they are planted, format F-1、F-2…consistent across chapters.

Archive 3: Update characters' current status

# 定位"当前状态"字段
wpsnote-cli search --note_id <角色笔记> --query "当前状态" --json
# → block_id

# 替换状态描述
wpsnote-cli edit --json-args '{
  "note_id": "<角色笔记>",
  "op": "replace",
  "block_id": "<状态block_id>",
  "content": "<p>当前状态:[新状态描述]</p>"
}'

Archive 4: Sync foreshadowing log (must be done, executed every chapter)

Case A: This chapter plants new foreshadowing

wpsnote-cli outline --note_id <伏笔日志> --json
# → last_block_id

wpsnote-cli edit --json-args '{
  "note_id": "<伏笔日志>",
  "op": "insert",
  "anchor_id": "<last_block_id>",
  "position": "after",
  "content": "<p>[F-X] [伏笔描述] → 埋入:第X章 / 状态:未回收</p>"
}'

Case B: This chapter pays off existing foreshadowing

wpsnote-cli search --note_id <伏笔日志> --query "F-X" --json
# → block_id

wpsnote-cli edit --json-args '{
  "note_id": "<伏笔日志>",
  "op": "replace",
  "block_id": "<伏笔block_id>",
  "content": "<p>[F-X] [伏笔描述] → 埋入:第X章 / 已回收:第Y章</p>"
}'

Case C: This chapter has no foreshadowing changes (must still be executed)

# 核对未回收数量与剧情日志最新条目一致
wpsnote-cli search --note_id <伏笔日志> --query "未回收" --json
# → 若数量与剧情日志对得上,归档完成;若对不上,逐条比对补齐

Archive 5: Update Meta progress

wpsnote-cli search --note_id <meta笔记> --query "当前进度" --json
# → block_id

wpsnote-cli edit --json-args '{
  "note_id": "<meta笔记>",
  "op": "replace",
  "block_id": "<进度block_id>",
  "content": "<p>当前进度:第 X 章</p>"
}'

Continuity error quick reference table

Continuity error type Trigger scenario Preventive measure
Character status contradiction Injured in Chapter 3, but acting normally in Chapter 4 Read the character's "current status" field before writing
Ability overreach A character suddenly has a skill not in the setting Read worldview/character setting notes before writing
Interpersonal relationship error People who have already fallen out suddenly act like old friends Read the character relationship chart notes
Geographical contradiction A three-day journey suddenly takes one day Mark geographical distances in scene notes
Scene detail contradiction Descriptions of the same location are inconsistent before and after Read scene setting notes before writing, and execute details faithfully
Scene state error A room that was destroyed returns to its original state Check the scene change history and use the latest state
Character appearance inconsistency The same character's hair color or clothing is contradictory before and after Before generating images/writing, you must first read the character notes' character design details
Forgotten foreshadowing Something planted in Chapter 2 is never paid off Scan the plot log before writing each time
Timeline confusion The order of events is unclear Record the plot log in chapter order

Special case handling

The user wants to change an existing setting

# 找出所有相关笔记
wpsnote-cli find --json-args '{"keyword":"角色名/设定名","tags":["#小说名"]}' --json
# 评估影响范围,告知用户(一句话说明)
# 确认后批量更新相关笔记
# 在剧情日志中标注"设定变更点:第X章起,XX设定改为YY"

The user wants to insert a new character

  1. Ask: "What characteristics does this character have?" (If the user has no ideas, the AI generates them directly)
  2. Create character notes → generate a character image (see 2-3)
  3. Append the relationship with existing characters in the character relationship chart notes
  4. Check whether the previous text is suitable for adding foreshadowing setup

The user wants to skip chapters and write

# 在剧情日志中为跳过的章节预留标记
wpsnote-cli edit --json-args '{
  "note_id": "<剧情日志>",
  "op": "insert",
  "anchor_id": "<last_block_id>",
  "position": "after",
  "content": "<p>[待写] 第X章 占位</p>"
}'
# 在 Meta 笔记"当前进度"后追加跳写记录
# 正常写指定章节并存档

Quick reference for the continuation sequence

# Step 1:加载 meta 笔记(索引 + 风格约束)
# 首次使用标签搜索定位 meta,后续直接用已知 META_ID
wpsnote-cli find --json-args '{"tags":["#小说名/meta"],"limit":1}' --json
wpsnote-cli read --note_id <META_ID> --json
# → 从"基本信息"取:目标字数、叙述视角、语言风格
# → 从"笔记索引"取:剧情日志、伏笔日志、各角色、各场景、最新章节的 note_id
# → 将所有 note_id 缓存在本次上下文

# Step 2:读最新章节结尾(直接用索引中的 note_id)
wpsnote-cli outline --note_id <最新章节note_id> --json
wpsnote-cli read-blocks --json-args '{"note_id":"<最新章节note_id>","block_id":"<倒数block_id>","after":5}' --json

# Step 3:扫描剧情日志(直接用索引 note_id)
wpsnote-cli read --note_id <剧情日志note_id> --json

# Step 4:[如有用户需求] 从 meta 索引查找对应笔记,索引没有则搜索后更新索引

# Step 5:写作(通过 create + batch-edit 写入笔记)

# Step 6:存档(见"写作后归档"章节,含回写 note_id 到索引)

Troubleshooting

Cannot find existing novel notes

# 先从 meta 索引直接读取 note_id(检查 0 已加载)
# 若 meta 索引中的 note_id 访问失败,执行以下修复流程:
wpsnote-cli find --keyword "小说名" --json
wpsnote-cli list --limit 20 --sort update_time --direction desc --json
# 找到正确 note_id 后,立即更新 meta 索引中对应条目

Image generation failed (RATE_LIMITED or other error)

  • Do not retry and block the process: When image generation fails, write (图待补) as a placeholder at the corresponding position, and continue with subsequent steps
  • Rate limit: Generate at most 10 images every 10 minutes; when exceeded, likewise use a placeholder and continue
  • Because the text description has already fully recorded all details, when returning to that note later, if a placeholder is found, simply generate it then

block_id is invalid

After an editing operation, block_id changes; retrieve it again:

wpsnote-cli outline --note_id <note_id> --json
# → 获取最新 block_id 后重试

The plot log is too long and reads slowly

When the log content is large, switch to precise search:

wpsnote-cli search --note_id <剧情日志> --query "未回收" --json

XML content contains special characters, causing JSON parsing to fail

When it contains Chinese quotation marks, double quotation marks, or line breaks, write the XML content to a temporary file and then reference it via --json-args , or escape the special characters:

  • " → \"
  • Line break → \n

Coordination with other Skills

Scenario Coordinating Skill
Post to WeChat Official Account after writing wechat-publisher
Generate Xiaohongshu images xiaohongshu-article-layout
Review notes for inspiration ie-recall-memory / ie-engine
Organize tags tag-organize
Beautify the formatting of setting notes wpsnote-beautifier