unihiker_button
Skill34 starsChanged 6 months agoMITView on GitHub
Use this skill when the user asks to read UNIHIKER K10 A/B button status, wait for button press, or detect button events from the XL9535 IO expander. Typical user requests include: Chinese aliases that should map to this skill include: 行空板 K10 按键、A 键、B 键、按键中断、按键事件监听。 Hardware mapping for this skill: The script provides two main modes: Run exactly one bundled Lua script with lua_run_script. If script execution returns an error, report that error directly to the user. Do not retry…
In this repository42 other files it gives its agents.
- air_mouseSkill
- balance_ballSkill
- bilibili_up_fansSkill
- camera_previewSkill
- china_a_share_quoteSkill
- clock_dial_demoSkill
- cloudmusicSkill
- codex_usage_dashboardSkill
- current_ip_infoSkill
- current_weatherSkill
- dfrobot_matrix_lidar_8x8_i2cSkill
- dfrobot_stcc4_i2cSkill
- dinoSkill
- example_skillSkill
- flappybirdSkill
- flashbackSkill
- game_2048Skill
- game_of_lifeSkill
- gimbal_color_detectSkill
- gimbal_motion_detectSkill
- github_repo_starSkill
- jump_prince_gameSkill
- lcd_touch_paintSkill
- mazeSkill
- mosaico-musicalSkill
- movement_detectionSkill
- network_radioSkill
- number_puzzleSkill
- reaction_gameSkill
- servo_dogSkill
- snake_gameSkill
- snakeSkill
- stock_quotes_displaySkill
- tetris_clockSkill
- token_usageSkill
- unihiker_expansion_batterySkill
- unihiker_expansion_irSkill
- unihiker_expansion_motor_controlSkill
- unihiker_expansion_servo_controlSkill
- unihiker_expansion_WS2812Skill
- weather_clockSkill
- whack_mole_gameSkill
The file
We split this skill into the rules it gives an agent
8 rules. About 0 are common, 6 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈6
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 19
Use this skill when the user asks to read UNIHIKER K10 A/B button status, wait for button press, or detect button events from the XL9535 IO …
- Very specific: line 42
Run exactly one bundled Lua script with lua_run_script.
- Distinctive: line 44
If script execution returns an error, report that error directly to the user.
- Distinctive: line 45
Do not retry with changed arguments in the same turn unless the user explicitly asks.
- Distinctive: line 116
Read current A/B button states once:
- Distinctive: line 122
Wait up to 10 seconds for any button press/release event:
- Distinctive: line 128
Wait only for A button press:
- Very specific: line 138
Use small poll_interval_ms (for example 1 to 5) and suitable debounce_ms (for example 8 to 20) for stable button events.
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
UNIHIKER Button (XL9535)
Use this skill when the user asks to read UNIHIKER K10 A/B button status, wait for button press, or detect button events from the XL9535 IO expander.
Typical user requests include:
- 当按下 UNIHIKER / 行空板 K10 的 A 键后,执行 xxx
- 当按下 UNIHIKER / 行空板 K10 的 B 键后,执行 xxx
- 监听行空板 K10 的 A/B 按键事件
- 等待 A 键按下再继续执行
- 等待 B 键释放后执行下一步
Chinese aliases that should map to this skill include: 行空板 K10 按键、A 键、B 键、按键中断、按键事件监听。
Hardware mapping for this skill:
- XL9535 I2C address:
0x20 - B button:
P02 - A button:
P14
The script provides two main modes:
read: read current A/B button state once.wait_event: block until button edge event (press/release) is detected, which is better than sparse app-side polling.
Run exactly one bundled Lua script with lua_run_script.
If script execution returns an error, report that error directly to the user. Do not retry with changed arguments in the same turn unless the user explicitly asks.
Script Args Schema
{
"type": "object",
"properties": {
"mode": {
"type": "string",
"enum": ["read", "wait_event"]
},
"target": {
"type": "string",
"enum": ["a", "b", "any"]
},
"edge": {
"type": "string",
"enum": ["press", "release", "any"]
},
"active_level": {
"type": "integer",
"minimum": 0,
"maximum": 1
},
"timeout_ms": {
"type": "integer",
"minimum": 0,
"maximum": 120000
},
"poll_interval_ms": {
"type": "integer",
"minimum": 1,
"maximum": 100
},
"debounce_ms": {
"type": "integer",
"minimum": 0,
"maximum": 100
},
"i2c_port": {
"type": "integer",
"minimum": 0,
"maximum": 1
},
"sda": {
"type": "integer",
"minimum": 0,
"maximum": 63
},
"scl": {
"type": "integer",
"minimum": 0,
"maximum": 63
},
"i2c_freq_hz": {
"type": "integer",
"minimum": 10000,
"maximum": 1000000
},
"addr": {
"type": "integer",
"minimum": 8,
"maximum": 119
}
}
}Tool Call Inputs
Read current A/B button states once:
{"path":"{CUR_SKILL_DIR}/scripts/unihiker_button.lua","args":{"mode":"read"}}Wait up to 10 seconds for any button press/release event:
{"path":"{CUR_SKILL_DIR}/scripts/unihiker_button.lua","args":{"mode":"wait_event","target":"any","edge":"any","timeout_ms":10000}}Wait only for A button press:
{"path":"{CUR_SKILL_DIR}/scripts/unihiker_button.lua","args":{"mode":"wait_event","target":"a","edge":"press","timeout_ms":10000}}Recommended Flow
- Confirm XL9535 is connected on the expected I2C bus and address (
0x20by default). - For reactive logic, prefer
wait_eventinstead of periodic app-side polling. - Use small
poll_interval_ms(for example1to5) and suitabledebounce_ms(for example8to20) for stable button events. - Run
{CUR_SKILL_DIR}/scripts/unihiker_button.lua. - Report script output directly to the user.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

