How to Add the Video Generation Rules Skill to Your AI Agent
How to add Video Generation Rules to your agent
Pick the way that suits you. Each takes about two minutes.
Save SKILL.md into your agent's skills
- Download the skill
Claude Code, and other agents that read Agent Skills, load it from this folder when they start.
mkdir -p ~/.claude/skills/video-generation-rules curl -fsSL https://spiral.ai/skills/video-generation-rules/SKILL.md -o ~/.claude/skills/video-generation-rules/SKILL.md
- Connect Spiral
The skill runs its tools through Spiral. Send your agent this message once to set it up.
set up https://spiral.ai/SKILL.md
Use the Spiral CLI
- Install and sign in
Installs the Spiral CLI, signs you in and adds its skill to your coding agents.
npx -y spiral-cli@latest init
- Read the skill
Built-in skills are on for every organization: the CLI prints this one with all its files.
spiral agent-skills get video-generation-rules --json
Read it from the Spiral API
- Create an API key
In the console, under API keys.
- Fetch the skill
The answer holds SKILL.md and every other file of the skill, in path order.
curl https://api.spiral.ai/v1/skills/video-generation-rules \ -H "Authorization: Bearer $SPIRAL_API_KEY"
Then ask your agent for the task: it loads Video Generation Rules when a request matches the skill's description.
When to use (description)
Use when generating any video with an AI video model (load it before the first generation). Hard rules — attach reference assets, keep in-frame motion in the video model rather than programmatic composition, treat "video" as generative video, route on-frame text and logos by fidelity requirement (exact copy vs scene-integrated), native audio, multi-shot timeline prompting, matching the source image's aspect ratio, and keeping the same character across segments. The model picks stay in model-recommendations.
Instructions
Video Generation Rules
Pick the video model from model-recommendations ("VIDEO"), then follow every rule below that applies.
Reference assets for video generation (hard rule)
When any visual asset accompanies a video request — uploaded photo, prior generation, screenshot, logo, character ref, product shot, moodboard — it must be incorporated, not treated as coincidental context. Incorporation normally means passing the asset to the video model, except when the asset is intended solely for deterministic placement under the exact-copy rule below. Default to text-to-video ONLY when no generative reference is in scope.
Operational rule (hard):
- If an asset is intended solely for deterministic placement (for example, an exact logo or end-card graphic that must not be redrawn): do NOT pass it to the video generator. Retain its authoritative URL for composition, generate the base footage without that asset, then load the hyperframes-video Skill and place the exact asset in an HTML composition.
- For every other provided reference image: route to image-to-video, reference-to-video, motion-control, start-end-frame, or whichever
model-recommendationsuse case accepts the asset shape, with the asset in the schema's input field — NEVER silently fall back to text-to-video. - If the connection between the reference and the prompt is unclear: do not decide the attachment was accidental or unrelated. ASK the user to choose what role it should play (setting, subject, style reference, target of the action, character to insert). Silently dropping a user-provided asset redefines the brief.
- If the user did NOT provide reference image(s) but the request would clearly benefit from one (a recurring person, a specific product, brand consistency, "in this style", a particular setting): ASK the user for the image before generating.
- If the source image's aspect ratio differs from the desired video aspect ratio: see "Aspect ratio must match the source image" below.
- If genuinely no reference is needed and none was supplied: use text-to-video and don't ask unprompted.
In-frame motion belongs to AI video models, not programmatic composition (hard rule)
When the inferred intent involves motion WITHIN image contents — a character walking, gesturing, an expression changing, an object transforming, a scene playing out — use AI video models (image-to-video, start-end-frame, reference-to-video, motion-control). Do NOT route it through programmatic composition (slide-in, bounce, opacity tween, scale animation of a static image): moving a still across the canvas does not animate its content.
Image-to-video continues from the given frame. Before planning, compare each requested action with what the source image already shows: an action whose result is already visible cannot be performed. Say so in the plan and offer to animate what follows, or to make a "before" frame first. When several clips each hinge on one key action, generate one at default settings and check that the action happened before running the rest.
Reserve a composition render for composing pre-rendered clips (cuts, layout, overlays, captions, transitions), pixel-deterministic positioning of finished assets, and data-driven motion (charts, numeric tickers, scoreboards).
"Video" means generative video, not assembled stills (hard rule)
When the inferred intent is a video, the default output is a generative clip from a video model — NOT a composition / ffmpeg slideshow of stills with pans, fades, or Ken Burns transitions. A stills-assembly is right ONLY when the user explicitly asks for one: a photo montage of their own pictures, a recap reel of existing stills, a slide-style presentation.
Route on-frame text by fidelity requirement (hard rule)
Use the video model for text that must feel native to the scene — lettering on a moving sign, perspective-bound type, or stylized words that interact with lighting and motion — when exact spelling is not the acceptance gate. Generative typography is probabilistic: prompt the intended copy clearly, then inspect the rendered frames before saying it is correct. Never describe unseen or unchecked model-rendered text as guaranteed, pixel-perfect, or verified.
Classify deterministic animation before considering a placement picker. If the request is explicitly for a data-driven chart, numeric ticker, scoreboard, templated price board, or another visual whose exact values and deterministic frame-by-frame motion are the intended result, route directly to a fully programmatic video. Do not ask the user about text placement, even when that deterministic visual includes exact prices, names, logos, or CTAs.
For every remaining new video request that includes fidelity-sensitive copy or branding — URLs, prices, legal text, brand names, CTAs, or an exact logo — and whose placement priority is unstated, ask the user to choose before any billed generation: "How should exact text or a logo appear?"
- Scene-integrated text or logo (
scene_integrated): follows perspective, lighting, motion, and occlusion, but exact spelling and logo pixels remain probabilistic. - Exact overlay or end card (
exact_overlay): keeps creative moving footage and adds exact flat content that will not bend, turn, or pass behind objects.
These are outcome labels: never expose internal rendering technology, tool names, or pipeline details in the options. Do not ask again when the user already stated which placement priority matters more; follow that route faithfully. After scene_integrated, keep the text or logo in the generative prompt and any supplied logo in the generator reference, state that fidelity is probabilistic, and inspect the result. After exact_overlay, generate creative moving footage without the exact content, then add the authoritative flat text or logo during composition. Exact copy alone is not a reason to make the entire video programmatic: reserve a fully programmatic video for a request that genuinely needs data-driven motion, charts, numeric tickers, scoreboards, or another deterministic animation.
Exact-copy scenario routes
| Scenario | Required route |
|---|---|
| Exact end-card URL | If placement priority is unstated, offer the two user-facing options. When exact placement is selected, generate creative moving footage without the URL, then add the exact URL as a flat end card. |
| Exact logo on a rotating package | If placement priority is unstated, offer the two user-facing options. Scene-integrated placement keeps the supplied logo as a required generator reference and states that pixel fidelity is probabilistic; exact placement moves the authoritative logo to a flat overlay or end card instead. |
| Exact data-driven scoreboard | Do not ask; use a fully programmatic video because exact names, prices, logos, scores, and deterministic frame-by-frame motion are the requested visual behavior; do not pretend static transforms are natural in-scene action. |
Use a deterministic composition pass for copy whose exact characters are the requirement and whose placement can remain a flat overlay or end-card element: URLs, brand names, prices, legal copy, end-card CTAs, or any string the user asks to reproduce exactly. Generate the moving footage without that copy, then load the hyperframes-video Skill and add the exact text in an HTML composition. Treat an exact logo asset this way when it is an overlay-only or end-card element whose faithful, flat placement is the requirement: retain and composite the supplied asset rather than passing it to the video generator to redraw.
Exact text or a logo integrated into a moving scene is a different route: it needs perspective, occlusion, and lighting from the generative model, which cannot guarantee exact spelling or pixel fidelity. If the user requires both scene integration and exact fidelity, ask the user to choose the priority before generating: (1) scene-integrated placement with probabilistic text/logo fidelity, keeping any supplied logo as a required generator reference and inspecting the result, or (2) faithful deterministic overlay/end-card placement, compositing the authoritative copy or asset afterward. Never promise that one route guarantees both properties.
Recovery rule: after the user reports malformed text, or inspection finds a misspelling, do NOT pay to retry the same generative-text strategy and do not promise that another model render will guarantee correctness. Offer the deterministic overlay route and obtain approval before any additional billed generation. If the user explicitly prefers another integrated-text attempt, state that spelling remains probabilistic and verify the result before presenting it as fixed.
Other programmatic text work: word-timed captions for spoken audio ("Word-level caption timing" in model-recommendations, burned onto the finished clip), and overlays spanning multiple generated clips assembled in one composition (lower thirds across cuts, captions over a montage).
Native audio (generate_audio: true)
When a video model's schema exposes generate_audio, leave it true unless the user asked for silent video: it renders speech, dialogue, SFX, and ambience in lockstep with the picture in one call, which is cheaper and better synced than video → TTS → lipsync.
Spoken words from the brief go IN the prompt. On-camera dialogue, narration, voiceover, a character line — write the exact text into the prompt as speech. Do NOT ship ambient-only video and offer to "add the voice afterwards". A separate redub is legitimate only when the user opts into it after hearing the native-audio output.
Multi-shot / multi-scene in a single call (timeline prompting)
Use this when the inferred intent is a short sequence of distinct shots that run back-to-back as one piece (hook → product reveal → CTA; three-beat explainer). Structure the prompt as ordered beats — timestamped (0-2s: ... ; 2-5s: ...) or a numbered scene list — and the model renders one clip with the cuts baked in. This works for text-, image-, and reference-to-video.
Pipeline rule (hard): do NOT split a multi-shot brief into N separate calls stitched together afterwards. Use one timeline-structured call. Fall back to per-clip generation only when the user explicitly wants independently directed shots, OR the total runtime exceeds the model's max duration (from the schema). When the beats do not land as distinct shots, take the upgrade model in model-recommendations ("VIDEO").
Aspect ratio must match the source image
When generating video from a reference image (image-to-video, reference-to-video, motion-control, talking-photo, storyboard), the output aspect ratio MUST match the source image's. Image-to-video models animate within the image canvas; a mismatch yields letterboxing, bad crops, or distortion.
When the desired ratio differs from the source image's, do NOT pass the mismatched image. Instead:
- Regenerate the image in the desired aspect ratio with the selected compatible image-edit model, attaching the original as a reference and describing the new framing.
- Pass the new aspect-correct image to the video model.
Check this before selecting duration, resolution, or other fields.
When the selected mode's schema exposes an output aspect-ratio control and treats the image as a reference rather than as the first frame (reference-to-video), set the requested ratio directly on that call instead of regenerating the image. Never generate in another ratio and crop, pad, or stretch the result while a curated model can produce it natively. If no curated model exposes the ratio, say so before generating and ask whether to crop. This covers new generations: another format of footage or images the user already approved is reuse, so reframe it first.
Same character across multiple video segments (hard rule)
Use this when the plan needs two or more video generations (segments, chained clips, a runtime longer than one call allows) AND the same character must stay recognizable: a character reference (uploaded photo, approved character sheet, or generated hero still) is in scope.
- Pick the reference-to-video model from
model-recommendations("Several video segments with the same character"), and use one model for every segment of the piece.
Operational rules (hard):
- Pass the original character reference to every segment as a reference image, not only the first call. Identity comes from that original image on every call, never from the previous clip.
- Keep stray props out of identity references. The model copies what a reference shows, including items held in hand. Crop the reference to the person or pick a frame with empty hands, and describe what the hands hold (or "empty hands") in every shot.
- A handoff frame is an extra reference, never the identity source. You may add the previous clip's last frame (or a better one just before it) after the original. Skip it when the face is hidden, turned away, blurred, or no longer matches the original.
- Do not chain identity through image-to-video start frames. That lets every segment drift, and a frame without a visible face invents a new person. This applies even for a seamless one-take: accept a slightly softer seam to keep the face. When the user asks for exact frame-to-frame joins, tell them before generating that exact joins let the face drift and that keeping the face means short blended joins; ask which matters more, defaulting to the face.
- Set the requested aspect ratio natively on every segment call, per the rule above.
- Check each segment before the next one (before delivery when they run in parallel): take a frame per shot and compare face, hair, outfit, and held items with the original reference. Regenerate a drifted segment rather than building on it. Never describe the face as matching the reference unless that comparison passed for every segment.
When the whole piece fits within one generation, prefer a single timeline-structured reference-to-video call with the original reference attached.
Capabilities
Used in this skill · 0
None yet.
More skills
Use when producing a narrative video about historical figures, fictional stories, day-in-the-life pieces, educational explainers with a protagonist, brand mascot stories, and any narrative video that depends on a consistent main character across scenes. Methodology for producing multi-scene character-driven short films: covers the full 11-phase pipeline — creative brief, style reference, character sheet, scene stills, animation, voiceover, per-clip audio mix, stitching, music with proper fade technique, optional subtitles, and optional Fin card — plus approval gates, parallelization strategy, asset naming, and the prompting principles that hold across video models. Tool and model selection is delegated to model-recommendations.
Use whenever the inferred intent is a continuous tracking shot or a long single-take video built from chained clips, including character-following journeys ("the character walks from room to room", "follow the figure across the city"), or an AI transition between two known frames (a first-to-last-frame clip from a start image to an end image, seamless loops from one image, chains of transitions A→B→C). Frame chaining: extract last frame → feed as next input → repeat → stitch. Covers workflow modes (all-at-once vs step-by-step), prompting rules, aspect ratio discipline, last-frame quality control, stitching, character continuity (original reference on every clip through reference-to-video, the handoff frame as an extra reference only, locked character description string, locomotion-through-space rule, the rear-facing danger, corrective stills), the morphing problem and visual bridges, and prompting cheat sheets for style/audio/camera.
Use when the user explicitly asks for Gemini Omni, Omni Flash or Google's Omni video model: text-to-video, image-to-video, reference-to-video or editing a short video with Gemini Omni. Covers finding the tools, duration format, edit-video preparation, prompt structure, media role tags, audio behavior, text rendering, timing, and how to prepare source media.
Use when a HyperFrames composition needs any motion or animation: atomic motion rules, multi-phase scene blueprints, scene transitions, broader motion-design techniques, AND the seven runtime adapters (GSAP default, plus Lottie, Three.js, Anime.js, CSS keyframes, Web Animations API, TypeGPU). Use for any motion or animation task: pick 2-4 rules and compose, or load a blueprint, or look up runtime-specific API (e.g. GSAP eases / Lottie player / Three.js mixer). Also covers auditing an existing composition's choreography (animation map) and 24 named text-animation effects. HyperFrames-native: single paused timeline, seek-safe, deterministic.
Questions about Video Generation Rules
What does the Video Generation Rules skill do?
Use when generating any video with an AI video model (load it before the first generation). Hard rules — attach reference assets, keep in-frame motion in the video model rather than programmatic composition, treat "video" as generative video, route on-frame text and logos by fidelity requirement (exact copy vs scene-integrated), native audio, multi-shot timeline prompting, matching the source image's aspect ratio, and keeping the same character across segments. The model picks stay in model-recommendations.
Which tools does Video Generation Rules use?
It names no tool of its own: it guides how your agent works and which Spiral tools it picks.
Does the Video Generation Rules skill cost anything?
The skill is free. The tools it runs are billed pay-as-you-go from your Spiral balance at each tool's stated price, with no plan.
How does my agent know when to use Video Generation Rules?
An agent reads each skill's description and loads its instructions when a request matches it.
How do I add Video Generation Rules to Claude Code?
Save its files into ~/.claude/skills/video-generation-rules/ with the commands on this page; Claude Code loads it when it starts.
Can I use Video Generation Rules in other agents?
Yes. Any agent that reads Agent Skills folders loads the same files, and any other agent reads the skill with `spiral agent-skills get video-generation-rules --json` or the Spiral API.
Is Video Generation Rules on for my Spiral organization?
Yes. Built-in skills are on for every organization; an admin can turn Video Generation Rules off on the console's Skills page.
Where is the Video Generation Rules SKILL.md file?
At https://spiral.ai/skills/video-generation-rules/SKILL.md, with no key needed. On the console's Skills page, Customize saves a copy you can edit as your organization's own skill.