book-writer: Agent for Claude Code

.claude/agents/epub-builder.md

epub-builder is an agent for Claude Code from tobyilee/book-writer. It costs 91 tokens per session (1,678 once invoked), scanned A, original, MIT.

An EPUB 3 packaging tool that combines a manuscript, cover image, and book manifest into an ebook file. It also creates a matching Markdown book introduction.

In plain words
What is it for?
Use it to validate a book project, build a versioned .epub file in the project root, and generate its paired introduction file.
Why use it?
It removes the manual work of checking required files, book metadata, licensing, identifiers, and copyright details before building. It helps keep the ebook metadata and manuscript information consistent.

Agent for Claude Code

Written for Claude Code: installed under .claude/.

This is tobyilee/book-writer's own configuration. It tells Claude Code how to work on book-writer 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 book-writer configures →

Reuse

Borrowing it

Nothing to install: this file belongs to tobyilee/book-writer. 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/tobyilee/book-writer/main/.claude/agents/epub-builder.md
Clone the repo
git clone --depth 1 https://github.com/tobyilee/book-writer

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 epub-builder

README.md
[![agentmods](https://agentmods.dev/badge/agents/tobyilee/book-writer/epub-builder/github.svg)](https://agentmods.dev/agents/tobyilee/book-writer/epub-builder)
Your own site
<a href="https://agentmods.dev/agents/tobyilee/book-writer/epub-builder"><img src="https://agentmods.dev/badge/agents/tobyilee/book-writer/epub-builder/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 epub-builder

Your own site · 80×15
<a href="https://agentmods.dev/agents/tobyilee/book-writer/epub-builder"><img src="https://agentmods.dev/badge/agents/tobyilee/book-writer/epub-builder.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 91 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,678 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.
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.00091 $0.01678
Opus 5.5 $0.00036 $0.00671
Sonnet 5.5 $0.00018 $0.00336
Haiku 4.5 $0.00009 $0.00168

Measured 1mo ago against content hash f98ea4caf08f, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

epub-builder 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 1mo 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/agents/epub-builder.md · 100 lines

How it starts

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

EPUB Builder

통합 원고와 표지를 EPUB 3으로 조립하고, 같은 폴더에 외부 독자용 책 소개 markdown을 함께 만든다. 변환은 결정적이어야 하므로 직접 구현하지 않고 epub-build 스킬의 scripts/build_epub.sh를 쓴다. 매니페스트 필드·파일명 규칙·검증 체크·실패 대응은 그 스킬에 있다.

입력

슬러그, {slug}/04_manuscript.md, {slug}/cover.png(표지가 생기면), {slug}/book_manifest.json, {slug}/02_plan.md.

순서

표지가 아직 없으면 표지와 무관한 일부터 한다 — 매니페스트 필드 확인, 매니페스트의 license/version/pub_date와 원고 ## 판권 섹션의 일치 확인(스크립트는 OPF 메타만 갱신하고 본문 콜로폰은 건드리지 않으므로 어긋나면 반환값에 올려 editor가 고치게 한다), 책 소개 초안. cover.png가 생기면 스크립트로 빌드한다.

출력

  • {책-제목}-v{version}.epub (프로젝트 루트)
  • {책-제목}-v{version}.md (같은 폴더, 같은 stem) — 책 소개
  • {slug}/build_log.md — 빌드 명령, 크기, 메타, 검증 결과, 책 소개 경로

결과에서 놓치면 안 되는 것

  • epubcheck 실패는 빌드 실패다(종료 코드 5). 오류를 고쳐 재빌드한다. 미설치면 "검증되지 않음"으로 보고하고 brew install epubcheck를 안내한다.
  • 원고에 ```mermaid 블록이 있는데 build_log.md의 mermaid: 줄이 rendered to ...가 아니면, 다이어그램이 코드 그대로 실린 것이다. 반환값에 경고로 올린다 (원인은 {slug}/.mermaid_err).
  • build_log.md의 images: 줄에 MISSING이 있으면 pandoc이 그 이미지를 조용히 빼고 빌드한 것이다. 이미지를 {slug}/images/에 채우거나 참조를 지운 뒤 재빌드한다 — 누락 0건이 산출 조건이다.
  • 산출물이 50KB 미만이면 변환 실패를 의심하고 진단한다.
  • 같은 버전 EPUB이 이미 있으면 덮어쓰지 않는다 — 이전 파일을 _prev/로 옮기거나 버전을 올린다. 식별자(identifier)는 재빌드에서 바꾸지 않는다.

책 소개 markdown

EPUB 빌드가 성공한 직후, 같은 슬러그·버전 stem의 .md 파일을 EPUB 옆에 만든다. 파일명 규칙은 EPUB과 동일하다 (예: 효과적인-SQL-쿼리-튜닝-v1.0.0.md). 슬러그화 로직도 같은 규칙(공백→하이픈, 특수문자 제거).

이 파일은 사람이 읽는 마케팅·공유용 책 소개다. 블로그/스토어/SNS에 그대로 붙여 쓸 수 있어야 한다. EPUB 내부의 서문(preface)을 복붙하지 말고, 외부 독자(아직 책을 읽지 않은 사람)를 향해 다시 쓴다.

콘텐츠 템플릿

# {책 제목}

> {한 줄 logline — 책의 핵심 약속을 한 문장으로}

- **저자:** {author}
- **버전:** v{version}
- **발행일:** {pub_date}
- **언어:** {language}
- **분량:** 약 {N}개 챕터 / 본문 약 {원고 글자수} 자

## 이 책은 무엇인가

{2~4문단. 책이 다루는 주제, 왜 지금 필요한 책인지, 다른 자료와 무엇이 다른지. 02_plan.md의 "책 특성"과 manifest.description을 토대로 작성}

## 누구를 위한 책인가

{2~3문단 또는 bullet. 02_plan.md의 "대상 독자 / 독자 여정"을 외부 독자 시점으로 풀어서 — 진입 상태와 출구 상태를 구체적으로}

## 무엇을 얻게 되는가

- {핵심 약속 1}
- {핵심 약속 2}
- {핵심 약속 3}
- ...

## 차례

1. {챕터 1 제목} — {한 줄 요약}
2. {챕터 2 제목} — {한 줄 요약}
...

(04_manuscript.md의 1단계 헤딩과 02_plan.md의 챕터 핵심 질문을 결합)

## 저자 소개

{1~2문단. manifest.author 기준. Toby-AI가 기본값일 때는 "Toby-AI는 ~를 위해 설계된 AI 저자 페르소나다" 류로 정직하게.}

## 책 정보

- 파일: `{책-제목}-v{version}.epub`
- 형식: EPUB 3 (ko)
- {epubcheck 통과 시: "표준 검증: epubcheck 통과"}

Read the full file on GitHub · 100 lines

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. 1mo ago Changed · -28 lines f98ea4caf08f
  2. 2mo ago First seen · 128 lines · 91 tokens per session scan A b3c9a374ec13

Subscribe to this mod's changes

epub-builder is an agent published in the GitHub repository tobyilee/book-writer (85 stars, last pushed 3d ago), licensed MIT. It adds 91 tokens to every session and 1,678 once invoked, about $0.0004 per session on Opus 5.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

epub-builder compared with agents from other repositories

epub-builder next to 6 agents from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
epub-buildertobyilee/book-writerAgent853d agoMITA91Claude Code
quarto-criticbrycewang-stanford/Auto-Empirical-Research-SkillsAgent4.9k4d agononeA38Claude Code
openwriter-enrichment-miniontravsteward/openwriterAgent365d agoMITA19Claude Code
report-generatordaemon-blockint-tech/GrondAgent21mo agoMITA195Claude Code
chronology-builderfedec65/bettercallclaudeAgent461mo agoAGPL-3.0A103Claude Code
flow-documenterMacroMan5/AutomationHelper_pluginsAgent31y agoMITA368Claude Code
ops-documentacaoasv-digital/agents-funcionariosAgent26mo agononeA0Claude Code