nw-migrate

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

A migration command for moving an older novel project into a newer folder and file structure. It updates files, adds newer planning fields, renames chapter files, and records the changes with Git, a version-control system.

In plain words
What is it for?
Use it to upgrade a specified project, split large planning files into smaller ones, add story-planning fields, rename three-digit chapter numbers to four digits, and continue writing.
Why use it?
It reduces the manual work and risk involved in updating an existing project. The Git backup and final commit provide a way to review or undo the migration.

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 upgrade a specified project, split large planning files into smaller ones, add story-planning fields, rename three-digit chapter numbers to four digits, and continue writing.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/zhiliyouxian/claude-novel-writer/nw-migrate
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-migrate

README.md
[![agentmods](https://agentmods.dev/badge/commands/zhiliyouxian/claude-novel-writer/nw-migrate/github.svg)](https://agentmods.dev/commands/zhiliyouxian/claude-novel-writer/nw-migrate)
Your own site
<a href="https://agentmods.dev/commands/zhiliyouxian/claude-novel-writer/nw-migrate"><img src="https://agentmods.dev/badge/commands/zhiliyouxian/claude-novel-writer/nw-migrate/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-migrate

Your own site · 80×15
<a href="https://agentmods.dev/commands/zhiliyouxian/claude-novel-writer/nw-migrate"><img src="https://agentmods.dev/badge/commands/zhiliyouxian/claude-novel-writer/nw-migrate.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 23 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 506 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.00023 $0.00506
Opus 5 $0.00012 $0.00253
Sonnet 5 $0.00005 $0.00101
Haiku 4.5 $0.00002 $0.00051

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

Security

Grade A, and why

nw-migrate 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-migrate.md · 80 lines

What it actually says

项目迁移命令

将旧版项目一键升级到新版结构,完成后可继续创作。

用法

# 指定项目
/nw-migrate xuanhuan_001

# 自动检测(工作区只有一个项目时)
/nw-migrate

功能

自动完成所有升级操作:

  1. 检测版本 - 识别当前项目结构
  2. Git 备份 - 自动提交当前状态
  3. 结构升级 - 拆分文件为分层结构
  4. 内容升级 - 补充戏剧理论字段
  5. 章节重命名 - 3位数升级到4位数
  6. 完成提交 - 自动提交迁移结果

升级内容

旧版 新版
worldview.md worldview.md + worldview/*.md
characters.md characters.md + characters/*.md
outline.md outline.md + outlines/vol-*.md
chapter-001.md chapter-0001.md

新增字段:

  • 控制思想、五大转折点、递进压力链
  • 场景极性、双层欲望、压力人格
  • 对抗力量、冲突层次框架

执行流程

/nw-migrate xuanhuan_001
  ↓
检测项目 → Git备份 → 执行升级 → 提交结果
  ↓
✅ 迁移完成,可继续创作

回滚

如需回滚:

git revert HEAD

输出示例

🔄 开始迁移: xuanhuan_001
━━━━━━━━━━━━━━━━━━━━━━━━━━━━

📦 Git 备份... ✓
📂 结构升级... ✓
📝 内容升级... ✓
🔢 章节重命名... ✓
💾 提交结果... ✓

✅ 迁移完成!

可继续创作:
  /nw-ch-write 下一章
  "继续写第X章"
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 · 80 lines · 0 tokens per session scan A 5d9f47901450

Subscribe to this mod's changes

nw-migrate is a command published in the GitHub repository zhiliyouxian/claude-novel-writer (5 stars, last pushed 8mo ago), licensed MIT. It adds 23 tokens to every session and 506 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.