← 返回 Skills 市场
Story Setup
作者
worldwonderer
· GitHub ↗
· v1.0.0
· MIT-0
43
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install story-setup
功能描述
网文写作工具集基础设施部署。将 hooks/rules/agents/CLAUDE.md 等基础设施部署到用户项目目录。 触发方式:/story-setup、「准备写书」「帮我搭一下环境」「配置写作项目」
使用说明 (SKILL.md)
story-setup:网文写作工具集基础设施部署
你是写作基础设施部署器。将网文写作工具集的全套基础设施(hooks、rules、agents、CLAUDE.md)部署到用户项目目录。
执行铁律:不覆盖用户已有配置,合并而非替换。
Phase 1:检测项目状态
- 检查当前目录是否已部署过(存在
.story-deployed)- 如果已存在 → 使用 AskUserQuestion 确认是否重新部署
- 检查是否有书名目录(包含
追踪/子目录的目录,或用户自定义结构)- 有 → 识别为长篇项目,显示当前项目信息
- 无 → 识别为新项目或短篇项目
- 检查
.claude/settings.local.json是否存在- 存在 → 读取现有配置,后续合并
- 不存在 → 后续创建新文件
- 检查
.active-book文件是否存在- 存在 → 显示当前活跃书目
- 不存在 → 跳过
Phase 2:部署基础设施
使用 AskUserQuestion 确认部署位置后,依次执行:
2.1 部署 CLAUDE.md
- 读取
skills/story-setup/references/templates/CLAUDE.md.tmpl - 替换占位符(见下方「模板占位符」段)
- 写入项目根目录
CLAUDE.md(如已存在,按「CLAUDE.md 合并策略」处理)
2.2 部署 Hooks
- 读取
skills/story-setup/references/templates/hooks/下所有.sh文件 - 复制到用户项目的
.claude/hooks/目录 - 确保脚本有执行权限(chmod +x)
2.3 部署 Rules
- 读取
skills/story-setup/references/templates/rules/下所有.md文件 - 复制到用户项目的
.claude/rules/目录
2.4 部署 Agents
- 读取
skills/story-setup/references/templates/agents/下所有.md文件 - 复制到用户项目的
.claude/agents/目录
2.5 部署 Session State 模板
- 读取
skills/story-setup/references/templates/上下文.md.tmpl - 如有书名目录,复制到
{书名}/追踪/下
2.6 合并 Hooks 注册到 settings.local.json
- 读取
skills/story-setup/references/templates/settings-hooks.json - 读取用户项目的
.claude/settings.local.json(如存在) - 合并 hooks 配置(按「settings-hooks.json 合并算法」处理)
- 写入
.claude/settings.local.json
2.7 创建部署标记
- 创建
.story-deployed文件(sentinel file) - 写入两行:第一行
deployed_at: \x3Cdate -u +"%Y-%m-%dT%H:%M:%SZ">,第二行agents_version: 2 - 此文件供 session-start.sh 和写作 skill 检测部署状态,避免重复提示
- 如果
.story-deployed已存在但无agents_version或版本为 1,提示用户重新运行 story-setup 以更新 Agent
Phase 3:验证安装
- 验证 hooks 注册:
- 检查
.claude/settings.local.json中的 hooks 字段是否正确 - 检查
.claude/hooks/下的脚本是否存在且有执行权限
- 检查
- 验证 rules 路径:
- 检查
.claude/rules/下的规则文件是否存在且包含pathsfrontmatter
- 检查
- 验证 agents:
- 检查
.claude/agents/下的 agent 定义文件是否存在
- 检查
- 验证部署标记:
- 检查
.story-deployed是否存在且包含时间戳
- 检查
- 输出安装报告:
- 列出所有已部署的文件
- 列出需要注意的事项(如已有配置已合并)
- 提示用户可以开始使用
/story-long-write或/story-short-write
模板占位符
| 占位符 | 替换规则 | 示例 |
|---|---|---|
{项目名} |
用户项目名称或目录名 | 《剑来》、《暗卫》 |
{书名} |
书名目录名(与目录一致) | 与 {项目名} 相同,或用户自定义 |
替换时去掉花括号。如果用户未指定项目名,用当前目录名。
CLAUDE.md 合并策略
用户已有 CLAUDE.md 时,按 section 合并:
- 读取用户现有 CLAUDE.md,按
##标题切分为 section map - 读取模板 CLAUDE.md.tmpl,同样切分
- 模板中的标准 section(Skill 路由表、文件结构、协作规则、Context Recovery、语言)覆盖用户同名 section
- 用户独有的 section(自定义内容)保留不动
- 未知冲突用 AskUserQuestion 让用户选择保留哪个版本
settings-hooks.json 合并算法
hooks 注册合并按 command 字段去重:
- 读取用户现有
.claude/settings.local.json(如存在),提取 hooks 部分 - 读取
settings-hooks.json模板,提取要注册的 hooks - 对每个 hook event(SessionStart、PreToolUse 等):
- 用户已有的 hook command → 保留,不重复添加
- 模板中的新 hook command → append 到对应 event 的 hooks 数组
- 用户独有的其他配置(permissions、env 等)→ 完整保留
- 写入合并后的完整 settings.local.json
重新部署
.story-deployed不存在 → 全新安装,Phase 2 全部执行.story-deployed存在且agents_version: 2→ 提示已部署,AskUserQuestion 确认是否重新部署.story-deployed存在但无agents_version或版本 \x3C 2 → 提示需要更新,重新执行 Phase 2 覆盖 agents/hooks/rules,CLAUDE.md 和 settings.local.json 走合并策略
参考资料
| 文件 | 用途 |
|---|---|
| references/templates/CLAUDE.md.tmpl | 项目根 CLAUDE.md 模板 |
| references/templates/hooks/ | 5 个 hook 脚本模板 |
| references/templates/rules/ | 4 条 path-scoped 规则模板 |
| references/templates/agents/ | 4 个 agent 定义模板 |
| references/templates/settings-hooks.json | hooks 注册 JSON 片段 |
| references/templates/上下文.md.tmpl | 写作上下文模板 |
安全使用建议
Install only in a writing project you trust. Before using it, inspect .claude/settings.local.json and the .claude/hooks scripts, make sure .active-book points to a valid directory inside your project, and avoid putting secrets or instruction-like text in 追踪/上下文.md.
功能分析
Type: OpenClaw Skill
Name: story-setup
Version: 1.0.0
The bundle is a legitimate toolset designed to set up a structured environment for web novel writing. It automates the deployment of project-specific configurations, git hooks, and specialized AI agent prompts (e.g., story-architect, narrative-writer). The included shell scripts in the hooks directory (such as session-start.sh and validate-story-commit.sh) perform benign local operations like checking project status, verifying file structures, and auditing markdown content for writing consistency. No evidence of data exfiltration, malicious execution, or harmful prompt injection was found.
能力评估
Purpose & Capability
The artifacts are coherent with the stated purpose of deploying writing-project hooks, rules, and agents, but that purpose includes modifying local Claude project behavior.
Instruction Scope
SKILL.md says to ask the user before deployment, merge existing settings, and avoid wholesale overwrites; however, it also replaces standard CLAUDE.md sections and deploys agents with Write/Edit authority for story files.
Install Mechanism
There is no package install or network download, but the skill copies shell scripts, makes them executable, registers them as hooks, and references deployment templates that are not present in the provided manifest.
Credentials
The hook behavior is mostly project-scoped, but the scripts use .active-book contents as a path without canonicalization or containment, which can lead to automatic reads or writes outside the intended project.
Persistence & Privilege
The setup persists Bash hooks into .claude/settings.local.json so they run on future session, compact, and git-commit events; this is disclosed, but it amplifies the unbounded path-handling concern.
如何使用
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install story-setup - 安装完成后,直接呼叫该 Skill 的名称或使用
/story-setup触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
v0.4.1: 基础设施部署首次发布
元数据
常见问题
Story Setup 是什么?
网文写作工具集基础设施部署。将 hooks/rules/agents/CLAUDE.md 等基础设施部署到用户项目目录。 触发方式:/story-setup、「准备写书」「帮我搭一下环境」「配置写作项目」. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 43 次。
如何安装 Story Setup?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install story-setup」即可一键安装,无需额外配置。
Story Setup 是免费的吗?
是的,Story Setup 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。
Story Setup 支持哪些平台?
Story Setup 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 Story Setup?
由 worldwonderer(@worldwonderer)开发并维护,当前版本 v1.0.0。
推荐 Skills