@scenerok/cli 1.0.4 → 1.0.5

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 (57) hide show
  1. package/dist/commands/skills.d.ts.map +1 -1
  2. package/dist/commands/skills.js +42 -1
  3. package/dist/commands/validate.d.ts.map +1 -1
  4. package/dist/commands/validate.js +26 -4
  5. package/dist/lib/api.d.ts +2 -0
  6. package/dist/lib/api.d.ts.map +1 -1
  7. package/examples/system/3-tips-fitness.vid +45 -0
  8. package/examples/system/ecom-product-launch.vid +31 -0
  9. package/examples/system/glitch-title.vid +17 -0
  10. package/examples/system/meme-remix.vid +15 -0
  11. package/examples/system/minimal-text-reel.vid +11 -0
  12. package/examples/system/product-launch.vid +18 -0
  13. package/examples/system/rokmilk-chocolate-promo.vid +24 -0
  14. package/examples/system/testimonial-cut.vid +16 -0
  15. package/examples/system/ugc-testimonial-voiceover.vid +33 -0
  16. package/examples/system/voice-visual-promo.vid +21 -0
  17. package/package.json +2 -1
  18. package/skills/aider/SKILL.md +18 -8
  19. package/skills/aider/vidscript-guide.md +29 -9
  20. package/skills/aider/vidscript-sample.md +22 -14
  21. package/skills/aider/vidscript-strict.md +95 -0
  22. package/skills/claude/SKILL.md +18 -8
  23. package/skills/claude/vidscript-guide.md +26 -7
  24. package/skills/claude/vidscript-sample.md +22 -14
  25. package/skills/claude/vidscript-strict.md +95 -0
  26. package/skills/codex/SKILL.md +18 -8
  27. package/skills/codex/vidscript-guide.md +29 -9
  28. package/skills/codex/vidscript-sample.md +22 -14
  29. package/skills/codex/vidscript-strict.md +95 -0
  30. package/skills/cursor/SKILL.md +18 -8
  31. package/skills/cursor/vidscript-guide.md +29 -9
  32. package/skills/cursor/vidscript-sample.md +22 -14
  33. package/skills/cursor/vidscript-strict.md +95 -0
  34. package/skills/opencode/SKILL.md +18 -8
  35. package/skills/opencode/vidscript-guide.md +29 -9
  36. package/skills/opencode/vidscript-sample.md +22 -14
  37. package/skills/opencode/vidscript-strict.md +95 -0
  38. package/skills/skills/aider/SKILL.md +190 -0
  39. package/skills/skills/aider/vidscript-guide.md +375 -0
  40. package/skills/skills/aider/vidscript-sample.md +29 -0
  41. package/skills/skills/aider/vidscript-strict.md +95 -0
  42. package/skills/skills/claude/SKILL.md +190 -0
  43. package/skills/skills/claude/vidscript-guide.md +375 -0
  44. package/skills/skills/claude/vidscript-sample.md +29 -0
  45. package/skills/skills/claude/vidscript-strict.md +95 -0
  46. package/skills/skills/codex/SKILL.md +190 -0
  47. package/skills/skills/codex/vidscript-guide.md +375 -0
  48. package/skills/skills/codex/vidscript-sample.md +29 -0
  49. package/skills/skills/codex/vidscript-strict.md +95 -0
  50. package/skills/skills/cursor/SKILL.md +190 -0
  51. package/skills/skills/cursor/vidscript-guide.md +375 -0
  52. package/skills/skills/cursor/vidscript-sample.md +29 -0
  53. package/skills/skills/cursor/vidscript-strict.md +95 -0
  54. package/skills/skills/opencode/SKILL.md +190 -0
  55. package/skills/skills/opencode/vidscript-guide.md +375 -0
  56. package/skills/skills/opencode/vidscript-sample.md +29 -0
  57. package/skills/skills/opencode/vidscript-strict.md +95 -0
@@ -0,0 +1,95 @@
1
+ # VidScript v2 — Strict Agent Reference
2
+
3
+ Follow these rules exactly. When in doubt, copy a file from `examples/system/` (installed with `scenerok skills install`).
4
+
5
+ ## Rule 1: Plugin imports are mandatory
6
+
7
+ ```vidscript
8
+ import xai from "@scenerok/xai"
9
+ ```
10
+
11
+ Without this line, `xai.imagine`, `xai.tts`, and animation helpers like `fadeIn` fail validation.
12
+
13
+ **Never** call `video xai.imagine(...)` or `animate: fadeIn(...)` without the import above.
14
+
15
+ ## Rule 2: Put plugin calls directly in time blocks
16
+
17
+ ```vidscript
18
+ [-] = video xai.imagine("Prompt here", aspect_ratio: "9:16", duration: 5)
19
+ [-] = audio xai.tts("Voiceover line", voice: "eve")
20
+ ```
21
+
22
+ **Never** assign plugins to variables: `let clip = xai.imagine(...)` is invalid.
23
+
24
+ ## Rule 3: Time ranges use `..`
25
+
26
+ ```vidscript
27
+ [0s .. 5s] = text "Hello"
28
+ ```
29
+
30
+ Not `[0s - 5s]`.
31
+
32
+ ## Rule 4: Text params stay on one line
33
+
34
+ ```vidscript
35
+ [0.5s .. 3s] = text "Headline", font: "Inter", size: 64, color: "#FFFFFF", x: "50%", y: "30%", align: center
36
+ ```
37
+
38
+ ## Rule 5: Quote safety in prompts
39
+
40
+ Use only straight `"` inside `xai.imagine("...")`. Do not nest quotes inside the prompt string (e.g. avoid `"RokMilk"` inside the prompt — say `labeled RokMilk` without extra quotes).
41
+
42
+ ## Rule 6: Audio syntax
43
+
44
+ ```vidscript
45
+ [-] = audio xai.tts("Spoken line", voice: "eve", speed: 1.0)
46
+ ```
47
+
48
+ **Invalid:** `audio music("...", duration: 15), volume: 0.35` — trailing `, volume` after a plugin call is a parse error.
49
+
50
+ Music/generative audio plugins require their own `import` when available; do not invent bare `music(...)` calls.
51
+
52
+ ## Rule 7: Filters
53
+
54
+ ```vidscript
55
+ [0s .. 15s] = filter "vignette", intensity: 0.3
56
+ [0s .. 15s] = filter "saturation", value: 1.12
57
+ ```
58
+
59
+ `saturation` uses `value`, not `intensity`.
60
+
61
+ ## Rule 8: Always end with output
62
+
63
+ ```vidscript
64
+ output to "video.mp4", resolution: "1080x1920", fps: 30
65
+ ```
66
+
67
+ Do **not** use legacy `config { }` blocks — they are not part of VidScript v2.
68
+
69
+ ## Animations (after import)
70
+
71
+ ```vidscript
72
+ [0s .. 2s] = text "Launch", x: "50%", y: "50%", animate: popIn(0.7s)
73
+ ```
74
+
75
+ Available: `fadeIn`, `fadeOut`, `slideX`, `slideY`, `popIn`, `riseIn`, `swingIn`, `glitchIn`, `float`, `typewriter`.
76
+
77
+ ## Validate before render
78
+
79
+ ```bash
80
+ scenerok validate my-video.vid
81
+ ```
82
+
83
+ Each error line includes `Line N:C — message` when the server returns location info.
84
+
85
+ ## Bundled examples
86
+
87
+ | File | Use case |
88
+ |------|----------|
89
+ | `minimal-text-reel.vid` | Text-only, no API keys |
90
+ | `product-launch.vid` | User video input + text + vignette |
91
+ | `ecom-product-launch.vid` | xAI product visuals + CTA |
92
+ | `3-tips-fitness.vid` | Multiple `[-]` blocks + xAI per segment |
93
+ | `rokmilk-chocolate-promo.vid` | 15s generated-video promo pattern |
94
+
95
+ Full grammar: https://scenerok.com/docs/vidscript
@@ -86,18 +86,20 @@ import music from "@elevenlabs/music" # generative music
86
86
  use intro at [-] with { clip: main, headline: "Welcome" }
87
87
  ```
88
88
 
89
- ### Plugin Calls
89
+ ### Plugin Calls (required import)
90
90
 
91
91
  ```vidscript
92
- import eleven from "/tts"
92
+ import xai from "@scenerok/xai"
93
93
 
94
- [-] = audio eleven.tts("Welcome to SceneRok", voice: "Rachel")
95
- [-] = video xai.imagine("Cinematic product shot", aspect_ratio: "9:16")
96
- [-] = audio music("upbeat launch soundtrack", duration: 12, instrumental: true)
97
- [-] = audio xai.tts("Next line", voice: "eve")
94
+ [-] = video xai.imagine("Cinematic product shot", aspect_ratio: "9:16", duration: 5)
95
+ [-] = audio xai.tts("Welcome to SceneRok", voice: "eve")
98
96
  ```
99
97
 
100
- Package-style plugin calls are supported inside time blocks. Use `video ...` for generated visual clips and `audio ...` for generated speech, music, and other generated audio.
98
+ **Always** add `import xai from "@scenerok/xai"` before any `xai.imagine` / `xai.tts` call or `animate: fadeIn(...)` helper. Calls without import fail validation with `Unknown function 'xai.imagine'`.
99
+
100
+ Put plugin calls **directly** in time blocks — never `let clip = xai.imagine(...)`.
101
+
102
+ Read `vidscript-strict.md` for anti-patterns and `examples/system/*.vid` for copy-paste templates (installed with `scenerok skills install`).
101
103
 
102
104
  ### Placeholders
103
105
 
@@ -165,7 +167,15 @@ Always ask clarifying questions about:
165
167
  - Desired duration and style
166
168
  - Whether they want to start from a template or from scratch
167
169
 
170
+ ## Reference files (in this skill folder)
171
+
172
+ | File | Purpose |
173
+ |------|---------|
174
+ | `vidscript-guide.md` | Full grammar reference |
175
+ | `vidscript-strict.md` | **Read first** — rules that prevent common agent mistakes |
176
+ | `vidscript-sample.md` | Minimal promo with xAI import |
177
+ | `examples/system/*.vid` | Official SceneRok templates (text-only, product launch, xAI reels) |
178
+
168
179
  ## Full Reference
169
180
 
170
- For exhaustive grammar documentation, visit:
171
181
  https://scenerok.com/docs/vidscript
@@ -2,6 +2,22 @@
2
2
 
3
3
  VidScript is a declarative DSL for composing short-form videos. Write a script, render an MP4.
4
4
 
5
+ ## Agent quick start (read before composing)
6
+
7
+ 1. **Import plugins** — `import xai from "@scenerok/xai"` before `xai.imagine`, `xai.tts`, or `animate: fadeIn(...)`.
8
+ 2. **Validate early** — `scenerok validate file.vid` (errors show as `Line N:C — message`).
9
+ 3. **Copy working examples** — see `examples/system/` in this skill folder (e.g. `minimal-text-reel.vid`, `ecom-product-launch.vid`, `rokmilk-chocolate-promo.vid`).
10
+ 4. **Strict rules** — see `vidscript-strict.md` for invalid patterns (bare `xai.imagine`, `audio music(...), volume:`, nested quotes in prompts).
11
+
12
+ ### Common validation failures
13
+
14
+ | Symptom | Fix |
15
+ |---------|-----|
16
+ | `Unknown function 'xai.imagine'` | Add `import xai from "@scenerok/xai"` at top |
17
+ | `Unknown function 'fadeIn'` | Same import (animation helpers are plugin-backed) |
18
+ | `Expected ... but "," found` | Do not put `, volume:` after a plugin call on the same line |
19
+ | Parse error on imagine prompt | Remove nested `"` quotes inside the prompt string |
20
+
5
21
  ## Program Structure
6
22
 
7
23
  A VidScript program is a sequence of statements separated by newlines.
@@ -218,21 +234,24 @@ Audio sources can be MP3 inputs, audio plugin results, or the embedded audio str
218
234
  | `fade_in` | number | Fade-in duration (seconds) |
219
235
  | `fade_out` | number | Fade-out duration (seconds) |
220
236
 
221
- ### Plugin Calls (explicit default import — the only supported form)
237
+ ### Plugin Calls
222
238
 
223
239
  ```vidscript
224
240
  import xai from "@scenerok/xai"
225
- import eleven from "@elevenlabs/tts" # example future scoped package
226
241
 
227
- [-] = video xai.imagine("Cinematic product shot", aspect_ratio: "9:16")
242
+ [-] = video xai.imagine("Cinematic product shot", aspect_ratio: "9:16", duration: 5)
228
243
  [-] = audio xai.tts("Welcome to SceneRok", voice: "eve")
229
- [-] = audio eleven.tts("Hello", voice: "Rachel")
230
- [-] = audio music("upbeat launch soundtrack", duration: 12, instrumental: true)
231
244
  ```
232
245
 
233
- **Rule:** Always start with `import name from "@scope/pkg"`. No more bare globals or named imports. This is the single obvious syntax for both humans and LLMs.
246
+ Plugins require an explicit default import. The server registers `@scenerok/xai` when API keys are configured. Plugin calls run at compile time and must appear **inside time blocks**, not in `let` assignments.
234
247
 
235
- Plugins are npm packages that add new function names. The built-in server registration includes xAI media/TTS (via `@scenerok/xai`) and others when keys are configured. They run at compile time.
248
+ **Invalid (will not validate):**
249
+
250
+ ```vidscript
251
+ [-] = video xai.imagine("...") # missing import
252
+ [-] = audio music("..."), volume: 0.5 # trailing params after plugin call
253
+ let clip = xai.imagine("...") # plugin assigned to variable
254
+ ```
236
255
 
237
256
  ## Animations, Effects & Plugins (v2 Extensibility)
238
257
 
@@ -1,21 +1,29 @@
1
- # VidScript v2 Sample — Product Launch Promo
2
- # A 6-second vertical video for TikTok / Instagram Reels
3
- # Demonstrates dynamic timeblocks, video shorthand, named args, expressions, and filters
1
+ # VidScript v2 Sample — Product promo with generated video
4
2
 
5
- input hero = "{{hero_clip}}"
3
+ Copy this shape for promos that use xAI-generated clips. Run `scenerok validate` before `scenerok render`.
6
4
 
7
- # Auto-append: cursor starts at 0, each [-] advances automatically
8
- [-] = video hero
9
- hero.Trim(start: 0s, end: 6s)
5
+ ```vidscript
6
+ import xai from "@scenerok/xai"
10
7
 
11
- # Text overlays with comma-separated named params
12
- [0.3s .. 2.3s] = text "NEW DROP", style: title, position: top, color: "#FFFFFF", size: 64, stroke: "#000000", stroke_width: 3
8
+ input product_name = "{{product_name | RokMilk}}"
9
+ input hook_text = "{{hook_text | Chocolate Milkshake}}"
10
+ input cta_text = "{{cta_text | visit your nearest grocery store}}"
13
11
 
14
- [2.5s .. 4.5s] = text "The most anticipated release of the season", style: caption, position: center, color: "#F3F4F6", size: 36, stroke: "#000000", stroke_width: 2
12
+ [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: fadeIn(0.6s)
15
13
 
16
- [4.5s .. 5.8s] = text "SHOP NOW", style: title, position: bottom, color: "#F59E0B", size: 52, stroke: "#000000", stroke_width: 3
14
+ [2s .. 4.5s] = text hook_text, font: "Outfit", size: 52, color: "#FFFFFF", x: "50%", y: "45%", align: center, stroke: "#3E1C00", stroke_width: 3, animate: riseIn(0.8s)
17
15
 
18
- # Filter applied from start to end of the clip
19
- [0s .. 6s] = filter "vignette", intensity: 0.35
16
+ [-] = video xai.imagine(
17
+ "Premium lifestyle product shot of " + product_name + " chocolate milk in 250ml carton, cinematic lighting, 9:16 vertical",
18
+ aspect_ratio: "9:16",
19
+ duration: 6
20
+ )
20
21
 
21
- output to "product-launch.mp4", resolution: "1080x1920", fps: 30
22
+ [8s .. 11s] = text cta_text, font: "Bebas Neue", size: 48, color: "#FFD700", x: "50%", y: "80%", align: center, stroke: "#3E1C00", stroke_width: 4, animate: fadeIn(0.8s)
23
+
24
+ [0s .. 12s] = filter "vignette", intensity: 0.3
25
+
26
+ output to "product-promo.mp4", resolution: "1080x1920", fps: 30
27
+ ```
28
+
29
+ For clips you already have (no xAI), start from `examples/system/product-launch.vid` instead.
@@ -0,0 +1,95 @@
1
+ # VidScript v2 — Strict Agent Reference
2
+
3
+ Follow these rules exactly. When in doubt, copy a file from `examples/system/` (installed with `scenerok skills install`).
4
+
5
+ ## Rule 1: Plugin imports are mandatory
6
+
7
+ ```vidscript
8
+ import xai from "@scenerok/xai"
9
+ ```
10
+
11
+ Without this line, `xai.imagine`, `xai.tts`, and animation helpers like `fadeIn` fail validation.
12
+
13
+ **Never** call `video xai.imagine(...)` or `animate: fadeIn(...)` without the import above.
14
+
15
+ ## Rule 2: Put plugin calls directly in time blocks
16
+
17
+ ```vidscript
18
+ [-] = video xai.imagine("Prompt here", aspect_ratio: "9:16", duration: 5)
19
+ [-] = audio xai.tts("Voiceover line", voice: "eve")
20
+ ```
21
+
22
+ **Never** assign plugins to variables: `let clip = xai.imagine(...)` is invalid.
23
+
24
+ ## Rule 3: Time ranges use `..`
25
+
26
+ ```vidscript
27
+ [0s .. 5s] = text "Hello"
28
+ ```
29
+
30
+ Not `[0s - 5s]`.
31
+
32
+ ## Rule 4: Text params stay on one line
33
+
34
+ ```vidscript
35
+ [0.5s .. 3s] = text "Headline", font: "Inter", size: 64, color: "#FFFFFF", x: "50%", y: "30%", align: center
36
+ ```
37
+
38
+ ## Rule 5: Quote safety in prompts
39
+
40
+ Use only straight `"` inside `xai.imagine("...")`. Do not nest quotes inside the prompt string (e.g. avoid `"RokMilk"` inside the prompt — say `labeled RokMilk` without extra quotes).
41
+
42
+ ## Rule 6: Audio syntax
43
+
44
+ ```vidscript
45
+ [-] = audio xai.tts("Spoken line", voice: "eve", speed: 1.0)
46
+ ```
47
+
48
+ **Invalid:** `audio music("...", duration: 15), volume: 0.35` — trailing `, volume` after a plugin call is a parse error.
49
+
50
+ Music/generative audio plugins require their own `import` when available; do not invent bare `music(...)` calls.
51
+
52
+ ## Rule 7: Filters
53
+
54
+ ```vidscript
55
+ [0s .. 15s] = filter "vignette", intensity: 0.3
56
+ [0s .. 15s] = filter "saturation", value: 1.12
57
+ ```
58
+
59
+ `saturation` uses `value`, not `intensity`.
60
+
61
+ ## Rule 8: Always end with output
62
+
63
+ ```vidscript
64
+ output to "video.mp4", resolution: "1080x1920", fps: 30
65
+ ```
66
+
67
+ Do **not** use legacy `config { }` blocks — they are not part of VidScript v2.
68
+
69
+ ## Animations (after import)
70
+
71
+ ```vidscript
72
+ [0s .. 2s] = text "Launch", x: "50%", y: "50%", animate: popIn(0.7s)
73
+ ```
74
+
75
+ Available: `fadeIn`, `fadeOut`, `slideX`, `slideY`, `popIn`, `riseIn`, `swingIn`, `glitchIn`, `float`, `typewriter`.
76
+
77
+ ## Validate before render
78
+
79
+ ```bash
80
+ scenerok validate my-video.vid
81
+ ```
82
+
83
+ Each error line includes `Line N:C — message` when the server returns location info.
84
+
85
+ ## Bundled examples
86
+
87
+ | File | Use case |
88
+ |------|----------|
89
+ | `minimal-text-reel.vid` | Text-only, no API keys |
90
+ | `product-launch.vid` | User video input + text + vignette |
91
+ | `ecom-product-launch.vid` | xAI product visuals + CTA |
92
+ | `3-tips-fitness.vid` | Multiple `[-]` blocks + xAI per segment |
93
+ | `rokmilk-chocolate-promo.vid` | 15s generated-video promo pattern |
94
+
95
+ Full grammar: https://scenerok.com/docs/vidscript
@@ -86,18 +86,20 @@ import music from "@elevenlabs/music" # generative music
86
86
  use intro at [-] with { clip: main, headline: "Welcome" }
87
87
  ```
88
88
 
89
- ### Plugin Calls
89
+ ### Plugin Calls (required import)
90
90
 
91
91
  ```vidscript
92
- import eleven from "/tts"
92
+ import xai from "@scenerok/xai"
93
93
 
94
- [-] = audio eleven.tts("Welcome to SceneRok", voice: "Rachel")
95
- [-] = video xai.imagine("Cinematic product shot", aspect_ratio: "9:16")
96
- [-] = audio music("upbeat launch soundtrack", duration: 12, instrumental: true)
97
- [-] = audio xai.tts("Next line", voice: "eve")
94
+ [-] = video xai.imagine("Cinematic product shot", aspect_ratio: "9:16", duration: 5)
95
+ [-] = audio xai.tts("Welcome to SceneRok", voice: "eve")
98
96
  ```
99
97
 
100
- Package-style plugin calls are supported inside time blocks. Use `video ...` for generated visual clips and `audio ...` for generated speech, music, and other generated audio.
98
+ **Always** add `import xai from "@scenerok/xai"` before any `xai.imagine` / `xai.tts` call or `animate: fadeIn(...)` helper. Calls without import fail validation with `Unknown function 'xai.imagine'`.
99
+
100
+ Put plugin calls **directly** in time blocks — never `let clip = xai.imagine(...)`.
101
+
102
+ Read `vidscript-strict.md` for anti-patterns and `examples/system/*.vid` for copy-paste templates (installed with `scenerok skills install`).
101
103
 
102
104
  ### Placeholders
103
105
 
@@ -165,7 +167,15 @@ Always ask clarifying questions about:
165
167
  - Desired duration and style
166
168
  - Whether they want to start from a template or from scratch
167
169
 
170
+ ## Reference files (in this skill folder)
171
+
172
+ | File | Purpose |
173
+ |------|---------|
174
+ | `vidscript-guide.md` | Full grammar reference |
175
+ | `vidscript-strict.md` | **Read first** — rules that prevent common agent mistakes |
176
+ | `vidscript-sample.md` | Minimal promo with xAI import |
177
+ | `examples/system/*.vid` | Official SceneRok templates (text-only, product launch, xAI reels) |
178
+
168
179
  ## Full Reference
169
180
 
170
- For exhaustive grammar documentation, visit:
171
181
  https://scenerok.com/docs/vidscript
@@ -2,6 +2,22 @@
2
2
 
3
3
  VidScript is a declarative DSL for composing short-form videos. Write a script, render an MP4.
4
4
 
5
+ ## Agent quick start (read before composing)
6
+
7
+ 1. **Import plugins** — `import xai from "@scenerok/xai"` before `xai.imagine`, `xai.tts`, or `animate: fadeIn(...)`.
8
+ 2. **Validate early** — `scenerok validate file.vid` (errors show as `Line N:C — message`).
9
+ 3. **Copy working examples** — see `examples/system/` in this skill folder (e.g. `minimal-text-reel.vid`, `ecom-product-launch.vid`, `rokmilk-chocolate-promo.vid`).
10
+ 4. **Strict rules** — see `vidscript-strict.md` for invalid patterns (bare `xai.imagine`, `audio music(...), volume:`, nested quotes in prompts).
11
+
12
+ ### Common validation failures
13
+
14
+ | Symptom | Fix |
15
+ |---------|-----|
16
+ | `Unknown function 'xai.imagine'` | Add `import xai from "@scenerok/xai"` at top |
17
+ | `Unknown function 'fadeIn'` | Same import (animation helpers are plugin-backed) |
18
+ | `Expected ... but "," found` | Do not put `, volume:` after a plugin call on the same line |
19
+ | Parse error on imagine prompt | Remove nested `"` quotes inside the prompt string |
20
+
5
21
  ## Program Structure
6
22
 
7
23
  A VidScript program is a sequence of statements separated by newlines.
@@ -221,17 +237,21 @@ Audio sources can be MP3 inputs, audio plugin results, or the embedded audio str
221
237
  ### Plugin Calls
222
238
 
223
239
  ```vidscript
224
- import eleven from "@elevenlabs/tts" # future scoped package
225
- import music from "@elevenlabs/music"
226
-
227
- [-] = audio tts("Welcome to SceneRok", voice: "Rachel")
228
- [-] = video xai.imagine("Cinematic product shot", aspect_ratio: "9:16")
229
- [-] = audio music("upbeat launch soundtrack", duration: 12, instrumental: true)
230
- [-] = audio xai.tts("Next line", voice: "eve")
231
- [-] = tts("Next line")
240
+ import xai from "@scenerok/xai"
241
+
242
+ [-] = video xai.imagine("Cinematic product shot", aspect_ratio: "9:16", duration: 5)
243
+ [-] = audio xai.tts("Welcome to SceneRok", voice: "eve")
232
244
  ```
233
245
 
234
- Plugins are npm packages that add new function names. The built-in server registration includes xAI media/TTS and ElevenLabs music when the matching API keys are configured. They run at compile time and their outputs are baked into the final video. Package-style calls such as `video xai.imagine(...)` and qualified calls such as `audio xai.tts(...)` are supported inside time blocks.
246
+ Plugins require an explicit default import. The server registers `@scenerok/xai` when API keys are configured. Plugin calls run at compile time and must appear **inside time blocks**, not in `let` assignments.
247
+
248
+ **Invalid (will not validate):**
249
+
250
+ ```vidscript
251
+ [-] = video xai.imagine("...") # missing import
252
+ [-] = audio music("..."), volume: 0.5 # trailing params after plugin call
253
+ let clip = xai.imagine("...") # plugin assigned to variable
254
+ ```
235
255
 
236
256
  ## Animations, Effects & Plugins (v2 Extensibility)
237
257
 
@@ -1,21 +1,29 @@
1
- # VidScript v2 Sample — Product Launch Promo
2
- # A 6-second vertical video for TikTok / Instagram Reels
3
- # Demonstrates dynamic timeblocks, video shorthand, named args, expressions, and filters
1
+ # VidScript v2 Sample — Product promo with generated video
4
2
 
5
- input hero = "{{hero_clip}}"
3
+ Copy this shape for promos that use xAI-generated clips. Run `scenerok validate` before `scenerok render`.
6
4
 
7
- # Auto-append: cursor starts at 0, each [-] advances automatically
8
- [-] = video hero
9
- hero.Trim(start: 0s, end: 6s)
5
+ ```vidscript
6
+ import xai from "@scenerok/xai"
10
7
 
11
- # Text overlays with comma-separated named params
12
- [0.3s .. 2.3s] = text "NEW DROP", style: title, position: top, color: "#FFFFFF", size: 64, stroke: "#000000", stroke_width: 3
8
+ input product_name = "{{product_name | RokMilk}}"
9
+ input hook_text = "{{hook_text | Chocolate Milkshake}}"
10
+ input cta_text = "{{cta_text | visit your nearest grocery store}}"
13
11
 
14
- [2.5s .. 4.5s] = text "The most anticipated release of the season", style: caption, position: center, color: "#F3F4F6", size: 36, stroke: "#000000", stroke_width: 2
12
+ [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: fadeIn(0.6s)
15
13
 
16
- [4.5s .. 5.8s] = text "SHOP NOW", style: title, position: bottom, color: "#F59E0B", size: 52, stroke: "#000000", stroke_width: 3
14
+ [2s .. 4.5s] = text hook_text, font: "Outfit", size: 52, color: "#FFFFFF", x: "50%", y: "45%", align: center, stroke: "#3E1C00", stroke_width: 3, animate: riseIn(0.8s)
17
15
 
18
- # Filter applied from start to end of the clip
19
- [0s .. 6s] = filter "vignette", intensity: 0.35
16
+ [-] = video xai.imagine(
17
+ "Premium lifestyle product shot of " + product_name + " chocolate milk in 250ml carton, cinematic lighting, 9:16 vertical",
18
+ aspect_ratio: "9:16",
19
+ duration: 6
20
+ )
20
21
 
21
- output to "product-launch.mp4", resolution: "1080x1920", fps: 30
22
+ [8s .. 11s] = text cta_text, font: "Bebas Neue", size: 48, color: "#FFD700", x: "50%", y: "80%", align: center, stroke: "#3E1C00", stroke_width: 4, animate: fadeIn(0.8s)
23
+
24
+ [0s .. 12s] = filter "vignette", intensity: 0.3
25
+
26
+ output to "product-promo.mp4", resolution: "1080x1920", fps: 30
27
+ ```
28
+
29
+ For clips you already have (no xAI), start from `examples/system/product-launch.vid` instead.
@@ -0,0 +1,95 @@
1
+ # VidScript v2 — Strict Agent Reference
2
+
3
+ Follow these rules exactly. When in doubt, copy a file from `examples/system/` (installed with `scenerok skills install`).
4
+
5
+ ## Rule 1: Plugin imports are mandatory
6
+
7
+ ```vidscript
8
+ import xai from "@scenerok/xai"
9
+ ```
10
+
11
+ Without this line, `xai.imagine`, `xai.tts`, and animation helpers like `fadeIn` fail validation.
12
+
13
+ **Never** call `video xai.imagine(...)` or `animate: fadeIn(...)` without the import above.
14
+
15
+ ## Rule 2: Put plugin calls directly in time blocks
16
+
17
+ ```vidscript
18
+ [-] = video xai.imagine("Prompt here", aspect_ratio: "9:16", duration: 5)
19
+ [-] = audio xai.tts("Voiceover line", voice: "eve")
20
+ ```
21
+
22
+ **Never** assign plugins to variables: `let clip = xai.imagine(...)` is invalid.
23
+
24
+ ## Rule 3: Time ranges use `..`
25
+
26
+ ```vidscript
27
+ [0s .. 5s] = text "Hello"
28
+ ```
29
+
30
+ Not `[0s - 5s]`.
31
+
32
+ ## Rule 4: Text params stay on one line
33
+
34
+ ```vidscript
35
+ [0.5s .. 3s] = text "Headline", font: "Inter", size: 64, color: "#FFFFFF", x: "50%", y: "30%", align: center
36
+ ```
37
+
38
+ ## Rule 5: Quote safety in prompts
39
+
40
+ Use only straight `"` inside `xai.imagine("...")`. Do not nest quotes inside the prompt string (e.g. avoid `"RokMilk"` inside the prompt — say `labeled RokMilk` without extra quotes).
41
+
42
+ ## Rule 6: Audio syntax
43
+
44
+ ```vidscript
45
+ [-] = audio xai.tts("Spoken line", voice: "eve", speed: 1.0)
46
+ ```
47
+
48
+ **Invalid:** `audio music("...", duration: 15), volume: 0.35` — trailing `, volume` after a plugin call is a parse error.
49
+
50
+ Music/generative audio plugins require their own `import` when available; do not invent bare `music(...)` calls.
51
+
52
+ ## Rule 7: Filters
53
+
54
+ ```vidscript
55
+ [0s .. 15s] = filter "vignette", intensity: 0.3
56
+ [0s .. 15s] = filter "saturation", value: 1.12
57
+ ```
58
+
59
+ `saturation` uses `value`, not `intensity`.
60
+
61
+ ## Rule 8: Always end with output
62
+
63
+ ```vidscript
64
+ output to "video.mp4", resolution: "1080x1920", fps: 30
65
+ ```
66
+
67
+ Do **not** use legacy `config { }` blocks — they are not part of VidScript v2.
68
+
69
+ ## Animations (after import)
70
+
71
+ ```vidscript
72
+ [0s .. 2s] = text "Launch", x: "50%", y: "50%", animate: popIn(0.7s)
73
+ ```
74
+
75
+ Available: `fadeIn`, `fadeOut`, `slideX`, `slideY`, `popIn`, `riseIn`, `swingIn`, `glitchIn`, `float`, `typewriter`.
76
+
77
+ ## Validate before render
78
+
79
+ ```bash
80
+ scenerok validate my-video.vid
81
+ ```
82
+
83
+ Each error line includes `Line N:C — message` when the server returns location info.
84
+
85
+ ## Bundled examples
86
+
87
+ | File | Use case |
88
+ |------|----------|
89
+ | `minimal-text-reel.vid` | Text-only, no API keys |
90
+ | `product-launch.vid` | User video input + text + vignette |
91
+ | `ecom-product-launch.vid` | xAI product visuals + CTA |
92
+ | `3-tips-fitness.vid` | Multiple `[-]` blocks + xAI per segment |
93
+ | `rokmilk-chocolate-promo.vid` | 15s generated-video promo pattern |
94
+
95
+ Full grammar: https://scenerok.com/docs/vidscript
@@ -86,18 +86,20 @@ import music from "@elevenlabs/music" # generative music
86
86
  use intro at [-] with { clip: main, headline: "Welcome" }
87
87
  ```
88
88
 
89
- ### Plugin Calls
89
+ ### Plugin Calls (required import)
90
90
 
91
91
  ```vidscript
92
- import eleven from "/tts"
92
+ import xai from "@scenerok/xai"
93
93
 
94
- [-] = audio eleven.tts("Welcome to SceneRok", voice: "Rachel")
95
- [-] = video xai.imagine("Cinematic product shot", aspect_ratio: "9:16")
96
- [-] = audio music("upbeat launch soundtrack", duration: 12, instrumental: true)
97
- [-] = audio xai.tts("Next line", voice: "eve")
94
+ [-] = video xai.imagine("Cinematic product shot", aspect_ratio: "9:16", duration: 5)
95
+ [-] = audio xai.tts("Welcome to SceneRok", voice: "eve")
98
96
  ```
99
97
 
100
- Package-style plugin calls are supported inside time blocks. Use `video ...` for generated visual clips and `audio ...` for generated speech, music, and other generated audio.
98
+ **Always** add `import xai from "@scenerok/xai"` before any `xai.imagine` / `xai.tts` call or `animate: fadeIn(...)` helper. Calls without import fail validation with `Unknown function 'xai.imagine'`.
99
+
100
+ Put plugin calls **directly** in time blocks — never `let clip = xai.imagine(...)`.
101
+
102
+ Read `vidscript-strict.md` for anti-patterns and `examples/system/*.vid` for copy-paste templates (installed with `scenerok skills install`).
101
103
 
102
104
  ### Placeholders
103
105
 
@@ -165,7 +167,15 @@ Always ask clarifying questions about:
165
167
  - Desired duration and style
166
168
  - Whether they want to start from a template or from scratch
167
169
 
170
+ ## Reference files (in this skill folder)
171
+
172
+ | File | Purpose |
173
+ |------|---------|
174
+ | `vidscript-guide.md` | Full grammar reference |
175
+ | `vidscript-strict.md` | **Read first** — rules that prevent common agent mistakes |
176
+ | `vidscript-sample.md` | Minimal promo with xAI import |
177
+ | `examples/system/*.vid` | Official SceneRok templates (text-only, product launch, xAI reels) |
178
+
168
179
  ## Full Reference
169
180
 
170
- For exhaustive grammar documentation, visit:
171
181
  https://scenerok.com/docs/vidscript