majiayu000/spellbook / skills/repo-film
repo-film
Verified把一个 git 仓库在一段时间里的真实提交做成 15–25 秒的炫酷短片:主线和各条分支按真实分叉、合并同时生长成流程图,越长越快再拉远看全景;仓库有 you-are-here 项目地图时,整张网会收拢成地图里的阻塞链,再沿地图讲卡点、当前位置和一句话总结,最后接可改的结尾卡片。一行命令出 MP4,基于 motion-stack 渲染器。当用户说「把这个仓库这周 / 昨晚做的事做成视频」「做个项目进展短片」「git 记录做成流程图动画」「给 you-are-here / 某项目做宣传视频」「像上次 Keepline 那个视频一样做一个」时使用。只在明确请求时触发,忽略顺带提及。
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 5.6 KB |
| scripts/capture.mjs | script | 2.8 KB |
| scripts/lanes.py | script | 5.0 KB |
| scripts/make.mjs | script | 6.8 KB |
| template/package.json | manifest | 224 B |
| template/scene.html | other | 27.0 KB |
scripts/capture.mjs
View on GitHub#!/usr/bin/env node
// Screenshot the real project map and record where its main blocks sit.
// usage: MOTION_KIT=<motion-stack kit> node capture.mjs <map index.html> <out dir>
import { createRequire } from 'node:module';
import { pathToFileURL } from 'node:url';
import fs from 'node:fs';
const require = createRequire(import.meta.url);
const { launch } = await import(process.env.MOTION_KIT + '/env.mjs');
const [src, out] = process.argv.slice(2);
const browser = await launch();
const page = await browser.newPage({ viewport: { width: +(process.env.VW || 1600), height: 900 }, deviceScaleFactor: 2 });
await page.goto(pathToFileURL(src).href);
// lay the map out in one column so the whole blocker chain is visible, not scrolled
await page.addStyleTag({ content: '.workspace.grid{grid-template-columns:1fr !important} .chain{overflow:visible !important}' });
await page.waitForTimeout(800);
const rects = await page.evaluate(() => {
const r = (el, key) => { const b = el.getBoundingClientRect(); return { key, cls: el.className || '', x: b.left + scrollX, y: b.top + scrollY, w: b.width, h: b.height }; };
const pick = (sel, key) => [...document.querySelectorAll(sel)].filter(e => e.offsetParent || e.getClientRects().length).map((e, i) => r(e, key + (i ? i : '')));
return {
page: { w: document.documentElement.scrollWidth, h: document.documentElement.scrollHeight },
blocks: [
...pick('header.header', 'header'),
...pick('section.panel.brief', 'brief'),
...pick('section.route.track', 'track'),
...pick('.milestone.current', 'current'),
...pick('.milestone', 'ms'),
...pick('section.chain-card', 'chain'),
...pick('.chain-node', 'node'),
...pick('section.panel.parts-panel', 'parts'),
...pick('section.panel.remaining', 'remaining'),
...pick('section.panel.changes-panel', 'changes'),
...pick('section.panel.uncertain-panel', 'uncertain'),
...pick('aside.aside', 'aside'),
...pick('.brief-row', 'row'),
],
paths: [...document.querySelectorAll('.chain svg path')].filter(p => p.getTotalLength() > 20).map(p => {
const m = p.getScreenCTM(), L = p.getTotalLength(), pts = [];
for (let i = 0; i <= 40; i++) { const q = p.getPointAtLength(L * i / 40); pts.push([+(m.a * q.x + m.c * q.y + m.e + scrollX).toFixed(1), +(m.b * q.x + m.d * q.y + m.f + scrollY).toFixed(1)]); }
const cs = getComputedStyle(p);
return { pts, dashed: cs.strokeDasharray !== 'none', marker: !!p.getAttribute('marker-end'), stroke: cs.stroke };
}),
};
});
fs.mkdirSync(out, { recursive: true });
await page.screenshot({ path: out + '/map.png', fullPage: true });
fs.writeFileSync(out + '/rects.json', JSON.stringify(rects, null, 1));
console.log(JSON.stringify(rects.page), rects.blocks.length, 'blocks');
await browser.close();
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| receiving-code-reviewobra/superpowersUse when receiving code review feedback, before implementing suggestions, especially if feedback seems unclear or technically questionable - requires technical rigor and verification, not performative agreement or blind implementation | Stars: 323k | Updated | Claude CodeCodex | Verified | Install |
| requesting-code-reviewobra/superpowersUse when completing tasks, implementing major features, or before merging to verify work meets requirements | Stars: 323k | Updated | Claude CodeCodex | Verified | Install |
| using-git-worktreesobra/superpowersUse when starting feature work that needs isolation from current workspace or before executing implementation plans - ensures an isolated workspace exists via native tools or git worktree fallback | Stars: 323k | Updated | Claude CodeCodex | Verified | Install |
| verification-before-completionobra/superpowersUse when about to claim work is complete, fixed, or passing, before committing or creating PRs - requires running verification commands and confirming output before making any success claims; evidence before assertions always | Stars: 323k | Updated | Claude CodeCodex | Verified | Install |