Skyline Worklet
Worklet animation skill for high-performance UI-thread interactive animations in Skyline, covering drag, gesture follow, and spring rebound.
- CCM score
- 66 of 100
- skills.sh installs
- 1.1K
- GitHub stars
- 58
- last updated
- Aug 21, 2026
Own this skill? Claim it
What it does
- Covers shared variables, timing, spring, and decay animations, Easing curves, combined animations, and runOnUI/runOnJS thread communication
- Includes reference docs on worklet architecture, SharedValue and DerivedValue, scroll-view context, and an index mapping each need to its document
- Enforces
'worklet'directives,.valueaccess for SharedValue, runOnJS for non-worklet calls, and no directwxAPI calls inside worklets - Designed for Skyline-rendered mini programs that need animations to respond directly on the UI thread without JS-thread round trips
Install
$ npx -y skills add wechat-miniprogram/skyline-skills --skill skyline-worklet -yInstalls into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.
Files
Worklet 动画系统
适用场景
- 实现手势跟随、拖拽等交互动画
- 使用 timing/spring/decay 创建动画效果
- 通过 SharedValue 驱动节点样式变化
- 组合多段动画(序列、重复、延迟)
- 在 UI 线程和 JS 线程间传递数据
核心概念
双线程架构与 Worklet 的意义
小程序双线程架构中,UI 事件需跨线程传递到 JS 线程再回传,交互动画会有明显延迟。Worklet 动画让动画逻辑直接运行在 UI 线程,实现类原生动画体验。
三大核心概念
| 概念 | 说明 | 关键 API |
|---|---|---|
| worklet 函数 | 可运行在 JS 或 UI 线程的函数,顶部声明 'worklet' 指令 | runOnUI(), runOnJS() |
| 共享变量 | 跨线程同步的变量,通过 .value 读写 | shared(), derived() |
| 动画驱动 | 将 SharedValue 绑定到节点样式 | applyAnimatedStyle() |
基本流程
const { shared, timing } = wx.worklet
// 1. 创建共享变量
const offset = shared(0)
// 2. 绑定到节点样式(updater 为 worklet 函数)
this.applyAnimatedStyle('#box', () => {
'worklet'
return { transform: `translateX(${offset.value}px)` }
})
// 3. 修改值驱动动画
offset.value = timing(300, { duration: 200 })
文档索引
根据需求快速定位(路径相对于 references/):
Details
- Repository
- github.com/wechat-miniprogram/skyline-skills
- Categories
- Animation & Motion, Mobile Apps
- First seen
- Jun 3, 2026
Questions
What does the skyline-worklet skill do?
The skyline-worklet skill helps build high-performance interactive animations in WeChat Mini Programs with the Skyline renderer. It covers worklet functions, SharedValue, timing, spring and decay animations, Easing, and runOnUI and runOnJS thread communication. It suits drag, gesture-following and spring rebound effects that need direct UI thread response.
How do I install the skyline-worklet skill?
Run npx -y skills add wechat-miniprogram/skyline-skills --skill skyline-worklet -y in your project to install it. Once installed, the agent can write worklet animations that run on the UI thread instead of waiting on the JS thread. This reduces the visible lag in interactive animations.
Where does skyline-worklet stand in the Animation & Motion category?
The skyline-worklet skill is listed in the Animation & Motion category on Claude Marketplaces, alongside remotion-render and hyperframes skills. It is tailored to WeChat Mini Program Skyline animations rather than general motion graphics. It focuses on UI thread animation driven by SharedValue bindings.
Does skyline-worklet require Skyline rendering in my app?
Yes, worklet animations only work in Skyline rendering mode. The skill requires app.json to set renderer to skyline and the developer tools option to compile JS to ES5 to be enabled. Without these settings the worklet animations will not run.
More from wechat-miniprogram/skyline-skills
All 7Similar to Skyline Worklet
More Animation & Motionskyline-scroll-apiwechat-miniprogram/skyline-skills1K installsSkyline scroll control APIs for programmatic refresh, two-level pulldown, scroll positioning, and draggable sheet control.
reanimated-skia-performanceandreev-danila/skills1K installsPerformance-focused guide for React Native animations and 2D graphics with Reanimated v4 and Skia shaders.
ui-animationmblode/agent-skills11.4K installsPrecise motion-design toolkit covering springs, gestures, CSS transitions, curve fitting from recordings, and sparse interface sound.
skyline-routewechat-miniprogram/skyline-skills1.1K installsSkyline custom routes and page transitions covering presets, routeBuilder animations, pop gestures, and container transitions.
motion-reactpedronauck/skills1.2K installsMotion for React skill covering gestures, scroll effects, springs, layout, and exit animations in React apps.