Skill: zoucdr/world-as-100-people-video-gen (version 1.0.1)

--- name: world-as-100-people-video-gen version: 1.0.1 description: "Create ‘world as 100 people’ verticals: shrink hook, stat morphs, punchline, timed English captions and motion graphics (WeryAI). Use for infographic TikToks, demographic explainers, or icon-driven stats. Use when the user names the 100-people metaphor. SEO: 100 people world video; demographic hook video." tags: [infographic, demographics, data, icons, hooks, subtitles, short-video, video-gen] metadata: { "openclaw": { "emoji": "👥", "primaryEnv": "WERYAI_API_KEY", "paid": true, "network_required": true, "requires": { "env": ["WERYAI_API_KEY"], "bins": ["node"], "node": ">=18" } } } user-invocable: true --- # World as 100 people (icons + stat race + punchline) **Template (assume `duration` 10 unless scaled):** **0–2s** *shrink the world to 100 people*; **2–9s** **rapid visual changes** (wealth split, gender, access to water/internet, etc.—user picks **themes**); **9–10s** **one shocking or memorable stat line** (user-themed). **English on-screen text** with **exact windows**. Default **`duration`** is **10** when unspecified. **Dependencies:** `WERYAI_API_KEY` + Node.js 18+. **`scripts/video_gen.js`** + **[`WERYAI_VIDEO_API.md`](resources/WERYAI_VIDEO_API.md)**. **No other Cursor skills required.** ## Prerequisites - `WERYAI_API_KEY` **must be set**; Node **18+**. Prefer public **`https`** image URLs; if the assembled `scripts/video_gen.js` supports local file paths, review/verify the script and explicitly consent before local read-and-upload to WeryAI. - Non-empty `model` in JSON. ## Security, secrets, and API hosts - **`WERYAI_API_KEY`**: Secret; never commit. - **API hosts** fixed in `video_gen.js` as in sibling skills—only the key is read from env. - **Local image handling disclosure**: Prefer public **`https`** image URLs. If the assembled `scripts/video_gen.js` supports local file paths, it may read a local image and upload it to WeryAI to obtain a public URL; require review / verification and explicit consent before using that path. - **Higher assurance**: Prefer a short-lived or isolated environment; review `scripts/video_gen.js` before production use. Verify whether the runtime can read local image files and upload them to WeryAI, and obtain explicit consent before using that path. ## Prompt expansion (mandatory) - **Duration:** Default **10**; **5** or **15** when allowed and requested. - **Timeline scaling:** Rescale hook / middle / punchline segments proportionally; keep **hook → three middle beats → final punchline** order. **Locked rhythm (example for duration 10):** - **0.0–2.0s** — Hook: e.g. *SHRINK EARTH TO 100 PEOPLE*. - **2.0–4.0s**, **4.0–6.0s**, **6.0–9.0s** — **Three** rotating **stat / theme** lines (user brief): e.g. *WEALTH SHIFTS* / *GENDER* / *WHO GETS WHAT*—keep labels **short**; pair each with **icon morph**, **pie wipe**, or **counter tick**. - **9.0–10.0s** — **Punchline stat** (one short English line the user intends—e.g. *ONLY X HAVE Y*). **Visuals:** Isometric or flat UI icons, **glow**, **snappy** transitions (~1s); **no** tiny unreadable numbers unless the **caption** carries the readable stat. **Typography:** Bold sans, outline, lower third; **English only** unless user requests otherwise. **Audio:** Light digital ticks / whoosh if audio on. **Negatives (Kling):** garbled numbers, illegible text, watermark. **Confirmation:** Full expanded `prompt` in table. ### Niche checklist - Prefer **one clear metaphor** per middle window. - Punchline must be **one screenful**—no paragraph. ## Workflow 1. Text / image / multi-image (**SEEDANCE_2_0** only, ≤3 URLs). 2. Collect **which stats or angles** to imply (user may give Chinese—**translate** lines to English on screen). 3. Expand with **timed captions** + motion graphics language. 4. Validate JSON vs frozen tables. 5. Confirm → `wait`. 6. **`[Video](url)`** only for playable links. ## CLI reference ~~~sh node scripts/video_gen.js wait --json '{"model":"KLING_V3_0_PRO","prompt":"…","duration":10,"aspect_ratio":"9:16","generate_audio":true,"negative_prompt":"illegible text, garbled numbers, watermark"}' node scripts/video_gen.js wait --json '{"model":"SEEDANCE_2_0","prompt":"…","duration":10,"aspect_ratio":"9:16","resolution":"720p","generate_audio":true}' ~~~ **Full reference:** **[`WERYAI_VIDEO_API.md`](resources/WERYAI_VIDEO_API.md)**. ## Definition of done **[Video](url)** or error; `prompt` includes **0–2 / 2–4 / 4–6 / 6–9 / 9–10** (or user-approved adjustment) subtitle schedule. ## Boundaries (out of scope) - **Not** verified census data—**illustrative** motion; user owns factual claims. - No `negative_prompt` on Seedance; no unsupported fields. - **`resources/WERYAI_VIDEO_API.md`** for CLI details. ### Example prompts - `Focus: internet access, education, wealth—punchline about inequality` - `Climate + water + energy icons, last line about renewable share` - `Three chart images URLs → Seedance multi-image, same caption windows` - `Healthcare access vs wealth percentiles—punchline about who gets left out` --- ## Model and API constraints (frozen for this skill) ### Text-to-video | model_key | durations | aspect_ratios | resolutions | audio | negative_prompt | prompt limit | |-----------|-----------|---------------|-------------|-------|-----------------|--------------| | KLING_V3_0_PRO | 5, 10, 15 | 9:16, 1:1, 16:9 | *(omit)* | yes | yes | 2000 | | KLING_V3_0_STA | 5, 10, 15 | 9:16, 1:1, 16:9 | *(omit)* | yes | yes | 2000 | | SEEDANCE_2_0 | 5, 10, 15 | 9:16, 1:1, 16:9 | 480p, 720p | yes | no | 2000 | ### Image-to-video | model_key | durations | aspect_ratios | resolutions | audio | negative_prompt | image slots | |-----------|-----------|---------------|-------------|-------|-----------------|-------------| | KLING_V3_0_PRO | 5, 10, 15 | 9:16, 16:9, 1:1 | *(omit)* | yes | yes | single `image` | | KLING_V3_0_STA | 5, 10, 15 | 9:16, 16:9, 1:1 | *(omit)* | yes | yes | single `image` | | SEEDANCE_2_0 | 5, 10, 15 | 9:16, 1:1, 16:9 | 480p, 720p | yes | no | up to **3** `images` | ## Recommended models | Tier | model_key | Default duration | |------|-----------|------------------| | ⭐ Best | KLING_V3_0_PRO | 10 | | 👍 Good | KLING_V3_0_STA | 10 | | ⚡ Fast | SEEDANCE_2_0 | 10 (`resolution`: **720p**) | ## Default parameters | Field | Value | |-------|--------| | aspect_ratio | 9:16 | | duration | 10 | | generate_audio | true | | resolution | 720p (Seedance) | | negative_prompt | Kling: `illegible text, garbled captions, watermark` | ## Text-to-video (primary) User lists **themes** → you **assign lines + seconds** → confirm → `wait`. ## Image-to-video (optional) Charts / icons stills → animate under same windows. ## Tips - If user gives **too many themes**, merge into **three** middle beats. - Punchline hits harder with a **contrast number** (still short). > Packaged as **`world-as-100-people-video-gen`**.

path: eval.yaml
content: version: "1"
defaults:
  trials: 5
  timeout: 600
  threshold: 0.8
skill: "world-as-100-people-video-gen"
trigger_tests:
  - id: explicit-invoke
    should_trigger: true
    prompt: "Use world-as-100-people-video-gen to produce a vertical infographic-style clip with timed English stat lines."
  - id: implicit-domain
    should_trigger: true
    prompt: "If the world were 100 people—animated icons, fast demographic shifts, punchline stat, 9:16 with burned-in English captions."
  - id: implicit-paraphrase
    should_trigger: true
    prompt: "I want a demographic explainer for Shorts: shrink-Earth hook, three morphing stat beats, one killer line at the end—all subtitled."
  - id: negative-control
    should_trigger: false
    prompt: "Fix this React useEffect dependency warning."
outcome_tests:
  - id: layout
    type: deterministic
    checks:
      - file_exists: "SKILL.md"
      - file_exists: "eval.yaml"
  - id: prompt-expansion-required
    type: llm_rubric
    rubric: |
      SKILL.md must mandate prompt expansion, hook/middle/punchline subtitle structure with duration scaling, and WeryAI workflow with confirmation.


path: resources/WERYAI_VIDEO_API.md
content: # WeryAI video CLI & JSON (`video_gen.js`)

Shipped at **`resources/WERYAI_VIDEO_API.md`** (next to `SKILL.md`). From the skill package root, run **`node scripts/video_gen.js`** (see examples below). **Node.js 18+** required.

This file describes **CLI usage, JSON shape, and image handling**. Per-skill rules (prompt expansion, confirmation tables, allowed models) live in each skill’s **`SKILL.md`**.

---

## What you need by generation mode

The script picks the API route from your JSON:

| Mode | When | Required in JSON | API path (conceptually) |
|------|------|-------------------|-------------------------|
| **Text → video** | No `image` and no non-empty `images[]` | `model`, `prompt`, `duration` (and any optional fields the **model** supports) | `text-to-video` |
| **Image → video** | Non-empty string `image` | Same as above **plus** `image` — **must be a public `https` image URL** (see below) | `image-to-video` |
| **Multi-image → video** | Non-empty `images` array | Same as above **plus** `images` — **every element must be a public `https` image URL** | `multi-image-to-video` |

- **`model`**: required for real runs and for `--dry-run` when `prompt` is present. Empty/missing → `MISSING_PARAM` (there is **no default model**). The script does **not** enforce skill-specific model allowlists—callers must match the skill’s `SKILL.md`.
- **`prompt`**: required for `wait` and all `submit-*` flows that generate video.
- **`duration`**: sent to the API; must be one of the values allowed for the chosen model (check `models` output or the skill’s frozen table).
- Other fields (`aspect_ratio`, `resolution`, `generate_audio`, `negative_prompt`) are **only** valid if that model supports them—see `node scripts/video_gen.js models` and the skill’s **`## Model and API constraints`**.

---

## Image-to-video & multi-image: public URL requirement

For **image-to-video** (`image`) and **multi-image-to-video** (`images[]`), the value that ultimately reaches WeryAI must be a **public, directly fetchable image URL on the internet**:

- **Scheme must be `https://`** — plain **`http://` image URLs are rejected** by `video_gen.js` and must not be used.
- The URL must be reachable **from WeryAI’s servers** (not `localhost`, `127.0.0.1`, LAN-only hosts, or links that only work inside your browser session).
- Do **not** pass opaque file paths, `data:` URLs, or private object-storage links that are not already a stable public `https` address.

**Operational rule for skills and operators:** treat **public `https` image URLs as mandatory** for any image-to-video request. Host the image on a CDN, object storage with public read, or any HTTPS endpoint the API can GET without your local machine.

---

## Image input: public URL vs local path (how `video_gen.js` behaves)

### Normal path: public **https** URL (required for correct image-to-video usage)

- Put that URL in `image` (single) or each entry of `images[]` (multi).
- The script **does not** re-upload; it sends the URL straight to the video API.
- This matches the **public URL requirement** above.

### Advanced: local file → script uploads, then uses returned public URL

If `image` or an `images[]` entry is **not** already a public https URL, `video_gen.js` treats it as a **local path** (or `file://…`) and:

1. Reads the file from disk.
2. **POST**s it to **`https://api-growth-agent.weryai.com/growthai/v1/generation/upload-file`** with `Authorization: Bearer $WERYAI_API_KEY` and multipart fields `batch_no`, `fixed`, `file`.
3. Parses the response for a returned **public https** URL and substitutes that URL into the JSON sent to **video** generation — i.e. the video API still only ever sees a **public URL**; the script is just creating one from a local file.

**Implications (local path only)**

- Requires **`WERYAI_API_KEY`** with access to both **video** and **upload-file** endpoints.
- File must exist and be a **regular file**. Extensions with sensible MIME types in script: **`.jpg` / `.jpeg` / `.png` / `.webp` / `.gif`**.
- **`--dry-run`**: does **not** upload; stdout may still show local paths with a note that a real run would upload first.

**Skills / product docs:** prefer telling users to supply a **public `https` link**; use local paths only after **reviewing `video_gen.js`** and **explicit user consent** to read and upload files.

### Multi-image limits in this script

- `images` is passed through after upload resolution; the built request body keeps **at most the first 3** entries (`images.slice(0, 3)`). Models may allow fewer—always check `models` / skill tables (e.g. `upload_image_limit`).

---

## Environment

- **`WERYAI_API_KEY`** (required for `models`, generation, `status`, and local-image upload; **not** required for `--dry-run` only): bearer token. Never commit the value.
- **No other environment variables** are read. Hosts are fixed in `video_gen.js`. The **`wait`** command polls task status with **exponential backoff**: first delay **3s**, then **6s → 12s → 24s → …** (each step doubles), **capped at 60s** between polls, with a **total wall-clock budget of 600s (10 minutes)** before timeout.

## API hosts (fixed)

| Purpose | Base URL |
|---------|-----------|
| Video generation & task status | `https://api.weryai.com` |
| Model registry (`models` command) | `https://api-growth-agent.weryai.com` |
| Local file → public URL (upload) | `https://api-growth-agent.weryai.com/growthai/v1/generation/upload-file` |

---

## `models` — model metadata (JSON on stdout)

```sh
node scripts/video_gen.js models
node scripts/video_gen.js models --mode text_to_video
node scripts/video_gen.js models --mode image_to_video
node scripts/video_gen.js models --mode multi_image_to_video
```

Typical fields include `model_key`, `title`, `durations`, `aspect_ratios`, `resolutions`, `has_generate_audio`, `has_negative_prompt`, `prompt_length_limit`; image modes may add `support_multiple_images`, `support_first_last_frame`, `upload_image_limit`, etc. Use this to author **`## Model and API constraints`** in `SKILL.md`.

---

## `wait` — submit and block until done

```sh
node scripts/video_gen.js wait --json '{"model":"KLING_V3_0_PRO","prompt":"...","duration":5,"aspect_ratio":"9:16"}'
node scripts/video_gen.js wait --json '{"model":"...","prompt":"...","image":"https://cdn.example.com/pet.jpg","duration":5}'
node scripts/video_gen.js wait --json '{"model":"...","prompt":"...","images":["https://cdn.example.com/a.jpg","https://cdn.example.com/b.jpg"],"duration":5}'
# Advanced only: local paths trigger upload-file first; skills should default to public https URLs above.
node scripts/video_gen.js wait --json '{"model":"...","prompt":"...","image":"./girl.png","duration":5}'
node scripts/video_gen.js wait --json '...' --dry-run
```

Same JSON object is used for **`submit-*`**; only the blocking behavior differs.

---

## `submit-*` — submit only (async)

```sh
node scripts/video_gen.js submit-text  --json '{"model":"…","prompt":"…","duration":5}'
node scripts/video_gen.js submit-image --json '{"model":"…","prompt":"…","image":"https://…","duration":5}'
node scripts/video_gen.js submit-multi-image --json '{"model":"…","prompt":"…","images":["https://…","https://…"],"duration":5}'
# Advanced only: local file → upload then submit (same public-URL requirement for the API).
node scripts/video_gen.js submit-image --json '{"model":"…","prompt":"…","image":"./local.png","duration":5}'
```

**Note:** `submit-text`, `submit-image`, and `submit-multi-image` are **aliases** in this script: routing (text vs image vs multi-image) is decided **only** from JSON (`image` / `images`), exactly like `wait`. Use the verb that matches your intent; behavior is the same `submitTask` path aside from blocking.

Poll completion with **`status`** (below). Response JSON may include `batchId` / `taskIds` from the API; this CLI does **not** expose a separate `batch-status` subcommand.

---

## `status`

```sh
node scripts/video_gen.js status --task-id <id>
```

You may also pass a task id inside JSON as `task_id` or `taskId` when using `--json` (less common). If `--task-id` is omitted and JSON has no id, the script errors with `status command requires --task-id <id>`.

There is **no** `batch-status` command in `video_gen.js`; use per-task `status` with each `taskId` you care about. Invalid invocation prints a **Usage** line to stdout JSON (there is no `--help` flag).

---

## Agent UX: in-progress notice, task IDs, backoff polling, completion, skill name

Use this when an executor should **talk to the user** during async generation (not only return raw JSON).

1. **Right after a successful `submit-*`:** Tell the user that generation **has started** and paste **`taskId`** from stdout JSON. If the API returns **`batchId`** and/or **`taskIds`**, include those too so logs and support can correlate the job.

2. **Poll until terminal state:** Run `status --task-id <id>` repeatedly until the payload shows **completed** or **failed** (or your wrapper treats the script’s `phase` / `ok` as terminal). **Recommended delay between polls:** **3s, then 6s, then 12s, …** doubling each time, **cap at 60s**—the same pattern as **`wait`** uses inside `video_gen.js`. Stop early on success/failure; respect your own overall timeout if you need stricter limits than the built-in 10-minute `wait` budget.

3. **`wait` vs `submit-*`:** **`wait`** is one blocking call; it does **not** emit a separate “submitted” line for the user unless **your** layer prints one before/after. For “notify immediately, then poll in the open,” use **`submit-*`** and your own **`status`** loop with the backoff above.

4. **When generation finishes:** Summarize the **outcome** for the user: on success, **playable links** from **`videos`** (e.g. Markdown `[label](url)`); on failure, **`errorCode`** and **`errorMessage`**. **`video_gen.js` does not know which skill was used**—add **skill attribution** yourself from the active skill’s **`SKILL.md`** (e.g. frontmatter **`name`**) or the skill folder slug, in the same user-facing message.

---

## JSON field reference

| Field | Role |
|--------|------|
| `model` | **Required** (non-empty). No default. |
| `prompt` | **Required** for generation commands. |
| `duration` | Sent as number; default **5** if missing/invalid in script—still must be valid for the model. |
| `aspect_ratio` | Optional; model-dependent. |
| `resolution` | Optional; model-dependent. |
| `generate_audio` | Optional boolean; model-dependent. |
| `negative_prompt` | Optional string; model-dependent. |
| `image` | **Image-to-video:** use a **public `https` image URL** (required for normal use). Local path / `file://` is **script-only**: uploads first, then the API receives the returned public URL. |
| `images` | **Multi-image-to-video:** each entry must end up as a **public `https` URL** (directly, or via the script’s upload step). Up to **3** entries are forwarded after preparation. |

Do not send fields the chosen model does not support (reduces spurious `1002` / parameter errors).

---

## Status & stdout conventions

- HTTP OK with business `status === 0` (or `200` in some responses): request accepted for that layer.
- Generation success: look for completed phase and `videos` with `url` / `cover_url`.
- Errors: stdout JSON with `ok: false`, `errorCode`, `errorMessage` (script maps common API codes to short messages).
- Common keys: `ok`, `phase`, `taskId`, `batchId`, `taskIds`, `videos`, `tasks`, `inProgress`, `errorCode`, `errorMessage`.

---

**Reminder:** Skills may require user confirmation before any paid `wait` / `submit-*` call. For **any** image-to-video flow, assume **public `https` image URLs are mandatory** unless the skill explicitly documents a vetted local-upload path—always follow the active skill’s **`SKILL.md`**.


Security scan verdicts — ClawScan: clean | static analysis: clean | VirusTotal: clean | SkillSpector: clean (LOW)