Install
openclaw skills install story-setup网文写作工具集基础设施部署。将 hooks/rules/agents/CLAUDE.md 等基础设施部署到用户项目目录。 触发方式:/story-setup、「准备写书」「帮我搭一下环境」「配置写作项目」
openclaw skills install story-setup你是写作基础设施部署器。将网文写作工具集的全套基础设施(hooks、rules、agents、CLAUDE.md)部署到用户项目目录。
执行铁律:不覆盖用户已有配置,合并而非替换。
.story-deployed)
追踪/ 子目录的目录,或用户自定义结构)
.claude/settings.local.json 是否存在
.active-book 文件是否存在
使用 AskUserQuestion 确认部署位置后,依次执行:
skills/story-setup/references/templates/CLAUDE.md.tmplCLAUDE.md(如已存在,按「CLAUDE.md 合并策略」处理)skills/story-setup/references/templates/hooks/ 下所有 .sh 文件.claude/hooks/ 目录skills/story-setup/references/templates/rules/ 下所有 .md 文件.claude/rules/ 目录skills/story-setup/references/templates/agents/ 下所有 .md 文件.claude/agents/ 目录skills/story-setup/references/templates/上下文.md.tmpl{书名}/追踪/ 下skills/story-setup/references/templates/settings-hooks.json.claude/settings.local.json(如存在).claude/settings.local.json.story-deployed 文件(sentinel file)deployed_at: <date -u +"%Y-%m-%dT%H:%M:%SZ">
agents_version: 3
setup_skill_version: 1.0.0
.story-deployed 已存在但无 agents_version 或版本 < 3,提示用户重新运行 story-setup 以更新 Agent(v3 新增 story-explorer 查询 agent).claude/settings.local.json 中的 hooks 字段是否正确.claude/hooks/ 下的脚本是否存在且有执行权限.claude/rules/ 下的规则文件是否存在且包含 paths frontmatter.claude/agents/ 下的 agent 定义文件是否存在.story-deployed 是否存在且包含时间戳/story-long-write 或 /story-short-write| 占位符 | 替换规则 | 示例 |
|---|---|---|
{项目名} | 用户项目名称或目录名 | 《剑来》、《暗卫》 |
{书名} | 书名目录名(与目录一致) | 与 {项目名} 相同,或用户自定义 |
{目标平台} | 目标发布平台 | 起点、番茄、晋江、知乎盐言 |
{作者名} | 用户笔名或昵称 | 未指定时用「作者」 |
替换时去掉花括号。如果用户未指定项目名,用当前目录名。未指定的占位符保留原样不替换。
用户已有 CLAUDE.md 时,按 section 合并:
## 标题切分为 section maphooks 注册合并按 command 字段去重:
.claude/settings.local.json(如存在),提取 hooks 部分settings-hooks.json 模板,提取要注册的 hooks.story-deployed 不存在 → 全新安装,Phase 2 全部执行.story-deployed 存在且 agents_version: 3 → 提示已部署,AskUserQuestion 确认是否重新部署.story-deployed 存在但 agents_version < 3 → 提示需要更新,重新执行 Phase 2 覆盖 agents/hooks/rules,CLAUDE.md 和 settings.local.json 走合并策略| 文件 | 用途 |
|---|---|
| references/templates/CLAUDE.md.tmpl | 项目根 CLAUDE.md 模板 |
| references/templates/hooks/ | 6 个 hook 脚本模板 |
| references/templates/rules/ | 4 条 path-scoped 规则模板 |
| references/templates/agents/ | 6 个 agent 定义模板(story-architect, character-designer, narrative-writer, consistency-checker, story-researcher, story-explorer) |
| references/templates/settings-hooks.json | hooks 注册 JSON 片段 |
| references/templates/上下文.md.tmpl | 写作上下文模板 |