webnovel-learn

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

/webnovel-learn

/webnovel-learn

Project Root Guard(必须先确认)

Project Root Guard (Must Confirm First)

  • 必须在项目根目录执行(需存在
    .webnovel/state.json
  • 若当前目录不存在该文件,先询问用户项目路径并
    cd
    进入
  • 进入后设置变量:
    $PROJECT_ROOT = (Resolve-Path ".").Path
  • Must be executed in the project root directory (
    .webnovel/state.json
    must exist)
  • If the file does not exist in the current directory, first ask the user for the project path and
    cd
    into it
  • After entering, set the variable:
    $PROJECT_ROOT = (Resolve-Path ".").Path

目标

Objectives

  • 提取可复用的写作模式(钩子/节奏/对话/微兑现等)
  • 追加到
    .webnovel/project_memory.json
  • Extract reusable writing patterns (hooks, pacing, dialogue, payoff, emotion, etc.)
  • Append to
    .webnovel/project_memory.json

输入

Input

bash
/webnovel-learn "本章的危机钩设计很有效,悬念拉满"
bash
/webnovel-learn "The crisis hook design in this chapter is very effective, building great suspense"

输出

Output

json
{
  "status": "success",
  "learned": {
    "pattern_type": "hook",
    "description": "危机钩设计:悬念拉满",
    "source_chapter": 100,
    "learned_at": "2026-02-02T12:00:00Z"
  }
}
json
{
  "status": "success",
  "learned": {
    "pattern_type": "hook",
    "description": "Crisis hook design: Builds intense suspense",
    "source_chapter": 100,
    "learned_at": "2026-02-02T12:00:00Z"
  }
}

执行流程

Execution Flow

  1. 读取
    "$PROJECT_ROOT/.webnovel/state.json"
    ,获取当前章节号(progress.current_chapter)
  2. 读取
    "$PROJECT_ROOT/.webnovel/project_memory.json"
    ,若不存在则初始化
    {"patterns": []}
  3. 解析用户输入,归类 pattern_type(hook/pacing/dialogue/payoff/emotion)
  4. 追加记录并写回文件
  1. Read
    "$PROJECT_ROOT/.webnovel/state.json"
    to get the current chapter number (progress.current_chapter)
  2. Read
    "$PROJECT_ROOT/.webnovel/project_memory.json"
    ; if it does not exist, initialize it as
    {"patterns": []}
  3. Parse the user input and classify the pattern_type (hook/pacing/dialogue/payoff/emotion)
  4. Append the record and write back to the file

约束

Constraints

  • 不删除旧记录,仅追加
  • 避免完全重复的 description(可去重)
  • Do not delete old records, only append
  • Avoid completely duplicate descriptions (deduplication is allowed)