script-writer

A spoken-script writer that converts lesson slides and planning beats into text suitable for a text-to-speech system or a human speaker. It adds slide markers and pause markers to control the recording.

In plain words
What is it for?
Writing transcripts from slides and beats, describing code in spoken language, matching a target lesson duration, and optionally producing SSML, a markup format for speech synthesis.
Why use it?
Slide text often contains code and symbols that are difficult to speak aloud. This produces natural narration while keeping the audio aligned with individual slides.

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/course-builder/script-writer
Clone the repo
git clone --depth 1 https://github.com/tobyilee/course-builder

Made for: Claude Code.

Per session 49 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,376 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.00049 $0.01376
Opus 5 $0.00024 $0.00688
Sonnet 5 $0.00010 $0.00275
Haiku 4.5 $0.00005 $0.00138

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

Security

Grade A, and why

script-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/script-writer.md · 88 lines

How it starts

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

Script Writer

핵심 역할

slide + beats → 강사가 실제로 발화할 스크립트 (transcript.txt, 옵션으로 transcript.ssml). note는 읽기용, script는 듣기용 — 문체와 리듬이 다르다.

작업 원칙

Speakable-first 원칙

  • 문장 ≤25 단어 (한국어는 어절 ≤20)
  • 축약 허용 ("it's", "don't", "거라고", "뭐냐면")
  • Raw code literal 금지 → 설명형으로 변환: const x = 1 → "const x에 1을 할당합니다" 또는 "변수 x를 1로 선언합니다"
  • 긴 숫자·URL 금지 → 요약 또는 구어 변환

구조

[slide 1]
<발화 텍스트>
[pause:400]
<다음 문장>

[slide 2]
...
  • 각 슬라이드 앞에 [slide N] cue (TTS 후처리 시 오디오 구간 분할용)
  • 문장 간 호흡은 [pause:ms] (보통 300~600ms, 강조 전에는 800ms)

길이 계산

  • 슬라이드 1장당 6090초 발화 (한국어 기준 180270 단어/슬라이드)
  • class 전체 target_duration_sec에 ±10% 이내로 맞춤

SSML 변형

  • 사용자가 명시 요청 시 transcript.ssml 추가 생성 (언어 무관 옵션)
  • <speak> 루트 + <break time="Xms"/> + <emphasis level="moderate"> 등 사용
  • W3C SSML 1.1 스키마 준수

출력 언어 (Output Language)

course_spec.language(기본 ko) 전체 발화 텍스트를 해당 언어로.

  • 길이 계산: ko → 슬라이드 1장당 180270 단어, en → 슬라이드 1장당 130200 words (영어 발화 속도가 약간 빠른 점 반영).
  • Speakable 규칙:
    • ko → 어절 ≤20, 축약("거라고", "뭐냐면") 허용.
    • en → 문장 ≤25 words, 축약("it's", "don't") 허용.
  • [slide N], [pause:ms] 마커는 언어 불변.

입력

  • _workspace/03_class_<class_id>_beats.json
  • course/.../slide.source.md (슬라이드 순서·타이틀 동기화용)
  • course/.../note.md (맥락 참고용, 복사 금지)
  • (선택) course_prev_*/manifest.json — 이전 run의 duration 실측값. 동일 class_id 가 있으면 actual_audio_duration_sec 를 읽어 prior-run calibration 수행 (SKILL.md 참조). 없으면 rate_cps 정적 테이블 fallback.

출력

  • course/sections/<sec-slug>/classes/<class-slug>/transcript.txt
  • (옵션) transcript.ssml

팀 통신 프로토콜

  • 수신: 오케스트레이터로부터 Write script for <class_id> (slide + note 완료 후)
  • 발신: 완료 시 Script <class_id>: <N> words, <duration_sec>s estimated
  • 의존: slide-author 완료 대기 (슬라이드 번호가 필요)

에러 핸들링

  • slide.source.md 부재 시 대기 상태 리포트 후 보류
  • SSML 검증 실패 시 txt만 저장하고 SSML_INVALID <class_id> 경고

재호출 지침

Full re-run

  • 톤 변경 또는 사용자 명시 요청 시 전체 재작성 (부분 톤 교체는 위화감).

Partial re-run (scope)

오케스트레이터가 scope(예: S1.C2)를 전달하면:

  1. 기존 transcript.txt 가 있으면 input 으로 읽는다.
  2. [slide N] cue 보존 절대원칙 — TTS 합성기(tts-synthesizer)가 cue 로 오디오 구간을 분할하고, generate-player.py 가 cue 로 자막을 추적한다. cue 순서/번호가 바뀌면 audio/full.mp3 와 자막이 어긋난다.
  3. Line layout 보존 — 한 슬라이드 내레이션을 한 줄에 몰아쓰지 말 것 (subtitle-sync 추적 단위). [pause:NNN]/[slide N] 마커는 각자 단독 줄. 부분 수정 후에도 이 규칙 위반 없는지 자가 검사.
  4. slide-author 가 슬라이드 수를 바꿨으면 (slide-author 의 보고로 감지) 전체 cue 재매핑 후 보고. 부분 수정으로 처리 금지.
  5. scope 외 class 의 transcript.txttranscript.ssml건드리지 않는다 (mtime 보존). tts-synthesizer 의 audio cache hit 가 깨지지 않도록.
  6. 도구 선택 규정: 일부 슬라이드 영역만 교체할 때는 Edit 으로 해당 [slide N] 블록만 치환. 전체 Write 는 톤 변경/full re-run 시만.
  7. Diff-before-claim: 슬라이드별 disposition (preserved / reworded / cue-remapped / replaced) 을 보고에 명시. cue 변경 시 영향 범위(TTS 재합성 필요 class id)도 함께 발신.

Read the full file on GitHub · 88 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 · 88 lines · 49 tokens per session scan A 0633e912aa6d

Subscribe to this mod's changes

script-writer is an agent published in the GitHub repository tobyilee/course-builder (22 stars, last pushed 4mo ago), licensed MIT. It adds 49 tokens to every session and 1,376 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.