Communitygithub.com

ASoudy/AGS

利用 Remotion 从 Stitch 项目生成带有平滑转场、缩放和文字叠加的走查视频。

AGS 是什么?

该技能专为 AI 代理(如 Claude Code、Cursor 或 Codex)设计,能够将 Stitch 设计工具中的应用原型界面自动转化为专业的产品走查视频。它通过调用 Stitch MCP 服务获取项目屏幕截图及其元数据,再借助 Remotion 的程序化视频生成能力,将这些素材组合成带有流畅转场、缩放动画和文字标注的 MP4 视频。代理会依次完成发现 MCP 服务、检索屏幕信息、下载资源、搭建 Remotion 项目、编写 React 组件(如 ScreenSlide 和 WalkthroughComposition)以及最终渲染输出的全过程。该技能支持多种常见模式(如幻灯片展示、功能高亮和用户流程演示),并内置了转场效果(淡入淡出、滑动、缩放)、动画热点、语音旁白集成以及从 Stitch HTML 代码中自动提取文本等高级功能。最终输出是一个结构清晰、性能优化的视频文件,可直接用于产品演示、用户文档或分享给利益相关者。

兼容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/ASoudy/AGS/tree/HEAD/AGAS/plugins/antigravity-awesome-skills-claude/skills/remotion

在你喜欢的 AI 中提问

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

文档

Stitch 到 Remotion 走查视频生成

你是一位专注于从应用设计稿创建引人入胜的走查视频的视频制作专家。你通过结合 Stitch 的屏幕检索能力和 Remotion 的程序化视频生成能力,制作出流畅、专业的演示视频。

概述

此技能使你能够创建展示应用屏幕的走查视频,并配合专业的转场、缩放效果以及上下文相关的文字叠加。工作流程从 Stitch 项目中检索屏幕,并将其编排成 Remotion 视频合成。

前提条件

必需:

  • 能够访问 Stitch MCP 服务器
  • 能够访问 Remotion MCP 服务器(或 Remotion CLI)
  • 已安装 Node.js 和 npm
  • 一个包含设计好的屏幕的 Stitch 项目

推荐:

  • 熟悉 Remotion 的视频功能
  • 了解 React 组件(Remotion 使用 React)

检索与网络连接

步骤 1:发现可用的 MCP 服务器

运行 list_tools 以识别可用的 MCP 服务器及其前缀:

  • Stitch MCP:查找 stitch: 或 mcp_stitch: 前缀
  • Remotion MCP:查找 remotion: 或 mcp_remotion: 前缀

步骤 2:检索 Stitch 项目信息

  1. 项目查找(如果未提供项目 ID):

    • 调用 [stitch前缀]:list_projects,参数为 filter: "view=owned"
    • 根据标题(例如“计算器应用”)识别目标项目
    • 从 name 字段中提取项目 ID(例如 projects/13534454087919359824)
  2. 屏幕检索:

    • 使用项目 ID(仅数字部分)调用 [stitch前缀]:list_screens
    • 查看屏幕标题以识别走查所需的所有屏幕
    • 从每个屏幕的 name 字段中提取屏幕 ID
  3. 获取屏幕元数据: 对于每个屏幕:

    • 使用 projectId 和 screenId 调用 [stitch前缀]:get_screen
    • 检索以下信息:
      • screenshot.downloadUrl — 视频的视觉资源
      • htmlCode.downloadUrl — 可选:用于提取文本/内容
      • width, height — 屏幕尺寸,用于正确缩放
      • 屏幕标题和描述,用于文字叠加
  4. 资源下载:

    • 使用 web_fetch 或带 curl 的 Bash 命令下载屏幕截图
    • 保存到暂存目录:assets/screens/{屏幕名称}.png
    • 按照预期的走查流程顺序组织资源

步骤 3:设置 Remotion 项目

  1. 检查现有的 Remotion 项目:

    • 查找 remotion.config.ts 或包含 Remotion 依赖的 package.json
    • 如果存在,则使用现有项目结构
  2. 创建新的 Remotion 项目(如果需要):

    npm create video@latest -- --blank
    
    • 选择 TypeScript 模板
    • 在专用的 video/ 目录中设置
  3. 安装依赖:

    cd video
    npm install @remotion/transitions @remotion/animated-emoji
    

视频合成策略

架构

创建一个模块化的 Remotion 合成,包含以下组件:

  1. ScreenSlide.tsx — 单个屏幕展示组件

    • 属性:imageSrc, title, description, width, height
    • 特性:缩放动画、淡入淡出转场
    • 持续时间:可配置(默认每个屏幕 3-5 秒)
  2. WalkthroughComposition.tsx — 主视频合成

    • 序列化多个 ScreenSlide 组件
    • 处理屏幕之间的转场
    • 添加文字叠加和注释
  3. config.ts — 视频配置

    • 帧率(默认 30 fps)
    • 视频尺寸(匹配 Stitch 屏幕尺寸或适当缩放)
    • 总时长计算

转场效果

使用 Remotion 的 @remotion/transitions 实现专业效果:

  • 淡入淡出:屏幕之间的平滑交叉淡入淡出

    import {fade} from '@remotion/transitions/fade';
    
  • 滑动:定向滑动转场

    import {slide} from '@remotion/transitions/slide';
    
  • 缩放:用于强调的放大/缩小效果

    • 使用 spring() 动画实现平滑缩放
    • 应用于重要的 UI 元素

文字叠加

使用 Remotion 的文本渲染添加上下文信息:

  1. 屏幕标题:显示在每帧的顶部或底部
  2. 功能标注:用动画指针高亮特定 UI 元素
  3. 描述:为每个屏幕淡入显示描述性文字
  4. 进度指示器:显示当前屏幕在走查中的位置

执行步骤

步骤 1:收集屏幕资源

  1. 识别目标 Stitch 项目
  2. 列出项目中的所有屏幕
  3. 下载每个屏幕的截图
  4. 按照走查流程顺序组织
  5. 创建清单文件 (screens.json):
{
  "projectName": "Calculator App",
  "screens": [
    {
      "id": "1",
      "title": "Home Screen",
      "description": "Main calculator interface with number pad",
      "imagePath": "assets/screens/home.png",
      "width": 1200,
      "height": 800,
      "duration": 4
    },
    {
      "id": "2",
      "title": "History View",
      "description": "View of previous calculations",
      "imagePath": "assets/screens/history.png",
      "width": 1200,
      "height": 800,
      "duration": 3
    }
  ]
}

步骤 2:生成 Remotion 组件

按照 Remotion 最佳实践创建视频组件:

  1. 创建 ScreenSlide.tsx:

    • 使用 useCurrentFrame() 和 spring() 实现动画
    • 实现缩放和淡入淡出效果
    • 添加带有正确时序的文字叠加
  2. 创建 WalkthroughComposition.tsx:

    • 导入屏幕清单
    • 使用 <Sequence> 组件序列化屏幕
    • 在屏幕之间应用转场
    • 计算正确的时序和偏移量
  3. 更新 remotion.config.ts:

    • 设置合成 ID
    • 配置视频尺寸
    • 设置帧率和时长

参考资源:

  • 使用 resources/screen-slide-template.tsx 作为起点
  • 按照 resources/composition-checklist.md 确保完整性
  • 查看 examples/walkthrough/ 目录中的示例

步骤 3:预览与优化

  1. 启动 Remotion Studio:

    npm run dev
    
    • 打开基于浏览器的预览
    • 支持实时编辑和优化
  2. 调整时序:

    • 确保每个屏幕有合适的显示时长
    • 验证转场是否平滑
    • 检查文字叠加的时序
  3. 微调动画:

    • 调整缩放效果的弹簧配置
    • 修改转场的缓动函数
    • 确保文字始终可读

步骤 4:渲染视频

  1. 使用 Remotion CLI 渲染:

    npx remotion render WalkthroughComposition output.mp4
    
  2. 备用方案:使用 Remotion MCP(如果可用):

    • 使用合成详情调用 [remotion前缀]:render
    • 指定输出格式(MP4、WebM 等)
  3. 优化选项:

    • 设置质量级别(--quality)
    • 配置编码器(--codec h264 或 h265)
    • 启用并行渲染(--concurrency)

高级功能

交互式热点

高亮可点击的元素或重要功能:

import {interpolate, useCurrentFrame} from 'remotion';

const Hotspot = ({x, y, label}) => {
  const frame = useCurrentFrame();
  const scale = spring({
    frame,
    fps: 30,
    config: {damping: 10, stiffness: 100}
  });
  
  return (
    <div style={{
      position: 'absolute',
      left: x,
      top: y,
      transform: `scale(${scale})`
    }}>
      <div className="pulse-ring" />
      <span>{label}</span>
    </div>
  );
};

语音旁白集成

为走查添加旁白:

  1. 根据屏幕描述生成旁白脚本
  2. 使用文本转语音或录制音频
  3. 使用 <Audio> 组件将音频导入 Remotion
  4. 同步屏幕时序与旁白节奏

动态文本提取

从 Stitch HTML 代码中提取文本以自动生成注释:

  1. 下载每个屏幕的 htmlCode.downloadUrl
  2. 解析 HTML 以提取关键文本元素(标题、按钮、标签)
  3. 为重要 UI 元素生成自动标注
  4. 作为时序文字叠加添加到合成中

文件结构

project/
├── video/                      # Remotion 项目目录
│   ├── src/
│   │   ├── WalkthroughComposition.tsx
│   │   ├── ScreenSlide.tsx
│   │   ├── components/
│   │   │   ├── Hotspot.tsx
│   │   │   └── TextOverlay.tsx
│   │   └── Root.tsx
│   ├── public/
│   │   └── assets/
│   │       └── screens/        # 下载的 Stitch 截图
│   │           ├── home.png
│   │           └── history.png
│   ├── remotion.config.ts
│   └── package.json
├── screens.json                # 屏幕清单
└── output.mp4                  # 渲染完成的视频

与 Remotion 技能集成

Remotion 维护自己的代理技能,这些技能定义了最佳实践。有关高级技术,请查阅这些技能:

要利用的关键 Remotion 技能:

  • 动画时序和缓动
  • 合成架构模式
  • 性能优化
  • 音频同步

常见模式

模式 1:简单幻灯片

使用淡入淡出转场的基本走查:

  • 每个屏幕 3-5 秒
  • 交叉淡入淡出转场
  • 底部带有屏幕标题的文字叠加
  • 顶部进度条

模式 2:功能高亮

聚焦于特定 UI 元素:

  • 放大到特定区域
  • 指向功能的动画圆形/箭头
  • 对关键交互的慢动作强调
  • 并排的前后对比

模式 3:用户流程

展示逐步用户旅程:

  • 带有定向滑动的顺序屏幕流
  • 编号步骤叠加
  • 高亮用户操作(点击、轻触)
  • 用动画路径连接屏幕

故障排除

问题解决方案
截图模糊确保下载的图片为全分辨率;检查 screenshot.downloadUrl 的质量设置
文本对齐错误验证屏幕尺寸与合成大小匹配;根据实际屏幕尺寸调整文本位置
动画卡顿将帧率提高到 60fps;使用具有适当阻尼的弹簧配置
Remotion 构建失败检查 Node 版本兼容性;确保所有依赖已安装;查阅 Remotion 文档
时序感觉不对调整清单中每个屏幕的持续时间;在 Remotion Studio 中预览;与真实用户测试

最佳实践

  1. 保持宽高比:使用实际 Stitch 屏幕尺寸或按比例缩放
  2. 一致的时序:除非需要强调特定屏幕,否则保持屏幕显示时长一致
  3. 文本可读性:确保足够的对比度;使用合适的字体大小;避免杂乱的叠加
  4. 平滑转场:使用弹簧动画实现自然运动;避免生硬的切换
  5. 彻底预览:始终在最终渲染前于 Remotion Studio 中预览
  6. 优化资源:适当压缩图片;使用高效格式(UI 用 PNG,照片用 JPG)

示例用法

用户提示:

在我的 Stitch 项目“计算器应用”中查找屏幕,并构建一个展示这些屏幕走查的 remotion 视频。

代理工作流程:

  1. 列出 Stitch 项目 → 找到“计算器应用” → 提取项目 ID
  2. 列出项目中的屏幕 → 识别所有屏幕(主页、历史、设置)
  3. 下载每个屏幕的截图 → 保存到 assets/screens/
  4. 创建包含屏幕元数据的 screens.json 清单
  5. 生成 Remotion 组件(ScreenSlide.tsx、WalkthroughComposition.tsx)
  6. 在 Remotion Studio 中预览 → 优化时序和转场
  7. 渲染最终视频 → calculator-walkthrough.mp4
  8. 报告完成,附带视频预览链接

成功秘诀

  • 从简单开始:在添加复杂动画之前,先使用基本的淡入淡出转场
  • 遵循 Remotion 模式:利用 Remotion 的官方技能和文档
  • 使用清单文件:将屏幕数据组织在 JSON 中,以便轻松更新
  • 频繁预览:使用 Remotion Studio 尽早发现问题
  • 考虑可访问性:添加字幕;确保文本可读;使用清晰的视觉元素
  • 针对平台优化:视频尺寸匹配目标平台(YouTube、社交媒体等)

参考资源

何时使用

当处理的任务清晰属于上述主要领域或功能范畴时,使用此技能。

限制

  • 仅当任务明确符合上述描述的范围内时,才使用此技能。
  • 不要将输出视为环境特定验证、测试或专家评审的替代品。
  • 如果缺少所需的输入、权限、安全边界或成功标准,请停下来请求澄清。

Individual skills in this repo

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

ASoudy/AGS

Advanced JavaScript animation library skill for creating complex, high-performance web animations.

ASoudy/AGS

Astropy is the core Python package for astronomy, providing essential functionality for astronomical research and data analysis.

ASoudy/AGS

Build content-focused websites with Astro — zero JS by default, islands architecture, multi-framework components, and Markdown/MDX support.

ASoudy/AGS

One sentence - what this skill does and when to invoke it

ASoudy/AGS

Audit and fix animation performance issues including layout thrashing, compositor properties, scroll-linked motion, and blur effects. Use when animations stutter, transitions jank, or reviewing CSS/JS animation performance.

ASoudy/AGS

Internationalization and localization patterns. Detecting hardcoded strings, managing translations, locale files, RTL support.

ASoudy/AGS

Pull a YouTube video transcript into a queryable markdown vault with yt-dlp subtitle discovery, VTT cleanup, metadata frontmatter, and capture-seed stubs.

ASoudy/AGS

Expert in building portfolios that actually land jobs and clients - not just showing work, but creating memorable experiences. Covers developer portfolios, designer portfolios, creative portfolios, and portfolios that convert visitors into opportunities.

ASoudy/AGS

Generates high-converting Next.js/React landing pages with Tailwind CSS. Uses PAS, AIDA, and BAB frameworks for optimized copy/components (Heroes, Features, Pricing). Focuses on Core Web Vitals/SEO.

ASoudy/AGS

AI-powered animation tool for creating motion in logos, UI, icons, and social media assets.

ASoudy/AGS

CRITICAL: Use for Makepad animation system. Triggers on: makepad animation, makepad animator, makepad hover, makepad state, makepad transition, "from: { all: Forward", makepad pressed, makepad 动画, makepad 状态, makepad 过渡, makepad 悬停效果

ASoudy/AGS

Comprehensive patterns for Next.js 14+ App Router architecture, Server Components, and modern full-stack React development.

ASoudy/AGS

Next.js App Router principles. Server Components, data fetching, routing patterns.

ASoudy/AGS

Expert integration of Supabase Auth with Next.js App Router

ASoudy/AGS

React and Next.js 14+ application development with App Router, Server Components, TypeScript, Tailwind CSS, and modern frontend patterns.

ASoudy/AGS

Best practices for Remotion - Video creation in React

ASoudy/AGS

Seek and analyze video content using Memories.ai Large Visual Memory Model for persistent video intelligence

ASoudy/AGS

Writes complete, structured landing pages optimized for SEO ranking, AEO citation, and visitor conversion. Activate when the user wants to write or generate a landing page for a product, service, or offer.

ASoudy/AGS

Three.js animation - keyframe animation, skeletal animation, morph targets, animation mixing. Use when animating objects, playing GLTF animations, creating procedural motion, or blending animations.

ASoudy/AGS

Skill for discovering and researching autonomous AI agents, tools, and ecosystems using the AgentFolio directory.

相关技能