ba-storybook: Instructions file for Claude Code

CLAUDE.md

ba-storybook CLAUDE.md is an instructions file for Claude Code from HePudding/ba-storybook. It costs 742 tokens per session, scanned A, original, MIT.

Repository instructions for ba-storybook, a project that generates game story text and Chinese translations from source data. They define the language, commands, and data-processing pipelines contributors should follow.

In plain words
What is it for?
They help generate story Markdown files, rebuild manifests, create and merge translation tables, find missing translations, and run smoke tests.
Why use it?
They give coding agents consistent project-specific rules instead of making them infer how the repository works.

Instructions file for Claude Code

Written for Claude Code: the file is CLAUDE.md. Also seen: mentions CLAUDE.md; mentions Claude Code.

This is HePudding/ba-storybook's own configuration. It tells Claude Code how to work on ba-storybook itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything ba-storybook configures →

Reuse

Borrowing it

Nothing to install: this file belongs to HePudding/ba-storybook. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/HePudding/ba-storybook/main/CLAUDE.md
Clone the repo
git clone --depth 1 https://github.com/HePudding/ba-storybook

Made for: Claude Code.

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 ba-storybook CLAUDE.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/hepudding/ba-storybook/claude-md.svg)](https://agentmods.dev/instructions/hepudding/ba-storybook/claude-md)
Your own site
<a href="https://agentmods.dev/instructions/hepudding/ba-storybook/claude-md"><img src="https://agentmods.dev/badge/instructions/hepudding/ba-storybook/claude-md.svg" alt="Measured on agentmods" height="20"></a>
Per session 742 This file is loaded in full into every session.
When invoked 742 The same file — it is already loaded in full.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.00742 $0.00742
Opus 5 $0.00371 $0.00371
Sonnet 5 $0.00148 $0.00148
Haiku 4.5 $0.00074 $0.00074

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

Security

Grade A, and why

ba-storybook CLAUDE.md 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 8d 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.

CLAUDE.md · 48 lines

What it actually says

CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

语言

始终使用简体中文与用户交流。所有文档使用简体中文。

常用命令

# 剧情文本生成管线
python3 -m utils.build_manifest       # 重建 manifest.json(GroupId 分类)
python3 -m utils.generate_all         # 生成全部 7 类剧情 Markdown
python3 -m utils.build_readme         # 重建 ba-stories/README.md 和统计

# 翻译表管线
python3 -m utils.build_translation_table   # 从游戏数据提取 JP→CN
python3 -m utils.build_gaps                # 找出缺失条目
python3 -m utils.merge_translations        # 合并所有来源(优先级:game_data_tw > moegirl > gamekee)
python3 -m utils.build_md_report           # 生成 翻译对照表.md

# 冒烟测试
python3 -m utils._smoke_test

所有模块通过 python3 -m utils.<module> 运行,不要直接 python3 utils/<module>.py

架构概览

两条独立管线:

剧情提取管线raw-data/Excel (JP JSON) → load_data.py (加载+索引) → parse_dialogue.py (ScriptKr 指令解析) → format_markdown.py (Markdown 输出) → generate_all.py (调度 7 类生成) → ba-stories/ (2022 个 Markdown 文件)

翻译表管线raw-data-global/Excel (Tw 字段,繁中) → build_translation_table.py (初始提取) → build_gaps.py (缺失识别) → 外部补全 (moegirl/gamekee JSON) → merge_translations.py (合并+繁转简) → translation_table.json

关键设计决策

  • 数据源结构:Excel JSON 都包在 {"DataList": [...]} 里,加载时需要 unwrap。load_translation.pyload_data.py 都处理了这一点。
  • 角色名解析:ScriptKr 用韩语角色名,需通过 ScenarioCharacterNameExcelTable 映射到日语。无法匹配时用子串回退(如 "통신아로나" 包含 "아로나" → "アロナ"),最终兜底为 NPC_<id>
  • 繁简转换:翻译表的主要来源是 global 分支的 Tw 字段(繁体中文),通过 opencct2s 配置转为简体中文。转换在 merge_translations.py_convert_all_to_sc() 中执行。
  • 社团名/活动名:大部分社团名和全部活动名不在 Excel 表中(存在于 UI AssetBundle),需从萌娘百科/GameKee 外部补全。
  • 目录名是日语ba-stories/ 下的子目录名(主線、イベント 等)是日语,这是实际文件夹名,不要改。

外部依赖

唯一的第三方包是 opencc-python-reimplemented(繁转简)。其余全部使用标准库。

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. 8d ago First seen · 48 lines · 742 tokens per session scan A e35ad0f9fb46

Subscribe to this mod's changes

ba-storybook CLAUDE.md is an instructions file published in the GitHub repository HePudding/ba-storybook (13 stars, last pushed 4mo ago), licensed MIT. It adds 742 tokens to every session, about $0.0037 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.

Related

Other instructions, from other repositories

next.js AGENTS.md

AGENTS.md instructions for vercel/next.js, covering next.js development guide, codebase structure, monorepo overview, core package: packages/next and other important packages.

vercel/next.js · 7,296 tokens

codex AGENTS.md

AGENTS.md instructions for openai/codex, covering rust/codex-rs, the codex-core crate, code review rules, crate api surface and model visible context.

openai/codex · 5,153 tokens

vscode buildNext.instructions.md

Working notes and architecture documentation for the new esbuild-based build system in build/next. Use when making changes to the new build pipeline (transpile/bundle commands, NLS plugin, source-map handling, resource copying, or self-hosting watch tasks).

microsoft/vscode · 6,785 tokens

vscode oss-third-party-notices.instructions.md

Instructions for microsoft/vscode, covering vs code oss third-party-notices pipeline, architecture, pipeline flow in ci, applying the notice (cutover) and fallback chain (never fail the build).

microsoft/vscode · 5,001 tokens

langchain AGENTS.md

AGENTS.md instructions for langchain-ai/langchain, covering global development guidelines for the langchain monorepo, corridor security analysis, project architecture and context, monorepo structure and development tools & commands.

langchain-ai/langchain · 4,469 tokens

spec-kit AGENTS.md

AGENTS.md instructions for github/spec-kit, covering agents.md, about spec kit and specify, quickstart — add a new integration in 5 steps, integration architecture and integrationmanifest — file tracking.

github/spec-kit · 7,104 tokens