card-onboard
Installation
Review the source and dependencies with a prompt. A package is available to download.
Install with an AI assistant
Copy the prompt so your assistant can review the pinned revision and dependencies first.
View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "card-onboard" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-35fe1ecff891203418a2961da66ea4c0f5bf359b133f238561d5f5f935618925. Verify the upstream source and version against https://github.com/op7418/ai-desk-card before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.
Source and setup
github.com
Setup guidance pending
See the original source for supported tools, dependencies, and permissions.
Installation test pending
Guides users through first-time setup of an AI desktop card, or reconfiguration after device change, new network connection, or firmware update. Checks daemon status, USB/BLE/Wi‑Fi connections, firmware version, and mDNS visibility, and guides the user to complete missing steps (e.g., install firmware, connect USB, pair BLE, configure Wi‑Fi). Triggered when users mention phrases like “first time setup,” “just got the device,” “card not responding,” “flashing firmware,” “how to connect the card,” or “ai-desk-card can't connect.”
Introduction source: third_party · op7418 · 0.0.1 Reference
SkillPi interpretation
- Tasks
- Translation pending; see source documentation.
- Testing
- Not tested
Browse files
Frontmatter
name: card-onboard
description: |
Onboard a user setting up AI Desk Card for the first time, or after moving
to a new machine, plugging the device into a new network, or after a
firmware update. Detects daemon state, USB / BLE / Wi-Fi connection,
firmware version, and mDNS visibility — then walks the user through
whatever's missing (install firmware, plug USB, pair BLE, provision
Wi-Fi). Use whenever the user says "first-time setup" / "刚拿到设备" /
"卡片没反应" / "刷固件" / "怎么连卡片" / "ai-desk-card 连不上".
trigger_keywords:
- card onboard
- 入职
- 第一次用
- first-time setup
- 刷固件
- 怎么连卡片
- ai-desk-card 连不上
- 配对
- 配 wifi
allowed-tools:
- Bash
- Readcard-onboard — AI Desk Card 首次接入流程
把用户从"刚拿到设备/啥都没装"带到"四个 widget 在屏上、Wi-Fi 在线、推帧 0.2 秒到位"。
一次性原则
- 永远先跑 probe,不要凭空问"你 daemon 启动了吗"。
scripts/probe.sh一 次拿全所有状态。 - 每一步告诉用户当前进度:"我看到 daemon 跑着了,但还没设备连接, 现在去查串口..."。不要静默操作。
- 失败别循环重试。卡住就停,把诊断结果给用户、让他决定。
- 优先推 Wi-Fi,不要默认走 USB-serial 或 BLE。Wi-Fi 单帧 0.2 秒,USB 1-32 秒,BLE 命令通但 frame 不通(已知问题)。
探针入口
bash $CLAUDE_PLUGIN_ROOT/skills/card-onboard/scripts/probe.sh
输出结构(JSON):
{
"daemon": { "running": bool, "pid": int|null },
"transport": { "connected": bool,
"type": "SerialTransport|BLETransport|WiFiTransport|null" },
"firmware": { "our": bool, "note": str, "banner": str|null },
"serial_ports": [ "/dev/cu.usbserial-..." ],
"mdns_peer": { "ip": "192.168.x.y", "port": 9880,
"txt": { "fw": "0.8.0", "proto": "1" } } | null
}
firmware.our=true = 设备上跑的是我们的固件(daemon 发了 cmd:owner
2.5 秒内收到 ack:owner)。
mdns_peer != null = 设备已经在 LAN 上播 Wi-Fi,这是最理想的状态。
决策树(按顺序处理;命中分支就先修,再回到 probe 验证)
G — mdns_peer != null 且 transport.type != "WiFiTransport"
最理想状态被错过了。设备已在 Wi-Fi,但 daemon 没用 Wi-Fi。告诉用户:
设备在 Wi-Fi
<ip>已上线。你 daemon 没用它,估计是之前没重启过 daemon。
跑:
/card-stop && /card-start
回到 probe,应该看到 transport.type == "WiFiTransport"。
A — daemon.running == false
Daemon 没跑。跑 /card-start(自动选 Wi-Fi > USB > BLE)。等 1-2 秒重新
probe。
B — daemon.running == true && serial_ports == [] && mdns_peer == null
设备完全离线 — 没插 USB、Wi-Fi 也没起来。可能场景:
- 设备根本没启动:电池死了,或者没开机。让用户按一下电源键。
- 设备启动了但没配过 Wi-Fi:第一次开机或者 NVS 凭据被清了。需要先用
USB 把 daemon 连起来,再走 BLE pair →
/card-wifi-setup喂凭据。让 用户插一条 USB-C 数据线(注意不是充电线)。 - 设备在 Wi-Fi 但不同网段:daemon 跑这台 Mac 跟设备不在同一个局域 网。让用户检查 Wi-Fi 是不是手机热点或公司客网。
C — transport.connected == false 但 serial_ports != []
USB 端口在但 daemon 没接上。最常见原因:上次 daemon 没释放干净,或者 M5Paper 那一头 USB 还在 boot。跑:
/card-stop && /card-start
还不行 → 给我看 probe + tail -20 "${TMPDIR:-/tmp}/ai_desk_card_daemon.log"。
D — transport.connected == true && firmware.our == false
USB 通了但固件不是我们的(裸板 / M5 出厂 demo / 旧 buddy 固件)。问:
设备已连接,但运行的不是 AI Desk Card 固件。要现在刷上吗? (刷固件会清掉设备上的其他程序,30 秒内完成)
用户同意 → /card-install flash,等 5 秒重新 probe。
E — transport.connected == true && firmware.our == true 但 mdns_peer == null
固件就位但 Wi-Fi 没配过。强烈推荐配 Wi-Fi(之后单 widget 0.2 秒)。让 用户给出 SSID + 密码:
设备就绪。要不要现在配 Wi-Fi?这样以后推 widget 0.2 秒一帧,比 USB 快 100 倍。 告诉我 SSID 和密码,我帮你写到设备 NVS(凭据只存设备本地,不进 git)。
收到凭据 → 跑:
/card-wifi-setup "<SSID>" "<密码>"
等 15 秒重新 probe,看到 mdns_peer.ip → 成功。
如果用户不想配 Wi-Fi("只是想看看效果"),直接进 分支 F。
F — 全绿,要不要推默认 widget
✅ 一切就位。问用户:
推一组默认 widget 上去看看?默认布局: top-left = weather, top-right = ai-status, middle = focus, bottom = todo
同意 → 切到 card-widget skill。
Z — 用户明确要用 BLE only(不推荐)
USB / Wi-Fi 都不想用的场景。注意:BLE 推 widget 数据不稳(已知问题, 小命令通、大块数据 device 端 onWrite 不触发)。提醒用户后:
- 拔 USB,daemon 自动 fallback 到 BLE
/card-stop && /card-start- daemon 自动扫描
Card-*设备 → 1-2 分钟连上 - 重 probe →
transport.type == "BLETransport" - 推 widget 失败时回到此分支建议配 Wi-Fi
安抚话术
- "为什么 e-ink 显示这么慢" → USB serial 32s/帧是 115200 baud 的物理上 限。Wi-Fi 是 0.2 秒。强烈建议配 Wi-Fi。
- "为什么屏幕一直显示之前内容" → e-ink 0 功耗保留最后一帧,特性不是 bug。
- "电量怎么不准" → 通过电池电压 > 4150 mV 判定"USB 在充"。刚拔 USB 电 池满电时也会显示 USB 模式,几分钟后会回归正常。
- "我想换显示的人名/二维码" → 编
ai-desk-card/assets/profile.yaml, 跑/card-sleep推送名片帧。
不要做的事
- ❌ 不要自动
/card-install flash— 总是先问用户 - ❌ 不要主动重启 daemon 或 device,除非用户同意(或走 /card-stop+start)
- ❌ 不要试图自己解析串口协议 — 走
/firmware-probeHTTP endpoint - ❌ 不要跳过 mDNS 分支直接推 USB / BLE — Wi-Fi 是首选路径
- ❌ 不要把 SSID/密码记到 daemon log 或写进 git — 只通过
/card-wifi-setup一次性写到设备 NVS
排错信息收集
如果用户卡某一步:
bash $CLAUDE_PLUGIN_ROOT/skills/card-onboard/scripts/probe.sh
tail -30 "${TMPDIR:-/tmp}/ai_desk_card_daemon.log"
ioreg -p IOUSB | grep -i 'usb\|m5\|silab\|ftdi' | head -10
把这些汇集给用户、问要不要发 issue 到 https://github.com/op7418/m5-paper-buddy
Version history
-
v0.10.1
GitHub ↗
Original release notes
小版本,主要给 **M5Paper V1.1** 加 "**离线自动睡眠**" — 不需要 daemon 也能自己渲染电子名片 + deep sleep。 ## 新功能 ### V1.1 离线 idle-sleep(不依赖 daemon) 之前 V1.1 想要"屏自动息屏 + 显示名片"必须 daemon 一直跑着 + 推 `/card-sleep`。现在彻底本地: ``` [用户行为] [设备] ──────── ──── 按 RESET boot, loads idle_minutes from NVS └─→ 任意 daemon push frame calls markContentDisplayed → resets idle timer └─→ 再无活动 N 分钟 firmware paint sleep_card.bin → 2.5 s GC16 settle → esp_deep_sleep_start [panel 0 W 保留名片 ∞] ``` ### 配置(一次性) ```bash # 1. 改 assets/profile.yaml 写你的电子名片内容 # 2. 在 host 上渲染 540×960 灰阶 card → data/sleep_card.bin python3 tools/build_sleep_card.py # 3. 烧 LittleFS(一次就行) pio run -e card -t uploadfs # 4. 设阈值(30 分钟) python3 -c "import serial,time;s=serial.Serial('/dev/cu.usbserial-XXX',115200);s.write(b'{\"cmd\":\"idle_sleep_set\",\"minutes\":30}\n');time.sleep(2);print(s.read(200).decode())" ``` 阈值持久化在 NVS — 重启后保留。设为 0 = 关闭。最大 1440 (24h)。 ### 关键修复 - **4bpp packer 反色 bug**:`tools/build_sleep_card.py` 原本直接 `pixel >> 4`,但 **M5EPD 4bpp 是 "0=白 / 15=黑"**(跟 PIL 反),导致名片显示成"对比度错乱 + 模糊"。改用 daemon/card_render.py 现成的 `to_4bpp_packed`(带 invert)就清晰了。 ## v0.10.0 → v0.10.1 升级 ```bash cd ~/.claude/skills/ai-desk-card && git pull # V1.1 用户启用 idle sleep: python3 tools/build_sleep_card.py pio run -e card -t uploadfs pio run -e card -t upload # 重新烧 firmware 拿到 0.10.1 + idle 模块 ``` Color 用户不需要做任何事 — idle-sleep 是 V1.1 only 特性,Color 不影响。 ## 完整 commit log - `15692f9` build_sleep_card: use daemon's canonical 4bpp packer - `bdeb9a8` V1.1: idle-sleep timer + local sleep card - `dc3b498` v0.10.1: bump CARD_VERSION + plugin.json 完整变更见 [HANDOVER.md](https://github.com/op7418/ai-desk-card/blob/main/HANDOVER.md)。
-
v0.10.0
GitHub ↗
Original release notes
> 这个 release 把 ai-desk-card 从单设备扩到**双设备**:原有的 M5Paper V1.1(灰阶)+ 新增的 M5Paper Color(Spectra 6 真彩)。Skill 自动识别 device profile,所有 17 个 widget 在两块板上都有对应的渲染。 ## 新增:M5Paper Color 完整支持 新硬件参数差异: | | V1.1 | **Color (新)** | |---|---|---| | SoC | ESP32 | **ESP32-S3R8**(native USB CDC) | | 屏 | 4.7" 540×960 16 灰阶 | **4" 600×400 Spectra 6 真彩 6 色** | | 刷新 | GC16 ~700ms / A2 ~150ms | ~15-19 秒/帧全刷 | | 触屏 | GT911 | **3 物理键 + 电源键** | | 库 | M5EPD | **M5Unified + M5GFX + NeoPixel** | | 传感器 | 无 | **SHT40 温湿度 / ES8311 codec + 1W speaker + MEMS 麦 / 2× RGB LED / IR 发射** | ### 移植要点 - `env:paper-color` 新增到 platformio.ini,跟 `env:card` 用 `build_src_filter` 隔离 - `src/paper_color/` 完整目录(独立的 wifi_bridge / http_server / frame_buffer / sht40 / audio / feedback_led) - 横屏 setRotation(1):native 是 400×600 portrait,必须强制 landscape - 字号 ≥ 20pt 强制:Spectra 6 上小字断成 dither pattern - M5GFX 在 Spectra 6 panel 上必须 setEpdMode(epd_fastest),否则 silently 不刷新 ### 新模块 - `daemon/card_render_color.py` — 600×400 RGB → M5GFX 自动量化到 Spectra 6 palette。**17 个 widget 全部 color 化**,每个有独立 accent header 颜色 - `daemon/card_render_settings_color.py` — Color 版设置页(fw / panel / battery / Wi-Fi / SHT40) - `daemon/card_render_sleep_color.py` — Color 版电子名片(彩色 chip + 蓝色头像圆 + 黑底 footer) - `daemon/color_daemon.py` — 全新持久 daemon,bind 0.0.0.0 + IP allowlist,接 agent /widget POST + 设备 /button POST 闭环 ### Color 专属功能 - **`ambient` widget** — 设备 SHT40 实时温湿度,0 cloud / 0 API - **`/beep` endpoint** — 3 个预设(chime / urgent / alert)+ 自定义 freq+ms。日程 deadline 临近时可让 Agent 响铃 - **3 物理键** — **顶=睡眠 / 下左=刷新 / 下中=设置**(已验过 M5.BtnA/B/C 在这块板上跟物理位置反着对应) - **RGB LED** — 按下时白闪 ack,/frame 进来时绿色 pulse 提示"数据到了" - **deep sleep + 唤醒** — 顶键推名片 + esp_deep_sleep。三个 user 键 + 电源键都能唤 - **状态栏新按键 hint** — 底栏左侧显示 `顶 睡眠 左 刷新 中 设置`(黄字物理位置) ## Skill 路由 [`SKILL.md`](https://github.com/op7418/ai-desk-card/blob/main/SKILL.md) 新增 Step 1.5 device profile 识别 — 如果 `/heartbeat` 返回 `device == M5PaperColor`,agent 走 [`flows/08_paper_color.md`](https://github.com/op7418/ai-desk-card/blob/main/flows/08_paper_color.md)。所有 V1.1 流程不变。 ## v0.9 → v0.10 升级 ```bash cd ~/.claude/skills/ai-desk-card && git pull # 如果你买了 M5Paper Color pio run -e paper-color -t upload # USB-C 插上设备 python3 daemon/color_daemon.py --device-ip <IP> ``` V1.1 用户**不需要**做任何事 — `env:card` / `card_daemon.py` / 所有 V1.1 flow 完全不动。 ## 已知限制 - 两个 daemon 不能同时跑(都占 127.0.0.1:9877)。用户按手上哪块设备选启动哪个。 - Color daemon 还没并入主 daemon,是独立进程。下一版可能做统一 router。 - Color 板 17 秒全刷限制下,高频更新 widget(比如秒级 status 字段)不实用。规划层面 Color 适合"每分钟看一眼" 的低频信息。 完整变更见 [HANDOVER.md](https://github.com/op7418/ai-desk-card/blob/main/HANDOVER.md)。
-
v0.9.0
GitHub ↗
Original release notes
> 首个面向最终用户的版本。装上 Skill 后由 AI Agent 全程引导烧固件、配 Wi-Fi、推内容;不再需要用户手动跑 `pio` 或 `curl`。 ## 主要变化 ### Skill-first 架构 - 根 [`SKILL.md`](https://github.com/op7418/ai-desk-card/blob/main/SKILL.md) 成为 agent-agnostic 入口(Claude Code / Codex / Cursor / Aider 等都能识别) - [`scripts/state.sh`](https://github.com/op7418/ai-desk-card/blob/main/scripts/state.sh) 统一状态探测 → JSON 输出 hardware / firmware / daemon / transport / device / wifi / interests - [`flows/01-07`](https://github.com/op7418/ai-desk-card/tree/main/flows) 7 个子流程(install / transport / wifi / interests / push / schedule / sleep)按需读取 - 老的 plugin/ slash 命令保留作为 Claude Code 兼容层 ### 触屏 + 点击反馈 - 固件 50 Hz 直接 poll GT911(不依赖 IRQ,V1.1 GPIO 36 没内部上拉) - 按下 chip 立即 EPD partial refresh (A2 mode) ~150 ms 白色 ACK 反馈 - daemon 通过 `cmd:set_chips` 把 chip rects 推给固件,固件本地 hit-test 不依赖 daemon 来回 ### 设备 liveness - 新 `GET /heartbeat` endpoint:`{alive, last_seen_seconds, active_transport, battery_pct, uptime, firmware}` - 底栏正确显示当前传输(Wi-Fi / USB / BLE)而非启动时的初始选择 - Device 90 秒没回包时底栏显示 OFFLINE ### Wi-Fi 回程通道 - 固件在 wifi_connected 时把 status_report / touch event POST 给 daemon(daemon IP 从最近的 /frame 入站请求 cache) - Arch A (Wi-Fi only) 终于有了 device → daemon 的回包路径 - 副通道:daemon 在 Wi-Fi 主传输时,如果 USB 也插着,自动开 read-only 副串口当 fallback ### 自动 quiet hours 名片 - daemon 后台线程读 `~/.ai-desk-card/interests.yaml`,到 `quiet_hours.start` 自动渲染电子名片 + 设备 deep sleep - 不需要 Agent 在线触发 ### Boot 体验 - RTC slow memory 记 magic — 第一次显示帧后置上,软重启 / 拔 USB 再插 / `cmd:sleep_now` 醒来都**保留上一帧**(e-ink 物理 0 功耗特性) - 真正首次开机才画 install splash,splash 现在带 GitHub URL + 给 AI 的指令 + BLE 配对名 ### 多个 Wi-Fi / 启动鲁棒性 bug 修复 - mDNS 探测 2.5s → 8s(避免烧固件后立即 daemon 启动降级到 32s/帧的 USB serial) - `WiFiTransport.connected()` 不再 sticky-false(单次 POST 超时不再永久锁死传输) - 持久化 last_frame 在设备重启时主动 reset(避免推 144×33 diff 留 splash) ### 文档 - 中文 README 设为主文档([README.md](https://github.com/op7418/ai-desk-card/blob/main/README.md)),英文 mirror([README.en.md](https://github.com/op7418/ai-desk-card/blob/main/README.en.md)) - [HANDOVER.md](https://github.com/op7418/ai-desk-card/blob/main/HANDOVER.md) 重写:覆盖架构图、11 个真实踩过的 bug + 修法、调试 recipe、扩展指南 - [PRODUCT.md](https://github.com/op7418/ai-desk-card/blob/main/PRODUCT.md) 重写:产品 / 思考 / 体验 / 预测 / 用户 5 段叙事 ## 30 秒开始 ```bash npx skills add https://github.com/op7418/ai-desk-card --skill ai-desk-card ``` 或发给你的 AI Agent: > 帮我装 ai-desk-card Skill。把 https://github.com/op7418/ai-desk-card 克隆到 ~/.claude/skills/ai-desk-card。 之后跟 Agent 说: > 帮我把卡片装上,M5Paper V1.1 已经插好了。 Skill 会自动探测硬件、烧固件、起 daemon、配 Wi-Fi、推第一个 widget。 ## 已知限制(v0.10 计划修) - 硬件长按旋钮 2s = AXP192 切电源,固件来不及拦截。`/card-sleep` 走 deep_sleep 名片正常;硬关机会停在最后一帧 - BLE frame-data 路径长包重组有 bug,目前 BLE 只跑小命令,frame 走 Wi-Fi 完整变更见 [HANDOVER.md § 已知问题](https://github.com/op7418/ai-desk-card/blob/main/HANDOVER.md)。
Current listing version
0.0.1
Safety and assessment details
Quality assessment
Out of 100 · Assessment report from SkillPi LAB.
Highlights
- 解决用户首次设置 AI 桌面卡片的核心痛点,涵盖多种连接方式和故障排查
- 提供完整的端到端配置流程,从设备检测到最终 widget 推送
Highlights
- 触发词覆盖合理,包含中英文多种变体(如'第一次用'、'first-time setup'、'怎么连卡片'等)
- 边界清晰,能准确识别用户需要设备接入帮助的场景
Highlights
- Phase/步骤清晰,有明确的决策树和出口条件
- 包含详细的探针入口、JSON输出结构说明和完整示例
- frontmatter完整,文档结构良好
Areas to improve
-
引用文件缺失 Reported severity: Minor
SKILL.md 中引用了 scripts/probe.sh 脚本文件,但未在传入内容中提供该文件
Recommendation: 请确保所有被引用的脚本文件都包含在 Skill 包中,或明确说明这些是平台内置命令
Highlights
- 工具来源明确,参数正确,覆盖主要异常情况
- 不可逆操作(如刷固件)都有确认机制,安全性良好
- 提供了详细的排错信息收集方法
The arithmetic mean of the first four original scores, rounded to a whole number.
Static text checks
100 / 100 · skillpi-20261123-no-r3-v1
No current rules matched the text.
This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.
Permissions and checks before use
Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.
These common operations were not identified in the main document. This does not mean no permissions or risks exist.
Domains or addresses referenced in the document
These addresses may be documentation links or examples, not an approved network allowlist. Verify actual destinations and outgoing data before use.
- github.com
Security rating and access scope
safe · Static evidence review; not a runtime safety guarantee.
Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.
User discussion
No verified reviews yet.