split-checkout

A read-only command that builds a Mermaid dependency diagram from Textum story files. Mermaid is a text format for diagrams, and dependencies show which stories must come before others.

In plain words
What is it for?
It helps read story front matter, validate required fields and prerequisite links, detect failures, and write docs/story-mermaid.md when the input passes.
Why use it?
A project with many stories can be difficult to understand from separate files, especially when prerequisites are inconsistent. This checks the story metadata and produces a diagram without editing the stories themselves.

Command for Claude Code

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.

agentmods
npx agentmods add commands/snakeying/textum/split-checkout
Clone the repo
git clone --depth 1 https://github.com/snakeying/Textum

Made for: Claude Code.

Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,006 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00000 $0.01006
Opus 5 $0.00000 $0.00503
Sonnet 5 $0.00000 $0.00201
Haiku 4.5 $0.00000 $0.00101

Measured 2d ago against content hash 0bb99d376a4f, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

split-checkout 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 2d 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.

outdated/.claude_outdated/commands/split-checkout.md · 82 lines

What it actually says

阶段5: Split checkout(导出 Story 依赖图 / split-checkout)

读取:docs/story-*-*.md | 写入:docs/story-mermaid.md | 模板:N/A

仅导出依赖图;不修改任何 Story 文件。

最小读取(必须;避免通读)

  1. 读取所有 Story:只解析 YAML front-matter(首部 --- ... ---

输出规则(只读)

  • 不输出任何 Story 原文
  • 若存在任何 FAIL
    • 输出 FAIL 清单(F-001 起编号;每条必须包含以下字段):
      • 定位:目标 Story 文件(docs/story-N-<slug>.md)+ YAML front-matter key(如 prereq_stories)或门禁项;避免行号
      • 问题:1 句
      • 期望:可机械执行的“替换目标/格式”(能推导就写出来)
      • 影响:H/M/L
      • 修复:只给 1 个动作(通常是“按定位修正对应 Story 文件”)
    • 末尾追加:
      • 修正:按 FAIL 清单逐条修复 docs/story-*-*.md 后重跑 /split-checkout
      • 重跑:/split-checkout
    • 然后结束(不写文件)
  • 否则:
    • 覆盖写入 docs/story-mermaid.md
    • 输出:
      • PASS
      • 已写入:docs/story-mermaid.md
      • 下一步:/story-check N

硬约束(必须遵守)

  • Mermaid 图必须仅由 Story 编号与 prereq_stories 推导(不得脑补额外依赖)

执行步骤(必须按序)

1) 解析所有 Story(只看 YAML front-matter)

对每个 docs/story-*-*.md

  • 必须存在 YAML front-matter(文件首部 --- ... ---),且必须可解析为 YAML;否则 FAIL
  • 根键必须包含 STORY: v1;否则 FAIL
  • 抽取(仅用于构图):
    • story(严格形如 Story 1
    • n(整数)
    • prereq_stories[](形如 ["Story 1"];无依赖则空数组)

构造:

  • AllStories =n 升序的 Story N 列表
  • Edges = 对每个 Story N 与其每条 prereq_stories,生成有向边:prereq -> Story N

2) 门禁(任一命中即停止;不写文件)

  • 至少存在 1 个 docs/story-*-*.md
  • AllStoriesn 必须唯一
  • 每个 Story:
    • story 必须严格等于 "Story {n}"
    • prereq_stories[] 中每个 Story X 必须存在于 AllStoriesX < n

3) 写入 docs/story-mermaid.md(覆盖写;严格按序)

写入内容必须严格为:

  1. 第一行:# Story 依赖图
  2. 第二行:空行
  3. 第三行开始写入 1 个 Mermaid fenced code block(围栏为 3 个反引号字符 `):
    • 开始行必须为:三个反引号 + mermaid
    • 第二行必须为:flowchart TD
    • 节点(必须全量覆盖 AllStories;按 n 升序逐行输出):
      • 对每个 Story n:输出一行 Story_{n}["Story {n}"]
    • 边(必须全量覆盖 Edges;按 prereq_n 升序、再按 story_n 升序逐行输出):
      • 对每条边 Story a -> Story b:输出一行 Story_{a} --> Story_{b}
    • 结束行必须为:三个反引号

节点命名规则(必须):必须生成 Story_1["Story 1"] 形式的节点(避免空格导致 Mermaid 解析失败)。

开始

请确认 docs/story-*-*.md 已存在。

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. 2d ago First seen · 82 lines · 0 tokens per session scan A 0bb99d376a4f

Subscribe to this mod's changes

split-checkout is a command published in the GitHub repository snakeying/Textum (41 stars, last pushed 7mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,006 tokens. 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.