Communitygithub.com

AbobakrDiara61/railway-system

从 Stitch 项目中生成走查视频,使用 Remotion 实现平滑过渡、缩放效果和文字叠加。

railway-system 是什么?

此技能专为开发者与 AI 代理设计,可将 Stitch 设计稿中的屏幕截图自动编排为专业的程序化走查视频。它结合 Stitch MCP 服务器的屏幕检索能力与 Remotion 的视频合成能力,生成包含淡入淡出、滑动和缩放等过渡效果,并支持屏幕标题、功能标注与进度指示等文字叠加的高质量视频。技能提供了完整的流程指南:从识别 Stitch 项目、下载屏幕资源、创建 JSON 清单,到生成 Remotion 组件(ScreenSlide.tsx 与 WalkthroughComposition.tsx)、在 Remotion Studio 中预览调整,最终渲染为 MP4 等格式。此外还支持高级功能如交互式热点、语音旁白集成以及动态文字提取,适用于产品演示、功能亮点展示和用户流程走查等场景。

兼容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/AbobakrDiara61/railway-system/tree/HEAD/frontend/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_prefix]:list_projects 并设置参数 filter: "view=owned"
    • 按标题识别目标项目(例如 "Calculator App")
    • 从 name 字段提取项目 ID(例如 projects/13534454087919359824)
  2. 屏幕检索:

    • 使用项目 ID(仅数字)调用 [stitch_prefix]:list_screens
    • 查看屏幕标题,确定走查所需的所有屏幕
    • 从每个屏幕的 name 字段提取屏幕 ID
  3. 屏幕元数据获取: 对每个屏幕:

    • 使用 projectId 和 screenId 调用 [stitch_prefix]:get_screen
    • 获取:
      • screenshot.downloadUrl — 视频的可视化素材
      • htmlCode.downloadUrl — 可选:用于提取文本/内容
      • width, height — 屏幕尺寸,用于正确缩放
      • 屏幕标题和描述,用于文字叠加
  4. 资源下载:

    • 使用 web_fetch 或通过 curl 的 Bash 命令下载截图
    • 保存到暂存目录:assets/screens/{screen-name}.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 — 单个屏幕显示组件

    • Props: 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": "主计算器界面,包含数字键盘",
      "imagePath": "assets/screens/home.png",
      "width": 1200,
      "height": 800,
      "duration": 4
    },
    {
      "id": "2",
      "title": "History View",
      "description": "查看历史计算结果",
      "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. 微调动画:

    • 调整缩放效果的 spring 配置
    • 修改过渡的缓动函数
    • 确保文字始终可读

步骤 4:渲染视频

  1. 使用 Remotion CLI 渲染:

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

    • 调用 [remotion_prefix]: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;使用适当的 spring 配置并设置合适的阻尼
Remotion 构建失败检查 Node 版本兼容性;确保所有依赖已安装;参考 Remotion 文档
时间控制感觉不对在清单中调整每屏幕的时长;在 Remotion Studio 中预览;与实际用户测试

最佳实践

  1. 保持宽高比:使用实际的 Stitch 屏幕尺寸或按比例缩放
  2. 一致的时间控制:除非要强调特定屏幕,否则保持每屏幕显示时长一致
  3. 文字可读:确保足够的对比度;使用适当的字号;避免杂乱的叠加
  4. 平滑过渡:使用 spring 动画实现自然运动;避免突兀的切变
  5. 彻底预览:在最终渲染前始终在 Remotion Studio 中预览
  6. 优化资源:适当压缩图像;使用高效的格式(UI 用 PNG,照片用 JPG)

使用示例

用户提示:

查找我在 Stitch 项目“Calculator App”中的屏幕,并构建一个展示屏幕走查的 Remotion 视频。

代理工作流:

  1. 列出 Stitch 项目 → 找到 "Calculator App" → 提取项目 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.

AbobakrDiara61/railway-system

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

AbobakrDiara61/railway-system

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

AbobakrDiara61/railway-system

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

AbobakrDiara61/railway-system

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

AbobakrDiara61/railway-system

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.

AbobakrDiara61/railway-system

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

AbobakrDiara61/railway-system

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.

AbobakrDiara61/railway-system

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.

AbobakrDiara61/railway-system

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

AbobakrDiara61/railway-system

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 悬停效果

AbobakrDiara61/railway-system

Best practices for Remotion - Video creation in React

AbobakrDiara61/railway-system

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

AbobakrDiara61/railway-system

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.

AbobakrDiara61/railway-system

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

AbobakrDiara61/railway-system

Automate TikTok tasks via Rube MCP (Composio): upload/publish videos, post photos, manage content, and view user profiles/stats. Always search tools first for current schemas.

AbobakrDiara61/railway-system

Video and audio perception, indexing, and editing. Ingest files/URLs/live streams, build visual/spoken indexes, search with timestamps, edit timelines, add overlays/subtitles, generate media, and create real-time alerts.

AbobakrDiara61/railway-system

Upload, stream, search, edit, transcribe, and generate AI video and audio using the VideoDB SDK.

AbobakrDiara61/railway-system

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

AbobakrDiara61/railway-system

Automate YouTube tasks via Rube MCP (Composio): upload videos, manage playlists, search content, get analytics, and handle comments. Always search tools first for current schemas.

AbobakrDiara61/railway-system

Extract transcripts from YouTube videos and generate comprehensive, detailed summaries using intelligent analysis frameworks

相关技能