---
name: codexity
description: Compile production-grade animated social media UI mockups and app notification clips (Instagram Posts, Profiles, Stories/Reels, X/Twitter Posts, Shopify/Stripe/iMessage/WhatsApp/YouTube/TikTok/Discord notifications) into 100% deterministic OpenFilm Protocol 0.1 HTML pages (`window.film`) and inject them directly into `film.html`.
---

# Codexity for OpenFilm — Agent Manual

When the user gives you this link (`https://codexity.dev/openfilm.md` or `http://localhost:5173/openfilm.md`), you have full access to **Codexity's OpenFilm Protocol 0.1 UI Compiler**.

Every clip Codexity generates:
1. Implements `window.film = { width, height, duration, ready, frame(t) }` as a **100% pure function of `t` (in seconds)** with zero state accumulation—guaranteed to pass `openfilm look <t>` (`✓ drawn again after another frame: same picture`).
2. Exposes semantic DOM IDs (`#card`, `#avatar`, `#handle`, `#verified-badge`, `#caption`, `#like-icon`, `#like-count`, `#heart-burst`, `#follow-btn`, `#followers-count`, etc.) so the user can move, scale, or edit text in OpenFilm Studio's **Layers** panel (`overrides`) without touching code.
3. Exposes `data-props` mapped to `:root` CSS variables (`--entrance-dur`, `--like-at`, `--follow-at`, `--accent-color`) so OpenFilm Studio's **Inspector** can adjust animation timing and colors non-destructively.

---

## 1. Fastest Way to Generate & Inject a Clip (Zero Setup)

### Option A: If you have the `codexity` MCP server connected
Call the MCP tool **`compile_openfilm_clip`**:
```json
{
  "template": "instagram_post",
  "clipId": "ig-post",
  "duration": 4,
  "at": "0",
  "trackRole": "front",
  "left": 290,
  "top": 580,
  "data": {
    "handle": "codexity.ai",
    "verified": true,
    "likes": "2,482,986",
    "caption": "Every UI component is now a deterministic OpenFilm HTML clip."
  },
  "outputPath": "./ig-post.html",
  "filmHtmlPath": "./film.html"
}
```

### Option B: Via Terminal / Bash (Works in ANY OpenFilm Agent, including Pi / Codex / Claude Code)
If the local CLI exists at `C:/Users/USER/Desktop/codexityAE/mcp-server/openfilm-cli.cjs`, run it directly; otherwise fetch and run `https://codexity.dev/openfilm-cli.cjs`:

```bash
# Local execution (fastest):
node "C:/Users/USER/Desktop/codexityAE/mcp-server/openfilm-cli.cjs" \
  --template instagram_post \
  --id ig-post \
  --out ./ig-post.html \
  --film ./film.html \
  --at 0 \
  --duration 4 \
  --role front \
  --left 290 \
  --top 580 \
  --data '{"handle":"codexity.ai","verified":true,"likes":"2,482,986","caption":"Built for OpenFilm."}'
```

Or from anywhere via URL (zero local files required):
```bash
curl -fsSL https://codexity.dev/openfilm-cli.cjs -o .codexity-cli.cjs && \
node .codexity-cli.cjs \
  --template instagram_post \
  --id ig-post \
  --out ./ig-post.html \
  --film ./film.html \
  --at 0 \
  --duration 4 \
  --data '{"handle":"codexity.ai","verified":true,"likes":"2,482,986","caption":"Built for OpenFilm."}'
```

---

## 2. All Available UI Templates & Data Schemas

### 1. `instagram_post` (`500×640`)
Animated Instagram feed card with spring pop entrance, double-tap heart burst, red heart fill, and live like counter increment at `--like-at` (default `1.2s`).
- **`data` fields**:
  - `handle` (string, e.g. `"codexity.ai"`)
  - `verified` (boolean, default `true`)
  - `location` (string, e.g. `"San Francisco, California"`)
  - `likes` (string/number, e.g. `"2,482,986"`)
  - `caption` (string)
  - `timeAgo` (string, e.g. `"2 HOURS AGO"`)
  - `theme` (`"dark"` | `"light"`, default `"dark"`)
- **Layers (`overrides` selectors)**: `#card`, `#avatar`, `#handle`, `#verified-badge`, `#location`, `#media-box`, `#heart-burst`, `#like-icon`, `#like-count`, `#caption`, `#time-ago`
- **Inspector (`data-props`)**: `--like-at` (`Like Click Time (s)`), `--entrance-dur` (`Entrance Speed (s)`)

### 2. `instagram_profile` (`420×280`)
Animated Instagram profile header with avatar ring, Posts/Followers/Following counters, verified badge, bio, and interactive `Follow` → `Following` button morph + follower increment at `--follow-at` (default `1.2s`).
- **`data` fields**:
  - `handle` (string)
  - `fullName` (string)
  - `verified` (boolean, default `true`)
  - `bio` (string)
  - `posts` (string, e.g. `"142"`)
  - `followers` (string/number, e.g. `"84,999"`)
  - `following` (string, e.g. `"310"`)
  - `theme` (`"dark"` | `"light"`, default `"dark"`)
- **Layers (`overrides` selectors)**: `#card`, `#avatar`, `#posts-count`, `#followers-count`, `#following-count`, `#full-name`, `#verified-badge`, `#bio`, `#follow-btn`
- **Inspector (`data-props`)**: `--follow-at`, `--entrance-dur`

### 3. `twitter_post` (`520×310`)
Animated X / Twitter post card with verified badge, post text, timestamp, and live like + repost counter pulse at `--like-at`.
- **`data` fields**:
  - `fullName` (string, e.g. `"Codexity Studio"`)
  - `handle` (string, e.g. `"@codexity_ai"`)
  - `verified` (boolean, default `true`)
  - `content` (string)
  - `date` (string, e.g. `"9:41 AM · Oct 24, 2026"`)
  - `retweets` (string/number, e.g. `"1,420"`)
  - `likes` (string/number, e.g. `"12,840"`)
  - `views` (string, e.g. `"428.5K"`)
  - `theme` (`"dark"` | `"light"`, default `"dark"`)
- **Layers (`overrides` selectors)**: `#card`, `#avatar`, `#full-name`, `#verified-badge`, `#handle`, `#tweet-text`, `#date-row`, `#retweet-count`, `#like-icon`, `#like-count`, `#views-count`

### 4. `instagram_story` / `instagram_reel` (`380×675`)
Vertical 9:16 story/reel card with deterministic progress bar fill across the clip's `duration`.
- **`data` fields**: `handle`, `timeAgo`, `caption`
- **Layers (`overrides` selectors)**: `#card`, `#progress-fill`, `#avatar`, `#handle`, `#time-ago`, `#caption`, `#reply-pill`

### 5. App Notification Pills (`460×128`)
Templates:
- `shopify_notification` (Shopify green `#95BF47`)
- `stripe_notification` (Stripe blurple `#635BFF`)
- `instagram_notification` (Instagram magenta `#E1306C`)
- `imessage_notification` (iMessage green `#34C759`)
- `whatsapp_notification` (WhatsApp green `#25D366`)
- `youtube_notification` (YouTube red `#FF0033`)
- `tiktok_notification` (TikTok cyan `#00F2FE`)
- `discord_notification` (Discord blurple `#5865F2`)
- **`data` fields**:
  - `appName` (string, optional override)
  - `title` (string, e.g. `"New Order #4829"`)
  - `message` (string, e.g. `"2x Motion Bundle — Paid via Apple Pay"`)
  - `amount` (string, optional badge e.g. `"+$149.00"`)
  - `time` (string, e.g. `"now"`)
  - `theme` (`"dark"` | `"light"`, default `"dark"`)
- **Layers (`overrides` selectors)**: `#card`, `#icon-box`, `#app-name`, `#title`, `#message`, `#time`, `#amount-badge`
- **Inspector (`data-props`)**: `--accent-color`, `--entrance-dur`

---

## 3. Always Verify with `openfilm look`

After generating and injecting a clip into `film.html`, run:
```bash
openfilm look 1.5
```
to render the frame and verify determinism (`✓ drawn again after another frame: same picture`).
