
Research
/Security News
Miasma Mini Shai-Hulud Hits ImmobiliareLabs npm Packages
Miasma Mini Shai-Hulud hits @immobiliarelabs Backstage plugins, targeting GitLab and LDAP auth packages on npm.
AI Native 长篇小说生成工具 — 端到端 AI 写作助手
MuseFlow 是一款本地运行的 CLI 工具,用户输入一句话故事简介,AI 自动完成从世界观构建、大纲生成到逐章正文撰写的全部工作,最终输出完整可读的长篇小说。
npm install -g museflow
安装后全局可用 museflow 命令。
# 克隆项目
git clone <repository-url>
cd museflow
# 安装依赖
npm install
# 编译 TypeScript
npm run build
# 开发时使用 npm start 代替 museflow
npm start -- <command> [args]
首次使用前需要配置 AI 模型:
# 查看当前配置
museflow config show
# 配置 OpenAI
museflow config set --provider openai --api-key YOUR_API_KEY --model gpt-4o
# 配置 Claude (Anthropic)
museflow config set --provider anthropic --api-key YOUR_API_KEY --model claude-3-sonnet-20240229
# 配置其他 OpenAI 兼容服务(MiniMax、Ollama、DeepSeek 等)
museflow config set --provider openai --api-key YOUR_API_KEY --model MODEL_NAME --base-url https://api.example.com/v1
配置保存在项目目录下的 .museflow/config.json(项目级配置,优先于全局 ~/.museflow/config.json)。
# 启动新故事(仅规划和创建,不写正文)
museflow start --idea "一个少年获得修真能力后崛起为最强者的故事" --chapters 30 --genre xianxia
此命令会:
./books/{story_id}/# 撰写当前章节(写完一章后停止)
museflow write <story-id>
# 继续撰写下一章
museflow write <story-id>
如果质量检查发现错误,会提示修复:
# 针对性修复当前章节(保留大部分内容,修改问题段落)
museflow fix <story-id>
# 彻底重写当前章节(从头重新撰写)
museflow rewrite <story-id>
修复策略:
# 查看故事进度
museflow status <story-id>
# 查看故事详情
museflow info <story-id>
start → 世界观 → 人物 → 大纲
↓
write → 草稿 → 质量检查 → 伏笔检测 → 幻觉检测 → 一致性检查 → 大纲合规
↓
┌─────┴─────┐
↓ ↓
通过 发现问题
↓ ↓
下一章 fix / rewrite
↓
重新检查
| 命令 | 说明 |
|---|---|
start | 创建新故事,完成世界观、人物、大纲 |
write <id> | 撰写当前章节 |
continue <id> | 从断点恢复继续撰写 |
rewrite <id> | 重写有问题的章节 |
fix <id> | 针对性修复章节问题 |
status <id> | 查看故事进度 |
info <id> | 查看故事详情 |
export <id> | 导出故事为 txt 文件 |
config | 管理模型配置 |
genres | 查看可用题材 |
内置以下题材,可通过 --genre 指定:
| 题材 | 参数值 | 说明 |
|---|---|---|
| 玄幻 | xianxia | 修真、仙侠、武侠 |
| 科幻 | scifi | 未来科技、太空冒险 |
| 恐怖 | horror | 悬疑、惊悚、灵异 |
| 都市 | urban | 现代都市、职场 |
| 浪漫 | romance | 言情、爱情 |
| 默认 | default | 通用题材 |
MuseFlow 使用 8 类专业 Agent 协同工作:
| Agent | 职责 |
|---|---|
| WorldBuilder | 构建世界观、历史背景、社会结构 |
| Character | 生成人物设定、性格、关系网 |
| Outline | 生成章节大纲,确保故事结构完整 |
| Chapter | 撰写章节正文,保持风格一致 |
| Quality | 检查用词重复、描写质量、节奏 |
| Foreshadowing | 检测伏笔回收,最后 15% 章节禁止埋新伏笔 |
| Hallucination | 检测与设定矛盾的内容 |
| Consistency | 检查跨章节逻辑一致性 |
故事数据保存在本地 ./books/ 目录下:
| 路径 | 内容 |
|---|---|
./.museflow/config.json | 项目级配置(API key、provider 等) |
./books/{story_id}/meta.json | 故事元数据(世界观、人物、大纲) |
./books/{story_id}/checkpoints/ | LangGraph checkpoint JSON 文件 |
./books/{story_id}/chapters/chapter_{n}.md | 各章正文 .md 文件 |
注意:MuseFlow 使用 JSON + 文件系统存储,不依赖 SQLite。
src/
├── cli/ # 命令行入口(所有命令的实现)
├── graph/ # LangGraph 图编排(状态、节点、边、检查点)
├── agents/ # 8 类 Agent 实现
├── core/ # 核心业务逻辑(Runner)
├── genres/ # 题材 Skill 系统
├── storage/ # JSON 元数据 + 文件系统存储
├── model/ # 模型抽象层(OpenAI 兼容 / Anthropic)
├── types/ # 共享 TypeScript 类型
└── utils/ # 工具函数
# 监听模式运行测试
npm run test:watch
# 开发模式(tsx watch)
npm run dev
# 类型检查
npm run typecheck
# 运行测试
npm test
# 代码检查
npm run lint
write 没有反应确保传入了 story-id:museflow write <story-id>
检查 config 中 api key 和 base url 是否正确,用 museflow config show 确认。
运行 rewrite 或 fix 命令处理当前章节:
museflow rewrite <story-id> # 彻底重写
museflow fix <story-id> # 针对性修复
运行 continue 命令从断点恢复:
museflow continue <story-id>
Fix 命令会分析问题所在段落,只修改相关部分。如果问题描述涉及常见词汇(如"轻轻"、"缓缓"),可能会匹配到多个段落。这种情况建议用 rewrite 代替。
MIT
FAQs
AI Native 长篇小说生成工具 - 端到端 AI 写作助手
The npm package museflow receives a total of 11 weekly downloads. As such, museflow popularity was classified as not popular.
We found that museflow demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Research
/Security News
Miasma Mini Shai-Hulud hits @immobiliarelabs Backstage plugins, targeting GitLab and LDAP auth packages on npm.

Security News
Rolldown paused Rust React Compiler integration after a 5MB binary size increase raised concerns about shipping React-specific code to all Vite users.

Security News
/Research
Mini Shai-Hulud expands into the Go ecosystem after hitting LeoPlatform npm packages and targeting GitHub Actions workflows.