mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-11-17 23:47:33 +00:00
refactor(pipeline): strip dead capture outputs, add easing vocabulary, streamline skill
Capture CLI: - Remove detected-libraries.json, assets-catalog.json, full-page.png generation - Remove detectedLibraries from AGENTS.md generator and buildPrompt Skill: - step-5: pro easing vocabulary + stacked-beats code pattern for fast pacing - step-3: contact sheet asset discovery, marketing assets vs screenshots distinction - SKILL.md: lighter DESIGN.md for fast pacing, no arbitrary GSAP call count
This commit is contained in:
@@ -48,17 +48,9 @@ export function generateAgentPrompt(
|
||||
hasLottie?: boolean,
|
||||
hasShaders?: boolean,
|
||||
_catalogedAssets?: CatalogedAsset[], // reserved for future asset inventory
|
||||
detectedLibraries?: string[],
|
||||
_detectedLibraries?: string[],
|
||||
): void {
|
||||
const prompt = buildPrompt(
|
||||
outputDir,
|
||||
url,
|
||||
tokens,
|
||||
hasScreenshot,
|
||||
hasLottie,
|
||||
hasShaders,
|
||||
detectedLibraries,
|
||||
);
|
||||
const prompt = buildPrompt(outputDir, url, tokens, hasScreenshot, hasLottie, hasShaders);
|
||||
writeFileSync(join(outputDir, "AGENTS.md"), prompt, "utf-8");
|
||||
writeFileSync(join(outputDir, "CLAUDE.md"), prompt, "utf-8");
|
||||
writeFileSync(join(outputDir, ".cursorrules"), prompt, "utf-8");
|
||||
@@ -71,7 +63,6 @@ function buildPrompt(
|
||||
hasScreenshot: boolean,
|
||||
hasLottie?: boolean,
|
||||
hasShaders?: boolean,
|
||||
detectedLibraries?: string[],
|
||||
): string {
|
||||
const title = tokens.title || new URL(url).hostname.replace(/^www\./, "");
|
||||
|
||||
@@ -124,9 +115,6 @@ function buildPrompt(
|
||||
tableRows.push(
|
||||
"| `screenshots/scroll-*.png` | Individual viewport screenshots if you need detail on a specific section. |",
|
||||
);
|
||||
tableRows.push(
|
||||
"| `screenshots/full-page.png` | Entire page as one tall image. For scrolling website animation videos. |",
|
||||
);
|
||||
}
|
||||
tableRows.push(
|
||||
`| \`extracted/tokens.json\` | Design tokens: ${tokens.colors.length} colors, ${tokens.fonts.length} fonts, ${tokens.headings?.length ?? 0} headings, ${tokens.ctas?.length ?? 0} CTAs |`,
|
||||
@@ -148,11 +136,6 @@ function buildPrompt(
|
||||
if (hasShaders) {
|
||||
tableRows.push("| `extracted/shaders.json` | WebGL shader source (GLSL). |");
|
||||
}
|
||||
if (detectedLibraries && detectedLibraries.length > 0) {
|
||||
tableRows.push(
|
||||
`| \`extracted/detected-libraries.json\` | Libraries: ${detectedLibraries.join(", ")} |`,
|
||||
);
|
||||
}
|
||||
|
||||
// Asset contact sheets — dynamically list all pages
|
||||
const assetSheetRows = contactSheetRows(
|
||||
@@ -188,9 +171,6 @@ function buildPrompt(
|
||||
const brandLines: string[] = [];
|
||||
brandLines.push(`- **Colors**: ${colorSummary || "see tokens.json"}`);
|
||||
brandLines.push(`- **Fonts**: ${fontSummary}`);
|
||||
if (detectedLibraries && detectedLibraries.length > 0) {
|
||||
brandLines.push(`- **Built with**: ${detectedLibraries.join(", ")}`);
|
||||
}
|
||||
|
||||
return `# ${title}
|
||||
|
||||
|
||||
@@ -483,23 +483,7 @@ export async function captureWebsite(
|
||||
writeFileSync(join(outputDir, "extracted", "visible-text.txt"), visibleTextContent, "utf-8");
|
||||
}
|
||||
|
||||
// Save cataloged assets as JSON for AI agent
|
||||
if (catalogedAssets.length > 0) {
|
||||
writeFileSync(
|
||||
join(outputDir, "extracted", "assets-catalog.json"),
|
||||
JSON.stringify(catalogedAssets, null, 2),
|
||||
"utf-8",
|
||||
);
|
||||
}
|
||||
|
||||
// Save detected libraries
|
||||
if (detectedLibraries.length > 0) {
|
||||
writeFileSync(
|
||||
join(outputDir, "extracted", "detected-libraries.json"),
|
||||
JSON.stringify(detectedLibraries, null, 2),
|
||||
"utf-8",
|
||||
);
|
||||
}
|
||||
// detected-libraries and assets-catalog removed — 0/8 agents read them in v6 testing
|
||||
|
||||
// AI-powered image captioning via Gemini (optional — enriches asset descriptions)
|
||||
const geminiCaptions = await captionImagesWithGemini(outputDir, progress, warnings);
|
||||
|
||||
@@ -136,20 +136,7 @@ export async function captureScrollScreenshots(page: Page, outputDir: string): P
|
||||
await page.evaluate(`window.scrollTo(0, 0)`);
|
||||
await new Promise((r) => setTimeout(r, 200));
|
||||
|
||||
// Full-page screenshot — single tall image of the entire page.
|
||||
// Useful for scrolling website animation videos where the whole page
|
||||
// pans vertically as one continuous surface.
|
||||
try {
|
||||
const fullPagePath = join(screenshotsDir, "full-page.png");
|
||||
const fullPageBuffer = await page.screenshot({
|
||||
type: "png",
|
||||
fullPage: true,
|
||||
});
|
||||
writeFileSync(fullPagePath, fullPageBuffer);
|
||||
filePaths.push("screenshots/full-page.png");
|
||||
} catch {
|
||||
/* full-page screenshot can fail on very tall pages — non-critical */
|
||||
}
|
||||
// full-page.png removed — 1/8 agents read it, contact sheet covers the same content
|
||||
} catch {
|
||||
/* scroll screenshots are non-critical */
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user