Communitygithub.com

Varnan-Tech/opendirectory

创建从CSS动画(默认)或AI图像生成视频的动画循环GIF。默认800×800像素,6种动画类型,4种样式预设。当用户说“创建一个动画GIF”、“制作一个循环GIF”、“动画横幅”、“CSS动画GIF”、“社交媒体动画”、“让这个循环”、“动画图形”或“动效图形”时触发。

opendirectory 是什么?

此技能(graphic-gif)能够生成循环播放的动画GIF,与输出静态PNG或PDF的其他graphic-技能不同,它输出的是动画.gif文件。它有两种工作模式:默认的CSS动画模式(选项A)利用Playwright和Web Animations API逐帧捕获CSS @keyframes动画;另一种是AI图像转视频模式(选项B),通过Kling API将静态图像转化为动态视频,再转换为GIF。该技能遵循严格规则:画布固定为800×800像素,所有动画帧通过Web Animations API精确控制,而非依赖setTimeout或animation-delay,以确保循环无缝无卡顿。它提供6种动画类型(淡入、滑入、打字机、计数、脉冲、循环滚动)和4种样式预设(clean-slate、terminal、electric-burst、brutalist),并内置自我QA检查清单来保证输出质量。适合需要快速生成社交媒体动画、营销横幅或动态图形的开发者。

兼容平台✓Claude Code~Codex CLI✓Cursor✓Gemini CLI
npx skills add https://github.com/Varnan-Tech/opendirectory/tree/main/skills/graphic-gif

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

graphic-gif

从CSS动画或AI图像转视频API生成循环播放的动画GIF。输出:animation.gif。

与其他输出静态PNG或PDF的graphic-技能不同,此技能输出动画的.gif文件。它使用CSS @keyframes 动画,通过Playwright和Web Animations API逐帧捕获(选项A,默认),或通过Kling实现AI图像转视频管道(选项B)。


关键规则(每次生成前必读)

  1. 默认使用css-animated。 除非明确要求,否则不要使用ai-generated。
  2. 画布为800×800像素正方形。 所有clamp() 值按800px计算(1vw = 8px)。
  3. 单个自包含HTML。 所有CSS内联在<style>中。字体CDN <link> 是唯一的外部依赖。
  4. 切勿在聊天中直接转储HTML。 保存到文件,仅显示摘要。
  5. 帧捕获使用Web Animations API的seeking。 不要使用setTimeout循环,也不要使用animation-delay技巧。
  6. 精确帧数: Math.floor(duration_seconds * fps) 帧。不得捕获t=duration_ms时刻的帧——它会与t=0重复,导致循环点处出现可见卡顿。
  7. 不得使用占位框。 仅使用CSS生成的可视内容。不要出现“此处放置图像”之类的元素。
  8. 更简单的调色板 = 更小的文件。 使用:clean-slate、terminal、electric-burst、brutalist。
  9. 不要使用animation-delay实现交错。 将交错直接编入@keyframes百分比——帧seeking会处理时序。
  10. 在编写CSS之前确定设计方向。 基调、标志性元素、运动风格、令人难忘的细节——在编写第一行代码之前全部确定。

步骤1:输入

必填: prompt(内容描述和动态简述)

可选参数及默认值:

参数默认值选项
animation_typecss-animatedcss-animated / ai-generated
duration3.0秒
fps12帧/秒
looptruetrue / false
styleclean-slateclean-slate / terminal / electric-burst / brutalist
dimensions800x800像素(宽x高)
optimizationbalancedquality / balanced / filesize

如果缺少提示或没有动态描述,请准确提问:

“GIF应该显示什么内容?请描述内容以及动态效果(例如:'统计数据逐个递增:73%的购买者在购买前阅读3篇以上内容。打字机效果,一次一个字符。样式:terminal。3秒,12fps。')

关键设置(均为可选,显示默认值):

  • animation_type: css-animated(默认)或 ai-generated
  • duration: 3.0 秒
  • fps: 12
  • loop: true
  • style: clean-slate(选项:clean-slate / terminal / electric-burst / brutalist)
  • dimensions: 800x800
  • optimization: balanced(选项:quality / balanced / filesize)”

如果所有必要信息均已提供 → 直接跳至步骤2。


步骤2:内部架构(绝不向用户展示)

对于css-animated:

  1. 从以下动画类型中选择:fade-in、slide-in、typewriter、counter、pulse、loop-scroll
  2. 阅读 references/animation-library.md — 找到所选类型的完整HTML/CSS规范
  3. 阅读 references/style-presets.md — 加载所选样式的CSS令牌块
  4. 计算帧数:Math.floor(duration_seconds * fps) — 记下这个数字
  5. 确定设计方向:
决策推导依据
基调面向受众的情感基调(机械/温暖/电气/专业)
标志性元素一致使用一种视觉装置(光标闪烁、幽灵数字、扫描线叠加、强调边框)
运动风格此类动画的缓动曲线理念(弹簧/线性/步进/缓入缓出)
令人难忘的细节观看者记住此GIF的“唯一”要素

对于ai-generated:

  1. 生成基础静态帧HTML(海报风格布局,适合画布)
  2. 使用截图导出为PNG
  3. 调用Kling API:POST https://api.klingai.com/v1/videos/image2video,参数为 image_url 和描述动态的 prompt
  4. 轮询任务完成状态
  5. 下载视频 → 使用ffmpeg转换为GIF:
    # 两次调色板以获得最佳色彩质量
    ffmpeg -i input.mp4 -vf "fps=12,scale=800:800:flags=lanczos,palettegen=stats_mode=diff" palette.png
    ffmpeg -i input.mp4 -i palette.png -vf "fps=12,scale=800:800:flags=lanczos,paletteuse=dither=bayer:bayer_scale=5" output.gif
    

步骤3:HTML生成(css-animated路径)

在生成之前,先阅读 references/animation-library.md 和 references/style-presets.md。

画布基础 — 每个GIF必需的CSS:

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

body {
  width: 800px;
  height: 800px;
  overflow: hidden;
  background: var(--bg);
  font-family: var(--font-body);
}

.canvas {
  width: 800px;
  height: 800px;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

动画规则:

  • 所有动画元素使用 animation-fill-mode: forwards(或 both)
  • 每种类型的缓动函数:
    • typewriter → steps(N, end),其中N = 精确的字符数
    • counter → linear
    • fade-in → cubic-bezier(0.22, 1, 0.36, 1)(缓出)
    • slide-in → cubic-bezier(0.34, 1.56, 0.64, 1)(弹簧过冲)
    • pulse → ease-in-out,同时 animation-iteration-count: infinite
    • loop-scroll → linear,同时 animation-iteration-count: infinite
  • 对于一次性动画(fade-in、slide-in、typewriter、counter):animation-iteration-count: 1 — 循环在GIF层面处理
  • 不要使用 animation-delay — 交错直接编入 @keyframes 百分比

打字机效果N的计算: 统计每个字符,包括空格、标点、数字:

  • "73% of buyers" = 14个字符 → steps(14, end)
  • "Hello, World!" = 13个字符 → steps(13, end)

计数器CSS @property(counter类型必需):

@property --num {
  syntax: '<integer>';
  inherits: false;
  initial-value: 0;
}
.counter {
  animation: countUp var(--duration) linear forwards;
  counter-reset: num var(--num);
}
.counter::after { content: counter(num); }
@keyframes countUp {
  from { --num: 0; }
  to   { --num: var(--target); }
}

循环滚动:内容必须复制:

<!-- 4个原始项 + 4个重复项 -->
<div class="ticker-track" style="--item-count: 4;">
  [item1][item2][item3][item4][item1][item2][item3][item4]
</div>

使用 translateX(0 → -50%) 配合 linear infinite。

设计质量规则(来自步骤2的承诺):

  • 步骤2中命名的标志性元素必须在CSS/HTML中出现(不仅仅是描述)
  • 排版:显示文本与辅助文本之间的字重对比至少为2:1(例如700比400)
  • 背景:深色样式不要使用纯白 #fff — 使用预设中准确的 --bg 值
  • terminal样式:添加扫描线叠加层 ::after,使用 repeating-linear-gradient,opacity: 0.03
  • brutalist样式:关键元素使用粗边框 4px solid #000 或 4px solid var(--accent)
  • 令人难忘的细节:如果需要额外元素来实现 — 立即添加

步骤4:自我QA(在步骤5之前修复所有失败)

画布:

  • body 和 .canvas 恰好为800×800px(或指定尺寸)
  • body 和 .canvas 都设置了 overflow: hidden
  • 没有元素超出画布边界

动画:

  • 任何地方都没有使用 animation-delay — 交错在 @keyframes 百分比中处理
  • 所有动画从 t=0 开始(Web Animations API将从那里开始seeking)
  • 所有动画元素设置了 animation-fill-mode: forwards 或 both
  • 一次性动画:animation-iteration-count: 1
  • 无限动画(pulse、loop-scroll):animation-iteration-count: infinite

类型特定检查:

  • 打字机效果:steps(N, end) 中的N = 文本字符串的精确字符数
  • 计数器:使用 syntax: '<integer>' 和 initial-value: 0 声明了 @property --num
  • 计数器:使用了 counter-reset: num var(--num) 以及 ::after { content: counter(num) }
  • 循环滚动:HTML中内容恰好复制了一次

设计:

  • 没有占位框
  • 从 references/style-presets.md 应用了样式预设令牌 — 没有自由散落的十六进制颜色
  • 步骤2中命名的标志性元素实际出现在HTML/CSS中
  • 步骤2中的令人难忘的细节已实际实现
  • 所选样式对应的字体CDN <link> 已存在

步骤5:导出

根据提示确定slug(kebab-case,不超过30个字符)。创建输出目录:

mkdir -p [slug]

保存HTML:

[slug]/animation.html

在浏览器中打开以快速视觉检查:

open [slug]/animation.html

运行导出脚本(将 [skill-root] 替换为此技能的实际路径):

bash [skill-root]/scripts/export-gif.sh \
  [slug]/animation.html \
  [slug]/animation.gif \
  --duration [duration] \
  --fps [fps] \
  [--no-loop 如果loop=false] \
  --optimization [optimization] \
  --width [W] \
  --height [H]

该脚本会:

  1. 在临时目录中安装 gifenc、sharp(或 jimp)和 playwright
  2. 下载Chromium(如未缓存)
  3. 运行 capture-and-encode.mjs — 暂停动画、seeking每一帧、截图、组装GIF
  4. 如果可用,运行 gifsicle 优化通道
  5. 报告文件大小并打开结果

如果导出脚本在 [skill-root]/scripts/export-gif.sh 未找到,请检查技能是否已随其 scripts/ 文件夹一起完整安装。


步骤6:输出摘要

成功导出后显示:

## GIF:[1行描述]
日期:[YYYY-MM-DD] | 样式:[style] | 动画:[type] | [duration]秒 @ [fps]fps
尺寸:[WxH] | 帧数:[N] | 循环:[true/false]

文件
  源文件:   [slug]/animation.html
  输出:   [slug]/animation.gif
  大小:     [X] KB

检查清单
- [ ] 预览时首尾循环流畅(无卡顿)
- [ ] 在目标显示尺寸下文本清晰可读
- [ ] 文件大小合适:邮件 <500KB / 社交媒体 <3MB

AI生成路径(选项B)

仅当明确指定 animation_type: ai-generated 时使用。

要求:

  • 环境中设置Kling API密钥:KLING_API_KEY(每天66次免费额度,免费层无需信用卡)
  • 本地安装 ffmpeg 用于视频→GIF转换

工作流程:

  1. 生成与提示匹配的基础静态帧HTML(指定尺寸的海报/图形风格)
  2. 将静态帧导出为PNG:
    # 通过Playwright快速截图
    node -e "
      const { chromium } = require('playwright');
      (async () => {
        const browser = await chromium.launch();
        const page = await browser.newPage({ viewport: { width: W, height: H } });
        await page.goto('file://[slug]/animation.html');
        await page.screenshot({ path: '[slug]/base-frame.png' });
        await browser.close();
      })();
    "
    
  3. 上传到Kling图像转视频端点
  4. 使用ffmpeg两次调色板将结果转换为GIF
  5. 应用gifsicle优化

当Kling不可用时: 回退到css-animated,并向用户附注说明:“AI生成需要Kling API密钥(KLING_API_KEY)。回退到css-animated。设置密钥以启用AI生成。”


提示技巧(用户请求指导时显示)

“描述动态,而不仅仅是内容。'统计数据一个接一个递增'优于'显示统计数据'。”

“为控制文件大小,保持简洁。1-3个动画元素配合纯色背景。”

“以循环为思路。动画应该从结束到开始流畅地无缝过渡。”

“明确指定动画类型。typewriter 和 counter 在社交媒体上最有效。”

✅ 好的示例:“创建一个动画GIF,css-animated,打字机效果。文本:'73%的B2B购买者在联系销售之前阅读3篇以上内容。'每个字符逐个打出。样式:terminal。3秒,12fps,loop=true。”

❌ 不好的示例:“制作一个营销技巧的动画GIF”

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

Varnan-Tech/opendirectory

Use when the user asks to generate a blog cover image, thumbnail, or article header. Automatically uses modern typography, brand logos, and Google Search grounding to create beautiful 16:9 images with Gemini 3.1 Flash Image Preview.

Varnan-Tech/opendirectory

World-class brand strategist and naming expert. Uses an interrogation-led discovery phase to extract your brand's DNA, then applies scientific naming frameworks (Phonosemantics) and automated multi-TLD domain checking.

Varnan-Tech/opendirectory

Use when the user asks to generate or update a project's CLAUDE or AGENTS context file from a codebase scan. Writes a focused file under 100 lines containing only the non-obvious build commands, conventions, and gotchas Claude Code needs.

Varnan-Tech/opendirectory

Use when the user wants to verify cold emails, enrich a lead list, or autonomously guess email addresses from a CSV using ValidEmail.co or the open-source Reacher engine.

Varnan-Tech/opendirectory

Competitive intelligence orchestrator tracking companies across 8+ platforms (GitHub, Twitter, Reddit, HN, PH, YC Jobs) with heat scores and AI briefings.

Varnan-Tech/opendirectory

Give it your product URL or description. It finds your top 5 competitors, runs three-track PR research across all of them (editorial, podcasts, communities), identifies which channels appear most frequently, looks up the journalist or host for each, and returns a tiered outreach list with story angles and ready-to-send cold pitch drafts tailored to your product. Use when asked to find PR opportunities, discover where competitors got featured, build a media outreach list, find which journalists cover my space, or get pitch templates for press coverage.

Varnan-Tech/opendirectory

Generate high-converting, deep-dive growth case studies in MDX format. Use this skill when asked to write a case study or blog post about a company's growth, tech stack, or product-led strategy. It handles the full pipeline (researching the company via Tavily, generating a 16:9 cover image, quality checking the draft, uploading assets to cloud storage, and pushing directly to the target repository).

Varnan-Tech/opendirectory

Scans your project for outdated npm, pip, Cargo, Go, or Ruby packages. Runs a CVE security audit. Fetches changelogs, summarizes breaking changes with Gemini, and opens one PR per risk group (patch, minor, major). Includes Diagnosis Mode for install conflicts. Use when asked to update dependencies, check for outdated packages, open dependency PRs, scan for package updates, audit for CVEs, or flag breaking changes in upgrades. Trigger when a user says "check for outdated packages", "update my dependencies", "open PRs for dependency updates", "scan for CVEs", or "which packages need upgrading".

Varnan-Tech/opendirectory

Generates and updates README.md and API reference docs by reading your codebase's functions, routes, types, schemas, and architecture. Uses graphify to build a knowledge graph first, then writes accurate docs from it. Use when asked to write docs, generate a README, document an API, update stale docs, create an API reference from code, add an architecture section, or document a project in any language. Trigger when a user says their docs are missing, outdated, or wants to document their codebase without writing it manually.

Varnan-Tech/opendirectory

Evaluates expired domain candidates against a target niche, scores them by topical relevance, historical activity level, and history cleanliness, then outputs a ranked shortlist with explainable reasoning and risk flags.

Varnan-Tech/opendirectory

Brutally honest developer-experience audit for a GitHub repo. Scores 10 DX dimensions (time-to-first-success, README clarity, visual proof, install, quick-start, docs, examples, community, trust, marketing), writes a shareable roast in the requested tone (brutal/honest/kind), produces a prioritized action plan ranked by impact × effort, and sketches an ideal README. Trigger when user says "roast my repo", "audit my README", "dx audit", "developer experience review", "score my GitHub project", "before launch checklist", or "make my repo shareable".

Varnan-Tech/opendirectory

Drafts and designs a complete HTML email newsletter from a topic or content brief. Outputs paste-ready HTML for Loops, Mailchimp, Beehiiv, Resend, or any standard email platform. Includes subject line options and plain-text fallback. Trigger when a user says "write a newsletter", "draft an email newsletter", "create an HTML email", "design an email for my subscribers", or "write a newsletter about [topic]".

Varnan-Tech/opendirectory

Takes a GitHub PR URL or the current branch and writes a plain-English explanation of what it does and why, then posts it as a PR comment. Use when asked to explain a PR, summarize a pull request, write a plain-English description of a PR, add a summary comment to a PR, or understand what a PR changes. Trigger when a user says "explain this PR", "summarize this pull request", "what does this PR do", "add a comment explaining the PR", or shares a GitHub PR URL and asks what it does.

Varnan-Tech/opendirectory

Audit how often LLMs recommend your brand vs competitors and generate a GEO action plan.

Varnan-Tech/opendirectory

Takes a competitor's public GitHub repo URL, fetches their open issues via the GitHub REST API, filters noise locally, clusters issues into 6 demand categories, computes a demand score per issue and per cluster, and outputs a ranked demand gap report with a GTM messaging brief. Use when asked to scan a competitor's GitHub issues, find what their users are begging for, turn GitHub complaints into product positioning, identify competitor feature gaps, or generate messaging from real user demand. Trigger when a user says "scan competitor issues", "what are users asking for on X repo", "find demand gaps in Y", "turn GitHub issues into messaging", or "what should I build based on competitor complaints".

Varnan-Tech/opendirectory

Find recurring confusion in your repo's GitHub Discussions, rank it by urgency, and draft the actual docs fixes and content angles — with verbatim community quotes and source links as evidence.

Varnan-Tech/opendirectory

SEO keyword research workflow for blog generation using Google Trends data. Use when writing blog posts, planning content calendars, or optimizing articles for search engines. Finds breakout keywords, builds content structure, and generates SEO-optimized blog outlines targeting tech and developer audiences.

Varnan-Tech/opendirectory

Generates a professionally designed case study PDF for B2B SaaS sales and marketing. Supports 7 page layouts, 9 style presets, 1-4 page output. Trigger when user says "create a case study", "write a customer story", "make a case study PDF", "design a success story", "turn this customer win into a PDF".

Varnan-Tech/opendirectory

Generates data visualization charts (bar, line, area, pie, doughnut, scatter, radar, treemap) as PNG using Apache ECharts v6. 1080×1080px default, 5 style presets, highlight annotations. Trigger when user says "create a chart", "visualize data", "make a bar chart", "line graph", "pie chart", "data visualization", "chart this data", "plot", "graph", or "visualize these numbers".

Varnan-Tech/opendirectory

Fetches low-star App Store and Google Play reviews, clusters them into broken-promise patterns, and generates a ranked copy brief with positioning opportunities.

相关技能