@scenerok/cli 1.0.3 → 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.
- package/dist/commands/auth.d.ts.map +1 -1
- package/dist/commands/auth.js +16 -7
- package/dist/commands/skills.d.ts.map +1 -1
- package/dist/commands/skills.js +42 -1
- package/dist/commands/validate.d.ts.map +1 -1
- package/dist/commands/validate.js +26 -4
- package/dist/index.js +2 -1
- package/dist/lib/api.d.ts +2 -0
- package/dist/lib/api.d.ts.map +1 -1
- package/dist/lib/config.d.ts.map +1 -1
- package/dist/lib/config.js +6 -1
- package/examples/system/3-tips-fitness.vid +45 -0
- package/examples/system/ecom-product-launch.vid +31 -0
- package/examples/system/glitch-title.vid +17 -0
- package/examples/system/meme-remix.vid +15 -0
- package/examples/system/minimal-text-reel.vid +11 -0
- package/examples/system/product-launch.vid +18 -0
- package/examples/system/rokmilk-chocolate-promo.vid +24 -0
- package/examples/system/testimonial-cut.vid +16 -0
- package/examples/system/ugc-testimonial-voiceover.vid +33 -0
- package/examples/system/voice-visual-promo.vid +21 -0
- package/package.json +2 -1
- package/skills/aider/SKILL.md +18 -8
- package/skills/aider/vidscript-guide.md +29 -9
- package/skills/aider/vidscript-sample.md +22 -14
- package/skills/aider/vidscript-strict.md +95 -0
- package/skills/claude/SKILL.md +18 -8
- package/skills/claude/vidscript-guide.md +26 -7
- package/skills/claude/vidscript-sample.md +22 -14
- package/skills/claude/vidscript-strict.md +95 -0
- package/skills/codex/SKILL.md +18 -8
- package/skills/codex/vidscript-guide.md +29 -9
- package/skills/codex/vidscript-sample.md +22 -14
- package/skills/codex/vidscript-strict.md +95 -0
- package/skills/cursor/SKILL.md +18 -8
- package/skills/cursor/vidscript-guide.md +29 -9
- package/skills/cursor/vidscript-sample.md +22 -14
- package/skills/cursor/vidscript-strict.md +95 -0
- package/skills/opencode/SKILL.md +18 -8
- package/skills/opencode/vidscript-guide.md +29 -9
- package/skills/opencode/vidscript-sample.md +22 -14
- package/skills/opencode/vidscript-strict.md +95 -0
- package/skills/skills/aider/SKILL.md +190 -0
- package/skills/skills/aider/vidscript-guide.md +375 -0
- package/skills/skills/aider/vidscript-sample.md +29 -0
- package/skills/skills/aider/vidscript-strict.md +95 -0
- package/skills/skills/claude/SKILL.md +190 -0
- package/skills/skills/claude/vidscript-guide.md +375 -0
- package/skills/skills/claude/vidscript-sample.md +29 -0
- package/skills/skills/claude/vidscript-strict.md +95 -0
- package/skills/skills/codex/SKILL.md +190 -0
- package/skills/skills/codex/vidscript-guide.md +375 -0
- package/skills/skills/codex/vidscript-sample.md +29 -0
- package/skills/skills/codex/vidscript-strict.md +95 -0
- package/skills/skills/cursor/SKILL.md +190 -0
- package/skills/skills/cursor/vidscript-guide.md +375 -0
- package/skills/skills/cursor/vidscript-sample.md +29 -0
- package/skills/skills/cursor/vidscript-strict.md +95 -0
- package/skills/skills/opencode/SKILL.md +190 -0
- package/skills/skills/opencode/vidscript-guide.md +375 -0
- package/skills/skills/opencode/vidscript-sample.md +29 -0
- 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
|
package/skills/cursor/SKILL.md
CHANGED
|
@@ -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
|
|
92
|
+
import xai from "@scenerok/xai"
|
|
93
93
|
|
|
94
|
-
[-] =
|
|
95
|
-
[-] =
|
|
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
|
-
|
|
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
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
[-] = audio tts("Welcome to SceneRok", voice: "
|
|
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
|
|
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
|
|
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
|
-
|
|
3
|
+
Copy this shape for promos that use xAI-generated clips. Run `scenerok validate` before `scenerok render`.
|
|
6
4
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
hero.Trim(start: 0s, end: 6s)
|
|
5
|
+
```vidscript
|
|
6
|
+
import xai from "@scenerok/xai"
|
|
10
7
|
|
|
11
|
-
|
|
12
|
-
|
|
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
|
-
[
|
|
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
|
-
[
|
|
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
|
-
|
|
19
|
-
|
|
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
|
-
|
|
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
|
package/skills/opencode/SKILL.md
CHANGED
|
@@ -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
|
|
92
|
+
import xai from "@scenerok/xai"
|
|
93
93
|
|
|
94
|
-
[-] =
|
|
95
|
-
[-] =
|
|
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
|
-
|
|
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
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
[-] = audio tts("Welcome to SceneRok", voice: "
|
|
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
|
|
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
|
|
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
|
-
|
|
3
|
+
Copy this shape for promos that use xAI-generated clips. Run `scenerok validate` before `scenerok render`.
|
|
6
4
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
hero.Trim(start: 0s, end: 6s)
|
|
5
|
+
```vidscript
|
|
6
|
+
import xai from "@scenerok/xai"
|
|
10
7
|
|
|
11
|
-
|
|
12
|
-
|
|
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
|
-
[
|
|
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
|
-
[
|
|
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
|
-
|
|
19
|
-
|
|
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
|
-
|
|
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
|