story-setup

story-setup is a skill for Claude Code, Codex from Xiaoyangy/novel-studio. It costs 81 tokens per session (9,124 once invoked), scanned A, original, Apache-2.0.

A setup tool for installing a novel-writing project’s supporting files and rules. It can prepare projects for Claude Code, OpenCode, Codex, or OpenClaw.

In plain words
What is it for?
Use it when starting a new writing project, preparing an existing book directory, or configuring the project for one or more supported coding agents.
Why use it?
It removes the manual work of creating and combining configuration, rules, agents, and project files. It checks the project first so existing configuration is not replaced.

Skill for Claude CodeCodex

Written for Claude Code and Codex: PreToolUse hook event, but also reads ~/.codex or $CODEX_HOME. Also seen: reads .claude/ paths; mentions CLAUDE.md; mentions subagents.

Good fit Use it when starting a new writing project, preparing an existing book directory, or configuring the project for one or more supported coding agents.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/xiaoyangy/novel-studio/story-setup
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.

Any agent
npx skills add Xiaoyangy/novel-studio --skill story-setup
Clone the repo
git clone --depth 1 https://github.com/Xiaoyangy/novel-studio

Made for: Claude Code, Codex.

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 story-setup

README.md
[![agentmods](https://agentmods.dev/badge/skills/xiaoyangy/novel-studio/story-setup/github.svg)](https://agentmods.dev/skills/xiaoyangy/novel-studio/story-setup)
Your own site
<a href="https://agentmods.dev/skills/xiaoyangy/novel-studio/story-setup"><img src="https://agentmods.dev/badge/skills/xiaoyangy/novel-studio/story-setup/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 story-setup

Your own site · 80×15
<a href="https://agentmods.dev/skills/xiaoyangy/novel-studio/story-setup"><img src="https://agentmods.dev/badge/skills/xiaoyangy/novel-studio/story-setup.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 81 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 9,124 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. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.00081 $0.09124
Opus 5 $0.00041 $0.04562
Sonnet 5 $0.00016 $0.01825
Haiku 4.5 $0.00008 $0.00912

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

Security

Grade A, and why

story-setup 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 10d ago.

The scan reads SKILL.md. This mod also ships 3 executable files (references/codex/hooks/story_codex_hook.py, references/opencode/plugin.ts, references/opencode/pre-commit.sh), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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.

skills/story-setup/SKILL.md · 426 lines

How it starts

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

story-setup:网文写作工具集基础设施部署

你是写作基础设施部署器。将网文写作工具集的全套基础设施(hooks、rules、agents、CLAUDE.md、AGENTS.md、Codex/OpenClaw 配置)部署到用户项目目录。

执行铁律:不覆盖用户已有配置,合并而非替换。


Phase 1:检测项目状态

  1. 检查当前目录是否已部署过(存在 .story-deployed
    • 如果已存在 → 使用 AskUserQuestion 确认是否重新部署
  2. 检查是否有书名目录(包含 追踪/ 子目录的目录,或用户自定义结构)
    • 有 → 识别为长篇项目,显示当前项目信息
    • 无 → 识别为新项目或短篇项目
  3. 检查 .claude/settings.local.json 是否存在
    • 存在 → 读取现有配置,后续合并
    • 不存在 → 后续创建新文件
  4. 检查 .active-book 文件是否存在
    • 存在 → 显示当前活跃书目
    • 不存在 → 跳过
  5. 检查 opencode.json.opencode/ 是否存在
    • 存在 → 识别为 opencode 项目,target_cli = opencode
    • 不存在 → 跳过
  6. 检查 .codex/.codex/config.toml.codex/agents/.codex/hooks.jsonAGENTS.md 中的 Codex 段
    • 存在 → 识别为 Codex 项目,target_cli = codex
    • 不存在 → 跳过
  7. 检查 openclaw.json.openclaw/.agents/skills/AGENTS.md 中的 OpenClaw 段,或 skills/*/SKILL.md 中的 metadata.openclaw
    • 存在 → 识别为 OpenClaw 项目,target_cli = openclaw
    • 不存在 → 跳过
  8. .claude/CLAUDE.md、opencode 标记、Codex 标记、OpenClaw 标记同时存在 → 使用 AskUserQuestion 让用户选择目标 CLI(选项:仅 Claude Code / 仅 OpenCode / 仅 Codex / 仅 OpenClaw / 任意组合)
  9. 如四者都不存在(全新项目)→ 使用 AskUserQuestion 让用户选择目标 CLI
    • 用户选择 opencode → target_cli = opencode,部署时创建 opencode.json.opencode/
    • 用户选择 claude-code → 按现有逻辑处理
    • 用户选择 codex → target_cli = codex,部署时创建 .codex/
    • 用户选择 openclaw → target_cli = openclaw,部署时复制 OpenClaw 兼容 skills 到项目 skills/
    • 用户选择多端 → target_cli = claude-code,opencode,codex,openclaw(仅包含用户选择的端)

Phase 2:部署基础设施

使用 AskUserQuestion 确认部署位置后,依次执行。

2.0 部署清单(机械可检查)

Source path Target path Owner class Merge mode Validation check
skills/story-setup/references/templates/CLAUDE.md.tmpl CLAUDE.md user+managed marker/section merge contains story skill routing sections
skills/story-setup/references/templates/hooks/ .claude/hooks/ story-setup managed recursive replace session-*.sh, detect-story-gaps.sh, validate-story-commit.sh, guard-outline-before-prose.sh, check-prose-after-write.sh, lib/common.sh, lib/sentinel.sh exist
skills/story-setup/references/templates/rules/*.md .claude/rules/*.md story-setup managed replace every rule contains paths frontmatter
skills/story-setup/references/templates/agents/*.md .claude/agents/*.md story-setup managed replace 7 agent files exist
skills/story-setup/references/agent-references/*.md .claude/skills/story-setup/references/agent-references/*.md story-setup managed replace every story-setup/references/agent-references/*.md reference resolves
skills/story-setup/references/templates/settings-hooks.json .claude/settings.local.json user+managed merge by hook command hook JSON valid and registered commands deduped
skills/story-setup/references/templates/上下文.md.tmpl {书名}/追踪/上下文.md user state create only if absent never overwrite existing writing context
generated sentinel .story-deployed story-setup managed replace contains agents_version, setup_skill_version, target_cli, resolver_strategy, references_dir
skills/story-setup/references/opencode/AGENTS.md.tmpl AGENTS.md user+managed marker/section merge contains story skill routing sections
skills/story-setup/references/opencode/agents/ .opencode/agents/ story-setup managed replace 7 agent files exist(replace 前按 2.4.4 Step 0 缓存现有 model:,避免覆盖用户已配模型)
skills/story-setup/references/opencode/plugin.ts .opencode/plugins/story-hooks.ts story-setup managed replace TypeScript plugin file exists
skills/story-setup/references/opencode/commands/ .opencode/commands/ story-setup managed replace 13 command files exist
skills/story-setup/references/opencode/opencode.json.patch merge into opencode.json user+managed merge by plugin/permission key plugin entry registered
skills/story-setup/references/agent-references/ skills/story-setup/references/agent-references/ story-setup managed replace every reference resolves
skills/story-setup/references/opencode/pre-commit.sh .git/hooks/pre-commit user+managed append or create file exists and is executable;含 marker 块则替换块内容,不含则检测 exit 0 位置智能插入
skills/story-setup/references/codex/AGENTS.md.tmpl AGENTS.md user+managed marker/section merge contains Codex story skill routing sections
skills/story-setup/references/codex/agents/ .codex/agents/ story-setup managed replace 7 TOML agent files parse and contain name/description/developer_instructions
skills/story-setup/references/codex/hooks/hooks.json .codex/hooks.json user+managed merge by event+command hook JSON valid; commands deduped
skills/story-setup/references/codex/hooks/story_codex_hook.py .codex/hooks/story_codex_hook.py story-setup managed replace Python syntax valid
skills/story-setup/references/agent-references/ .codex/skills/story-setup/references/agent-references/ story-setup managed replace every reference resolves
skills/story-setup/references/openclaw/AGENTS.md.tmpl AGENTS.md user+managed marker/section merge contains OpenClaw story skill routing sections
repository skills/story*/ skills/story*/ story-setup managed for known skill names replace known skill dirs only 8 SKILL.md files exist; OpenClaw-compatible frontmatter
skills/story-setup/references/agent-references/ skills/story-setup/references/agent-references/ story-setup managed replace via full skill copy every reference resolves

Read the full file on GitHub · 426 lines

Files

What ships with it

60 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 10d ago First seen · 426 lines · 81 tokens per session scan A aec880ea36ca

Subscribe to this mod's changes

story-setup is a skill published in the GitHub repository Xiaoyangy/novel-studio (105 stars, last pushed yesterday), licensed Apache-2.0. It adds 81 tokens to every session and 9,124 once invoked, about $0.0004 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-30.