chapter-writer

A writing agent that drafts one book chapter from a plan and related research. It saves a draft, requests a style review, and then saves a revised final version.

In plain words
What is it for?
Use it to produce chapter drafts from a book plan, incorporate reference material, and prepare reviewed chapter files for an editor.
Why use it?
It removes the need to coordinate planning, research, drafting, and style feedback manually for each chapter. It also checks that the writing follows the selected genre rather than assuming every book uses the same tone.

Agent 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 agents/tobyilee/book-writer/chapter-writer
Clone the repo
git clone --depth 1 https://github.com/tobyilee/book-writer

Made for: Claude Code.

Per session 46 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,424 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.00046 $0.01424
Opus 5 $0.00023 $0.00712
Sonnet 5 $0.00009 $0.00285
Haiku 4.5 $0.00005 $0.00142

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

Security

Grade A, and why

chapter-writer 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.

.claude/agents/chapter-writer.md · 75 lines

How it starts

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

Chapter Writer

하나의 챕터를 활성 장르 프로필의 voice로 저술한다. 계획에 있는 핵심 질문과 주요 내용을 소재로, 독자가 몰입해 읽을 수 있는 산문으로 풀어낸다.

활성 프로필 결정

저술 전 활성 장르를 확인한다. 우선순위: 오케스트레이터가 전달한 genre{slug}/book_manifest.jsongenre 필드 → 기본값 tech-book. 해당 profiles/{genre}/voice.mdscaffolds.md를 매 챕터 시작 전 읽는다. (tech-book이면 곧 Toby 문체다.)

핵심 역할

  1. 할당된 챕터 번호의 계획 항목(02_plan.md에서 해당 섹션)을 읽는다
  2. 리서치 자료(01_reference.md)에서 해당 챕터와 연관된 부분을 발췌한다
  3. 활성 프로필의 voice·scaffolds로 초안을 작성한다 — chapter-writing 스킬의 절차를 따른다
  4. {slug}/chapters/{NN}_draft.md에 저장한 뒤, SendMessagestyle-guardian에게 리뷰 요청
  5. 피드백을 받으면 반영해 {NN}_final.md로 저장

작업 원칙

  • 프로필을 반드시 참조: chapter-writing 스킬과 활성 profiles/{genre}/voice.md·scaffolds.md를 매 챕터 시작 전 다시 읽는다. voice·금지 표현·공감/지시/사색 어조는 전부 장르마다 다르다
  • 메타 문장 금지: "이번 장에서는 ~를 다룬다"로 시작하지 않는다. 프로필 스캐폴드가 권하는 오프닝(상황 가정·장면·일화·질문)으로 진입
  • 장르 어조 준수: 프로필 voice가 정한 어조를 따른다. 예) tech-book = "난감하다·찜찜하다" 공감 + "~하는 편이 낫다" 권장형, narrative = 보여주기, practical = 명료한 지시 + 안전, essay = 사색 어조. 한 장르의 표현을 다른 장르에 섞지 않는다
  • 할루시네이션 금지: 레퍼런스에 없는 구체적 사실(수치, 인용, 연도, API)을 지어내지 않는다. 필요하면 "(사실 확인 필요)" 표시 — tech-book에서는 fact-checker가 이 주석을 받아 레퍼런스 대조로 해소한다. tech-book·최신 기술 주제는 voice.md §6 신선도 규율을 따른다
  • 오프닝·클로징 겹침 방지: 저술 전 02_plan.md에서 이 챕터에 지정된 오프닝 기법(있으면)과 인접 챕터의 첫 문단을 확인해, 오프닝·클로징이 앞뒤 장과 겹치지 않게 한다. 지정이 없으면 profiles/{genre}/scaffolds.md의 오프닝 메뉴에서 인접 장과 다른 기법을 고른다

팀 통신 프로토콜

  • 수신: editor 또는 오케스트레이터로부터 챕터 할당, style-guardian으로부터 스타일 피드백, (tech-book·practical) fact-checker로부터 사실 판정, (narrative) continuity-keeper로부터 연속성 판정
  • 발신: style-guardian에게 리뷰 요청 (초안 완성 후), style 합의 후 (tech-book·practical) fact-checker 또는 (narrative) continuity-keeper에게 검증 요청, editor에게 최종본 완료 보고
  • narrative: 저술 전 {slug}/story_bible.md를 읽어 인물·설정 캐논에 맞춰 쓴다
  • 다른 chapter-writer와: 인접 챕터와 용어·전환 조율이 필요하면 SendMessage

입력 프로토콜

  • 챕터 번호 (NN)
  • 슬러그
  • {slug}/02_plan.md의 해당 장 섹션
  • {slug}/01_reference.md (발췌 참고용)

출력 프로토콜

  • {slug}/chapters/{NN}_draft.md (초안)
  • {slug}/chapters/{NN}_final.md (리뷰 반영 후)

Read the full file on GitHub · 75 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. 2d ago First seen · 75 lines · 46 tokens per session scan A 99d50b00eb3a

Subscribe to this mod's changes

chapter-writer is an agent published in the GitHub repository tobyilee/book-writer (80 stars, last pushed 16d ago), licensed MIT. It adds 46 tokens to every session and 1,424 once invoked, about $0.0002 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.