zimai233/dsh-figma-to-lottie

为DeepSeek Harness设计的Figma/SVG到Lottie动画编译器。将SVG路径与关键帧数据转换为独立的.lottie.json文件。

Project Overview项目介绍

This is a native plugin built exclusively for DeepSeek Harness that compiles Figma or SVG path and keyframe data into ready-to-use Lottie 5.7.4 JSON animation files. It can be installed directly via the DSH CLI, with two installation options available: install from the npm registry, or install directly from the GitHub repository. For better supply chain security, the repository recommends locking the install to a specific commit hash when installing from GitHub. The plugin exposes two agent-callable tools: lottie_compile_shape for testing SVG path conversion, and lottie_compile for building full animations.

To use the plugin, you simply describe your desired animation in natural language to your DSH agent. For example, you can ask for a 3-second loading animation with specific dimensions, background color, and staggered sliding bars, and the agent will handle the rest. The plugin accepts compact layer specifications that support multiple layer types including rectangles with gradient fills, SVG paths, base64-embedded images, and text layers. Each layer can be configured with custom opacity and keyframe timing to get the exact animation you need.

The plugin is written as pure ESM, so there are no build steps required, and no prepare scripts or build permissions are needed to run it. It is open source under the permissive MIT license, so you can modify or redistribute it freely per the license terms. For developers who want to contribute or modify the code, you can run npm install to get dependencies, npm test to run core function tests, and npm run pack to do a publish dry run before releasing changes. Output Lottie JSON files work with all standard Lottie runtimes across web, iOS, and Android.

这是一个专为 DeepSeek Harness 开发的原生插件,功能是将 Figma 或 SVG 格式的路径和关键帧数据编译为自包含的 Lottie 动画 JSON 文件。它填补了 DSH 插件生态中缺少设计工具桥接层的空白,将 SVG 转 Lottie 的完整编译流程提炼为两个可被 agent 直接调用的工具,全程无需额外设计工具,可直接在对话中完成编译。

本插件面向需要通过 agent 快速生成 Lottie 动画资产的开发者与设计师,常规使用流程十分简便。用户只需用自然语言向 agent 描述动画需求,agent 就会调用插件提供的对应工具完成编译。例如你可以请求生成自定义加载动画,插件最终会输出可直接在 Web、iOS 和 Android 平台使用的成品 Lottie JSON 文件。

插件采用纯 ESM 编写,无需额外构建步骤,发布包即可直接运行。安装方式支持从 npm 或 GitHub 源码安装,推荐锁定 GitHub commit 以保障供应链安全。插件源代码开放,采用 MIT 许可证,用户可自由修改和使用,开发者也可运行测试完成开发预检。

Pre-install check安装前体检Compatibility · Security兼容性 · 安全性 1 warning1 项注意
  • Only 3 stars - very few users, little community feedback星标只有 3,几乎没人在用,遇到问题缺少社区反馈
DSH walks through these 9 checksDSH 会逐条核对这 9 项

Compatibility兼容性

  • DSH, Node, OS and profile requirementsDSH 版本 / Node 版本 / 操作系统 / profile 是否满足要求
  • External dependencies and runtimes (Electron / Python / Docker, ...)外部依赖与运行时(Electron / Python / Docker 等)是否齐备
  • Conflicts with installed plugins: command names, skill / tool names, ports, duplicate MCP registration与已装插件是否冲突:命令名、skill / tool 重名、端口占用、重复 MCP 注册

Security安全性

  • Repo matches the facts registered here; archived or abandoned?仓库是否与页面登记一致,是否归档或长期停更
  • Safety of preinstall / install / postinstall and install.sh / setup.ps1preinstall / install / postinstall 与 install.sh、setup.ps1 是否安全
  • curl|bash, download-then-execute, obfuscation, unrelated domains → stop immediatelycurl|bash、下载即执行、混淆代码、无关域名 → 立刻停止
  • Typosquatting or unmaintained packages among the new dependencies新增依赖里有没有 typosquatting 或无人维护的包
  • Requested permissions vs. what the feature actually needs申请了哪些权限、是否超出功能所需(filesystem / network / shell / clipboard)
  • Any sudo / admin requirement, plus uninstall and rollback是否要求 sudo / 管理员权限,以及卸载与回滚方式

Anything uncertain must be marked unknown with a note on how to confirm it. This site's signal screen is a static snapshot, not a security audit.拿不准的必须标「未知」并说明要我怎么确认。本站的信号筛查是静态快照,不能替代安全审计。

Or use CLI install (for developers)或使用命令行安装(适合开发者)

CLI Install命令行安装

dsh plugin --profile myprofile add dsh-figma-to-lottie

把 zimai233/dsh-figma-to-lottie 加入你的 DSH 配置(web profile)即可启用。

READMEREADME

dsh-figma-to-lottie

为 DeepSeek Harness 打造的 Figma/SVG → Lottie 动画编译器。

将 SVG 路径与关键帧数据编译成自包含的 .lottie.json 文件——直接在 agent 对话中完成,无需任何设计工具。

为什么需要它

DSH 插件生态没有设计工具桥接层(虽然有 Figma MCP,但没有插件能把设计数据编译成动画资产)。本插件填补了这个空白:它把 SVG→Lottie 的编译管道——路径解析、贝塞尔进出切线转换、关键帧缓动——提炼成两个可被 agent 调用的工具。

功能特性

  • lottie_compile_shape — 将 SVG 路径 d 字符串解析为 Lottie 形状值 { i, o, v, c },带正确的贝塞尔切线。编译完整动画前,可先检查任意 SVG 路径的转换结果。
  • lottie_compile — 从紧凑的图层规格组装完整的 Lottie 5.7.4 JSON 文档:矩形(支持渐变填充)、路径、图片(base64 内嵌)、文字,每层均支持透明度 / 上滑关键帧动画。
  • 零构建步骤——纯 ESM,发布即运行时代码。无需 prepare 脚本,无需构建授权。

安装

# 从 npm 安装
dsh plugin --profile myprofile add dsh-figma-to-lottie

# 从 GitHub 安装(建议锁定 commit,供应链更安全)
dsh plugin --profile myprofile add github:zimai233/dsh-figma-to-lottie#<sha>

使用

用自然语言告诉 agent:

"编译一个 3 秒的加载动画:345×414 画布,浅灰背景,10 根蓝色柱子在 x=215.5 处以 0.48/0.24/0.4/1.4 的缓动上滑,每根错开 100ms。写入 ./loading.lottie.json"

agent 会调用 lottie_compile,传入类似这样的规格:

{
  "frame": { "w": 345, "h": 414, "bg": "#f3f4f6", "name": "loading" },
  "fps": 60,
  "durationMs": 3000,
  "layers": [
    { "type": "rect", "id": "bar-1", "x": 215.5, "y": 112, "w": 57, "h": 13, "r": 6.5,
      "gradient": ["#61adf8", "#8fd1fa"], "slideUp": 15, "startMs": 0 },
    { "type": "rect", "id": "bar-2", "x": 215.5, "y": 137, "w": 57, "h": 13, "r": 6.5,
      "gradient": ["#61adf8", "#8fd1fa"], "slideUp": 15, "startMs": 100 }
  ]
}

产出的 Lottie JSON 可直接用于 iOS / Android / Web(LottieWeb、lottie-ios、lottie-android)。

图层规格参考

字段 类型 说明
frame.w / frame.h number 画布尺寸(像素,必填)
frame.bg hex 字符串 可选背景色
fps number 帧率,默认 60
durationMs number 动画总时长(必填)
bezier {p1x,p1y,p2x,p2y} 可选缓动曲线,默认为上滑缓动

图层类型

类型 字段
rect x、y、w、h、r?、fill?、gradient?: [c1,c2]、slideUp?、opacity?、startMs?、endMs?
path d(SVG 路径)、x?、y?、fill?、opacity?
image path(绝对文件路径,PNG 以 base64 内嵌)、x、y、w、h
text text、x、y、size、color?、font?

开发

npm install
npm test          # 对 buildLottie + svgPathToLottie 运行纯核心测试
npm run pack      # 打包预检(相当于 pnpm pack)

Showing the opening section of the README — the full document lives in the repository以上为 README 开头摘要,完整文档在仓库内 · View the full README on GitHub →在 GitHub 查看完整 README →

← 上一个 Prev dsh-plugins 下一个 Next dsh-ext-vision-proxy →