UND1SPUTED

Bedtime Story Agent — AI skill for Claude Code

AI community

AI bedtime story generator for ages 5 to 10. Claude Haiku writes a story, an LLM judge scores it on six criteria, and the story is revised until it passes.

How to install Bedtime Story Agent

This entry records only its repository, not the path inside it, so there is no exact command to give. Open UND1SPUTED/Bedtime-Story-Agent and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

What Bedtime Story Agent does

AI bedtime story generator for ages 5 to 10. Claude Haiku writes a story, an LLM judge scores it on six criteria, and the story is revised until it passes. Includes a web UI, prompt inspector, and automatic sample logging.

Alternatives in AI

  • Omniget — Udemy & Hotmart course downloader, YouTube downloader (yt-dlp GUI, 1,800+ sites) + desktop app for AI agents 13.9k ★
  • Ralph For Claude Code — by Frank Bria - An autonomous AI development framework that enables Claude Code to work iteratively on project 8k ★
  • Ralph Loop — A long-running AI agent loop 292 ★

README

Bedtime Story Agent

A small Python tool that turns a short request into a bedtime story for children aged 5 to 10. A judge model reviews each draft, and the storyteller revises it until it passes or the revision limit is reached. The user can then ask for changes.

Quick start for reviewers

  1. Install Python 3.9 or newer.
  2. Install the dependencies:
    python -m venv .venv
    source .venv/bin/activate          # Windows PowerShell: .\.venv\Scripts\Activate.ps1
    pip install -r requirements.txt
  3. Run the tests (no key needed): python -m unittest discover -s tests -v
  4. Run the web app: python app.py, then open http://127.0.0.1:5000 and paste an Anthropic API key.
  5. Or run the terminal version: python main.py (set ANTHROPIC_API_KEY first).

Step-by-step instructions for running, testing, and publishing are in `docs/STEPS.md`.

Block diagram

flowchart TD
    U[User] -->|request| A[analyze_request
classify category, characters, tone] A -->|brief| W[write_first_draft
storyteller prompt + category guidance] W -->|draft| J[judge_story
rubric scores + feedback] J -->|passed?| D{All scores >= 4?} D -->|no, rounds < 2| R[revise
storyteller + judge feedback] R -->|revised draft| J D -->|yes, or rounds exhausted| O[Story + scores] O --> U O --> L[sample_log.py
appends to sample_outputs.md] U -->|requested change| F[apply_user_feedback
storyteller + user note] F -->|revised draft| J F --> L

Components:

  • main.py: the command-line loop (input, output, feedback turns).
  • pipeline.py: orchestrates the steps above.
  • prompts.py: all prompt text and the story categories.
  • judge.py: the LLM judge and its rubric.
  • llm.py: the Anthropic client wrapper and JSON parsing.
  • app.py: the Flask web server, security guards, and API routes.
  • keystore.py: holds the API key in memory only.
  • tracing.py: records each model call for the inspector.
  • `sample