AgentSkillsCN

Book Wizard

图书向导

SKILL.md

Book Creation Skill

Create children's books by writing JSON directly. The wizard is a display/generation layer - Claude Code writes files, wizard shows results and generates images.

Quick Start

bash
# 1. Write book JSON
# 2. Deploy
vercel --prod
# 3. Open wizard
open "https://funbookies.com/wizard/?slug={slug}&phase=3"

Workflow

StepClaude ActionUser Sees
1. StoryWrite public/books/{slug}.jsonWizard Phase 3 (story review)
2. ReferencesUser clicks "Generate" in wizardWizard Phase 4 (reference images)
3. PagesUser clicks "Generate" in wizardWizard Phase 5 (page images)
4. PublishSet status: "published", deployReader view

Book JSON Structure

Write to public/books/{slug}.json:

json
{
  "title": "Nat the Bat",
  "slug": "nat-the-bat",
  "level": "B1",
  "status": "draft",
  "characterName": "Nat",
  "characterDescription": "small brown bat with big round eyes, fuzzy body, small pointed ears, and delicate wings folded at sides when not flying",
  "setting": "cave at dusk transitioning to night, with rocks, moss, and eventually stars visible outside",
  "storyType": "growth",
  "visual_style": "soft digital children's book illustration, gentle glowing light, warm cave tones, cozy atmosphere, magical nighttime",
  "pages": [
    {
      "page": 1,
      "type": "cover",
      "text": "Nat the Bat",
      "scene": "Cover illustration: A small brown bat with big round eyes flying through a starry night sky. Wings spread wide. Moon glowing in background. The bat looks curious and happy. Deep blue night with twinkling stars."
    },
    {
      "page": 2,
      "type": "story",
      "text": "Nat is a bat.",
      "scene": "Medium shot: Small brown bat named Nat hanging upside down from a cave ceiling. Big round eyes, fuzzy body, wings folded. Soft evening light coming from cave entrance. Warm brown cave walls."
    },
    {
      "page": 10,
      "type": "end",
      "text": "The End",
      "scene": "Wide shot: Nat the bat soaring through beautiful starry night sky. Full moon in background. Peaceful, magical nighttime scene."
    }
  ]
}

Required Fields

FieldPurposeExample
titleBook title"Nat the Bat"
slugURL-safe identifier"nat-the-bat"
levelReading level"B1"
status"draft" or "published""draft"
characterNameMain character name"Nat"
characterDescriptionVisual details for consistency"small brown bat with big round eyes..."
settingWhere story takes place"cave at dusk..."
visual_styleArt style for all images"soft digital children's book illustration..."
pagesArray of page objectsSee below

Page Structure

Each page needs:

  • page: Number (1-indexed)
  • type: "cover", "story", or "end"
  • text: The readable text
  • scene: Visual description for image generation

Scene Description Rules

  1. Start with shot type: "Wide shot:", "Medium shot:", "Close-up:"
  2. Include character by name: "Nat the bat hanging..."
  3. Physical descriptions: "eyes wide", "wings spread"
  4. Never use negations: "no ball" generates a ball
  5. End prompt: Wizard adds "NO TEXT" automatically

Good Scene Example

code
Medium shot: Nat the bat opening his eyes wide with surprised expression. One wing uncurling from his body. Around him, the dark cave is visible in soft blue-gray tones.

Bad Scene Example

code
The bat is scared and there's no light.

(Uses emotion "scared" instead of physical description, uses negation "no light")

Visual Style Options

Choose based on story mood:

StyleBest For
soft digital children's book illustration, gentle lighting, warm colorsCozy, friendly
warm watercolor illustration, soft edges, luminous qualityNature, gentle
bold graphic illustration, simple shapes, primary colorsAction, energy
sketchy whimsical illustration, expressive linesSilly, playful
cozy detailed illustration, rich warm colors, intricate patternsRich environments

Level Guidelines

LevelWords/PagePagesFocus
A0-A21-38-12Single words, labels
B1-B24-610-14Simple sentences, CVC words
B3-B66-812-16Digraphs, blends
C1+10+16-20Complex sentences

Example Session

code
User: Create a B1 book about a bat who learns to see in the dark

Claude:
1. Writes public/books/nat-the-bat.json with full story
2. Runs: vercel --prod
3. Opens: https://funbookies.com/wizard/?slug=nat-the-bat&phase=3
4. Says: "Review the story. Click through to Phase 4 to generate reference images, then Phase 5 for page images."

User reviews in wizard, generates images, then:

5. Updates JSON: "status": "published"
6. Runs: vercel --prod
7. Opens: https://funbookies.com/reader.html?book=nat-the-bat

File Locations

ContentPath
Book JSONpublic/books/{slug}.json
Reference imagespublic/books/references/{slug}_multi/*.png
Page imagespublic/books/images/{slug}/page{NN}.png
Thumbnailpublic/images/thumbs/{slug}.jpg

Wizard Handles

The wizard automatically:

  • Builds image prompts from book data
  • Uses characterName, characterDescription, visual_style
  • Adds "NO TEXT" to all prompts
  • Saves generated images back to book JSON
  • Manages multi-reference cascade (style guide → scenes)

Claude Code just writes the book JSON. Wizard does the rest.

Publishing Checklist

Before setting status: "published":

  1. All pages have images (check pages[].image fields)
  2. Story text is final
  3. Generate thumbnail: uv run python scripts/generate_thumbnails.py --slug {slug}