Skyline Scroll Api logo

Skyline Scroll Api

Organization
wechat-miniprogram
skyline-scroll-api

Skyline 滚动控制 API 技能。涵盖 ScrollViewContext(程序化下拉刷新、下拉二级、滚动定位)、DraggableSheetContext(半屏面板程序化滚动)、worklet.scrollViewContext(UI 线程直接控制滚动)。适用于程序化触发刷新/二级、控制 DraggableSheet 位置、在 worklet 中操作滚动。触发关键词:ScrollViewContext、DraggableSheetContext、scrollTo、triggerRefresh、triggerTwoLevel、下拉刷新API、下拉二级API、滚动API、worklet scrollViewContext。

Overview

Publisherwechat-miniprogram
Repositoryskyline-skills
Skill nameskyline-scroll-api
Stars
56
Forks
2
Bundled files
4
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 4 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by wechat-miniprogram on GitHub. Read the source before you install it.

Installation

Install the Skyline Scroll Api AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/wechat-miniprogram/skyline-skills/tree/master/skills/skyline-scroll-api
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/wechat-miniprogram/skyline-skills.git /tmp/skyline-skills
mkdir -p .claude/skills
cp -r /tmp/skyline-skills/skills/skyline-scroll-api .claude/skills/skyline-scroll-api
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Skyline Scroll Api in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Skyline Scroll Api on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Skyline Scroll Api is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Skyline 滚动控制 API

适用场景

  • 程序化触发 scroll-view 下拉刷新或关闭刷新
  • 程序化触发/关闭下拉二级("二楼"页面)
  • 通过 ScrollViewContext 控制滚动位置和行为
  • 控制 DraggableSheet 半屏面板滚动到指定位置
  • 在 worklet 函数中(UI 线程)直接控制 scroll-view 滚动

核心概念

三大 API 族群

API 族群获取方式线程最低基础库
ScrollViewContextNodesRef.node() + enhanced 属性逻辑线程2.14.4
DraggableSheetContextNodesRef.node()逻辑线程3.2.0
worklet.scrollViewContextNodesRef.ref() + SharedValueUI 线程3.3.0

获取实例

js
// ScrollViewContext(需开启 enhanced)
wx.createSelectorQuery().select('#scrollview').node()
  .exec(res => { const ctx = res[0].node })

// DraggableSheetContext
wx.createSelectorQuery().select('.sheet').node()
  .exec(res => { const ctx = res[0].node })

// worklet.scrollViewContext(通过 ref)
this.scrollRef = wx.worklet.shared()
this.createSelectorQuery().select('.scrollable')
  .ref(res => { this.scrollRef.value = res.ref }).exec()

文档索引

根据需求快速定位(路径相对于 references/):

我想要...查阅文档
查看 ScrollViewContext 全部方法和属性api/scroll-view-context.md
了解 DraggableSheetContext.scrollTo 参数api/draggable-sheet-context.md
在 worklet 中控制滚动api/worklet-scroll-context.md
查看完整代码模式(刷新、二级、Sheet 控制)patterns.md

强制规则

MUST(必须遵守)

  1. scroll-view 必须开启 enhanced 属性才能获取 ScrollViewContext:

    html
    <!-- ❌ 错误:未开启 enhanced,node() 返回的不是 ScrollViewContext -->
    <scroll-view type="list" scroll-y>
    
    <!-- ✅ 正确 -->
    <scroll-view type="list" scroll-y enhanced>
  2. DraggableSheetContext.scrollTo 中 size 和 pixels 同时传入时,仅 size 生效:

    js
    // ❌ 错误:同时传入 size 和 pixels,pixels 被忽略
    sheetContext.scrollTo({ size: 0.7, pixels: 200 })
    
    // ✅ 正确:二选一
    sheetContext.scrollTo({ size: 0.7 })   // 相对位置
    sheetContext.scrollTo({ pixels: 200 }) // 绝对位置
  3. worklet.scrollViewContext 必须通过 NodesRef.ref 获取引用并存入 SharedValue:

    js
    // ❌ 错误:使用 node() 而非 ref()
    this.createSelectorQuery().select('.scroll').node()
      .exec(res => { /* 这是 ScrollViewContext,不是 worklet 引用 */ })
    
    // ✅ 正确:使用 ref() + shared()
    this.scrollRef = wx.worklet.shared()
    this.createSelectorQuery().select('.scroll')
      .ref(res => { this.scrollRef.value = res.ref }).exec()
  4. 调用 worklet.scrollViewContext.scrollTo 的函数必须声明 'worklet' 指令:

    js
    // ❌ 错误:缺少 worklet 指令
    onTap() {
      scrollViewContext.scrollTo(this.scrollRef.value, { top: 200 })
    }
    
    // ✅ 正确
    onTap() {
      'worklet'
      scrollViewContext.scrollTo(this.scrollRef.value, { top: 200 })
    }

NEVER(禁止行为)

  1. NEVER 在逻辑线程中调用 worklet.scrollViewContext.scrollTo——该 API 仅在 UI 线程(worklet 函数内)可用
  2. NEVER 在小程序插件中使用 worklet.scrollViewContext.scrollTo——该 API 不支持小程序插件

Quick Reference

ScrollViewContext 方法速查

方法说明最低基础库
scrollTo({ top, left, velocity, duration, animated })滚动至指定位置2.14.4
scrollIntoView(selector, options?)滚动至指定元素2.14.4
triggerRefresh({ duration?, easingFunction? })触发下拉刷新3.0.0
closeRefresh()关闭下拉刷新3.0.0
triggerTwoLevel({ duration?, easingFunction? })触发下拉二级3.0.0
closeTwoLevel({ duration?, easingFunction? })关闭下拉二级3.0.0

ScrollViewContext 属性速查

属性类型说明
scrollEnabledboolean滚动开关
bouncesboolean边界弹性(仅 iOS)
showScrollbarboolean显示滚动条
pagingEnabledboolean分页滑动
fastDecelerationboolean快速减速(仅 iOS)
decelerationDisabledboolean取消滚动惯性(仅 iOS)

场景决策表

场景推荐 API
程序化触发下拉刷新ScrollViewContext.triggerRefresh()
数据加载完成后关闭刷新ScrollViewContext.closeRefresh()
打开/关闭下拉二级triggerTwoLevel() / closeTwoLevel()
滚动到指定偏移量ScrollViewContext.scrollTo({ top })
滚动到指定元素ScrollViewContext.scrollIntoView(selector)
控制 DraggableSheet 位置DraggableSheetContext.scrollTo({ size })
UI 线程中控制滚动(配合手势)worklet.scrollViewContext.scrollTo()

程序化刷新最小示例

js
// 获取 ScrollViewContext
wx.createSelectorQuery().select('#sv').node().exec(res => {
  const ctx = res[0].node
  ctx.triggerRefresh({ duration: 300 })
  // 数据加载完成后
  setTimeout(() => ctx.closeRefresh(), 2000)
})

相关技能

场景推荐技能说明
scroll-view 组件属性和事件skyline-componentsscroll-view/draggable-sheet 组件详解
Worklet 动画系统skyline-workletSharedValue、timing/spring、worklet 基础
页面转场路由skyline-route自定义路由、预设路由
Skyline 概览与迁移skyline-overview渲染引擎概览、兼容性

References 目录结构

references/
├── api/
│   ├── draggable-sheet-context.md
│   ├── scroll-view-context.md
│   └── worklet-scroll-context.md
└── patterns.md

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Skyline Scroll Api AI skill do?

Skyline 滚动控制 API 技能。涵盖 ScrollViewContext(程序化下拉刷新、下拉二级、滚动定位)、DraggableSheetContext(半屏面板程序化滚动)、worklet.scrollViewContext(UI 线程直接控制滚动)。适用于程序化触发刷新/二级、控制 DraggableSheet 位置、在 worklet 中操作滚动。触发关键词:ScrollViewContext、DraggableSheetContext、scrollTo、triggerRefresh、triggerTwoLevel、下拉刷新API、下拉二级API、滚动API、worklet scrollViewContext。

Why use Skyline Scroll Api on TypingMind?

Because you install it once and use it with any model. Skyline Scroll Api is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Skyline Scroll Api in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/wechat-miniprogram/skyline-skills/tree/master/skills/skyline-scroll-api. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Skyline Scroll Api?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Skyline Scroll Api?

As many as you like. As long as a model supports skills, you can use Skyline Scroll Api with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Skyline Scroll Api AI skill free?

Yes. It is published on GitHub by wechat-miniprogram under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇