nw-scan

nw-scan is a command for Claude Code from zhiliyouxian/claude-novel-writer. It costs 27 tokens per session (1,205 once invoked), scanned A, original, MIT.

A command that scans text files containing reference novels and analyzes their writing style and recurring patterns. It saves reports for later use when planning or writing a novel.

In plain words
What is it for?
Use it to analyze a reference-text collection, extract style and story patterns, and create reports that guide a new project.
Why use it?
It replaces manual comparison of many reference texts with structured observations about sentences, dialogue, openings, chapter structure, and hooks.

Command for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the novel-writer plugin — 9 skills, 11 commands, 9 agents shipped together

Good fit Use it to analyze a reference-text collection, extract style and story patterns, and create reports that guide a new project.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/zhiliyouxian/claude-novel-writer/nw-scan
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/zhiliyouxian/claude-novel-writer

Made for: Claude Code.

Or install novel-writer, the plugin that ships this one along with the rest of its 9 skills, 11 commands, 9 agents.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for nw-scan

README.md
[![agentmods](https://agentmods.dev/badge/commands/zhiliyouxian/claude-novel-writer/nw-scan/github.svg)](https://agentmods.dev/commands/zhiliyouxian/claude-novel-writer/nw-scan)
Your own site
<a href="https://agentmods.dev/commands/zhiliyouxian/claude-novel-writer/nw-scan"><img src="https://agentmods.dev/badge/commands/zhiliyouxian/claude-novel-writer/nw-scan/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for nw-scan

Your own site · 80×15
<a href="https://agentmods.dev/commands/zhiliyouxian/claude-novel-writer/nw-scan"><img src="https://agentmods.dev/badge/commands/zhiliyouxian/claude-novel-writer/nw-scan.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 27 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,205 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00027 $0.01205
Opus 5 $0.00014 $0.00602
Sonnet 5 $0.00005 $0.00241
Haiku 4.5 $0.00003 $0.00120

Measured 12d ago against content hash f77a7582e9bb, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade A, and why

nw-scan scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 12d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

commands/nw-scan.md · 172 lines

How it starts

The opening of the file, as written. The whole thing — 172 lines — stays where its author put it; the contents beside it link to each section on GitHub.

素材池扫描命令

扫描分析参考小说素材,提取风格特征和写作模式。

用法

/nw-scan <pool_name>

示例

# 扫描分析名为 xuanhuan_1 的素材池
/nw-scan xuanhuan_1

# 扫描分析多个素材池
/nw-scan reference_novels

前置条件

需要先准备素材:

# 1. 创建素材目录
mkdir pools/xuanhuan_1

# 2. 放入参考小说(txt格式)
cp {参考小说1}.txt pools/xuanhuan_1/
cp {参考小说2}.txt pools/xuanhuan_1/

功能

此命令会:

  1. 读取素材文件:扫描 pools/{pool_name}/ 下的所有 txt 文件
  2. 分析风格特征
    • 平均句长
    • 对话比例
    • 爽点密度
    • 常用词汇
  3. 提取写作模式
    • 开篇模式
    • 章节结构
    • 钩子类型分布
  4. 生成分析报告:输出到 pools/analysis/{pool_name}/

执行流程

用户输入: /nw-scan xuanhuan_1
  ↓
检查素材目录:
  pools/{pool_name}/
  ├─ {参考小说1}.txt (200万字)
  ├─ {参考小说2}.txt (300万字)
  └─ ...
  ↓
调用 pool-analyzer Skill:
  ├─ 分词统计
  ├─ 句式分析
  ├─ 爽点关键词识别
  └─ 结构模式提取
  ↓
生成报告:
  pools/analysis/xuanhuan_1/
  ├─ style-analysis.md     # 风格分析
  ├─ pattern-analysis.md   # 模式分析
  └─ style-fusion.md       # 融合风格(用于创作参考)

输出示例

开始分析素材池: xuanhuan_1
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

📚 扫描素材文件...
  找到: 3 个文件
  总字数: 5,200,000 字

📊 分析风格特征...
  平均句长: 15.6 字
  对话比例: 43%
  爽点密度: 3.3/千字

📝 提取写作模式...
  开篇类型: 冲突开篇 (67%)
  钩子分布: 悬念型43%, 冲突型32%, 预告型15%, 反转型10%

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✅ 分析完成!

报告位置:
pools/analysis/xuanhuan_1/
├─ style-analysis.md
├─ pattern-analysis.md
└─ style-fusion.md

下一步:
1. 查看分析报告了解风格特征
2. 生成蓝图: /nw-bp-plan xuanhuan_1 玄幻 废柴流

分析报告内容

style-fusion.md(最重要)

融合多个参考小说的风格,生成创作参考参数:

# 融合风格指南

## 目标参数
- 平均句长: 15.6 字
- 对话比例: 43%
- 爽点密度: 3.3/千字
- 章节字数: 2800-3200 字

## 推荐钩子类型
1. 悬念型 (43%)
2. 冲突型 (32%)
3. 预告型 (15%)
4. 反转型 (10%)

## 常用爽点关键词
- 战斗类: 碾压、秒杀、轰飞...
- 突破类: 突破、晋级、圆满...
- 震惊类: 震惊、骇然、不可思议...

错误处理

错误1: 素材目录不存在

错误: pools/xuanhuan_1 目录不存在
建议: 先创建目录并放入参考小说
  mkdir pools/xuanhuan_1
  cp 参考小说.txt pools/xuanhuan_1/

错误2: 素材目录为空

错误: pools/xuanhuan_1 目录中没有 txt 文件
建议: 放入至少一个参考小说文件

注意事项

  1. 素材质量:参考小说质量决定分析结果质量
  2. 数量建议:2-5 本同类型小说效果最佳
  3. 格式要求:素材文件需为 UTF-8 编码的 txt 文件
  4. 可选步骤:没有参考素材也可以直接使用 /nw-bp-plan 创建蓝图

Read the full file on GitHub · 172 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 12d ago First seen · 172 lines · 0 tokens per session scan A f77a7582e9bb

Subscribe to this mod's changes

nw-scan is a command published in the GitHub repository zhiliyouxian/claude-novel-writer (5 stars, last pushed 8mo ago), licensed MIT. It adds 27 tokens to every session and 1,205 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.