Skip to content

PromptExecution/website

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

164 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LLM DOES NOT COMPUTE - PromptExecution

Retro comic UI + Cloudflare-native, agentic graphic-comic generation workflow.

Quick Start

Local full-stack (Pages Functions + local D1/R2)

just dev

This runs:

  1. bun run build
  2. bun run db:init:local
  3. wrangler pages dev dist --ip 127.0.0.1 --port 8788 -b TEST_SECRET=local-secret -b AUTO_GENERATE_ON_READ=1 -b ALLOW_LOCAL_BOOTSTRAP=1

For local real Workers AI image generation, use:

just dev-ai

Local frontend-only UI

just dev-ui

Dry-run the agentic prompt planner

Keep just dev running, then:

just test-workflow-dry

For a real generation run:

just test-workflow

Required Config

Wrangler config

wrangler.toml contains:

  • Pages build output config (dist)
  • D1 binding: DB
  • R2 binding: COMICS_BUCKET
  • Workers AI binding in production env: env.production.ai
  • default production model vars (SCRIPT_MODEL_A, SCRIPT_MODEL_B, TOPIC_MODEL)

wrangler.cron.toml contains:

  • Worker entrypoint (functions/_worker.js)
  • cron trigger (0 9 * * *)
  • the same D1/R2/KV/AI bindings used by scheduled generation

Environment variables

See .env.example for full list.

Core values:

  • TEST_SECRET for /api/test-generate
  • AUTO_GENERATE_ON_READ (1 to auto-create today's comic when /api/today is empty)
  • ALLOW_LOCAL_BOOTSTRAP (1 to create local SVG fallback comic if env.AI is unavailable)
  • ENABLE_PUSH_NOTIFICATIONS (1 to enable real VAPID push delivery)
  • VAPID_PRIVATE_KEY (JWK JSON string generated by npx @pushforge/builder vapid)
  • VAPID_SUBJECT (mailto: or https: contact string for VAPID)
  • SCRIPT_MODEL_A (default @cf/deepseek-ai/deepseek-r1-distill-qwen-32b)
  • SCRIPT_MODEL_B (default @cf/meta/llama-3.3-70b-instruct-fp8-fast)
  • TOPIC_MODEL (default @cf/qwen/qwen3-30b-a3b-fp8)

Agentic Graphic Workflow

Main implementation:

  • functions/lib/agentic-comic-workflow.ts

Workflow:

  1. Random panel count (1..4)
  2. Random cast size + cast selection from cast/characters.json
  3. Three topic suggestions
  4. Standardized comic-script prompt generation
  5. Two Workers AI writing variants (head-to-head), rendered server-side to SVG
  6. Artifact retention in R2
  7. Metadata retention in D1 (workflow_runs)

Cast assets:

  • Descriptions: cast/characters.json
  • Reference samples: public/cast/samples/*.svg

API Endpoints

  • GET /api/today
  • GET /api/day?day=YYYY-MM-DD
  • GET /api/archive?page=1&limit=20
  • GET /api/workflow?day=YYYY-MM-DD&include_artifacts=1
  • POST /api/test-generate Supports reset=1 and rebuild=1 for day-level admin repair.
  • POST /api/vote
  • POST /api/subscribe
  • DELETE /api/subscribe

Cron / ScheduledEvent Handler

The cron handler is exported in:

  • functions/_worker.js

Important: a top-level export async function scheduled(...) is present so Cron Triggers are handled correctly.

To test scheduled events locally:

just dev-cron

In another terminal:

just test-cron

If AI binding is not configured locally, cron trigger will run and fail with an explicit Workers AI binding error (expected).

For production deployment:

  1. Deploy Pages with bun run deploy:pages
  2. Deploy the scheduled Worker with bun run deploy:cron

Workers AI notes

Real image generation requires an AI binding (env.AI).

For local real-generation testing:

  1. set CLOUDFLARE_API_TOKEN
  2. run:
just dev-ai

If no AI binding is present, dry_run=1 still works for prompt workflow testing.

Architect Skill Package

A hardened skill spec for delegated analysis/orchestration now lives at:

  • skills/principal-cognitive-systems-architect/SKILL.md
  • skills/principal-cognitive-systems-architect/references/*
  • skills/principal-cognitive-systems-architect/scripts/*

Useful commands:

just architect-init "stabilize comic publish and voting flow"
just architect-summary .agent-runs/run-YYYYMMDDTHHMMSSZ

License

This project uses the MIT License. See LICENSE.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors