Skip to main content

Knowledge > Runbooks > Content Operations

Content Operations Runbooks

Procedures for managing IllustrateTheWord (ITW) illustration content and the product_knowledge table that is injected into all AI agent prompts at runtime.

Architecture Summary

All content is stored in unified_rag_content (327K rows). ITW illustrations use category='illustration'. Church-specific FAQ content uses category='church_kb'. The dir_illustrations Supabase view is a read-only snapshot — never write to it directly.

  • Codebase: C:\dev\sermon-illustrations\
  • Scripts: sermon-illustrations/scripts/
  • Content generation: Always use claude -p CLI, never the Anthropic API directly
  • External APIs: TMDB ($TMDB_API_KEY), Unsplash ($UNSPLASH_ACCESS_KEY)
  • Theological lenses: 18 rows in sai_theological_lenses (17 traditions + universal)

Critical Rule: Claude CLI for Batch Generation

All batch content generation scripts MUST use claude -p (Claude CLI). The founder pays $200/mo for Claude Max — using the Anthropic API directly for batch jobs wastes money and duplicates cost.

Before running any script that spawns Claude CLI internally, delete these env vars:

unset CLAUDE_CODE_ENTRYPOINT
unset CLAUDECODE

Runbooks

RunbookWhen to Use
add-illustrations.mdAdd new illustrations to the ITW database
regenerate-stubs.mdRegenerate incomplete or stub illustrations
generate-by-scripture.mdGenerate illustrations for a scripture passage
generate-by-topic.mdGenerate illustrations by topic or theme
generate-lens-content.mdGenerate content for a specific theological lens
illustration-images.mdAdd or update illustration images
audit-content.mdAudit content quality and identify gaps
update-product-knowledge.mdUpdate runtime knowledge injected into agent prompts

Key Tables

TablePurpose
unified_rag_contentAll content (327K rows). NEVER bulk delete.
sai_theological_lenses18 theological traditions used for lens filtering
product_knowledgeRuntime agent knowledge — changes take effect immediately
dir_illustrationsRead-only view of illustrations (do NOT write here)

Safety Rules

  • NEVER bulk-delete from unified_rag_content — set is_public=false to hide instead.
  • Always paginate with .range() — Supabase has a 1000-row default limit.
  • ONE production Supabase — there is no staging database. All writes are live.

See Also