@scenerok/cli 2.2.0 → 2.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (32) hide show
  1. package/README.md +6 -6
  2. package/dist/commands/skills.d.ts.map +1 -1
  3. package/dist/commands/skills.js +31 -25
  4. package/dist/utils/skillsManifest.d.ts +13 -3
  5. package/dist/utils/skillsManifest.d.ts.map +1 -1
  6. package/dist/utils/skillsManifest.js +35 -12
  7. package/examples/system/rokmilk-chocolate-promo.vid +1 -1
  8. package/examples/system/voice-visual-promo.vid +1 -1
  9. package/package.json +3 -3
  10. package/skills/scenerok/SKILL.md +150 -0
  11. package/skills/{remote → scenerok/references}/ai-models.md +1 -2
  12. package/skills/{remote → scenerok/references}/animations-catalog.md +139 -2
  13. package/skills/{remote → scenerok/references}/animations-picker.md +12 -1
  14. package/skills/{remote → scenerok/references}/brand-setup.md +3 -1
  15. package/skills/{remote → scenerok/references}/catalog-index.json +163 -19
  16. package/skills/scenerok/references/editing-actions.md +560 -0
  17. package/skills/{remote → scenerok/references}/environments.md +23 -24
  18. package/skills/{remote → scenerok/references}/intent-router.md +5 -15
  19. package/skills/{remote → scenerok/references}/media-stdlib.md +2 -3
  20. package/skills/{remote → scenerok/references}/music.md +2 -21
  21. package/skills/scenerok/references/sdk-guide.md +301 -0
  22. package/skills/{remote → scenerok/references}/shaders-filters.md +9 -6
  23. package/skills/{remote → scenerok/references}/text-styles.md +15 -35
  24. package/skills/{remote → scenerok/references}/transitions-catalog.md +2 -0
  25. package/skills/{remote → scenerok/references}/tts.md +4 -22
  26. package/skills/{remote → scenerok/references}/vidscript-guide.md +250 -67
  27. package/skills/scenerok/references/vidscript-sample.md +44 -0
  28. package/skills/{remote → scenerok/references}/vidscript-strict.md +41 -26
  29. package/skills/{remote → scenerok/references}/workflow.md +6 -7
  30. package/skills/remote/sdk-guide.md +0 -201
  31. package/skills/remote/vidscript-sample.md +0 -28
  32. package/skills/shared/SKILL.md +0 -157
@@ -1,6 +1,6 @@
1
1
  # VidScript v2 — Strict Agent Reference
2
2
 
3
- Follow these rules exactly. When in doubt, fetch `vidscript-sample.md` from https://scenerok.com/.well-known/agent-skills/ or run `scenerok skills sync` for local copies.
3
+ Follow these rules exactly. For a complete working script, see `vidscript-sample.md`; for cuts, layering, masks, audio mixing, and grading, see `editing-actions.md`.
4
4
 
5
5
  ## Rule 1: Package imports are mandatory
6
6
 
@@ -17,11 +17,7 @@ Without the owning import, calls like `xai.imagine`, `cf.video`, `xai.tts`, `ele
17
17
 
18
18
  ## Rule 2: Use URL assets selectively
19
19
 
20
- When the user gives a product, company, ecommerce, landing page, or app URL and you have browser/screenshot capability, you can visit the page and capture useful visual evidence. Favor above-fold screenshots, product views, app screenshots, pricing/offer cards, testimonials, and detectable logos or brand marks.
21
-
22
- Do not use full-page or very long website screenshots as video backgrounds; their text is usually illegible at output size. Crop or frame screenshots to the specific visual proof point, and use them sparingly.
23
-
24
- Website screenshots are optional source material, not a requirement to build the whole video from screenshots. You may combine them with still generation, text-to-video, image-to-video, reference-to-video, or extension plugins for lifestyle scenes, motion backgrounds, transitions, or product context. Do not invent claims; use website copy or ask the user.
20
+ A product or landing-page URL is optional source material. Capture focused, legible pieces (above-the-fold views, product shots, logos), never full-page screenshots as backgrounds, and don't invent claims. The full URL workflow is in `workflow.md`.
25
21
 
26
22
  ## Rule 2.5: Probe real asset type and dimensions before placement
27
23
 
@@ -37,6 +33,8 @@ identify asset.webp
37
33
  Use real video files for motion footage and still image inputs for screenshots, logos, product photos, and brand marks. The `video` primitive accepts both videos and images; image inputs render as static clips for the block duration.
38
34
 
39
35
  ```vidscript
36
+ import motion from "@scenerok/basic-animations"
37
+
40
38
  input screenshot = "assets/screenshots/homepage.png"
41
39
  [0s .. 4s] = video screenshot, width: 1080, height: 1920, x: 0, y: 0, animate: motion.fadeIn(0.35s)
42
40
  ```
@@ -53,6 +51,7 @@ Add entry motion to real assets, not only text. When a static visual needs a cle
53
51
  ```vidscript
54
52
  import motion from "@scenerok/basic-animations"
55
53
 
54
+ input product = "assets/product.png"
56
55
  [0s .. 3.4s] = video product, width: 760, height: 615, x: 160, y: 300, animate: [motion.riseIn(0.6s, 70), motion.float(2.4s, 8)]
57
56
  [3.4s .. 4s] = video product, width: 760, height: 615, x: 160, y: 300, animate: motion.fadeOut(0.6s)
58
57
  ```
@@ -64,8 +63,10 @@ AI-generated images and videos must not contain readable text. In every prompt f
64
63
  Good prompt pattern:
65
64
 
66
65
  ```vidscript
66
+ import xai from "@scenerok/xai"
67
+
67
68
  [-] = video xai.imagine("Clean cinematic product background, premium lighting, no text, no words, no letters, no captions, no logos, no watermark, no readable UI copy", aspect_ratio: "9:16", duration: 5)
68
- [0.5s .. 3s] = text "Launch offer", style: title, color: "#FFFFFF", x: "50%", y: "30%", stroke: "#000000", stroke_width: 3
69
+ [0.5s .. 3s] = text "Launch offer", style: title, color: "#FFFFFF", area: "title", stroke: "#000000", stroke_width: 3
69
70
  ```
70
71
 
71
72
  Invalid: asking the generator for signs, labels, packaging text, app UI text, title cards, lower thirds, prices, CTA buttons, or any readable copy.
@@ -101,13 +102,9 @@ Do not overuse one plugin function. Choose deliberately:
101
102
  | Voiceover | `xai.tts`, `xai.textToSpeech` |
102
103
  | Music bed | `eleven.music`, `eleven.generateMusic`, `eleven.composeMusic` |
103
104
 
104
- Use `imageToVideo` for one extracted screenshot/product/logo image. Use `referenceToVideo` for 1-7 reference images when extracted objects should guide the generated shot. xAI `referenceToVideo` requires a prompt and duration must be <= 10s.
105
+ Use `imageToVideo` for one extracted screenshot/product/logo image and `referenceToVideo` for 1–7 reference images (xAI: prompt required, duration ≤ 10s). Cloudflare calls take an explicit `model:` and `aspect_ratio:`; models, signatures, and durations are in `ai-models.md` and the plugin table in `vidscript-guide.md`.
105
106
 
106
- For Cloudflare calls, always prefer explicit `model:` and use `aspect_ratio: "9:16"` for vertical, `"16:9"` for wide, `"1:1"` for square, or model-supported values such as `"4:3"`, `"3:4"`, and `"21:9"`. `cf.imageToVideo(image, prompt, model: ..., aspect_ratio: ..., duration: ...)` accepts `aspect_ratio`; for Runway Gen-4.5, SceneRok translates `"9:16"` to Cloudflare's required `ratio: "720:1280"`. Useful models include `pixverse/v6`, `vidu/q3-turbo`, `runwayml/gen-4.5`, `minimax/hailuo-2.3`, `bytedance/seedance-2.0`, `google/veo-3.1`, `google/veo-3.1-fast`, `google/veo-3-fast`, `black-forest-labs/flux-2-pro-preview`, and `openai/gpt-image-2`. Veo models accept `duration: 4`, `duration: 4s`, or `duration: "4s"` — all forms snap to the supported 4s/6s/8s durations.
107
-
108
- xAI TTS voices are only `eve`, `ara`, `rex`, `sal`, and `leo`.
109
-
110
- For ElevenLabs music, import `@elevenlabs/music` and use `eleven.music(...)`, `eleven.generateMusic(...)`, or `eleven.composeMusic(...)`. Do not call `eleven.tts(...)`; ElevenLabs TTS is not registered in VidScript today. Ads, promos, tutorials, and reels should normally include either `xai.tts` voiceover, an ElevenLabs music bed, or both unless the user asks for silent output.
107
+ xAI TTS voices are only `eve`, `ara`, `rex`, `sal`, and `leo`. ElevenLabs is music only (`eleven.music`, `eleven.generateMusic`, `eleven.composeMusic`); there is no `eleven.tts`. Ads, promos, tutorials, and reels should normally have a voiceover, a music bed, or both unless the user asks for silence.
111
108
 
112
109
  ## Rule 4.5: `[-]` uses separate audio and visual playheads
113
110
 
@@ -129,16 +126,20 @@ Use explicit ranges when you need exact synchronization, overlaps, or cuts. Do n
129
126
 
130
127
  ## Rule 4.6: Never guess generated-asset durations
131
128
 
132
- Invalid — the real TTS length is unknown at write time, so a guessed window clips or overlaps:
129
+ Avoid — the real TTS length is unknown at write time, so a guessed window clips or overlaps:
130
+
131
+ ```vidscript avoid
132
+ import xai from "@scenerok/xai"
133
133
 
134
- ```vidscript
135
134
  [0s .. 3s] = audio xai.tts("A sentence that may well run past three seconds", voice: "eve")
136
135
  [3s .. 6s] = audio xai.tts("This one starts while the first is still playing", voice: "eve")
137
136
  ```
138
137
 
139
- Valid — assign with `let` and reference the measured `duration` (arithmetic allowed), or use `[-]` auto blocks:
138
+ Do this — assign with `let` and reference the measured `duration` (arithmetic allowed), or use `[-]` auto blocks:
140
139
 
141
140
  ```vidscript
141
+ import xai from "@scenerok/xai"
142
+
142
143
  let vo1 = xai.tts("First line", voice: "eve")
143
144
  let vo2 = xai.tts("Second line", voice: "eve")
144
145
  [0 .. vo1.duration] = audio vo1
@@ -207,10 +208,12 @@ let bed = eleven.music("Soft premium ad music", duration: 15, instrumental: true
207
208
 
208
209
  ```vidscript
209
210
  [0s .. 15s] = filter "vignette", intensity: 0.3
210
- [0s .. 15s] = filter "saturation", value: 1.12
211
+ [0s .. 15s] = filter "saturation", amount: 1.12
211
212
  ```
212
213
 
213
- Filters are optional finishing tools, not required ingredients. Use them only when they improve the visual result. `saturation` uses `value`, not `intensity`.
214
+ Filters are optional finishing tools, not required ingredients. Use them only when they improve the visual result. Each filter has its own parameter name (`saturation` takes `amount`, `blur` takes `radius`); a wrong name is ignored without an error. The table is in `editing-actions.md` → Color and finishing.
215
+
216
+ A `filter` line grades everything in its window. To grade one clip, add `target: clip` or write `clip.Filter("sepia", intensity: 0.6)`.
214
217
 
215
218
  ## Rule 10: Always end with output
216
219
 
@@ -220,6 +223,24 @@ output to "video.mp4", resolution: "1080x1920", fps: 30
220
223
 
221
224
  Do **not** use legacy `config { }` blocks — they are not part of VidScript v2.
222
225
 
226
+ ## Rule 11: Edits are values — place the result
227
+
228
+ `Trim`, `Speed`, `Loop`, `Crop`, `Resize`, `Mask`, `Filter`, `Overlay`, and `Composite` return a new value. Place the result in one line:
229
+
230
+ ```vidscript
231
+ input hero = "hero.mp4"
232
+ input logo = "logo.png"
233
+ [0s .. 4s] = hero.Trim(2s, 6s).Crop(420, 0, 1080, 1920)
234
+ [4s .. 8s] = hero.Trim(6s, 10s).Overlay(logo.Resize(200, 200), x: 840, y: 60)
235
+ ```
236
+
237
+ - A placed value lasts its own length (trimmed range ÷ speed × loops). Make the window that long.
238
+ - Put one video over another with `Overlay`, `Composite`, or `blend:`. Two plain clips in the same window have no defined order.
239
+ - `Mask` on its own line after the clip is placed is a compile error.
240
+ - Frame counts are written `48 frame` and use the output fps (30 if `output` has none). Timecodes are `01:00:02:12@24` (`@rate` optional; non-drop-frame only). Block times snap to the output frame grid; NTSC fps (23.976, 29.97) encodes at the exact rational rate.
241
+
242
+ All editing actions (masks, speed ramps, ducking, LUTs, timecode): `editing-actions.md`.
243
+
223
244
  ## Animations (after import)
224
245
 
225
246
  ```vidscript
@@ -240,12 +261,6 @@ Each error line includes `Line N:C — message` when the server returns location
240
261
 
241
262
  ## Bundled examples
242
263
 
243
- | File | Use case |
244
- |------|----------|
245
- | `minimal-text-reel.vid` | Text-only, no API keys |
246
- | `product-launch.vid` | User video input + text + vignette |
247
- | `ecom-product-launch.vid` | xAI product visuals + CTA |
248
- | `3-tips-fitness.vid` | Multiple `[-]` blocks + xAI per segment |
249
- | `rokmilk-chocolate-promo.vid` | 15s generated-video promo pattern |
264
+ The `@scenerok/cli` npm package ships working scripts in `examples/system/`: `minimal-text-reel.vid` (text only), `product-launch.vid` (your own video + text), `ecom-product-launch.vid` (generated product visuals + CTA), `3-tips-fitness.vid` (several `[-]` blocks), `rokmilk-chocolate-promo.vid` (15 s generated promo).
250
265
 
251
- Full grammar: `vidscript-guide.md` or https://scenerok.com/.well-known/agent-skills/vidscript-guide.md
266
+ Full grammar: `vidscript-guide.md`.
@@ -3,7 +3,7 @@
3
3
  ## Pipeline
4
4
 
5
5
  1. **Understand the goal** — promo, testimonial, meme, code demo, etc.
6
- 2. **Choose authoring** — short/human → VidScript (`.vid`); complex/agent → TypeScript `@scenerok/sdk` (`.ts`, see `sdk-guide.md`)
6
+ 2. **Choose authoring** — VidScript (`.vid`) by default and for every editing action; TypeScript `@scenerok/sdk` (`.ts`, `sdk-guide.md`) only for loops or computed timing
7
7
  3. **Plan the structure** — time blocks, durations, inputs
8
8
  4. **Gather assets** — URLs, local paths, generated clips, selective website screenshots
9
9
  5. **Probe asset type and dimensions** — `loadVideo` / media stdlib, or `file` / `ffprobe` / `sips` / `identify`; never guess
@@ -13,7 +13,8 @@
13
13
  9. **Validate** — `scenerok validate script.vid` or `scenerok validate scene.ts`
14
14
  10. **Deep-validate (VidScript)** — for scripts with TTS/generated media: `scenerok validate script.vid --generate-assets --report-json` (billed; assets cache for the render). SDK plugins generate during `scenerok render` instead. Fix `offCanvas`/`wasShrunk` text, `collisions`, and unintended `audio.overlaps`, then re-validate.
15
15
  11. **Render** — `scenerok render script.vid --watch` or `scenerok render scene.ts --watch`
16
- 12. **Deliver** — share download URL when complete
16
+ 12. **Check the render** — `scenerok lint-video <render-id> --cost medium --json` (billed); fix and re-render if it reports problems. `scenerok render script.vid --validate` does render and check in one step
17
+ 13. **Deliver** — share download URL when complete
17
18
 
18
19
  ## Website URL asset workflow
19
20
 
@@ -50,11 +51,9 @@ scenerok validate scene.ts
50
51
  scenerok render script.vid --watch
51
52
  scenerok render scene.ts --watch
52
53
  scenerok status <render-id>
53
- scenerok skills install <platform> # installs router skill
54
- scenerok skills sync # download full remote skill bundle
55
- scenerok skills check [--json]
56
- scenerok skills update
57
- scenerok secrets set KEY=VALUE
54
+ scenerok skills install <platform> # installs the skill (SKILL.md + references)
55
+ scenerok skills check [--json] # is the installed copy current?
56
+ scenerok skills update # refresh it from scenerok.com
58
57
  ```
59
58
 
60
59
  ## Error handling
@@ -1,201 +0,0 @@
1
- # @scenerok/sdk — TypeScript authoring for complex scenes
2
-
3
- Use **TypeScript + `@scenerok/sdk`** when the scene needs loops, branches, arithmetic timing, or data-driven composition. Keep **VidScript** for short human-authored promos and templates.
4
-
5
- Both paths emit the same `IRTimeline`. Preview and render (Pass 2) are unchanged.
6
-
7
- ## When to choose which
8
-
9
- | Signal | Language |
10
- |--------|----------|
11
- | Short promo, human edit, template placeholders | VidScript (`.vid`) |
12
- | Loop over clips, computed `start`/`end`, agent-authored complex timeline | TypeScript + `@scenerok/sdk` (`.ts`) |
13
-
14
- ## Schedule syntax
15
-
16
- JavaScript has no `t[0, end]` dual key (comma operator collapses to one index). Use dual-index assignment:
17
-
18
- ```ts
19
- import { timeline, loadVideo, text, audio, s, fadeIn } from '@scenerok/sdk'
20
-
21
- export default async function main() {
22
- const t = timeline({ width: 1080, height: 1920, fps: 30 })
23
- const scene1 = await loadVideo('./hero.mp4')
24
-
25
- t[0][scene1.duration] = scene1.animate(fadeIn(s(0.4)))
26
- t['0s']['3s'] = text('Hello', { size: 72 })
27
- t[scene1.duration][scene1.duration + s(2)] = text('Next')
28
- t.push(audio('./bed.mp3', { duration: 7, volume: 0.4 }))
29
-
30
- return t.toIR()
31
- }
32
- ```
33
-
34
- | Form | Meaning |
35
- |------|---------|
36
- | `t[start][end] = value` | Preferred dual-index schedule |
37
- | `t.range(start, end, value)` | Explicit call (no Proxy) |
38
- | `t['-'] = value` / `t.push(value)` | Auto-append at playhead |
39
-
40
- `start` / `end` accept numbers (seconds), `s(3)` / `ms(300)`, or strings (`'3s'`, `'1:30'`). Full JS arithmetic works.
41
-
42
- No `video` / `text` keywords after `=` — factories return typed values and the runtime infers IR kind.
43
-
44
- Use `loadVideo(path)` / `loadAudio(path)` to probe duration through the media stdlib when `duration` is omitted:
45
-
46
- ```ts
47
- const clip = await loadVideo('./hero.mp4')
48
- t[0][clip.duration] = clip
49
- ```
50
-
51
- Use the sync `video(path, { duration })` / `audio(path, { duration })` factories when you already know the timing.
52
-
53
- ## Grid areas
54
-
55
- Same CSS-grid regions as VidScript. Declare a grid on the timeline, then place text with `area:`:
56
-
57
- ```ts
58
- import { timeline, text, s } from '@scenerok/sdk'
59
-
60
- export default function main() {
61
- const t = timeline({ width: 1080, height: 1920, fps: 30 })
62
-
63
- t.grid({
64
- rows: '20% 1fr 30%',
65
- cols: '1fr 1fr',
66
- areas: ['title title', 'left right', 'caption caption'],
67
- })
68
-
69
- t[0][s(3)] = text('BIG SALE', { size: 72, area: 'title' })
70
- t[0][s(3)] = text('Left column', { size: 40, area: 'left' })
71
-
72
- return t.toIR()
73
- }
74
- ```
75
-
76
- Without `t.grid(...)`, `area: 'title' | 'stage' | 'lower-third' | 'caption'` uses the built-in social-video preset (portrait vs landscape). Explicit `x` / `y` / `maxWidth` / `maxHeight` override the area.
77
-
78
- Helpers also available: `resolveGridAreas`, `defaultGridSpec`, `placeInArea`.
79
-
80
- Same semantics as VidScript `grid rows: ..., areas: [...]` — see `vidscript-guide.md` → Grid Areas.
81
-
82
- ## Transitions
83
-
84
- Same `@scenerok/transitions` package as VidScript. Schedule a transition window between abutting clips; `toIR()` binds `fromId` / `toId` automatically:
85
-
86
- ```ts
87
- import { timeline, video } from '@scenerok/sdk'
88
- import tr from '@scenerok/transitions'
89
-
90
- export default function main() {
91
- const t = timeline({ width: 1080, height: 1920, fps: 30 })
92
-
93
- t[0][5] = video('./a.mp4', { duration: 5 })
94
- t[5][5.6] = tr.dissolve()
95
- t[5.6][10] = video('./b.mp4', { duration: 4.4 })
96
-
97
- // Or auto-append with catalog default (0.6s):
98
- // t.push(tr.push({ direction: 'right' }))
99
-
100
- return t.toIR()
101
- }
102
- ```
103
-
104
- Common options: `direction`, `ease`, `strength`, `mode` (`roll` | `freeze`). Full catalog: `transitions-catalog.md`.
105
-
106
- ## Entry contract
107
-
108
- Export `default async function main()` (or sync `main`) that returns either:
109
-
110
- - `t.toIR()`, or
111
- - an `IRTimeline` object
112
-
113
- `async main` is supported so you can `await loadVideo(...)`, `await getVideoLength(...)`, or `await grabFrame(...)`.
114
-
115
- ## Validate / render
116
-
117
- ```bash
118
- scenerok validate scene.ts
119
- scenerok render scene.ts --watch
120
- ```
121
-
122
- You can also **include** an SDK scene from VidScript:
123
-
124
- ```vidscript
125
- import intro from "./intro.ts"
126
- use intro at 0s .. 0s with {}
127
- output to "reel.mp4"
128
- ```
129
-
130
- See `vidscript-guide.md` → Include TypeScript / JavaScript scenes.
131
-
132
- MCP:
133
-
134
- - `scenerok_validate_vidscript` with `language: "typescript"`
135
- - `scenerok_render_video` with `language: "typescript"`
136
- - `scenerok_get_sdk_guide` for this document
137
-
138
- ## AI plugins (xAI / Cloudflare / ElevenLabs)
139
-
140
- Same packages as VidScript. Import them in TypeScript; the SceneRok compile host runs the real plugins and returns SDK `video` / `audio` nodes:
141
-
142
- ```ts
143
- import { timeline } from '@scenerok/sdk'
144
- import xai from '@scenerok/xai'
145
- import cf from '@scenerok/cloudflare'
146
- import eleven from '@elevenlabs/music'
147
-
148
- export default async function main() {
149
- const t = timeline({ width: 1080, height: 1920, fps: 30 })
150
- const clip = await xai.genVideo('Cinematic drone over mountains', {
151
- duration: 5,
152
- aspect_ratio: '9:16',
153
- resolution: '720p',
154
- })
155
- const still = await cf.image('Product on seamless backdrop', { aspect_ratio: '9:16' })
156
- const vo = await xai.tts('Welcome to SceneRok', { voice: 'eve' })
157
- const bed = await eleven.music('Warm lo-fi bed', { duration: 12 })
158
-
159
- t[0][clip.duration] = clip
160
- t[clip.duration][clip.duration + still.duration] = still
161
- t.push(vo)
162
- t.push(bed)
163
- return t.toIR()
164
- }
165
- ```
166
-
167
- | Package | Import | Key functions |
168
- |---------|--------|---------------|
169
- | `@scenerok/xai` | `import xai from '@scenerok/xai'` | `imagine`, `genVideo`, `image`, `imageToVideo`, `referenceToVideo`, `extendVideo`, `tts`, `listVoices` |
170
- | `@scenerok/cloudflare` | `import cf from '@scenerok/cloudflare'` | `video` / `imagine`, `image`, `imageToVideo`, `extendVideo`, `listModels` |
171
- | `@elevenlabs/music` | `import eleven from '@elevenlabs/music'` | `music`, `generateMusic`, `composeMusic` |
172
-
173
- Requires the same env secrets as VidScript (`XAI_API_KEY`, `ELEVENLABS_API_KEY`, Cloudflare AI Gateway credentials). Generation is billed on render the same way as VidScript plugins.
174
-
175
- ## MVP limits
176
-
177
- - Prefer `getVideoLength(path)` from `@scenerok/stdlib` instead of hard-coding `duration:` when assets exist on disk
178
- - `--generate-assets` remains VidScript-only (SDK scripts generate assets during `scenerok render` when plugins are called)
179
-
180
- ## Media stdlib
181
-
182
- ```ts
183
- import { loadVideo, getVideoLength, grabFrame, beats } from '@scenerok/sdk'
184
-
185
- export default async function main() {
186
- const clip = await loadVideo('./hero.mp4')
187
- const d = await getVideoLength('./hero.mp4')
188
- const thumb = await grabFrame('./hero.mp4', d / 2)
189
- // ...
190
- }
191
- ```
192
-
193
- Same functions are available in VidScript via `import media from "@scenerok/media"`.
194
-
195
- See `skills/remote/media-stdlib.md` and `ai-models.md` / `tts.md` / `music.md` for prompt guidance.
196
-
197
- ## Related
198
-
199
- - VidScript grammar: `vidscript-guide.md`
200
- - Intent routing: `intent-router.md`
201
- - Package README: `packages/scenerok-sdk/README.md`
@@ -1,28 +0,0 @@
1
- # VidScript v2 Sample — Product promo with generated video
2
-
3
- Copy this shape for promos that use xAI-generated clips. Run `scenerok validate` before `scenerok render`.
4
-
5
- ```vidscript
6
- import xai from "@scenerok/xai"
7
- import motion from "@scenerok/basic-animations"
8
-
9
- input product_name = "{{product_name | RokMilk}}"
10
- input hook_text = "{{hook_text | Chocolate Milkshake}}"
11
- input cta_text = "{{cta_text | visit your nearest grocery store}}"
12
-
13
- [0s .. 2.5s] = text product_name, font: "Bebas Neue", size: 80, color: "#FFD700", x: "50%", y: "20%", align: center, stroke: "#3E1C00", stroke_width: 4, animate: motion.fadeIn(0.6s)
14
-
15
- [2s .. 4.5s] = text hook_text, font: "Outfit", size: 52, color: "#FFFFFF", x: "50%", y: "45%", align: center, stroke: "#3E1C00", stroke_width: 3, animate: motion.riseIn(0.8s)
16
-
17
- [-] = video xai.imagine(
18
- "Premium lifestyle product shot of " + product_name + " chocolate milk in 250ml carton, cinematic lighting, 9:16 vertical, no text, no words, no letters, no captions, no logos, no watermark, no readable UI copy",
19
- aspect_ratio: "9:16",
20
- duration: 6
21
- )
22
-
23
- [8s .. 11s] = text cta_text, font: "Bebas Neue", size: 48, color: "#FFD700", x: "50%", y: "80%", align: center, stroke: "#3E1C00", stroke_width: 4, animate: motion.fadeIn(0.8s)
24
-
25
- output to "product-promo.mp4", resolution: "1080x1920", fps: 30
26
- ```
27
-
28
- For clips you already have (no xAI), start from `examples/system/product-launch.vid` instead.
@@ -1,157 +0,0 @@
1
- ---
2
- name: scenerok
3
- description: >-
4
- Compose VidScript v2 or TypeScript @scenerok/sdk and render videos with SceneRok —
5
- CLI, web editor, ChatGPT, or MCP. Use for promos, reels, motion graphics, code demos,
6
- social cards, and any request mentioning VidScript, SceneRok, or scenerok.
7
- triggers:
8
- - create a video
9
- - make a reel
10
- - generate a promo
11
- - VidScript
12
- - @scenerok/sdk
13
- - scenerok render
14
- - scenerok validate
15
- - social video
16
- - product launch video
17
- - SceneRok editor
18
- ---
19
-
20
- # SceneRok Agent Skill
21
-
22
- You help users compose **VidScript v2** or **TypeScript `@scenerok/sdk`** and produce MP4s with SceneRok. Skill content is **live at scenerok.com** — fetch it rather than relying on stale copies.
23
-
24
- ## Dual authoring
25
-
26
- | Who / scene | Write |
27
- |-------------|--------|
28
- | Humans / short promos / templates | **VidScript** (`.vid`) |
29
- | Agents / complex, data-driven timelines | **TypeScript + `@scenerok/sdk`** (`.ts`) |
30
-
31
- Both emit the same `IRTimeline`. Load **`sdk-guide.md`** before writing SDK scenes.
32
-
33
- ## 1. Know your environment
34
-
35
- Load **`environments.md`** and follow its capability matrix.
36
-
37
- | You are… | Do this |
38
- | --- | --- |
39
- | In the **SceneRok web editor** | Use `patch_vidscript`; validate/render in-app — VidScript today (SDK via CLI/MCP) |
40
- | On the **user's machine** with `scenerok` | `scenerok validate` → `scenerok render` (`.vid` or `.ts`) |
41
- | A **ChatGPT GPT** with SceneRok Actions | OAuth + `validateVidscript` → `renderVideo`; import uploads first |
42
- | **Gemini / Grok** without HTTP tools | Compose VidScript or SDK TS; user renders elsewhere |
43
- | **MCP host** with `scenerok-mcp` | Use MCP compose/render tools (`language: typescript` for SDK) |
44
-
45
- ## 2. Load remote docs (required before composing)
46
-
47
- 1. `https://scenerok.com/.well-known/agent-skills/index.json` — catalog
48
- 2. **Always:** `vidscript-strict.md`, `intent-router.md`, `environments.md`
49
- 3. **Complex / agent TS scenes:** also load `sdk-guide.md`
50
- 4. **Media probe / frame grab / loadVideo:** `media-stdlib.md`
51
- 5. **By intent** (see `intent-router.md`):
52
-
53
- | Intent | Load |
54
- | --- | --- |
55
- | Any VidScript composition | `vidscript-strict.md` |
56
- | Complex TS / loops / computed timing / grid in TS | `sdk-guide.md` |
57
- | AI generation (xAI / CF / ElevenLabs) — VidScript or TS | `ai-models.md` / `tts.md` / `music.md` (+ `sdk-guide.md` if TS) |
58
- | Workflow routing | `intent-router.md` |
59
- | HyperFrames / code / lower-thirds / social cards | `animations-picker.md` (+ `animations-catalog.md` if you need every param) |
60
- | Text animations (word reveals, scramble, kinetic type, gradient, quotes, stats, glitch, neon) | `animations-picker.md` text-anim rows (`animations.text_*`) |
61
- | Custom / bring-your-own animation — write HTML+CSS with GSAP, Three.js, or any seekable JS lib | `animations-catalog.md` → "Custom HTML" (`animations.custom_html`; author contract + template inside) |
62
- | Scene cuts / whip / dissolve | `transitions-catalog.md` |
63
- | Kinetic titles (motion primitives on `text`) | `text-styles.md` |
64
- | AI b-roll / product visuals | `ai-models.md` |
65
- | Voiceover | `tts.md` |
66
- | Music bed | `music.md` |
67
- | VFX on one clip | `shaders-filters.md` |
68
- | Full promo / URL assets | `workflow.md`, `brand-setup.md` |
69
- | Grammar deep-dive | `vidscript-guide.md` |
70
- | ChatGPT setup | `consumer-chat-apps.md`, `chatgpt-gpt-instructions.md` |
71
-
72
- Base: `https://scenerok.com/.well-known/agent-skills/{filename}`
73
-
74
- **Offline:** `scenerok skills sync` · **Freshness:** `scenerok skills check` · **Update:** `scenerok skills update`
75
-
76
- Browse previews: https://scenerok.com/catalog
77
-
78
- ## 3. Compose pipeline (summary)
79
-
80
- 1. Classify intent → `intent-router.md`
81
- 2. Choose authoring: simple → VidScript; complex/agent → `@scenerok/sdk` (`sdk-guide.md`)
82
- 3. Pick animation / transition / text / AI modality from the right catalog — **reuse-first**, do not invent syntax
83
- 4. If branded promo and colors/logo unknown → `brand-setup.md` (one short question max)
84
- 5. Probe asset dimensions before placement (`media-stdlib.md` / `loadVideo` / CLI `ffprobe`)
85
- 6. `scenerok validate script.vid` or `scenerok validate scene.ts` (or editor / ChatGPT equivalent)
86
- 7. Before rendering VidScript with TTS or generated media: `scenerok validate script.vid --generate-assets --report-json` — runs the real compile (billed, assets cached for the render), then read the inspection report: fix `offCanvas`/`wasShrunk` text, element `collisions`, and unintended `audio.overlaps` (voiceover-on-voiceover; music beds are fine). Patch and re-validate until clean. (SDK: plugins generate during `scenerok render`; `--generate-assets` is VidScript-only.)
87
- 8. Render and deliver download URL
88
- 9. After rendering, verify the actual MP4: `scenerok lint-video <render-id> --cost medium --json`. Fix reported issues and repeat: **write → validate → render → lint-video → fix**.
89
-
90
- **Never guess asset durations.** VidScript: `let vo = xai.tts(...)` + `vo.duration`. SDK: `await loadVideo(path)` / `await xai.tts(...)` and use `.duration` on the returned node.
91
-
92
- **Never guess text coordinates.** VidScript: `area: "title"` (+ optional `grid ...`). SDK: `t.grid({...})` then `text(..., { area: 'title' })`.
93
-
94
- ## 4. Packages (import before use)
95
-
96
- | Surface | Packages |
97
- | --- | --- |
98
- | VidScript | `@scenerok/xai`, `@scenerok/cloudflare`, `@elevenlabs/music`, `@scenerok/media`, `@scenerok/basic-animations`, `@scenerok/animations`, `@scenerok/transitions` |
99
- | SDK core | `import { timeline, video, loadVideo, text, audio, s, fadeIn } from '@scenerok/sdk'` |
100
- | SDK AI | `import xai from '@scenerok/xai'` · `import cf from '@scenerok/cloudflare'` · `import eleven from '@elevenlabs/music'` |
101
- | SDK transitions | `import tr from '@scenerok/transitions'` — same catalog as VidScript (`tr.dissolve()`, `tr.push({ direction: 'right' })`, …) |
102
- | SDK stdlib | `import { getVideoLength, grabFrame, beats } from '@scenerok/stdlib'` (also re-exported from `@scenerok/sdk`) |
103
-
104
- ## 5. CLI quick reference (desktop only)
105
-
106
- ```bash
107
- scenerok auth login
108
- scenerok validate script.vid
109
- scenerok validate scene.ts
110
- scenerok validate script.vid --render --cost medium
111
- scenerok render script.vid --watch
112
- scenerok render scene.ts --watch
113
- scenerok lint-video 42 --cost low --json
114
- scenerok skills install cursor --sync
115
- ```
116
-
117
- ## 6. Minimal VidScript
118
-
119
- ```vidscript
120
- import motion from "@scenerok/basic-animations"
121
-
122
- input hero = "https://cdn.example.com/clip.mp4"
123
- [-] = hero
124
- [- 3s] = text "Hello", style: title, color: "#FFF", area: "title", animate: motion.fadeIn(0.8s)
125
- output to "video.mp4", resolution: "1080x1920", fps: 30
126
- ```
127
-
128
- ## 7. Minimal SDK (TypeScript)
129
-
130
- ```ts
131
- import { timeline, text, s, fadeIn } from '@scenerok/sdk'
132
-
133
- export default function main() {
134
- const t = timeline({ width: 1080, height: 1920, fps: 30 })
135
- t.grid({
136
- rows: '16% 1fr 18% 10%',
137
- areas: ['title', 'stage', 'lower-third', 'caption'],
138
- })
139
- t[0][s(3)] = text('SceneRok', { size: 72, area: 'title' }).animate(fadeIn(s(0.4)))
140
- t[3][5] = text('Text to video', { size: 40, area: 'lower-third' })
141
- return t.toIR()
142
- }
143
- ```
144
-
145
- For AI generation, stdlib probing, and dual-index scheduling, load **`sdk-guide.md`**.
146
-
147
- ## Platform engineering
148
-
149
- For parser/render/API work (not video composition), load **`scenerok-development`** from `.agents/skills/scenerok-development/` in the SceneRok repo.
150
-
151
- ## Reference
152
-
153
- - Grammar: https://scenerok.com/.well-known/agent-skills/vidscript-guide.md
154
- - SDK: https://scenerok.com/.well-known/agent-skills/sdk-guide.md
155
- - Media stdlib: https://scenerok.com/.well-known/agent-skills/media-stdlib.md
156
- - Full docs: https://scenerok.com/llms-full.txt
157
- - Manifest: https://scenerok.com/.well-known/agent-skills/manifest.json