← Prototypes

Tools

Asset generation and lesson creation tools for Flow Education

🚀 Quick Start: Generate Your First Lesson

Download the tools

Get the tools from GitHub or use the files below

Get API keys

Fireworks AI for images, ElevenLabs for audio (or Amazon Polly for budget)

Configure
cd tools/
cp config.json.template config.json
# Add your API keys
Generate images
node image-gen/batch-generate.js --lesson quest-001-letter-a
Generate audio
node audio-gen/batch-audio.js --lesson quest-001-letter-a
Review outputs

Check assets/images/ and assets/audio/ — iterate prompts if needed

Download Tools

🔧 batch-generate.js

✓ Ready Node.js Fireworks AI

Batch image generation for lesson assets. Reads asset manifests and generates all images with consistent cartoon style.

View Source on GitHub

What It Does

Prompt Template (Auto-Applied)

Style Template Added to Every Prompt
"2D cartoon illustration for children, friendly and warm, simple shapes, bold outlines, flat colors, no gradients, educational style, suitable for kindergarten, high contrast, cheerful, isolated on transparent background"

Example: How an Apple Gets Generated

From manifest:

{
  "id": "apple",
  "prompt": "Cartoon red apple, friendly face, simple 2D style",
  "size": "512x512"
}

Full prompt sent to API:

Cartoon red apple, friendly face, simple 2D style, 
2D cartoon illustration for children, friendly and warm, 
simple shapes, bold outlines, flat colors, no gradients, 
educational style, suitable for kindergarten, high contrast, 
cheerful, isolated on transparent background

Usage

# Generate all images for a lesson
node batch-generate.js --lesson quest-001-letter-a

# Force regeneration (overwrite existing)
node batch-generate.js --lesson quest-001-letter-a --force

# Use custom manifest path
node batch-generate.js --lesson quest-001-letter-a \
  --manifest ../../lessons/quest-001-letter-a/assets-manifest.json

Features

API Configuration

{
  "image_api": {
    "provider": "fireworks",
    "api_key": "YOUR_FIREWORKS_KEY",
    "model": "stable-diffusion-xl-1024-v1-0",
    "default_params": {
      "width": 1024,
      "height": 1024,
      "steps": 30,
      "cfg_scale": 7.5,
      "style_preset": "digital-art"
    }
  }
}

Output Structure

assets/images/quest-001-letter-a/
├── characters/
│   ├── tutor-neutral.png
│   ├── tutor-happy.png
│   └── ...
├── objects/
│   ├── apple.png
│   ├── ant.png
│   └── ...
├── letters/
│   ├── letter-a.png
│   └── ...
├── backgrounds/
│   └── classroom.png
└── ui/
    ├── button-play.png
    └── ...

# Plus generation-report.json with stats

🔊 batch-audio.js

✓ Ready Node.js ElevenLabs / Polly

Batch audio generation for lesson narration and feedback. Supports ElevenLabs (high quality) or Amazon Polly (budget).

View Source on GitHub

What It Does

Usage

# Generate with ElevenLabs (recommended for MVP)
node batch-audio.js --lesson quest-001-letter-a --provider elevenlabs

# Generate with Polly (cheaper for scale)
node batch-audio.js --lesson quest-001-letter-a --provider polly

# Force regeneration
node batch-audio.js --lesson quest-001-letter-a --force

Features

Cost Comparison

API Configuration

{
  "audio_api": {
    "provider": "elevenlabs",
    "api_key": "sk_...",
    "voice_id": "XB0fDUnXU5powFXDhCwa",
    "model": "eleven_multilingual_v2"
  }
}

Output Structure

assets/audio/quest-001-letter-a/
├── narration/
│   ├── intro-welcome.mp3
│   ├── challenge-1-instruction.mp3
│   └── ...
└── feedback/
    ├── correct-01.mp3
    ├── correct-02.mp3
    ├── encourage-01.mp3
    └── ...

# Plus audio-report.json with stats

Example Manifest Entry

{
  "audio": {
    "narration": [
      {
        "id": "intro-welcome",
        "text": "Hello! I'm excited to learn with you today!",
        "emotion": "cheerful",
        "pace": "normal"
      }
    ],
    "feedback": [
      {
        "id": "correct-01",
        "text": "That's right! Great job!",
        "emotion": "celebrating"
      }
    ]
  }
}

📦 lesson-assembler/package.js

✓ Ready Node.js Asset Packaging

Compiles generated assets into deployable lesson packages for the Flow Education Android app.

View Source on GitHub

What It Does

Usage

# Package a complete lesson
node lesson-assembler/package.js --lesson quest-001-letter-a

# Package with detailed manifest
node lesson-assembler/package.js --lesson quest-001-letter-a --include-manifest

# Package all lessons
node lesson-assembler/package.js --all

Features

Output Structure

output/quest-001-letter-a/
├── images/
│   ├── characters/
│   ├── objects/
│   ├── letters/
│   ├── backgrounds/
│   └── ui/
├── audio/
│   ├── narration/
│   └── feedback/
└── manifest.json (if --include-manifest)

# Plus quest-001-letter-a-package-report.json

🧠 adaptive-logic.js

✓ Ready Node.js Rule-Based

Simple rule-based adaptive algorithm for Phase 0 MVP. Adjusts difficulty based on student performance in real-time. NOT machine learning — explicit rules for transparency and debugging.

View Source on GitHub

What It Does

5 Difficulty Levels

1. EASIEST   - Extra scaffolding, more hints, longer time
2. EASY      - Standard scaffolding, extra time allowed
3. NORMAL    - Default challenge (starting level)
4. HARD      - Faster pace, less scaffolding, fewer hints
5. HARDEST   - Timed, no hints, minimal scaffolding

Adaptation Triggers

3 consecutive errors  → Reduce difficulty (make easier)
5 consecutive correct → Increase difficulty (make harder)
<30% success rate      → Trigger review lesson
>80% success rate       → Mark skill mastered
>30 seconds stuck      → Offer hint/help

Usage

const { AdaptiveEngine } = require('./tools/adaptive-logic');

const engine = new AdaptiveEngine('student-001');

// Record an attempt
engine.recordAttempt('letter-b-recognition', true, 3000);

// Check if adaptation needed
const adaptations = engine.shouldAdapt('letter-b-recognition');
// Returns: [{ type: 'INCREASE_DIFFICULTY', reason: '5 consecutive correct' }]

// Get session summary
const summary = engine.getSessionSummary();
// { durationMinutes: 6, challengesCompleted: 4, successRate: "85%" }

📊 progress-tracker.js

✓ Ready Node.js Data Tracking

Student session tracking and recommendations. Stores progress locally (AsyncStorage for React Native) with skill mastery, streak tracking, and next quest recommendations.

View Source on GitHub

What It Does

Tracked Metrics

- Total sessions per student
- Total learning time (minutes)
- Quests completed
- Skills mastered (80%+ over 5+ attempts)
- Success rate per skill
- Daily streak
- Skills needing review (<50% success)

Usage

const { ProgressTracker } = require('./tools/progress-tracker');

const tracker = new ProgressTracker(AsyncStorage);
await tracker.init('student-001');

// Start a quest
await tracker.startQuest('quest-001-letter-a');

// Record challenge completion
await tracker.completeChallenge('challenge-1', true, 'letter-a', 5000);

// Complete quest
await tracker.completeQuest('quest-001-letter-a', 85);

// Get recommendations
const next = await tracker.getNextRecommendation();
// { nextQuest: 'quest-002-letter-b', reason: 'next_in_sequence' }

// Check stats
const stats = await tracker.getStats();
// { totalSessions: 12, completedQuests: 5, streakDays: 3, ... }

Configuration

config.json Template

{
  "image_api": {
    "provider": "fireworks",
    "api_key": "fw_...",
    "model": "accounts/fireworks/models/stable-diffusion-xl-1024-v1-0",
    "default_params": {
      "width": 1024,
      "height": 1024,
      "steps": 30,
      "cfg_scale": 7.5,
      "style_preset": "digital-art"
    }
  },
  "audio_api": {
    "provider": "elevenlabs",
    "api_key": "sk_...",
    "voice_id": "21m00Tcm4TlvDq8ikWAM",
    "model": "eleven_multilingual_v2"
  },
  "polly": {
    "accessKeyId": "AKIA...",
    "secretAccessKey": "...",
    "region": "us-east-1",
    "voiceId": "Joanna"
  },
  "output": {
    "imageDir": "../assets/images",
    "audioDir": "../assets/audio",
    "reportDir": "../output"
  }
}

Security: Never commit config.json with real keys. Add to .gitignore.

Asset Manifest Format

All tools read from lessons/{lesson-id}/assets-manifest.json:

{
  "lessonId": "quest-001-letter-a",
  "title": "Letter A Adventure",
  "duration": "6 minutes",
  "images": {
    "characters": [
      {
        "id": "tutor-happy",
        "prompt": "Friendly cartoon tutor character, happy expression...",
        "size": "512x512"
      }
    ],
    "objects": [
      {
        "id": "apple",
        "prompt": "Cartoon red apple, friendly face, simple 2D style",
        "size": "512x512"
      }
    ],
    "letters": [...],
    "backgrounds": [...],
    "ui": [...]
  },
  "audio": {
    "narration": [
      {
        "id": "intro-welcome",
        "text": "Welcome to the Letter A Adventure!",
        "emotion": "cheerful",
        "pace": "normal"
      }
    ],
    "feedback": [...]
  },
  "challenges": [...]
}

Style Guidelines

Visual Style

2D cartoon, friendly and warm, simple shapes, bold outlines, flat colors, transparent backgrounds for characters/objects

Audio Style

Clear, warm, encouraging, age-appropriate pacing, specific praise over generic "good job"

File Formats

Images: PNG (transparency for characters), JPG (backgrounds). Audio: MP3, 64-128kbps. Max 200MB per lesson.

Naming

kebab-case, descriptive, category-prefixed: tutor-happy.png, apple.png, intro-welcome.mp3

Repository Structure

projects/promptengines/experiments/prototypes/flow-education/
├── README.md                    # System overview
├── QUICKSTART.md               # 10-minute setup guide
├── MANIFESTO.html              # Philosophy & standards
├── index.html                  # This site
├── tools.html                  # This page
├── MVP-QUEST-SPEC.md           # 6-quest specification
├── tools/
│   ├── config.json.template    # API key template
│   ├── image-gen/
│   │   └── batch-generate.js   # ✅ Image generation
│   ├── audio-gen/
│   │   └── batch-audio.js      # ✅ Audio generation
│   ├── lesson-assembler/
│   │   └── package.js          # ✅ Asset packaging
│   ├── adaptive-logic.js       # ✅ Difficulty adjustment
│   └── progress-tracker.js     # ✅ Student tracking
├── lessons/
│   ├── quest-001-letter-a/
│   │   └── assets-manifest.json
│   ├── quest-002-letter-b/
│   │   └── assets-manifest.json
│   └── ... (5 complete)
├── assets/                      # Generated outputs
│   ├── images/
│   └── audio/
└── output/                      # Assembled lessons

Contributing

These tools are open source. To contribute:

  1. Fork github.com/aikaizen/promptengines
  2. Make atomic commits with explicit paths
  3. Follow the slop-free standard (no hedging, no hype)
  4. Test with Quest 001 before submitting

Support

Questions? Issues? principal@promptengines.com
Follow development: lab.promptengines.com