Skip to content

πŸŽ₯ Make videos programmatically with React

`@remotion/skills`: Improve skill publishing and guidance (#9678)

Jonny Burger5b8f3a5309e4
diff --git a/.agents/skills/mediabunny b/.agents/skills/mediabunny
deleted file mode 120000
index 444b3b565f..0000000000
--- a/.agents/skills/mediabunny
+++ /dev/null
@@ -1 +0,0 @@
-../../packages/skills/skills/mediabunny
\ No newline at end of file
diff --git a/.agents/skills/remotion-multimedia b/.agents/skills/remotion-multimedia
new file mode 120000
index 0000000000..5590aa4b0c
--- /dev/null
+++ b/.agents/skills/remotion-multimedia
@@ -0,0 +1 @@
+../../packages/skills/skills/remotion-multimedia
\ No newline at end of file
diff --git a/package.json b/package.json
index b2cb3a5229..5577fa93fb 100644
--- a/package.json
+++ b/package.json
@@ -45,8 +45,8 @@
"release": "bun publish.ts && turbo run publishprivate --concurrency=1 && git push --tags && git push",
"publishtemplates": "cd packages/it-tests && bun src/templates/publish.ts",
"playground": "bun packages/skills-evals/src/playground.ts",
- "checkskills": "bun packages/skills/scripts/sync-agent-skills.ts --check && bun packages/skills/scripts/sync-best-practices.ts --check && bun run validateskills",
- "syncskills": "bun packages/skills/scripts/sync-agent-skills.ts && bun packages/skills/scripts/sync-best-practices.ts",
+ "checkskills": "bun packages/skills/scripts/sync-agent-skills.ts --check && bun packages/skills/scripts/sync-embedded-skills.ts --check && bun run validateskills",
+ "syncskills": "bun packages/skills/scripts/sync-agent-skills.ts && bun packages/skills/scripts/sync-embedded-skills.ts",
"validateskills": "bun packages/skills/scripts/validate-links.ts",
"cleantypes": "rm -rf packages/**/tsconfig.tsbuildinfo && rm -f packages/tsconfig.tsbuildinfo",
"clean": "turbo run clean && rm -rf packages/**/dist && rm -rf .cache && rm -rf packages/**/tsconfig.tsbuildinfo && rm -f packages/tsconfig.tsbuildinfo && rm -rf packages/**/.turbo && rm -rf .turbo",
diff --git a/packages/claude-code-plugin/build.mts b/packages/claude-code-plugin/build.mts
index bada5f8a2a..6babd396a5 100644
--- a/packages/claude-code-plugin/build.mts
+++ b/packages/claude-code-plugin/build.mts
@@ -3,21 +3,17 @@ import {
existsSync,
mkdirSync,
readdirSync,
- readFileSync,
- renameSync,
rmSync,
statSync,
- writeFileSync,
} from 'node:fs';
import {join, resolve} from 'node:path';
import {fileURLToPath} from 'node:url';
+import {prepareEmbeddedSkills} from '../skills/scripts/prepare-embedded-skills';
const __dirname = fileURLToPath(new URL('.', import.meta.url));
const skillsOut = resolve(__dirname, 'skills');
const packagesSkillsDir = resolve(__dirname, '..', 'skills', 'skills');
-const embeddedSkillFilename = 'REFERENCE.md';
-
if (existsSync(skillsOut)) {
rmSync(skillsOut, {recursive: true});
}
@@ -39,59 +35,6 @@ const copySkillDir = (src: string, destName: string) => {
console.log(` Copied ${destName}`);
};
-const prepareEmbeddedBestPractices = () => {
- const embeddedRoot = join(skillsOut, 'remotion-best-practices');
-
- if (!existsSync(embeddedRoot)) {
- return;
- }
-
- const embeddedSkillNames = readdirSync(embeddedRoot, {withFileTypes: true})
- .filter((entry) => {
- const child = join(embeddedRoot, entry.name);
- return (
- entry.isDirectory() &&
- entry.name !== 'rules' &&
- existsSync(join(child, 'SKILL.md'))
- );
- })
- .map((entry) => entry.name)
- .sort();
-
- const rewriteMarkdownFiles = (dir: string) => {
- for (const entry of readdirSync(dir, {withFileTypes: true})) {
- const file = join(dir, entry.name);
- if (entry.isDirectory()) {
- rewriteMarkdownFiles(file);
- continue;
- }
-
- if (!entry.isFile() || !file.endsWith('.md')) {
- continue;
- }
-
- const contents = readFileSync(file, 'utf-8');
- let rewritten = contents.replaceAll('../remotion-best-practices/', '../');
- for (const skillName of embeddedSkillNames) {
- rewritten = rewritten.replaceAll(
- `${skillName}/SKILL.md`,
- `${skillName}/${embeddedSkillFilename}`,
- );
- }
- if (contents !== rewritten) {
- writeFileSync(file, rewritten);
- }
- }
- };
-
- rewriteMarkdownFiles(embeddedRoot);
-
- for (const skillName of embeddedSkillNames) {
- const child = join(embeddedRoot, skillName);
- renameSync(join(child, 'SKILL.md'), join(child, embeddedSkillFilename));
- }
-};
-
console.log('Building Claude Code plugin skills...\n');
if (existsSync(packagesSkillsDir)) {
@@ -103,7 +46,7 @@ if (existsSync(packagesSkillsDir)) {
for (const folder of skillFolders) {
copySkillDir(join(packagesSkillsDir, folder), folder);
}
- prepareEmbeddedBestPractices();
+ prepareEmbeddedSkills(skillsOut);
} else {
console.warn('Warning: packages/skills/skills/ not found');
}
diff --git a/packages/claude-code-plugin/test/plugin.test.ts b/packages/claude-code-plugin/test/plugin.test.ts
index dd3ed2a019..f3fb0521bb 100644
--- a/packages/claude-code-plugin/test/plugin.test.ts
+++ b/packages/claude-code-plugin/test/plugin.test.ts
@@ -4,7 +4,11 @@ import path from 'node:path';
const packageRoot = path.resolve(import.meta.dir, '..');
const generatedSkillsRoot = path.join(packageRoot, 'skills');
-const embeddedRoot = path.join(generatedSkillsRoot, 'remotion-best-practices');
+const embeddedRoots = [
+ path.join(generatedSkillsRoot, 'remotion-best-practices'),
+ path.join(generatedSkillsRoot, 'remotion-best-practices', 'remotion-markup'),
+ path.join(generatedSkillsRoot, 'remotion-markup'),
+];
const getDirectories = (directory: string) => {
return readdirSync(directory)
@@ -39,24 +43,41 @@ test('only top-level skills use the discovery filename', () => {
topLevelSkillNames.map((skillName) => path.join(skillName, 'SKILL.md')),
);
- const embeddedSkillNames = getDirectories(embeddedRoot).filter((skillName) =>
- topLevelSkillNames.includes(skillName),
- );
- for (const skillName of embeddedSkillNames) {
- expect(existsSync(path.join(embeddedRoot, skillName, 'SKILL.md'))).toBe(
- false,
- );
- expect(existsSync(path.join(embeddedRoot, skillName, 'REFERENCE.md'))).toBe(
- true,
+ for (const embeddedRoot of embeddedRoots) {
+ const embeddedSkillNames = getDirectories(embeddedRoot).filter(
+ (skillName) =>
+ existsSync(path.join(embeddedRoot, skillName, 'REFERENCE.md')),
);
+ for (const skillName of embeddedSkillNames) {
+ expect(existsSync(path.join(embeddedRoot, skillName, 'SKILL.md'))).toBe(
+ false,
+ );
+ expect(
+ existsSync(path.join(embeddedRoot, skillName, 'REFERENCE.md')),
+ ).toBe(true);
+ }
}
});
test('links to embedded skills use the renamed file', () => {
- for (const file of getMarkdownFiles(embeddedRoot)) {
- const contents = readFileSync(file, 'utf-8');
- for (const skillName of getDirectories(embeddedRoot)) {
- expect(contents).not.toContain(`${skillName}/SKILL.md`);
+ for (const embeddedRoot of embeddedRoots) {
+ for (const file of getMarkdownFiles(embeddedRoot)) {
+ const contents = readFileSync(file, 'utf-8');
+ for (const skillName of getDirectories(embeddedRoot)) {
+ expect(contents).not.toContain(`${skillName}/SKILL.md`);
+ }
}
}
});
+
+test('maps is available from either standalone parent skill', () => {
+ for (const parentSkill of ['remotion-best-practices', 'remotion-markup']) {
+ const parentRoot = path.join(generatedSkillsRoot, parentSkill);
+ expect(readFileSync(path.join(parentRoot, 'SKILL.md'), 'utf-8')).toContain(
+ '(remotion-maps/REFERENCE.md)',
+ );
+ expect(
+ existsSync(path.join(parentRoot, 'remotion-maps', 'REFERENCE.md')),
+ ).toBe(true);
+ }
+});
diff --git a/packages/codex-plugin/build.mts b/packages/codex-plugin/build.mts
index 915b131099..f4466df11a 100644
--- a/packages/codex-plugin/build.mts
+++ b/packages/codex-plugin/build.mts
@@ -4,21 +4,17 @@ import {
existsSync,
mkdirSync,
readdirSync,
- readFileSync,
- renameSync,
rmSync,
statSync,
- writeFileSync,
} from 'fs';
import {join, resolve} from 'path';
import {fileURLToPath} from 'url';
+import {prepareEmbeddedSkills} from '../skills/scripts/prepare-embedded-skills';
const __dirname = fileURLToPath(new URL('.', import.meta.url));
const skillsOut = resolve(__dirname, 'skills');
const packagesSkillsDir = resolve(__dirname, '..', 'skills', 'skills');
-const embeddedSkillFilename = 'REFERENCE.md';
-
if (existsSync(skillsOut)) {
rmSync(skillsOut, {recursive: true});
}
@@ -39,59 +35,6 @@ function copySkillDir(src: string, destName: string) {
console.log(` Copied ${destName}`);
}
-const prepareEmbeddedBestPractices = () => {
- const embeddedRoot = join(skillsOut, 'remotion-best-practices');
-
- if (!existsSync(embeddedRoot)) {
- return;
- }
-
- const embeddedSkillNames = readdirSync(embeddedRoot, {withFileTypes: true})
- .filter((entry) => {
- const child = join(embeddedRoot, entry.name);
- return (
- entry.isDirectory() &&
- entry.name !== 'rules' &&
- existsSync(join(child, 'SKILL.md'))
- );
- })
- .map((entry) => entry.name)
- .sort();
-
- const rewriteMarkdownFiles = (dir: string) => {
- for (const entry of readdirSync(dir, {withFileTypes: true})) {
- const file = join(dir, entry.name);
- if (entry.isDirectory()) {
- rewriteMarkdownFiles(file);
- continue;
- }
-
- if (!entry.isFile() || !file.endsWith('.md')) {
- continue;
- }
-
- const contents = readFileSync(file, 'utf-8');
- let rewritten = contents.replaceAll('../remotion-best-practices/', '../');
- for (const skillName of embeddedSkillNames) {
- rewritten = rewritten.replaceAll(
- `${skillName}/SKILL.md`,
- `${skillName}/${embeddedSkillFilename}`,
- );
- }
- if (contents !== rewritten) {
- writeFileSync(file, rewritten);
- }
- }
- };
-
- rewriteMarkdownFiles(embeddedRoot);
-
- for (const skillName of embeddedSkillNames) {
- const child = join(embeddedRoot, skillName);
- renameSync(join(child, 'SKILL.md'), join(child, embeddedSkillFilename));
- }
-};
-
const addCodexOnlyInstructions = () => {
const remotionSkill = join(skillsOut, 'remotion-best-practices', 'SKILL.md');
if (!existsSync(remotionSkill)) {
@@ -133,7 +76,7 @@ if (existsSync(packagesSkillsDir)) {
for (const folder of skillFolders) {
copySkillDir(join(packagesSkillsDir, folder), folder);
}
- prepareEmbeddedBestPractices();
+ prepareEmbeddedSkills(skillsOut);
addCodexOnlyInstructions();
} else {
console.warn('Warning: packages/skills/skills/ not found');
diff --git a/packages/codex-plugin/test/plugin.test.ts b/packages/codex-plugin/test/plugin.test.ts
index dd3ed2a019..f3fb0521bb 100644
--- a/packages/codex-plugin/test/plugin.test.ts
+++ b/packages/codex-plugin/test/plugin.test.ts
@@ -4,7 +4,11 @@ import path from 'node:path';
const packageRoot = path.resolve(import.meta.dir, '..');
const generatedSkillsRoot = path.join(packageRoot, 'skills');
-const embeddedRoot = path.join(generatedSkillsRoot, 'remotion-best-practices');
+const embeddedRoots = [
+ path.join(generatedSkillsRoot, 'remotion-best-practices'),
+ path.join(generatedSkillsRoot, 'remotion-best-practices', 'remotion-markup'),
+ path.join(generatedSkillsRoot, 'remotion-markup'),
+];
const getDirectories = (directory: string) => {
return readdirSync(directory)
@@ -39,24 +43,41 @@ test('only top-level skills use the discovery filename', () => {
topLevelSkillNames.map((skillName) => path.join(skillName, 'SKILL.md')),
);
- const embeddedSkillNames = getDirectories(embeddedRoot).filter((skillName) =>
- topLevelSkillNames.includes(skillName),
- );
- for (const skillName of embeddedSkillNames) {
- expect(existsSync(path.join(embeddedRoot, skillName, 'SKILL.md'))).toBe(
- false,
- );
- expect(existsSync(path.join(embeddedRoot, skillName, 'REFERENCE.md'))).toBe(
- true,
+ for (const embeddedRoot of embeddedRoots) {
+ const embeddedSkillNames = getDirectories(embeddedRoot).filter(
+ (skillName) =>
+ existsSync(path.join(embeddedRoot, skillName, 'REFERENCE.md')),
);
+ for (const skillName of embeddedSkillNames) {
+ expect(existsSync(path.join(embeddedRoot, skillName, 'SKILL.md'))).toBe(
+ false,
+ );
+ expect(
+ existsSync(path.join(embeddedRoot, skillName, 'REFERENCE.md')),
+ ).toBe(true);
+ }
}
});
test('links to embedded skills use the renamed file', () => {
- for (const file of getMarkdownFiles(embeddedRoot)) {
- const contents = readFileSync(file, 'utf-8');
- for (const skillName of getDirectories(embeddedRoot)) {
- expect(contents).not.toContain(`${skillName}/SKILL.md`);
+ for (const embeddedRoot of embeddedRoots) {
+ for (const file of getMarkdownFiles(embeddedRoot)) {
+ const contents = readFileSync(file, 'utf-8');
+ for (const skillName of getDirectories(embeddedRoot)) {
+ expect(contents).not.toContain(`${skillName}/SKILL.md`);
+ }
}
}
});
+
+test('maps is available from either standalone parent skill', () => {
+ for (const parentSkill of ['remotion-best-practices', 'remotion-markup']) {
+ const parentRoot = path.join(generatedSkillsRoot, parentSkill);
+ expect(readFileSync(path.join(parentRoot, 'SKILL.md'), 'utf-8')).toContain(
+ '(remotion-maps/REFERENCE.md)',
+ );
+ expect(
+ existsSync(path.join(parentRoot, 'remotion-maps', 'REFERENCE.md')),
+ ).toBe(true);
+ }
+});
diff --git a/packages/docs/docs/ai/skills.mdx b/packages/docs/docs/ai/skills.mdx
index ba32222b2e..22961fb0e0 100644
--- a/packages/docs/docs/ai/skills.mdx
+++ b/packages/docs/docs/ai/skills.mdx
@@ -86,7 +86,7 @@ Upgrade Remotion, related packages, compatible Mediabunny packages, and installe
<SuggestedPrompt prompt="/remotion-upgrade" />
-### `/mediabunny`
+### `/remotion-multimedia`
Guidance for browser-based multimedia handling with Mediabunny.
diff --git a/packages/example/public/17798fec-689b-4aab-9ba2-06da367a49f4.mov b/packages/example/public/17798fec-689b-4aab-9ba2-06da367a49f4.mov
deleted file mode 100644
index 7fd9eae6b0..0000000000
Binary files a/packages/example/public/17798fec-689b-4aab-9ba2-06da367a49f4.mov and /dev/null differ
diff --git a/packages/it-tests/src/templates/publish.ts b/packages/it-tests/src/templates/publish.ts
index 659bdc91d6..96a40f8a49 100644
--- a/packages/it-tests/src/templates/publish.ts
+++ b/packages/it-tests/src/templates/publish.ts
@@ -1,12 +1,4 @@
-import {
- cpSync,
- existsSync,
- readdirSync,
- readFileSync,
- renameSync,
- statSync,
- writeFileSync,
-} from 'node:fs';
+import {cpSync, readFileSync, writeFileSync} from 'node:fs';
import {tmpdir} from 'node:os';
import path from 'path';
import {$} from 'bun';
@@ -34,66 +26,6 @@ const skillsTemplate: MinimalTemplate = {
const templates = [skillsTemplate, ...folders];
-const embeddedSkillFilename = 'REFERENCE.md';
-
-const prepareEmbeddedBestPractices = (root: string) => {
- const embeddedRoot = path.join(root, 'skills', 'remotion-best-practices');
-
- if (!existsSync(embeddedRoot)) {
- return;
- }
-
- const embeddedSkillNames = readdirSync(embeddedRoot, {withFileTypes: true})
- .filter((entry) => {
- const child = path.join(embeddedRoot, entry.name);
- return (
- entry.isDirectory() &&
- entry.name !== 'rules' &&
- statSync(path.join(child, 'SKILL.md'), {
- throwIfNoEntry: false,
- })?.isFile()
- );
- })
- .map((entry) => entry.name)
- .sort();
-
- const rewriteMarkdownFiles = (dir: string) => {
- for (const entry of readdirSync(dir, {withFileTypes: true})) {
- const file = path.join(dir, entry.name);
- if (entry.isDirectory()) {
- rewriteMarkdownFiles(file);
- continue;
- }
-
- if (!entry.isFile() || !file.endsWith('.md')) {
- continue;
- }
-
- const contents = readFileSync(file, 'utf-8');
- let rewritten = contents.replaceAll('../remotion-best-practices/', '../');
- for (const skillName of embeddedSkillNames) {
- rewritten = rewritten.replaceAll(
- `${skillName}/SKILL.md`,
- `${skillName}/${embeddedSkillFilename}`,
- );
- }
- if (contents !== rewritten) {
- writeFileSync(file, rewritten);
- }
- }
- };
-
- rewriteMarkdownFiles(embeddedRoot);
-
- for (const skillName of embeddedSkillNames) {
- const child = path.join(embeddedRoot, skillName);
- renameSync(
- path.join(child, 'SKILL.md'),
- path.join(child, embeddedSkillFilename),
- );
- }
-};
-
const publish = async (template: MinimalTemplate) => {
const folder = path.join(
__dirname,
@@ -141,7 +73,16 @@ const publish = async (template: MinimalTemplate) => {
}
if (template.templateInMonorepo === 'skills') {
- prepareEmbeddedBestPractices(workingDir);
+ const prepareEmbeddedSkillsScript = path.join(
+ __dirname,
+ '..',
+ '..',
+ '..',
+ 'skills',
+ 'scripts',
+ 'prepare-embedded-skills.ts',
+ );
+ await $`bun ${prepareEmbeddedSkillsScript} ${path.join(workingDir, 'skills')}`;
}
await $`git add .`.cwd(workingDir).nothrow();
diff --git a/packages/kimi-code-plugin/build.mts b/packages/kimi-code-plugin/build.mts
index e6aa739008..bf03338769 100644
--- a/packages/kimi-code-plugin/build.mts
+++ b/packages/kimi-code-plugin/build.mts
@@ -3,21 +3,17 @@ import {
existsSync,
mkdirSync,
readdirSync,
- readFileSync,
- renameSync,
rmSync,
statSync,
- writeFileSync,
} from 'node:fs';
import {join, resolve} from 'node:path';
import {fileURLToPath} from 'node:url';
+import {prepareEmbeddedSkills} from '../skills/scripts/prepare-embedded-skills';
const __dirname = fileURLToPath(new URL('.', import.meta.url));
const skillsOut = resolve(__dirname, 'skills');
const packagesSkillsDir = resolve(__dirname, '..', 'skills', 'skills');
-const embeddedSkillFilename = 'REFERENCE.md';
-
if (existsSync(skillsOut)) {
rmSync(skillsOut, {recursive: true});
}
@@ -39,59 +35,6 @@ const copySkillDir = (src: string, destName: string) => {
console.log(` Copied ${destName}`);
};
-const prepareEmbeddedBestPractices = () => {
- const embeddedRoot = join(skillsOut, 'remotion-best-practices');
-
- if (!existsSync(embeddedRoot)) {
- return;
- }
-
- const embeddedSkillNames = readdirSync(embeddedRoot, {withFileTypes: true})
- .filter((entry) => {
- const child = join(embeddedRoot, entry.name);
- return (
- entry.isDirectory() &&
- entry.name !== 'rules' &&
- existsSync(join(child, 'SKILL.md'))
- );
- })
- .map((entry) => entry.name)
- .sort();
-
- const rewriteMarkdownFiles = (dir: string) => {
- for (const entry of readdirSync(dir, {withFileTypes: true})) {
- const file = join(dir, entry.name);
- if (entry.isDirectory()) {
- rewriteMarkdownFiles(file);
- continue;
- }
-
- if (!entry.isFile() || !file.endsWith('.md')) {
- continue;
- }
-
- const contents = readFileSync(file, 'utf-8');
- let rewritten = contents.replaceAll('../remotion-best-practices/', '../');
- for (const skillName of embeddedSkillNames) {
- rewritten = rewritten.replaceAll(
- `${skillName}/SKILL.md`,
- `${skillName}/${embeddedSkillFilename}`,
- );
- }
- if (contents !== rewritten) {
- writeFileSync(file, rewritten);
- }
- }
- };
-
- rewriteMarkdownFiles(embeddedRoot);
-
- for (const skillName of embeddedSkillNames) {
- const child = join(embeddedRoot, skillName);
- renameSync(join(child, 'SKILL.md'), join(child, embeddedSkillFilename));
- }
-};
-
console.log('Building Kimi Code plugin skills...\n');
if (existsSync(packagesSkillsDir)) {
@@ -103,7 +46,7 @@ if (existsSync(packagesSkillsDir)) {
for (const folder of skillFolders) {
copySkillDir(join(packagesSkillsDir, folder), folder);
}
- prepareEmbeddedBestPractices();
+ prepareEmbeddedSkills(skillsOut);
} else {
console.warn('Warning: packages/skills/skills/ not found');
}
diff --git a/packages/kimi-code-plugin/test/plugin.test.ts b/packages/kimi-code-plugin/test/plugin.test.ts
index 5d79e403aa..75c9ea64a0 100644
--- a/packages/kimi-code-plugin/test/plugin.test.ts
+++ b/packages/kimi-code-plugin/test/plugin.test.ts
@@ -83,26 +83,43 @@ test('generated skills match the canonical skills', () => {
})
.filter((file) => !file.endsWith('.tsx'))
.map((file) => path.relative(canonicalSkillsRoot, file));
- const embeddedSkillNames = getDirectories(
- path.join(canonicalSkillsRoot, 'remotion-best-practices'),
- ).filter((skillName) =>
- existsSync(
- path.join(
- canonicalSkillsRoot,
- 'remotion-best-practices',
- skillName,
- 'SKILL.md',
+ const embeddedSkillRoots = [
+ {
+ parentEntryFilename: 'REFERENCE.md',
+ rootParts: ['remotion-best-practices', 'remotion-markup'],
+ },
+ {
+ parentEntryFilename: 'SKILL.md',
+ rootParts: ['remotion-markup'],
+ },
+ {
+ parentEntryFilename: 'SKILL.md',
+ rootParts: ['remotion-best-practices'],
+ },
+ ].map(({parentEntryFilename, rootParts}) => {
+ const root = path.join(canonicalSkillsRoot, ...rootParts);
+ return {
+ parentEntryFilename,
+ rootParts,
+ skillNames: getDirectories(root).filter((skillName) =>
+ existsSync(path.join(root, skillName, 'SKILL.md')),
),
- ),
- );
+ };
+ });
const getGeneratedRelativeFile = (relativeFile: string) => {
const pathParts = relativeFile.split(path.sep);
- if (
- pathParts[0] === 'remotion-best-practices' &&
- embeddedSkillNames.includes(pathParts[1]) &&
- pathParts.at(-1) === 'SKILL.md'
- ) {
- pathParts[pathParts.length - 1] = 'REFERENCE.md';
+ for (const {rootParts, skillNames} of embeddedSkillRoots) {
+ const isWithinRoot = rootParts.every(
+ (part, index) => pathParts[index] === part,
+ );
+ if (
+ isWithinRoot &&
+ skillNames.includes(pathParts[rootParts.length] as string) &&
+ pathParts.at(-1) === 'SKILL.md'
+ ) {
+ pathParts[pathParts.length - 1] = 'REFERENCE.md';
+ break;
+ }
}
return pathParts.join(path.sep);
@@ -126,12 +143,32 @@ test('generated skills match the canonical skills', () => {
const pathParts = relativeFile.split(path.sep);
const canonicalContents = readFileSync(canonicalFile, 'utf-8');
let expectedContents = canonicalContents;
- if (pathParts[0] === 'remotion-best-practices') {
- expectedContents = expectedContents.replaceAll(
- '../remotion-best-practices/',
- '../',
+ for (const {
+ parentEntryFilename,
+ rootParts,
+ skillNames,
+ } of embeddedSkillRoots) {
+ const isWithinRoot = rootParts.every(
+ (part, index) => pathParts[index] === part,
);
- for (const skillName of embeddedSkillNames) {
+ if (!isWithinRoot) {
+ continue;
+ }
+
+ const parentSkillName = rootParts.at(-1);
+ expectedContents = expectedContents
+ .replaceAll(
+ `../${parentSkillName}/SKILL.md`,
+ `../${parentEntryFilename}`,
+ )
+ .replaceAll(`../${parentSkillName}/`, '../');
+ if (parentSkillName === 'remotion-markup') {
+ expectedContents = expectedContents.replaceAll(
+ '../../../remotion-interactivity/SKILL.md',
+ '../../../../remotion-interactivity/SKILL.md',
+ );
+ }
+ for (const skillName of skillNames) {
expectedContents = expectedContents.replaceAll(
`${skillName}/SKILL.md`,
`${skillName}/REFERENCE.md`,
@@ -144,3 +181,15 @@ test('generated skills match the canonical skills', () => {
}
}
});
+
+test('maps is available from either standalone parent skill', () => {
+ for (const parentSkill of ['remotion-best-practices', 'remotion-markup']) {
+ const parentRoot = path.join(generatedSkillsRoot, parentSkill);
+ expect(readFileSync(path.join(parentRoot, 'SKILL.md'), 'utf-8')).toContain(
+ '(remotion-maps/REFERENCE.md)',
+ );
+ expect(
+ existsSync(path.join(parentRoot, 'remotion-maps', 'REFERENCE.md')),
+ ).toBe(true);
+ }
+});
diff --git a/packages/skills/scripts/prepare-embedded-skills.ts b/packages/skills/scripts/prepare-embedded-skills.ts
new file mode 100644
index 0000000000..468e1e8257
--- /dev/null
+++ b/packages/skills/scripts/prepare-embedded-skills.ts
@@ -0,0 +1,119 @@
+import {
+ existsSync,
+ readdirSync,
+ readFileSync,
+ renameSync,
+ statSync,
+ writeFileSync,
+} from 'node:fs';
+import path from 'node:path';
+
+const embeddedSkillFilename = 'REFERENCE.md';
+
+const prepareEmbeddedSkillRoot = ({
+ embeddedRoot,
+ parentEntryFilename,
+}: {
+ embeddedRoot: string;
+ parentEntryFilename: 'REFERENCE.md' | 'SKILL.md';
+}) => {
+ if (!existsSync(embeddedRoot)) {
+ return;
+ }
+
+ const embeddedSkillNames = readdirSync(embeddedRoot, {withFileTypes: true})
+ .filter((entry) => {
+ const child = path.join(embeddedRoot, entry.name);
+ return (
+ entry.isDirectory() &&
+ entry.name !== 'rules' &&
+ statSync(path.join(child, 'SKILL.md'), {
+ throwIfNoEntry: false,
+ })?.isFile()
+ );
+ })
+ .map((entry) => entry.name)
+ .sort();
+
+ const parentSkillName = path.basename(embeddedRoot);
+ const rewriteMarkdownFiles = (dir: string) => {
+ for (const entry of readdirSync(dir, {withFileTypes: true})) {
+ const file = path.join(dir, entry.name);
+ if (entry.isDirectory()) {
+ rewriteMarkdownFiles(file);
+ continue;
+ }
+
+ if (!entry.isFile() || !file.endsWith('.md')) {
+ continue;
+ }
+
+ const contents = readFileSync(file, 'utf-8');
+ let rewritten = contents
+ .replaceAll(
+ `../${parentSkillName}/SKILL.md`,
+ `../${parentEntryFilename}`,
+ )
+ .replaceAll(`../${parentSkillName}/`, '../');
+ if (parentSkillName === 'remotion-markup') {
+ rewritten = rewritten.replaceAll(
+ '../../../remotion-interactivity/SKILL.md',
+ '../../../../remotion-interactivity/SKILL.md',
+ );
+ }
+ for (const skillName of embeddedSkillNames) {
+ rewritten = rewritten.replaceAll(
+ `${skillName}/SKILL.md`,
+ `${skillName}/${embeddedSkillFilename}`,
+ );
+ }
+ if (contents !== rewritten) {
+ writeFileSync(file, rewritten);
+ }
+ }
+ };
+
+ rewriteMarkdownFiles(embeddedRoot);
+
+ for (const skillName of embeddedSkillNames) {
+ const child = path.join(embeddedRoot, skillName);
+ renameSync(
+ path.join(child, 'SKILL.md'),
+ path.join(child, embeddedSkillFilename),
+ );
+ }
+};
+
+export const prepareEmbeddedSkills = (skillsRoot: string) => {
+ const embeddedRoots = [
+ {
+ embeddedRoot: path.join(
+ skillsRoot,
+ 'remotion-best-practices',
+ 'remotion-markup',
+ ),
+ parentEntryFilename: 'REFERENCE.md' as const,
+ },
+ {
+ embeddedRoot: path.join(skillsRoot, 'remotion-markup'),
+ parentEntryFilename: 'SKILL.md' as const,
+ },
+ {
+ embeddedRoot: path.join(skillsRoot, 'remotion-best-practices'),
+ parentEntryFilename: 'SKILL.md' as const,
+ },
+ ];
+
+ for (const embeddedRoot of embeddedRoots) {
+ prepareEmbeddedSkillRoot(embeddedRoot);
+ }
+};
+
+if (import.meta.main) {
+ const skillsRoot = process.argv[2];
+ if (!skillsRoot) {
+ throw new Error('Expected the skills root as the first argument');
+ }
+
+ prepareEmbeddedSkills(path.resolve(skillsRoot));
+}
diff --git a/packages/skills/scripts/sync-best-practices.ts b/packages/skills/scripts/sync-best-practices.ts
deleted file mode 100644
index f21e183ec3..0000000000
--- a/packages/skills/scripts/sync-best-practices.ts
+++ /dev/null
@@ -1,81 +0,0 @@
-import {
- existsSync,
- lstatSync,
- readdirSync,
- readFileSync,
- readlinkSync,
- symlinkSync,
- writeFileSync,
-} from 'node:fs';
-import path from 'node:path';
-
-const repoRoot = process.env.SKILLS_REPO_ROOT
- ? path.resolve(process.env.SKILLS_REPO_ROOT)
- : path.resolve(__dirname, '..', '..', '..');
-const skillsRoot = path.join(repoRoot, 'packages', 'skills', 'skills');
-const bestPracticesRoot = path.join(skillsRoot, 'remotion-best-practices');
-const bestPracticesSkill = path.join(bestPracticesRoot, 'SKILL.md');
-const checkOnly = process.argv.includes('--check');
-const issues: string[] = [];
-
-const skillFolders = readdirSync(skillsRoot, {withFileTypes: true})
- .filter((entry) => entry.isDirectory() || entry.isSymbolicLink())
- .map((entry) => entry.name)
- .filter((name) => name !== 'remotion-best-practices')
- .sort();
-
-for (const skillFolder of skillFolders) {
- const embeddedPath = path.join(bestPracticesRoot, skillFolder);
- const expectedTarget = `../${skillFolder}`;
-
- if (!existsSync(embeddedPath)) {
- const message = `Missing ${path.relative(repoRoot, embeddedPath)} -> ${expectedTarget}`;
- if (checkOnly) {
- issues.push(message);
- } else {
- symlinkSync(expectedTarget, embeddedPath, 'dir');
- console.log(
- `Created ${path.relative(repoRoot, embeddedPath)} -> ${expectedTarget}`,
- );
- }
- continue;
- }
-
- const stats = lstatSync(embeddedPath);
- if (stats.isSymbolicLink()) {
- const actualTarget = readlinkSync(embeddedPath);
- if (actualTarget !== expectedTarget) {
- issues.push(
- `${path.relative(repoRoot, embeddedPath)} points to ${actualTarget}, expected ${expectedTarget}`,
- );
- }
- }
-}
-
-let skillContents = readFileSync(bestPracticesSkill, 'utf-8');
-for (const skillFolder of skillFolders) {
- skillContents = skillContents.replaceAll(
- `../${skillFolder}/`,
- `${skillFolder}/`,
- );
-}
-
-const currentSkillContents = readFileSync(bestPracticesSkill, 'utf-8');
-if (currentSkillContents !== skillContents) {
- const message = `${path.relative(repoRoot, bestPracticesSkill)} has unsynced sibling skill links`;
- if (checkOnly) {
- issues.push(message);
- } else {
- writeFileSync(bestPracticesSkill, skillContents);
- }
-}
-
-if (issues.length > 0) {
- console.error(`remotion-best-practices is not synced:`);
- for (const issue of issues) {
- console.error(`- ${issue}`);
- }
- process.exit(1);
-}
-
-console.log('remotion-best-practices is synced.');
diff --git a/packages/skills/scripts/sync-embedded-skills.ts b/packages/skills/scripts/sync-embedded-skills.ts
new file mode 100644
index 0000000000..d4b2da8464
--- /dev/null
+++ b/packages/skills/scripts/sync-embedded-skills.ts
@@ -0,0 +1,96 @@
+import {
+ existsSync,
+ lstatSync,
+ readdirSync,
+ readFileSync,
+ readlinkSync,
+ symlinkSync,
+ writeFileSync,
+} from 'node:fs';
+import path from 'node:path';
+
+const repoRoot = process.env.SKILLS_REPO_ROOT
+ ? path.resolve(process.env.SKILLS_REPO_ROOT)
+ : path.resolve(__dirname, '..', '..', '..');
+const skillsRoot = path.join(repoRoot, 'packages', 'skills', 'skills');
+const checkOnly = process.argv.includes('--check');
+const issues: string[] = [];
+
+const skillFolders = readdirSync(skillsRoot, {withFileTypes: true})
+ .filter((entry) => entry.isDirectory() || entry.isSymbolicLink())
+ .map((entry) => entry.name)
+ .sort();
+
+const embeddedSkillSets = [
+ {
+ parentSkill: 'remotion-best-practices',
+ skillNames: skillFolders.filter(
+ (name) => name !== 'remotion-best-practices',
+ ),
+ },
+ {
+ parentSkill: 'remotion-markup',
+ skillNames: ['remotion-maps'],
+ },
+];
+
+for (const {parentSkill, skillNames} of embeddedSkillSets) {
+ const parentRoot = path.join(skillsRoot, parentSkill);
+ const parentSkillFile = path.join(parentRoot, 'SKILL.md');
+
+ for (const skillName of skillNames) {
+ const embeddedPath = path.join(parentRoot, skillName);
+ const expectedTarget = `../${skillName}`;
+
+ if (!existsSync(embeddedPath)) {
+ const message = `Missing ${path.relative(repoRoot, embeddedPath)} -> ${expectedTarget}`;
+ if (checkOnly) {
+ issues.push(message);
+ } else {
+ symlinkSync(expectedTarget, embeddedPath, 'dir');
+ console.log(
+ `Created ${path.relative(repoRoot, embeddedPath)} -> ${expectedTarget}`,
+ );
+ }
+ continue;
+ }
+
+ const stats = lstatSync(embeddedPath);
+ if (stats.isSymbolicLink()) {
+ const actualTarget = readlinkSync(embeddedPath);
+ if (actualTarget !== expectedTarget) {
+ issues.push(
+ `${path.relative(repoRoot, embeddedPath)} points to ${actualTarget}, expected ${expectedTarget}`,
+ );
+ }
+ }
+ }
+
+ let skillContents = readFileSync(parentSkillFile, 'utf-8');
+ for (const skillName of skillNames) {
+ skillContents = skillContents.replaceAll(
+ `../${skillName}/`,
+ `${skillName}/`,
+ );
+ }
+
+ const currentSkillContents = readFileSync(parentSkillFile, 'utf-8');
+ if (currentSkillContents !== skillContents) {
+ const message = `${path.relative(repoRoot, parentSkillFile)} has unsynced embedded skill links`;
+ if (checkOnly) {
+ issues.push(message);
+ } else {
+ writeFileSync(parentSkillFile, skillContents);
+ }
+ }
+}
+
+if (issues.length > 0) {
+ console.error('Embedded skills are not synced:');
+ for (const issue of issues) {
+ console.error(`- ${issue}`);
+ }
+ process.exit(1);
+}
+
+console.log('Embedded skills are synced.');
diff --git a/packages/skills/scripts/validate-links.ts b/packages/skills/scripts/validate-links.ts
index 5c1c65ccc2..c882000e03 100644
--- a/packages/skills/scripts/validate-links.ts
+++ b/packages/skills/scripts/validate-links.ts
@@ -20,7 +20,6 @@ const repoRoot = process.env.SKILLS_REPO_ROOT
const skillsRoot = process.env.SKILLS_ROOT
? path.resolve(process.env.SKILLS_ROOT)
: path.join(repoRoot, 'packages', 'skills', 'skills');
-const bestPracticesRoot = path.join(skillsRoot, 'remotion-best-practices');
const markdownLinkRegex = /!?\[[^\]]*]\(([^)]+)\)/g;
@@ -128,61 +127,74 @@ const validateMarkdownLinks = () => {
return issues;
};
-const validateEmbeddedBestPracticesSkills = () => {
+const validateEmbeddedSkills = () => {
const issues: LinkIssue[] = [];
const skillFolders = readdirSync(skillsRoot, {withFileTypes: true})
.filter((entry) => entry.isDirectory() || entry.isSymbolicLink())
.map((entry) => entry.name)
- .filter((name) => name !== 'remotion-best-practices')
.sort();
- for (const skillFolder of skillFolders) {
- const embeddedPath = path.join(bestPracticesRoot, skillFolder);
-
- if (!existsSync(embeddedPath)) {
- issues.push({
- file: bestPracticesRoot,
- link: skillFolder,
- message: `Missing embedded skill folder in remotion-best-practices: ${skillFolder}`,
- });
- continue;
- }
-
- const embeddedStats = lstatSync(embeddedPath);
- if (embeddedStats.isSymbolicLink()) {
- const target = readlinkSync(embeddedPath);
- if (target !== `../${skillFolder}`) {
+ const embeddedSkillSets = [
+ {
+ parentSkill: 'remotion-best-practices',
+ skillNames: skillFolders.filter(
+ (name) => name !== 'remotion-best-practices',
+ ),
+ },
+ {
+ parentSkill: 'remotion-markup',
+ skillNames: ['remotion-maps'],
+ },
+ ];
+
+ for (const {parentSkill, skillNames} of embeddedSkillSets) {
+ const parentRoot = path.join(skillsRoot, parentSkill);
+ for (const skillName of skillNames) {
+ const embeddedPath = path.join(parentRoot, skillName);
+
+ if (!existsSync(embeddedPath)) {
issues.push({
- file: embeddedPath,
- link: target,
- message: `Expected symlink target "../${skillFolder}"`,
+ file: parentRoot,
+ link: skillName,
+ message: `Missing embedded skill folder in ${parentSkill}: ${skillName}`,
});
+ continue;
+ }
+
+ const embeddedStats = lstatSync(embeddedPath);
+ if (embeddedStats.isSymbolicLink()) {
+ const target = readlinkSync(embeddedPath);
+ if (target !== `../${skillName}`) {
+ issues.push({
+ file: embeddedPath,
+ link: target,
+ message: `Expected symlink target "../${skillName}"`,
+ });
+ }
}
}
- }
- const bestPracticesSkill = path.join(bestPracticesRoot, 'SKILL.md');
- const contents = readFileSync(bestPracticesSkill, 'utf-8');
- const parentSkillLinks = [...contents.matchAll(markdownLinkRegex)]
- .map((match) => stripMarkdownTitle(match[1] as string))
- .filter((link) => link.startsWith('../'));
-
- for (const link of parentSkillLinks) {
- issues.push({
- file: bestPracticesSkill,
- link,
- message:
- 'Link from remotion-best-practices should point to the embedded copy, not a sibling skill folder',
- });
+ const parentSkillFile = path.join(parentRoot, 'SKILL.md');
+ const contents = readFileSync(parentSkillFile, 'utf-8');
+ const siblingSkillLinks = [...contents.matchAll(markdownLinkRegex)]
+ .map((match) => stripMarkdownTitle(match[1] as string))
+ .filter((link) =>
+ skillNames.some((skillName) => link.startsWith(`../${skillName}/`)),
+ );
+
+ for (const link of siblingSkillLinks) {
+ issues.push({
+ file: parentSkillFile,
+ link,
+ message: `Link from ${parentSkill} should point to the embedded copy, not a sibling skill folder`,
+ });
+ }
}
return issues;
};
-const issues = [
- ...validateMarkdownLinks(),
- ...validateEmbeddedBestPracticesSkills(),
-];
+const issues = [...validateMarkdownLinks(), ...validateEmbeddedSkills()];
if (issues.length > 0) {
console.error(`Found ${issues.length} invalid skill link issue(s):`);
diff --git a/packages/skills/skills/remotion-best-practices/SKILL.md b/packages/skills/skills/remotion-best-practices/SKILL.md
index d129fc1314..74b3e7abd2 100644
--- a/packages/skills/skills/remotion-best-practices/SKILL.md
+++ b/packages/skills/skills/remotion-best-practices/SKILL.md
@@ -1,6 +1,6 @@
---
name: remotion-best-practices
-description: Best practices for Remotion
+description: Router for all Remotion skills
metadata:
tags: remotion, video, react, animation, composition
---
@@ -17,9 +17,9 @@ If you are writing Remotion React Markup, load [Remotion Markup Best Practices](
For static maps, animated routes and markers, geographic explainers, Mapbox, MapLibre, MapTiler, GeoJSON, or 3D geographic flyovers, load [Remotion Maps](remotion-maps/SKILL.md).
-## Mediabunny Skills
+## Multimedia
-For achieving multimedia tasks in the browser, such as trimming, cropping videos, or getting metadata from them, load [Mediabunny Best Practices](mediabunny/SKILL.md)
+For achieving multimedia tasks in the browser, such as trimming, cropping videos, or getting metadata from them, load [Remotion Multimedia](remotion-multimedia/SKILL.md)
## Improving Interactivity
diff --git a/packages/skills/skills/remotion-best-practices/mediabunny b/packages/skills/skills/remotion-best-practices/mediabunny
deleted file mode 120000
index 439d57aa5e..0000000000
--- a/packages/skills/skills/remotion-best-practices/mediabunny
+++ /dev/null
@@ -1 +0,0 @@
-../mediabunny
\ No newline at end of file
diff --git a/packages/skills/skills/remotion-best-practices/remotion-multimedia b/packages/skills/skills/remotion-best-practices/remotion-multimedia
new file mode 120000
index 0000000000..d8a81993eb
--- /dev/null
+++ b/packages/skills/skills/remotion-best-practices/remotion-multimedia
@@ -0,0 +1 @@
+../remotion-multimedia
\ No newline at end of file
diff --git a/packages/skills/skills/remotion-captions/SKILL.md b/packages/skills/skills/remotion-captions/SKILL.md
index bc2c857739..36d8da506b 100644
--- a/packages/skills/skills/remotion-captions/SKILL.md
+++ b/packages/skills/skills/remotion-captions/SKILL.md
@@ -1,6 +1,6 @@
---
name: remotion-captions
-description: Dealing with captions in Remotion
+description: Transcribing, displaying and animating captions
metadata:
tags: subtitles, captions, remotion, json
---
diff --git a/packages/skills/skills/remotion-create/SKILL.md b/packages/skills/skills/remotion-create/SKILL.md
index f0f8f62bc2..4eaa00a189 100644
--- a/packages/skills/skills/remotion-create/SKILL.md
+++ b/packages/skills/skills/remotion-create/SKILL.md
@@ -1,6 +1,6 @@
---
name: remotion-create
-description: Creating a new Remotion video
+description: Create a new Remotion video
metadata:
tags: remotion
---
@@ -41,7 +41,9 @@ If Tailwind is requested, see [tailwind.md](tailwind.md) for using TailwindCSS i
npx remotion studio --no-open
```
-This will start a long-running process and print the server URL for the preview.
+This will start a long-running process and print the server URL for the preview.
+If server is already started, it will print the URL.
+You can visit a specific composition by navigating to `/[composition-id]`, for example `http://localhost:3000/MapAnimation`.
## Follow-up
diff --git a/packages/skills/skills/remotion-create/video-layout.md b/packages/skills/skills/remotion-create/video-layout.md
index 2ac116f6cb..3e6bc435ef 100644
--- a/packages/skills/skills/remotion-create/video-layout.md
+++ b/packages/skills/skills/remotion-create/video-layout.md
@@ -1,68 +1,9 @@
----
-name: video-layout
-description: Video-first layout, composition, and text sizing guidance for Remotion.
-metadata:
- tags: layout, composition, typography, text, motion graphics, promo
----
-
-# Video layout
-
-Videos are watched differently than web pages are read. Design for quick understanding from the full frame, not for a dense UI that rewards close inspection.
-
-## Start from the frame
+You are designing a video, not a webpage.
- Decide what the viewer should notice first in each scene. Build the frame around that one thing.
- Keep important content inside a generous safe area. For 1080px-wide videos, keep key text at least 80px from the sides and 100px from the top and bottom.
-- Prefer centered, stacked, or strongly aligned layouts. Avoid scattered dashboard-like layouts.
-- Use empty space intentionally. A video frame with one strong message is usually better than a frame full of widgets.
-- Do not place objects side by side just because there is room. If two elements compete, show them one after another or make one clearly secondary.
-
-## Default scene structure
-
-For promos, explainers, and motion graphics, a good default scene is:
-
-- One main text message
-- One supporting visual, such as an icon, product card, shape, or screenshot-style mockup
-- One or two background accents
-
-Avoid defaulting to many cards, badges, borders, pills, or tiny labels. Those are web UI patterns and often make videos feel cluttered.
-
-## Prevent overlap by construction
-
-- Do not manually position every readable element with independent `top`, `left`, `right`, or `bottom` values.
-- Put readable content in normal layout containers using `flex`, `grid`, `gap`, `justifyContent`, and `alignItems`.
-- Use absolute positioning mainly for backgrounds, decorative shapes, glows, particles, and elements that are meant to layer behind the content.
-- Reserve a slot for each major element in the scene. For example, a vertical promo scene can use a centered column with `gap` for headline, card, and CTA.
-- Animate elements from their reserved slot using `opacity`, `transform`, and `scale`; do not animate them into a space occupied by another element.
-- If an element enters from offscreen or from another part of the frame, its final resting position must still belong to a layout slot.
-- When text length is unknown or user-provided, assume it may wrap. Give the text block enough width and vertical room instead of placing another object immediately under it.
-
-## Text in video
-
-- Text must be readable at video-viewing distance. If unsure, make it larger, not smaller.
-- Treat small text as decorative unless the user explicitly needs it to be read.
+- Do not add redundant elements.
- For 1080px-wide compositions, use these rough minimums:
- Main headline: 84px
- Important supporting text: 44px
- - Labels or short callouts: 32px
-- Scale those values with the composition width. For example, a 1920px-wide composition needs larger text than a 1080px-wide composition.
-- Keep line lengths short. Break long ideas into multiple scenes instead of shrinking the font.
-- Use strong contrast between text and background. Add a subtle backing shape or simplify the background if the text is hard to read.
-- Do not stack many text blocks in the same area. Give each message its own moment or clearly separated region.
-
-## Solve crowding with time
-
-- Let time solve layout problems. Instead of showing every feature at once, reveal them one after another.
-- If a frame feels crowded, remove an element, enlarge the focal element, or move the secondary element to another scene.
-- Favor centered or strongly aligned compositions over scattered UI layouts.
-- Use background shapes, gradients, and cards to support the message, not to create visual noise.
-- Keep the visual system consistent across scenes: repeated spacing, repeated alignment, and a small set of shapes/colors.
-
-## Pre-render check
-
-Before rendering, inspect a representative frame at normal size:
-
-- Can the main message be read quickly?
-- Is there one obvious focal point?
-- Are any objects touching, overlapping, or awkwardly sitting next to each other?
-- Would the frame still make sense if seen for less than one second?
+- Scale those values with the composition width.
diff --git a/packages/skills/skills/remotion-docs/SKILL.md b/packages/skills/skills/remotion-docs/SKILL.md
index 86ead4c910..d8f41bc41e 100644
--- a/packages/skills/skills/remotion-docs/SKILL.md
+++ b/packages/skills/skills/remotion-docs/SKILL.md
@@ -1,6 +1,6 @@
---
name: remotion-docs
-description: Search and fetch Remotion documentation pages
+description: Search Remotion documentation
metadata:
tags: remotion, docs, documentation, search
---
diff --git a/packages/skills/skills/remotion-interactivity/SKILL.md b/packages/skills/skills/remotion-interactivity/SKILL.md
index 381e5a521e..c6d8cd2fce 100644
--- a/packages/skills/skills/remotion-interactivity/SKILL.md
+++ b/packages/skills/skills/remotion-interactivity/SKILL.md
@@ -1,6 +1,6 @@
---
name: remotion-interactivity
-description: Structures Remotion markup to enable interactivity
+description: Structure Remotion markup for interactivity
metadata:
tags: remotion, interactivity, studio, visual mode
---
@@ -63,7 +63,7 @@ const baseStyle = useMemo(() => {
return {
fontSize: 12 // ❌ Non-inline styles are not supported
}
-}, [])
+}, []);
<Interactive.Div
style={{
diff --git a/packages/skills/skills/remotion-interactivity/best-practices.md b/packages/skills/skills/remotion-interactivity/best-practices.md
deleted file mode 100644
index 50ba3815b8..0000000000
--- a/packages/skills/skills/remotion-interactivity/best-practices.md
+++ /dev/null
@@ -1,246 +0,0 @@
----
-image: /generated/articles-docs-studio-interactivity-best-practices.png
-title: Interactivity best practices
-crumb: "Remotion Studio"
----
-
-# Interactivity best practices
-
-By writing Remotion markup in a specific way, the [Remotion Studio](/docs/studio) is able to recognize the structure of the code and makes it [interactive](/docs/studio/interactivity):
-
-- Allowing items to be selected by clicking on them
-- Allowing drag+drop, resizing and rotation
-- Editing the CSS styles
-- Making keyframes and easing values editable
-
-If the markup is too complex for the Studio to make it interactive, then the values become grayed out.
-Use the [`/remotion-interactivity` skill](/docs/ai/skills#remotion-interactivity) skill to instruct an agent to restructure the markup to make it editable.
-
-## Make an HTML element interactive using `Interactive`
-
-Every HTML and SVG element such as `<div>` can be turned interactive using `Interactive`:
-
-```tsx title="Interactive elements"
-<Interactive.Div name="Greeting card" style={{fontSize: 80, padding: 24}}>
- Hello
-</Interactive.Div>
-```
-
-This allows styles and keyframes to be set in the Studio. Be sensible, if a component has many elements, the timeline might get messy.
-
-## Give interactive elements a descriptive name {#give-interactive-elements-a-descriptive-name}
-
-Add a `name` prop to elements to make them easily identifyable.
-
-```tsx title="Interactive names"
-<>
- <Interactive.Div name="Hero title" style={{fontSize: 80}}>
- Launch day
- </Interactive.Div>
- <Img name="Avatar" src="https://remotion.media/image.jpeg" />
- <Video name="Background" src="https://remotion.media/video.mp4" />
- <Sequence name="Title">
- Launch day
- </Sequence>
-</>
-```
-
-## Keep all CSS styles inline
-
-The best way is to just pass a plain object to `style` - no referring to constants, no object spreading, no math.
-
-```tsx title="Interactive example"
-<Interactive.Div
- style={{
- fontSize: 80,
- color: 'red',
- }}
->
- Hello World!
-</Interactive.Div>
-```
-
-```tsx title="❌ Bad for interactivity"
-const baseStyle = useMemo(() => {
- return {
- fontSize: 12 // ❌ Non-inline styles are not supported
- }
-}, [])
-
-<Interactive.Div
- style={{
- ...baseStyle, // ❌ Spreading is not supported
- color: RED, // ❌ Referring to constants is not supported
- scale: frame * 10 // ❌ Math is not supported
- }}
->
- Hello World!
-</Interactive.Div>
-```
-
-## Animate using `interpolate()`
-
-<SuggestedPrompt prompt="/remotion-interactivity Inline the values to make them editable." />
-
-Write animations as inline `interpolate()` calls on the property that changes.
-All values should also be hardcoded values: Input range, output range, easing, extrapolation, `output` property.
-
-No math should be performed, except basic arithmetic 2-side arithmetic with `durationInFrames`, `fps`, `width` and `height` from `useVideoConfig()`.
-
-```tsx title="Inline values"
-const {fps} = useVideoConfig();
-
-// πŸ‘ Inline values can be standardized and keyframed
-<Interactive.Div
- name="Product card"
- style={{
- color: 'white',
- fontSize: 80,
- scale: interpolate(frame, [0, fps], [0, 1], {
- easing: Easing.spring({damping: 200}),
- output: 'perceptual-scale',
- extrapolateLeft: 'clamp',
- extrapolateRight: 'clamp'
- }),
- rotate: interpolate(frame, [0, 1 * fps], ['0deg', '20deg'], {
- easing: Easing.spring({damping: 200}),
- extrapolateLeft: 'clamp',
- extrapolateRight: 'clamp'
- }),
- translate: interpolate(frame, [durationInFrames - 30, durationInFrames], ['0px 0px', '0px 120px'], {
- easing: Easing.spring({damping: 200}),
- output: 'perceptual-scale',
- extrapolateLeft: 'clamp',
- extrapolateRight: 'clamp'
- }),
- }}
-/>
-```
-
-```tsx title="❌ Bad interactivity"
-const translateY = interpolate(frame, [0, 30], [0, 120]); // ❌ Math should be directly in the markup
-
-<Interactive.Div
- name="Product card"
- style={{
- translate: translateY, // ❌ Only inline interpolate() calls are supported,
- rotate: interpolate(frame, [start, start + 10], [0, Math.PI]), // ❌ Cannot use math with arbitrary variables, cannot use constants
- scale: interpolate(anyVariable, [0, 30], [0, 1]) // ❌ Can only interpret the `frame` variable.
- }}
-/>
-```
-
-## Use `scale`, `translate`, `rotate` CSS properties
-
-Avoid the `transform` CSS property.
-If possible, use `scale`, `rotate` and `translate` instead because only they are interactively editable.
-
-```txt title="Prompt"
-Make this interactive in the Remotion Studio: https://www.remotion.dev/docs/studio/interactivity-best-practices.md
-```
-
-## Keep composition metadata inline
-
-When scaffolding a composition, keep `width`, `height`, `fps`, `durationInFrames` and [`defaultProps`](/docs/composition#defaultprops) inline and make no type assertions.
-
-The Props editor can save visual edits back to your code when `defaultProps` is an inline object literal on `<Composition>` or [`<Still>`](/docs/still).
-
-```tsx
-// πŸ‘ Static values are in <Composition>, dynamic values are in calculateMetadata()
-const calculateMetadata = useMemo(async () => {
- const dimensions = await getDimensions(); // just an example
- return {width: dimensions.width, height: dimensions.height};
-});
-
-<Composition
- id="my-video"
- component={MyComponent}
- durationInFrames={150}
- fps={30}
- calculateMetadata={calculateMetadata}
- defaultProps={{title: 'Hello', color: '#0b84ff'}}
-/>
-```
-
-```tsx title="Negative examples"
-const defaultProps = {title: 'Hello', color: '#0b84ff'}; // ❌ Don't extract defaultProps, must be inline
-const calculateMetadata = useMemo(() => {
- // ❌ Unnecessary because no calculation is being done,
- return {durationInFrames: 150, fps: 30, width: 1920, height: 1080};
-});
-
-<Composition
- id="my-video"
- component={MyComponent}
- calculateMetadata={calculateMetadata}
- defaultProps={{
- title: 'Hello',
- } as Props} // ❌ Don't have type assertions, instead type MyComponent correctly
-/>
-```
-
-Use only [`calculateMetadata()`](/docs/calculate-metadata) for the part of the metadata that is dynamic.
-
-```txt title="Prompt"
-Make this interactive in the Remotion Studio: https://www.remotion.dev/docs/studio/interactivity-best-practices.md
-```
-
-## Effects should be inline too
-
-The effects array should not be computed.
-The same rules for setting keyframes as `interpolate()` apply too here: All values should also be hardcoded: Input range, output range, easing, extrapolation, `output` property.
-
-```tsx title="Effects"
-// πŸ‘ Parameters are inline and the array shape is stable
-<CanvasImage
- src={src}
- width={1280}
- height={720}
- effects={[
- radialProgressiveBlur({
- center: [0.5, 0.5],
- width: 1.2,
- height: 0.8,
- start: 0.2,
- disabled: true,
- rotation: interpolate(frame, [0, 120], [0, 180]),
- }),
- ]}
-/>
-
-const center = [0.5, 0.5] as const;
-const rotation = frame * 1.5;
-
-<CanvasImage
- src={src}
- width={1280}
- height={720}
- // ❌ Conditional effect is not animateable
- effects={enabled ? [
- radialProgressiveBlur({
- // ❌ Not inline
- center,
- rotation,
- }),
- ] : []}
-/>
-```
-
-Render separate elements if one version should have effects and another should not.
-
-```txt title="Prompt"
-Make this interactive in the Remotion Studio: https://www.remotion.dev/docs/studio/interactivity-best-practices.md
-```
-
-## Make props of a custom component editable
-
-If you have a custom non-top-level component and want to make the props of that editable, see: [Make a component interactive](/docs/studio/make-component-interactive).
-
-## See also
-
-- [Studio interactivity](/docs/studio/interactivity)
-- [Make a component interactive](/docs/studio/make-component-interactive)
-- [Visual editing](/docs/visual-editing)
-- [`Interactive`](/docs/interactive)
-- [`interpolate()`](/docs/interpolate)
-- [`Easing.spring()`](/docs/easing#spring)
diff --git a/packages/skills/skills/remotion-maps/SKILL.md b/packages/skills/skills/remotion-maps/SKILL.md
index 3ea99561cb..f757ef89a4 100644
--- a/packages/skills/skills/remotion-maps/SKILL.md
+++ b/packages/skills/skills/remotion-maps/SKILL.md
@@ -1,6 +1,6 @@
---
name: remotion-maps
-description: Best practices for animating Maps in Remotion
+description: Remotion Map animation knowledge
---
# Remotion Maps
diff --git a/packages/skills/skills/remotion-markup/SKILL.md b/packages/skills/skills/remotion-markup/SKILL.md
index 92e4e8e6d3..6dee3d8792 100644
--- a/packages/skills/skills/remotion-markup/SKILL.md
+++ b/packages/skills/skills/remotion-markup/SKILL.md
@@ -1,6 +1,6 @@
---
name: remotion-markup
-description: Best practices for writing Remotion React Markup
+description: Content, animation and effects best practices
metadata:
tags: remotion, react, markup
---
@@ -10,15 +10,12 @@ If this is not relevant, load [Remotion Best Practices](../remotion-best-practic
## General rules
-Animate properties using `useCurrentFrame()` and `interpolate()`.
-
-Use `interpolate()` over `spring()`.
+Animate properties using `useCurrentFrame()` and `interpolate()`.
Use `Easing.bezier()` to customize timing, including jumpy or overshooting motion.
-Use `Easing.spring()` if you want spring animations
+Use `Easing.spring()` if you want spring animations.
-HTML Elements which make sense to be made interactive in the Studio should use `Interactive`: `<div>` -> `<Interactive.Div>`.
-Set a descriptive `name` prop such as `name="Hero title"` for `Interactive`, `Solid`, `Sequence`.
+Structure your markup according to [Remotion Interactivity Best Practices](../remotion-interactivity/SKILL.md)
```tsx
import { useCurrentFrame, Easing, interpolate, Interactive } from "remotion";
@@ -49,9 +46,22 @@ Prefer `scale`, `translate`, `rotate` CSS properties over `transform`.
```tsx
// πŸ‘ Inline editable keyframes and transform shorthands
style={{
- scale: interpolate(frame, [0, 100], [0, 1]),
- translate: interpolate(frame, [0, 100], ["0px 0px", "100px 100px"]),
- rotate: interpolate(frame, [0, 100], ["20deg", "90deg"]),
+ scale: interpolate(frame, [0, 100], [0, 1], {
+ extrapolateLeft: 'clamp',
+ extrapolateRight: 'clamp',
+ easing: Easing.spring({damping: 200}),
+ output: 'perceptual-scale' // For `scale` animations, use "output: 'perceptual-scale'"
+ }),
+ translate: interpolate(frame, [0, 100], ["0px 0px", "100px 100px"], {
+ extrapolateLeft: 'clamp',
+ extrapolateRight: 'clamp',
+ easing: Easing.spring({damping: 200}),
+ }),
+ rotate: interpolate(frame, [0, 100], ["20deg", "90deg"], {
+ extrapolateLeft: 'clamp',
+ extrapolateRight: 'clamp',
+ easing: Easing.spring({damping: 200}),
+ }),
}}
// πŸ‘Ž Hidden values and transform strings become harder to edit in Studio
@@ -70,19 +80,19 @@ Place assets in the `public/` folder at your project root.
Use `staticFile()` to reference files from the `public/` folder.
Add video and audio using `@remotion/media`.
-Add images using the `<Img>` component.
+Add images using the `<CanvasImage>` component.
Use `staticFile()` for files in `public/` or pass a remote URL directly:
```tsx
import { Audio, Video } from "@remotion/media";
-import { staticFile } from "remotion";
+import { staticFile, CanvasImage } from "remotion";
export const MyComposition = () => {
return (
<>
<Video src={staticFile("video.mp4")} style={{ opacity: 0.5 }} />
<Audio src={staticFile("audio.mp3")} />
- <Img src={staticFile("logo.png")} style={{ width: 100, height: 100 }} />
+ <CanvasImage src={staticFile("logo.png")} style={{ width: 100, height: 100 }} />
<Video src="https://remotion.media/video.mp4" />
</>
);
@@ -100,15 +110,15 @@ const Main = () => {
return (
<AbsoluteFill>
- <Sequence name="Background">
- <Background />
- </Sequence>
- <Sequence name="Title" from={30} durationInFrames={60} layout="none">
- <Title />
- </Sequence>
- <Sequence name="Subtitle" from={60} durationInFrames={60} layout="none">
- <Subtitle />
- </Sequence>
+ <Background />
+ <AbsoluteFill>
+ <Sequence name="Title" from={30} durationInFrames={60} layout="none">
+ <Title />
+ </Sequence>
+ <Sequence name="Subtitle" from={60} durationInFrames={60} layout="none">
+ <Subtitle />
+ </Sequence>
+ </AbsoluteFill>
</AbsoluteFill>
);
}
@@ -117,25 +127,47 @@ export const Title = () => {
const frame = useCurrentFrame();
return (
- <div
+ <Interactive.Div
+ name="Label"
style={{
opacity: interpolate(frame, [0, 60], [0, 1], {
extrapolateRight: "clamp",
extrapolateLeft: "clamp",
easing: Easing.bezier(0.16, 1, 0.3, 1),
}),
+ fontSize: 88
}}
>
Title
- </div>
+ </Interactive.Div>
);
};
export const Subtitle = () => {
- return <div>Subtitle</div>;
+ const frame = useCurrentFrame();
+
+ return (
+ <Interactive.Div
+ name="Subtitle"
+ style={{
+ opacity: interpolate(frame, [0, 60], [0, 1], {
+ extrapolateRight: "clamp",
+ extrapolateLeft: "clamp",
+ easing: Easing.bezier(0.16, 1, 0.3, 1),
+ }),
+ fontSize: 32
+ }}
+ >
+ Subtitle
+ </Interactive.Div>
+ );
};
```
+## Maps
+
+See [Remotion Maps](remotion-maps/SKILL.md) for choosing a map technique.
+
## Text highlights and annotations
See [text-highlights.md](text-highlights.md) for text highlights (highlight markers), circles, underlines, strike-throughs, crossed-off text, boxes, and brackets.
@@ -166,11 +198,12 @@ See [transitions.md](transitions.md) for scene transition patterns.
## Visual and pixel effects
-When creating a visual effect, prefer: 1. normal Remotion/HTML/CSS/SVG/filter/blend/mask animation, 2. a listed effect via [effects.md](effects.md), including on HTML rendered through `<HtmlInCanvas>`, 3. a custom `createEffect()` via [effects.md](effects.md) when the user asks for a reusable/project-specific effect, 4. custom `<HtmlInCanvas onPaint>` via [html-in-canvas.md](html-in-canvas.md) only if no effect fits.
-
-For light leak overlays, see [light-leaks.md](light-leaks.md). Docs: https://www.remotion.dev/docs/effects
+When creating a visual effect, consider whether it is feasible using CSS and HTML, or whether a shader is needed. Order or preference:
-Available effects: `brightness()`, `contrast()`, `colorKey()`, `duotone()`, `grayscale()`, `hue()`, `invert()`, `saturation()`, `tint()`, `linearGradient()`, `linearGradientTint()`, `thermalVision()`, `blur()`, `linearProgressiveBlur()`, `radialProgressiveBlur()`, `zoomBlur()`, `dropShadow()`, `glow()`, `lightTrail()`, `evolve()`, `venetianBlinds()`, `mirror()`, `scale()`, `uvTranslate()`, `xyTranslate()`, `barrelDistortion()`, `chromaticAberration()`, `fisheye()`, `cornerPin()`, `wave()`, `burlap()`, `emboss()`, `dotGrid()`, `halftone()`, `noise()`, `noiseDisplacement()`, `paper()`, `roughenEdges()`, `pattern()`, `pixelate()`, `pixelDissolve()`, `scanlines()`, `speckle()`, `shine()`, `shrinkwrap()`, `vignette()`, `contourLines()`, `checkerboard()`, `halftoneLinearGradient()`, `gridlines()`, `whiteNoise()`, `tvSignalOff()`, `lines()`, `rings()`, `waves()`, `zigzag()`, `lightLeak()`, `starburst()`.
+1. Normal Remotion/HTML/CSS/SVG/filter/blend/mask animation
+2. An effect applied to the element directly (`<Video>`, `<Img>`), or by wrapping the content in [`<HtmlInCanvas>`](html-in-canvas.md), which also accepts `effects`:
+ - A listed effect via [effects.md](effects.md)
+ - A custom `createEffect()` via [effects.md](effects.md) when no preset is available.
## 3D content
@@ -184,6 +217,10 @@ When needing to use sound effects, load the [./sfx.md](./sfx.md) file for more i
When needing to visualize audio (spectrum bars, waveforms, bass-reactive effects), load the [./audio-visualization.md](./audio-visualization.md) file for more information.
+## Maps
+
+For static maps, animated routes and markers, geographic explainers, Mapbox, MapLibre, MapTiler, GeoJSON, or 3D geographic flyovers, load [Remotion Maps](remotion-maps/SKILL.md).
+
## Captions
When dealing with captions or subtitles, load the [Remotion Captions](../remotion-captions/SKILL.md) skill for more information.
@@ -256,14 +293,9 @@ This goes for `@remotion/*` packages, `mediabunny`, `@mediabunny/*`, and `zod`.
## Previewing markup
-Only do this if you think the user wants to see the preview.
-
-```bash
-npx remotion studio --no-open
-```
-
This will start a long-running process and print the server URL for the preview.
-If already started, the URL will be printed.
+If server is already started, it will print the URL.
+You can visit a specific composition by navigating to `/[composition-id]`, for example `http://localhost:3000/MapAnimation`.
## Optional: one-frame render check
diff --git a/packages/skills/skills/remotion-markup/calculate-metadata.md b/packages/skills/skills/remotion-markup/calculate-metadata.md
index 1d5000aa7f..b66aedbe80 100644
--- a/packages/skills/skills/remotion-markup/calculate-metadata.md
+++ b/packages/skills/skills/remotion-markup/calculate-metadata.md
@@ -26,7 +26,7 @@ For static dimensions, duration, FPS, and initial props, inline the values on `<
## Setting duration based on a video
-Use the [`getVideoDuration`](../mediabunny/get-video-duration.md) and [`getVideoDimensions`](../mediabunny/get-video-dimensions.md) skills to get the video duration and dimensions:
+Use the [`getVideoDuration`](../remotion-multimedia/get-video-duration.md) and [`getVideoDimensions`](../remotion-multimedia/get-video-dimensions.md) skills to get the video duration and dimensions:
```tsx
import { CalculateMetadataFunction } from "remotion";
@@ -45,7 +45,7 @@ const calculateMetadata: CalculateMetadataFunction<Props> = async ({
## Matching dimensions of a video
-Use the [`getVideoDimensions`](../mediabunny/get-video-dimensions.md) skill to get the video dimensions:
+Use the [`getVideoDimensions`](../remotion-multimedia/get-video-dimensions.md) skill to get the video dimensions:
```tsx
import { CalculateMetadataFunction } from "remotion";
diff --git a/packages/skills/skills/remotion-markup/effects.md b/packages/skills/skills/remotion-markup/effects.md
index 8c278230ef..244f01b513 100644
--- a/packages/skills/skills/remotion-markup/effects.md
+++ b/packages/skills/skills/remotion-markup/effects.md
@@ -39,6 +39,19 @@ import {Config} from '@remotion/cli/config';
Config.setChromiumOpenGlRenderer('angle');
```
+## Available effects
+
+`brightness()`, `contrast()`, `colorKey()`, `duotone()`, `grayscale()`, `hue()`, `invert()`, `saturation()`, `tint()`, `linearGradient()`, `linearGradientTint()`, `thermalVision()`, `blur()`, `linearProgressiveBlur()`, `radialProgressiveBlur()`, `zoomBlur()`, `dropShadow()`, `glow()`, `lightTrail()`, `evolve()`, `venetianBlinds()`, `mirror()`, `scale()`, `uvTranslate()`, `xyTranslate()`, `barrelDistortion()`, `chromaticAberration()`, `fisheye()`, `cornerPin()`, `wave()`, `burlap()`, `emboss()`, `dotGrid()`, `halftone()`, `noise()`, `noiseDisplacement()`, `paper()`, `roughenEdges()`, `pattern()`, `pixelate()`, `pixelDissolve()`, `scanlines()`, `speckle()`, `shine()`, `shrinkwrap()`, `vignette()`, `contourLines()`, `checkerboard()`, `halftoneLinearGradient()`, `gridlines()`, `whiteNoise()`, `tvSignalOff()`, `lines()`, `rings()`, `waves()`, `zigzag()`, `lightLeak()`, `starburst()`.
+
+Example:
+
+```tsx
+import {brightness} from "@remotion/effects";
+
+<Video src="https://remotion.media/video.mp4" effects={[brightness({})]} />;
+```
+
+
## Custom effects
Use `createEffect()` from `remotion` when the user wants a reusable effect factory that works in the same `effects` array as `@remotion/effects`.
diff --git a/packages/skills/skills/remotion-markup/remotion-maps b/packages/skills/skills/remotion-markup/remotion-maps
new file mode 120000
index 0000000000..359d021a13
--- /dev/null
+++ b/packages/skills/skills/remotion-markup/remotion-maps
@@ -0,0 +1 @@
+../remotion-maps
\ No newline at end of file
diff --git a/packages/skills/skills/remotion-markup/sequencing.md b/packages/skills/skills/remotion-markup/sequencing.md
index a2af6690d9..a014c04fd6 100644
--- a/packages/skills/skills/remotion-markup/sequencing.md
+++ b/packages/skills/skills/remotion-markup/sequencing.md
@@ -8,42 +8,61 @@ metadata:
Use `<Sequence>` to delay when an element appears in the timeline.
```tsx
-import { Sequence } from "remotion";
+const Main = () => {
+ return (
+ <AbsoluteFill>
+ <Background />
+ <AbsoluteFill>
+ <Sequence name="Title" from={30} durationInFrames={60} layout="none">
+ <Title />
+ </Sequence>
+ <Sequence name="Subtitle" from={60} durationInFrames={60} layout="none">
+ <Subtitle />
+ </Sequence>
+ </AbsoluteFill>
+ </AbsoluteFill>
+ );
+}
export const Title = () => {
const frame = useCurrentFrame();
- const { fps } = useVideoConfig();
-
- const opacity = interpolate(frame, [0, 2 * fps], [0, 1], {
- extrapolateRight: "clamp",
- extrapolateLeft: "clamp",
- easing: Easing.bezier(0.16, 1, 0.3, 1),
- });
- return <div style={{ opacity }}>Title</div>;
+ return (
+ <Interactive.Div
+ name="Label"
+ style={{
+ opacity: interpolate(frame, [0, 60], [0, 1], {
+ extrapolateRight: "clamp",
+ extrapolateLeft: "clamp",
+ easing: Easing.bezier(0.16, 1, 0.3, 1),
+ }),
+ fontSize: 88
+ }}
+ >
+ Title
+ </Interactive.Div>
+ );
};
export const Subtitle = () => {
- return <div>Subtitle</div>;
-};
-
-const Main = () => {
- const {fps} = useVideoConfig();
+ const frame = useCurrentFrame();
return (
- <AbsoluteFill>
- <Sequence>
- <Background />
- </Sequence>
- <Sequence from={1 * fps} durationInFrames={2 * fps} layout="none">
- <Title />
- </Sequence>
- <Sequence from={2 * fps} durationInFrames={2 * fps} layout="none">
- <Subtitle />
- </Sequence>
- </AbsoluteFill>
+ <Interactive.Div
+ name="Subtitle"
+ style={{
+ opacity: interpolate(frame, [0, 60], [0, 1], {
+ extrapolateRight: "clamp",
+ extrapolateLeft: "clamp",
+ easing: Easing.bezier(0.16, 1, 0.3, 1),
+ }),
+ fontSize: 32
+ }}
+ >
+ Subtitle
+ </Interactive.Div>
);
-}
+};
```
This will by default wrap the component in an absolute fill element.
@@ -133,11 +152,12 @@ Sequences can be nested for complex timing:
## Nesting compositions within another
-To add a composition within another composition, you can use the `<Sequence>` component with a `width` and `height` prop to specify the size of the composition.
+To add a composition within another composition, you can use the `<Sequence>` component with a `width`, `height`, `durationInFrames` prop to specify the size of the composition.
+This will override the values of `useVideoConfig()` when calling inside that component.
```tsx
<AbsoluteFill>
- <Sequence width={COMPOSITION_WIDTH} height={COMPOSITION_HEIGHT}>
+ <Sequence width={500} height={500} durationInFrames={100} from={30}>
<CompositionComponent />
</Sequence>
</AbsoluteFill>
diff --git a/packages/skills/skills/remotion-markup/voiceover.md b/packages/skills/skills/remotion-markup/voiceover.md
index dcf271dc06..f4b022c371 100644
--- a/packages/skills/skills/remotion-markup/voiceover.md
+++ b/packages/skills/skills/remotion-markup/voiceover.md
@@ -55,7 +55,7 @@ writeFileSync(`public/voiceover/${compositionId}/${scene.id}.mp3`, audioBuffer);
## Dynamic composition duration with calculateMetadata
-Use [`calculateMetadata`](./calculate-metadata.md) to measure the [audio durations](../mediabunny/get-audio-duration.md) and set the composition length accordingly.
+Use [`calculateMetadata`](./calculate-metadata.md) to measure the [audio durations](../remotion-multimedia/get-audio-duration.md) and set the composition length accordingly.
```tsx
import { CalculateMetadataFunction, staticFile } from "remotion";
diff --git a/packages/skills/skills/mediabunny/SKILL.md b/packages/skills/skills/remotion-multimedia/SKILL.md
similarity index 89%
rename from packages/skills/skills/mediabunny/SKILL.md
rename to packages/skills/skills/remotion-multimedia/SKILL.md
index a4e056821d..4c2a6c2f85 100644
--- a/packages/skills/skills/mediabunny/SKILL.md
+++ b/packages/skills/skills/remotion-multimedia/SKILL.md
@@ -1,6 +1,6 @@
---
-name: mediabunny
-description: Multimedia handling with the Mediabunny library
+name: remotion-multimedia
+description: Interacting with Mediabunny
metadata:
tags: remotion, mediabunny, multimedia, video, audio
---
diff --git a/packages/skills/skills/mediabunny/get-audio-duration.md b/packages/skills/skills/remotion-multimedia/get-audio-duration.md
similarity index 100%
rename from packages/skills/skills/mediabunny/get-audio-duration.md
rename to packages/skills/skills/remotion-multimedia/get-audio-duration.md
diff --git a/packages/skills/skills/mediabunny/get-video-dimensions.md b/packages/skills/skills/remotion-multimedia/get-video-dimensions.md
similarity index 100%
rename from packages/skills/skills/mediabunny/get-video-dimensions.md
rename to packages/skills/skills/remotion-multimedia/get-video-dimensions.md
diff --git a/packages/skills/skills/mediabunny/get-video-duration.md b/packages/skills/skills/remotion-multimedia/get-video-duration.md
similarity index 100%
rename from packages/skills/skills/mediabunny/get-video-duration.md
rename to packages/skills/skills/remotion-multimedia/get-video-duration.md
diff --git a/packages/skills/skills/remotion-render/SKILL.md b/packages/skills/skills/remotion-render/SKILL.md
index a12e357701..3421892cac 100644
--- a/packages/skills/skills/remotion-render/SKILL.md
+++ b/packages/skills/skills/remotion-render/SKILL.md
@@ -1,6 +1,6 @@
---
name: remotion-render
-description: Best practices for rendering videos
+description: Export a Remotion video
metadata:
tags: remotion, render
---
diff --git a/packages/skills/skills/remotion-saas/SKILL.md b/packages/skills/skills/remotion-saas/SKILL.md
index 79f85076e9..d77b162d66 100644
--- a/packages/skills/skills/remotion-saas/SKILL.md
+++ b/packages/skills/skills/remotion-saas/SKILL.md
@@ -1,6 +1,6 @@
---
name: remotion-saas
-description: Building video apps with Remotion - framework, rendering and Player advice
+description: Build an app with Remotion
metadata:
tags: remotion, saas, player, rendering, templates, lambda
---