programmatic video rendering framework that is actually fast
feat(landing): Serve the skill from fframes.studio so npx skills add skips the repo clone (#158)
Dmitriy Kovalenko4d6557f02072
diff --git a/.github/workflows/main.yml b/.github/workflows/main.ymlindex 91f3d6c9..df6d4f10 100644--- a/.github/workflows/main.yml+++ b/.github/workflows/main.yml@@ -33,6 +33,39 @@ jobs:with:config: ./typos.toml+ # fframes.studio serves skills/ as a well-known index, generated by the wrangler build step+ # on every Cloudflare deploy. This builds the same index, serves it, and installs from it with+ # the real skills CLI, so a broken SKILL.md or CLI change fails here instead of on the site.+ skill-index:+ name: Install skill from well-known index+ runs-on: ubuntu-latest+ steps:+ - name: Checkout+ uses: actions/checkout@v4+ with:+ # skip the example media, the job only needs the skill and the generator+ sparse-checkout: |+ skills+ scripts++ - name: Set up Node.js+ uses: actions/setup-node@v4+ with:+ node-version: 24++ - name: Build the index+ run: node scripts/build-skills-index.mjs++ - name: Install with npx skills add+ run: |+ python3 -m http.server 8765 --directory landing > /dev/null 2>&1 &+ timeout 10 bash -c 'until curl -sf localhost:8765/.well-known/agent-skills/index.json > /dev/null; do sleep 0.2; done'+ mkdir "$RUNNER_TEMP/project" && cd "$RUNNER_TEMP/project"+ npx -y skills@latest add http://localhost:8765 -y -a claude-code+ for skill in "$GITHUB_WORKSPACE"/skills/*/; do+ diff -r "$skill" ".claude/skills/$(basename "$skill")"+ done+build-rescript:name: Build ReScriptruns-on: ubuntu-latestdiff --git a/.gitignore b/.gitignoreindex e244e5d4..9ab0235a 100644--- a/.gitignore+++ b/.gitignore@@ -24,3 +24,7 @@ examples/**/output/# this is my own remix of the song but I am not sure if this is legal lolpassenger.mp3++# generated by scripts/build-skills-index.mjs during the landing deploy+landing/.well-known/+.wrangler/diff --git a/README.md b/README.mdindex 83d336a0..eb9f3e45 100644--- a/README.md+++ b/README.md@@ -33,7 +33,7 @@fframes ships a skill for coding agents. Add it once:```sh-npx skills add dmtrKovalenko/fframes+npx skills add https://fframes.studio```Then describe the video you want, the way you would brief a motion designer. The skill takes your agent from an emptydiff --git a/examples/fframes-intro/src/scenes/outro.rs b/examples/fframes-intro/src/scenes/outro.rsindex 8eb04670..60f8612d 100644--- a/examples/fframes-intro/src/scenes/outro.rs+++ b/examples/fframes-intro/src/scenes/outro.rs@@ -62,7 +62,7 @@ impl Scene for OutroScene {let tag = prog(lb, 4.0, 4.6);let cmds = [(- "npx skills add dmtrKovalenko/fframes",+ "npx skills add https://fframes.studio","WITH YOUR CODING AGENT",),("cargo fframes new my-video", "OR BY HAND"),diff --git a/landing/index.html b/landing/index.htmlindex 1490e27a..e827adf3 100644--- a/landing/index.html+++ b/landing/index.html@@ -576,7 +576,7 @@<h3 id="start-skill">With your coding agent</h3><p>Add the official fframes skill from <a href="https://github.com/dmtrKovalenko/fframes/tree/main/skills/fframes-video">the GitHub repo</a>, then ask your agent for a video.</p><div class="command">- <pre><code><span class="prompt">$ </span>npx skills add dmtrKovalenko/fframes</code></pre>+ <pre><code><span class="prompt">$ </span>npx skills add https://fframes.studio</code></pre><button class="copy" type="button" aria-label="Copy command"><svg class="idle" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="9" y="9" width="12" height="12" rx="2"/><path d="M5 15V5a2 2 0 0 1 2-2h10"/></svg><svg class="done" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M5 12.5l4.5 4.5L19 7.5"/></svg>diff --git a/scripts/build-skills-index.mjs b/scripts/build-skills-index.mjsnew file mode 100644index 00000000..2604fcc0--- /dev/null+++ b/scripts/build-skills-index.mjs@@ -0,0 +1,64 @@+#!/usr/bin/env node+// Publishes skills/ on fframes.studio as an agent-skills well-known index, so+// `npx skills add https://fframes.studio` downloads four markdown files instead of+// cloning the whole repository with its example media. Runs as the wrangler build+// step (see wrangler.jsonc); the output directory is generated and gitignored.+import { cpSync, mkdirSync, readdirSync, readFileSync, rmSync, writeFileSync } from "node:fs";+import { dirname, join, relative, sep } from "node:path";+import { fileURLToPath } from "node:url";++const root = join(dirname(fileURLToPath(import.meta.url)), "..");+const skillsDir = join(root, "skills");+const outDir = join(root, "landing", ".well-known", "agent-skills");++function listFiles(dir) {+ return readdirSync(dir, { withFileTypes: true }).flatMap((entry) => {+ const path = join(dir, entry.name);+ return entry.isDirectory() ? listFiles(path) : [path];+ });+}++// Reads `description` from the SKILL.md front matter: either an inline value or a+// folded (`>`, `>-`) / literal (`|`, `|-`) block scalar.+function readDescription(skillMd) {+ const frontMatter = skillMd.match(/^---\n([\s\S]*?)\n---/)?.[1];+ if (!frontMatter) throw new Error("SKILL.md has no front matter");++ const lines = frontMatter.split("\n");+ const start = lines.findIndex((line) => line.startsWith("description:"));+ if (start === -1) throw new Error("SKILL.md front matter has no description");++ const value = lines[start].slice("description:".length).trim();+ const block = value.match(/^([>|])[+-]?$/);+ if (!block) return value.replace(/^(["'])(.*)\1$/, "$2");++ const body = [];+ for (const line of lines.slice(start + 1)) {+ if (line.trim() !== "" && !/^\s/.test(line)) break;+ body.push(line.trim());+ }+ return (block[1] === ">" ? body.join(" ") : body.join("\n")).trim();+}++rmSync(outDir, { recursive: true, force: true });+mkdirSync(outDir, { recursive: true });++const skills = readdirSync(skillsDir, { withFileTypes: true })+ .filter((entry) => entry.isDirectory())+ .map(({ name }) => {+ const dir = join(skillsDir, name);+ const files = listFiles(dir)+ .map((path) => relative(dir, path).split(sep).join("/"))+ .filter((path) => !path.split("/").at(-1).startsWith("."))+ .sort();+ const description = readDescription(readFileSync(join(dir, "SKILL.md"), "utf8"));++ for (const file of files) {+ mkdirSync(dirname(join(outDir, name, file)), { recursive: true });+ cpSync(join(dir, file), join(outDir, name, file));+ }+ return { name, description, files };+ });++writeFileSync(join(outDir, "index.json"), `${JSON.stringify({ skills }, null, 2)}\n`);+console.log(`Published ${skills.map((skill) => skill.name).join(", ")} to ${relative(root, outDir)}`);diff --git a/wrangler.jsonc b/wrangler.jsoncindex 806e26db..327d2d29 100644--- a/wrangler.jsonc+++ b/wrangler.jsonc@@ -1,9 +1,12 @@// landing/ as static assets on Cloudflare. Workers Builds runs `wrangler deploy` for main// and `wrangler preview` for pull requests, which needs the (empty) previews block.+// The build step publishes skills/ under landing/.well-known/agent-skills for+// `npx skills add https://fframes.studio`.{"name": "fframes","account_id": "86ddf0334885d2955aa80c778509d857","compatibility_date": "2026-09-01",+ "build": { "command": "node scripts/build-skills-index.mjs", "watch_dir": "skills" },"assets": { "directory": "./landing" },"previews": {}}