Xpersona
M

m5stack-uiflow2-coder

CLAWHUB · Unverified

UIFlow2 MicroPython coding assistant. Use when writing, debugging, reviewing, or explaining UIFlow2 MicroPython code for M5Stack devices; when selecting M5Stack UIFlow2 APIs, imports, constructors, examples, display/UI patterns, hardware/unit/module drivers, or troubleshooting UIFlow2 runtime errors

62
Rank
84
Safety
1.8k
Downloads

About

What it does, and when to use it.

Capability contract not published. No trust telemetry is available yet. 1.8K downloads reported by the source. Last updated 10/10/2026.

Avoid when

  • Contract metadata is missing or unavailable for deterministic execution.

Risk flags: missing_or_unavailable_contract, trust_data_unavailable, schema_references_missing

Install and run

Setup complexity: low.

clawhub skill install s172msxncqj8qynj4h8hmx0pk983j66k:uiflow2-coder
  1. Install using `clawhub skill install s172msxncqj8qynj4h8hmx0pk983j66k:uiflow2-coder` in an isolated environment before connecting it to live workloads.
  2. No published capability contract is available yet, so validate auth and request/response behavior manually.
  3. Review the upstream CLAWHUB listing at https://clawhub.ai/yuyun2000/uiflow2-coder before using production credentials.

Contract: missing

curl -s "https://www.xpersona.co/api/v1/agents/clawhub-yuyun2000-uiflow2-coder/snapshot"

Run-check

$0.02 USD

1 measured facts are behind this paywall: success rate and latency, uptime and estimated cost, when not to use it, how to call it, benchmark scores.

Agents pay $0.02 in USDC. A card payment is $0.50, the smallest a card allows.

Documentation

CLAWHUB

160,000 characters of source documentation, loaded on request.

Extracted files

5 files captured from the source.

SKILL.md

---
name: uiflow2-coder
description: UIFlow2 MicroPython coding assistant. Use when writing, debugging, reviewing, or explaining UIFlow2 MicroPython code for M5Stack devices; when selecting M5Stack UIFlow2 APIs, imports, constructors, examples, display/UI patterns, hardware/unit/module drivers, or troubleshooting UIFlow2 runtime errors. Always consult the bundled official docs before generating code.
---

# UIFlow2 Coder

你是 UIFlow2 MicroPython 编码助手。目标是输出能在 M5Stack UIFlow2 固件上运行、API 正确、资源友好、易验证的代码。默认用中文回答,代码和 API 名保持英文。

## 强制原则

- 先查文档,再写代码;禁止凭经验编造 UIFlow2 API、构造参数、返回值或 import。
- 先定位目标设备、模块类别和功能,再读取对应 `docs/` 文件。
- 如果目录下存在 `_overview.md`,先读 `_overview.md` 了解该模块整体规则,再读具体 API 文件。
- 不确定路径时先查 `file_tree.txt`,再用 `scripts/find_doc.ps1` 或 `scripts/find_doc.sh` 搜索。
- 生成代码前检查官方示例里的 import、初始化顺序、主循环和返回值用法。
- 请求涉及 UI、显示、图形、动画、Canvas、触摸、按钮状态、状态机、传感器数据显示、网络仪表盘、天气或图表时,先用下方的客观条件表判断是否值得读取例程;只有满足一行的全部条件才加载对应示例,不满足时不要为形式消耗上下文。用户点名或要求改造某个例程时直接读取它。
- 给出代码后附上最小验证方法;不能硬件验证时说明需要在哪块板或哪个 Unit 上验证。

## 文档定位

本 skill 的官方资料在 `docs/`。下方已内嵌完整文件树;先按树定位文件,再读取对应原文。常用入口:`docs/get-started/_overview.md`、`docs/m5ui/_overview.md`、`docs/widgets/_overview.md`、`docs/hardware/`、`docs/unit/`、`docs/module/`、`docs/base/`、`docs/hat/`、`docs/system/`、`docs/advanced/`。只有包含实质性整体指导的 `index.rst` 会生成 `_overview.md`;纯目录型 overview 已由文件树替代。

不确定时搜索:PowerShell `./scripts/find_doc.ps1 env temperature`;bash `./scripts/find_doc.sh env temperature`。

## 精选 UIFlow2 示例

`assets/examples/` 保存人工精选的例程镜像,入口清单见 `references/complex-examples.md`。每一行是客观的屏幕/UI 体系与功能组合条件,需全部满足才读取;同一功能条件中的多个关键词按“或”理解。未满足条件时跳过示例,避免无效上下文。

- 示例用于复用程序架构、事件组织、刷新策略和资源管理,不替代 `docs/` 的 API 约束。
- 先按 UI 体系、屏幕分辨率和功能选择示例,再确认目标板卡具备示例使用的 IMU、按键或触摸等硬件;不要无关地复制整个示例。
- 示例与需求冲突时以用户需求和当前官方文档为准,并明确需要重新硬件验证的部分。
- 只有经开发者确认适合作为标准参考的示例才会进入该目录;硬件验证状态以清单为准,未标明时不得声称已经过真机测试。

<!-- BEGIN_EXAMPLE_ROUTING -->
## 示例选择判定

只有当请求满足下表一行的全部客观条件时,才读取对应例程作为结构参考;不满足时不要为了形式加载示例,命中多行时可读取多个。
每一行的屏幕/UI 体系条件与功能条件需同时满足;同一功能条件中的多个关键词按“或”理解。
例程用于复用结构、刷新策略、状态管理和资源策略,API 签名与兼容性仍以 `docs/` 为准。

| 客观组合条件(全部满足才读取) | 参考例程 | 例程结构精华 |
| --- | --- | --- |
| 目标屏幕为 135 x 240<br>请求包含持续动画、IMU/重力/倾斜、粒子/物理模拟、按钮暂停或重置、离屏 Canvas | [assets/examples/widgets/hourglass_135x240.py](assets/examples/widgets/hourglass_135x240.py) | 固定 4 x 4 网格和 bytearray mask,限制粒子数量与内存<br>IMU 滤波、dead zone 和方向映射,避免画面抖动<br>time.ticks_ms/ticks_diff 帧间隔控制,M5.update 持续运行<br>M5.Lcd.newCanvas 复用整帧后一次 push,按钮回调只置位状态 |
| 目标屏幕为 135 x 240<br>请求包含天气/网络仪表盘、Wi-Fi、HTTP/HTTPS、周期刷新、缓存或 offline/stale 状态 | [assets/examples/widgets/weather_135x240.py](assets/examples/widgets/weather_135x240.py) | 暗色 token 调色板和 135 x 240 紧凑信息层级<br>M5.Lcd.newCanvas 复用离屏画布,天气图标由基础图元组合<br>先复用 UIFlow2 已联网状态,Wi-Fi/HTTP 有限超时和异常降级<br>15 分钟刷新、Button A 手动刷新、缓存数据标记 offline |
| 目标屏幕为 320 x 240 且使用 m5ui/LVGL<br>请求包含网络仪表盘、天气、HTTPS、缓存、offline/stale 或触控刷新 | [assets/examples/m5ui/weather_320x240.py](assets/examples/m5ui/weather_320x240.py) | M5Page + M5Canvas + M5Label/M5Button 的 parent=page 组合<br>M5Canvas 使用 RGB565 和 begin_draw/end_draw 批量提交<br>lv.text_get_size 计算数字、单位和右对齐文本位置

_meta.json

{
  "ownerId": "kn70r9ecz30v53j9cvh2q1ca9181yrva",
  "slug": "uiflow2-coder",
  "version": "1.0.13",
  "publishedAt": 1788251532699
}

references/complex-examples.md

# Curated UIFlow2 Examples

这些示例是人工精选的 UIFlow2 程序,用于复用整体结构、状态管理和性能策略。
示例按 UI 体系和屏幕分辨率组织,不以某一款主机作为唯一适用范围。
每个条目单独记录验证状态;未标明硬件验证时,不要声称已经过真机测试。
API 名称、参数和兼容性仍以 `docs/` 为准;不要仅凭示例推断未记录的 API。

## Hourglass (Widgets, 135 x 240)

- 仓库源路径:`examples/widgets/hourglass_135x240.py`
- Skill 镜像:[assets/examples/widgets/hourglass_135x240.py](../assets/examples/widgets/hourglass_135x240.py)
- 能力点:IMU gravity mapping and filtering、button-driven state changes、off-screen Canvas rendering、grid-based particle simulation、allocation-conscious animation loop
- 参考条件(需同时满足):目标屏幕为 135 x 240;请求包含持续动画、IMU/重力/倾斜、粒子/物理模拟、按钮暂停或重置、离屏 Canvas
- 结构精华:固定 4 x 4 网格和 bytearray mask,限制粒子数量与内存;IMU 滤波、dead zone 和方向映射,避免画面抖动;time.ticks_ms/ticks_diff 帧间隔控制,M5.update 持续运行;M5.Lcd.newCanvas 复用整帧后一次 push,按钮回调只置位状态
- 验证状态:开发者提供的参考实现;未记录真机验证
- 适用场景:Building a 135 x 240 Widgets animation, sensor-driven simulation, or frame-timed Canvas application.

## Weather (Widgets, 135 x 240)

- 仓库源路径:`examples/widgets/weather_135x240.py`
- Skill 镜像:[assets/examples/widgets/weather_135x240.py](../assets/examples/widgets/weather_135x240.py)
- 能力点:reuse of the existing UIFlow2 Wi-Fi connection、optional Wi-Fi fallback only when offline、HTTPS weather API requests and JSON parsing、cached offline display and refresh scheduling、off-screen Canvas dashboard rendering
- 参考条件(需同时满足):目标屏幕为 135 x 240;请求包含天气/网络仪表盘、Wi-Fi、HTTP/HTTPS、周期刷新、缓存或 offline/stale 状态
- 结构精华:暗色 token 调色板和 135 x 240 紧凑信息层级;M5.Lcd.newCanvas 复用离屏画布,天气图标由基础图元组合;先复用 UIFlow2 已联网状态,Wi-Fi/HTTP 有限超时和异常降级;15 分钟刷新、Button A 手动刷新、缓存数据标记 offline
- 验证状态:开发者提供的参考实现;未记录真机验证
- 适用场景:Building a 135 x 240 Widgets dashboard, periodic API client, cached offline view, or weather application.

## Weather (M5UI/LVGL, 320 x 240)

- 仓库源路径:`examples/m5ui/weather_320x240.py`
- Skill 镜像:[assets/examples/m5ui/weather_320x240.py](../assets/examples/m5ui/weather_320x240.py)
- 能力点:M5UI page, Canvas, label, and button composition、reuse of the existing UIFlow2 Wi-Fi connection、optional Wi-Fi fallback only when offline、IP-based location with Shenzhen fallback、HTTPS weather requests, caching, and offline display
- 参考条件(需同时满足):目标屏幕为 320 x 240 且使用 m5ui/LVGL;请求包含网络仪表盘、天气、HTTPS、缓存、offline/stale 或触控刷新
- 结构精华:M5Page + M5Canvas + M5Label/M5Button 的 parent=page 组合;M5Canvas 使用 RGB565 和 begin_draw/end_draw 批量提交;lv.text_get_size 计算数字、单位和右对齐文本位置;网络刷新显示 UPDATING/ONLINE/OFFLINE,保留缓存并回收内存
- 验证状态:开发者提供的参考实现;未记录真机验证
- 适用场景:Building a 320 x 240 M5UI/LVGL network dashboard, weather client, or cached offline view.

## Hourglass (M5UI/LVGL, 320 x 240)

- 仓库源路径:`examples/m5ui/hourglass_320x240.py`
- Skill 镜像:[assets/examples/m5ui/hourglass_320x240.py](../assets/examples/m5ui/hourglass_320x240.py)
- 能力点:M5UI page and touch button composition、IMU gravity mapping and filtering、double-buffered LVGL Canvas rendering、grid-based particle simulation、frame-timed allocation-conscious animation
- 参考条件(需同时满足):目标屏幕为 320 x 240 且使用 m5ui/LVGL;请求包含自定义 Canvas 动画、IMU/重力/倾斜、粒子/物理模拟、双 Canvas、触摸暂停或补充
- 结构精华:M5UI page 下只占中间区域的 RGB565 L

docs/addon/display_in.md

# addon DisplayIn

`DisplayIn` captures HDMI input from the Display In Add-on (U220) connected
to Unit PoE-P4 and saves a frame as a JPEG file. It initializes the LT6911
HDMI receiver when created and releases the capture resources with
`DisplayIn.deinit`.

The current capture format is `1280x720`. Connect an HDMI source before
calling `DisplayIn.capture`.

Support the following products:

    display_in

## MicroPython Example

#### HDMI input

This example captures one frame from the HDMI input and saves it as a JPEG file
in the device flash file system.

```python
import os, sys, io
import M5
from M5 import *
from addon import DisplayIn
import time

addon_display_in_0 = None

def setup():
    global addon_display_in_0

    M5.begin()
    addon_display_in_0 = DisplayIn()
    time.sleep(1)
    print(
        (
            str("saved /flash/lt6911_capture.jpg, ")
            + str(
                (str((addon_display_in_0.capture("/flash/capture.jpg", 75, 1000))) + str("bytes"))
            )
        )
    )

def loop():
    global addon_display_in_0
    M5.update()

if __name__ == "__main__":
    try:
        setup()
        while True:
            loop()
    except (Exception, KeyboardInterrupt) as e:
        try:
            from utility import print_error_msg

            print_error_msg(e)
        except ImportError:
            print("please update to latest firmware")
```

## **API**

#### DisplayIn

## `DisplayIn`
Capture HDMI input from the Display In Add-on (U220) as JPEG images.

`DisplayIn` initializes the LT6911 HDMI receiver. Call `capture`
to save one captured frame, then call `deinit` when capture is no
longer needed.

```python
from addon import DisplayIn

display_in = DisplayIn()
size = display_in.capture("/flash/capture.jpg", quality=75)
display_in.deinit()
```

### `capture`
Capture one HDMI frame and save it as a JPEG file.

- Parameter `path` (`str`): Destination JPEG file path.
- Parameter `quality` (`int`): JPEG quality from `1` to `100`. Default is `75`.
- Parameter `timeout_ms` (`int`): Maximum frame wait time in milliseconds. Default is `1000`.
- Returns: Number of bytes written to `path`.
- Return type: int

```python
size = display_in.capture("/flash/capture.jpg", quality=75)
```

### `deinit`
Release the Display In Add-on (U220) HDMI input resources.

```python
display_in.deinit()
```

docs/addon/display_out.md

# addon DisplayOut

`DisplayOut` enables HDMI display output on Unit PoE-P4 by registering the
PoE-P4 HDMI interface as an M5 display. Use it when an external HDMI monitor is
connected to the Unit PoE-P4 display output.

Support the following products:

    display_out

## MicroPython Example

#### HDMI output

This example initializes the HDMI output and draws basic widgets on the external display.

```python
import os, sys, io
import M5
from M5 import *
from addon import DisplayOut

title = None
circle0 = None
rect0 = None
label0 = None
line0 = None
triangle0 = None
addon_display_out_0 = None

def setup():
    global title, circle0, rect0, label0, line0, triangle0, addon_display_out_0

    M5.begin()
    addon_display_out_0 = DisplayOut(1280, 720, 60)
    Widgets.fillScreen(0x000000, addon_display_out_0)
    title = Widgets.Title(
        "addon Display Out For PoE-P4 Example",
        3,
        0xFFFFFF,
        0x0000FF,
        Widgets.FONTS.Montserrat18,
        addon_display_out_0,
    )
    circle0 = Widgets.Circle(118, 182, 68, 0xFFFFFF, 0xFFFFFF, addon_display_out_0)
    rect0 = Widgets.Rectangle(885, 338, 217, 217, 0xFFFFFF, 0xFFFFFF, addon_display_out_0)
    label0 = Widgets.Label(
        "label0",
        556,
        149,
        1.0,
        0xFFFFFF,
        0x222222,
        Widgets.FONTS.Montserrat18,
        addon_display_out_0,
    )
    line0 = Widgets.Line(398, 446, 448, 446, 0xFFFFFF, addon_display_out_0)
    triangle0 = Widgets.Triangle(
        765, 346, 735, 376, 794, 376, 0xFFFFFF, 0xFFFFFF, addon_display_out_0
    )

def loop():
    global title, circle0, rect0, label0, line0, triangle0, addon_display_out_0
    M5.update()

if __name__ == "__main__":
    try:
        setup()
        while True:
            loop()
    except (Exception, KeyboardInterrupt) as e:
        try:
            from utility import print_error_msg

            print_error_msg(e)
        except ImportError:
            print("please update to latest firmware")
```

## **API**

#### DisplayOut

## `DisplayOut`
Create an HDMI display output for Unit PoE-P4.

`DisplayOut` registers the Unit PoE-P4 HDMI output as an M5 display and
returns the display object created by `M5.addDisplay`. The display can
then be used by the standard M5 display APIs.

- Parameter `width` (`int`): The logical width of the HDMI output. Default is `1280`.
- Parameter `height` (`int`): The logical height of the HDMI output. Default is `720`.
- Parameter `refresh_rate` (`int`): The refresh rate of the HDMI output in Hz. Default is `60`.
- Returns: The display object registered by `M5.addDisplay`.
- Return type: object

> Note: Unit PoE-P4 HDMI output supports `1280x720@60Hz` and
> `1920x1080@30Hz` timings.

```python
from addon import DisplayOut

display = DisplayOut(1280, 720, 60)
```

Sponsored

Ads related to m5stack-uiflow2-coder and adjacent AI workflows.