token_usage
Skill34 starsChanged 6 months agoMITView on GitHub
Use this skill when the user asks to install, set up, show, open, refresh, or close the token usage dashboard, token monitor, or standing reminder screen. The installer switches the agent persona, registers boot auto-start for the dashboard, saves hourly telemetry into long-term memory, and sends on-the-hour greeting letters to known IM chats. Standing reminders are managed locally on the device. Match the user's language when you reply; do not switch language on your own. Use this flow when the…
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
- unihiker_buttonSkill
- unihiker_expansion_batterySkill
- unihiker_expansion_irSkill
- unihiker_expansion_motor_controlSkill
- unihiker_expansion_servo_controlSkill
- unihiker_expansion_WS2812Skill
- weather_clockSkill
- whack_mole_gameSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
22 rules. About 0 are common, 10 are distinctive, and 12 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈10
Distinctive · estimate
This author's own choices. Worth a look.
12
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 18
Use this skill when the user asks to install, set up, show, open, refresh, or close the token usage dashboard, token monitor, or standing …
- Distinctive: line 37
Use this flow when the user wants installation, boot auto-start, hourly memory snapshots, or scheduled greeting letters.
- Very specific: line 39
Run exactly one bundled Lua script with lua_run_script.
- Distinctive: line 41
If script execution returns an error, report that error directly to the user.
- Distinctive: line 42
Do not retry with changed arguments in the same turn unless the user explicitly asks.
- Distinctive: line 44
Ask for the PC IPv4 address that runs the token usage HTTP server.
- Very specific: line 45
Run {CUR_SKILL_DIR}/scripts/install_token.lua with the inputs shown below.
- Very specific: line 46
Wait for the log line [install_token] install complete before telling the user that setup is ready.
- Very specific: line 47
If the script prints [install_token] ERROR: ..., report that line to the user and stop.
- Very specific: line 48
After installation completes successfully, tell the user to restart the device (for example press the reset button or use device_reset) for …
- Distinctive: line 83
Use this flow when the user only wants to open or refresh the dashboard UI.
- Very specific: line 85
Run exactly one bundled Lua script asynchronously with lua_run_script_async.
- Distinctive: line 88
Do not retry with changed arguments or run another script in the same turn unless the user explicitly asks.
- Distinctive: line 184
Use a custom heartbeat interval when push is unavailable:
- Distinctive: line 199
Run the bundled Lua script asynchronously so the LVGL dashboard stays alive:
- Distinctive: line 210
If no display is listed, tell the user that the board does not declare a display and stop.
- Very specific: line 211
Ask for the PC host IP when the user wants live Cursor, Deepseek, standing, or weather data.
- Very specific: line 212
If the host is unknown, run the script with empty args to show the local UI without Windows polling.
- Very specific: line 213
Run {CUR_SKILL_DIR}/scripts/token_usage.lua with the resolved args.
- Very specific: line 215
Use lua_get_async_job or lua_tail_async_job when the user asks for runtime status or logs.
- Very specific: line 216
Stop the async Lua job named token_usage when the user asks to close the dashboard.
- Very specific: line 230
When host is set, the script polls the PC over HTTP in the main loop (no extra Lua worker task):
≈ “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
Token Usage
Use this skill when the user asks to install, set up, show, open, refresh, or close the token usage dashboard, token monitor, or standing reminder screen.
The installer switches the agent persona, registers boot auto-start for the dashboard, saves hourly telemetry into long-term memory, and sends on-the-hour greeting letters to known IM chats. Standing reminders are managed locally on the device.
Match the user's language when you reply; do not switch language on your own.
When to use
- The user asks to install, set up, or adopt the token usage dashboard, token monitor, or standing reminder screen, in any language.
- The user asks to show, open, refresh, or close the dashboard without reinstalling.
Prerequisites
- The board must declare a
display_lcddevice in board hardware info. - Live Cursor, Deepseek, standing, and weather data require a PC IPv4 address on the same network running the token usage HTTP server.
- On-the-hour greeting letters require SNTP time sync after installation.
Install
Use this flow when the user wants installation, boot auto-start, hourly memory snapshots, or scheduled greeting letters.
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.
- Ask for the PC IPv4 address that runs the token usage HTTP server. Do not run the installer without it.
- Run
{CUR_SKILL_DIR}/scripts/install_token.luawith the inputs shown below. - Wait for the log line
[install_token] install completebefore telling the user that setup is ready. - If the script prints
[install_token] ERROR: ..., report that line to the user and stop. - After installation completes successfully, tell the user to restart the device (for example press the reset button or use
device_reset) for the skill to take effect.
Re-running the installer updates the existing router rules and schedules (host, port, or letter language). On memory-constrained boards, the installer skips relaunching the dashboard when it is already running with the same host/port, and stops display jobs before a relaunch when host/port changes or restart_dashboard=true.
The hourly greeting schedule uses cron and requires SNTP time sync. The telemetry snapshot uses a relative interval and does not require wall-clock time.
Install Tool Call Inputs
{
"path": "{CUR_SKILL_DIR}/scripts/install_token.lua",
"args": {
"host": "192.168.1.20",
"port": 8080,
"language": "Chinese"
},
"timeout_ms": 30000
}hostorpc_ipis required.portdefaults to8080.languagedefaults toChineseand controls scheduled greeting letters.restart_dashboardoptional boolean. When true, stop the running dashboard and relaunch it after install even if host/port are unchanged.skip_dashboard_startoptional boolean. When true, update soul/rules/schedules only and do not queue a dashboard start event.
Install Example
User asks to install the token dashboard and gives a PC IP.
-> lua_run_script with the inputs above
-> wait for [install_token] install complete
-> Reply in the user's language, confirming boot auto-start, hourly memory snapshots, and on-the-hour greeting letters.
Show Dashboard
Use this flow when the user only wants to open or refresh the dashboard UI.
Run exactly one bundled Lua script asynchronously with lua_run_script_async.
If script execution returns an error, report that error directly to the user. Do not retry with changed arguments or run another script in the same turn unless the user explicitly asks.
Script Args Schema
{
"type": "object",
"properties": {
"host": {
"type": "string",
"description": "PC IPv4 address that runs the token usage HTTP server. Also accepts pc_ip."
},
"port": {
"type": "integer",
"default": 8080,
"minimum": 1,
"maximum": 65535,
"description": "HTTP port on the PC host."
},
"heartbeat_ms": {
"type": "integer",
"default": 1000,
"minimum": 1000,
"maximum": 60000,
"description": "Legacy alias for status_poll_ms."
},
"status_poll_ms": {
"type": "integer",
"default": 1000,
"minimum": 1000,
"maximum": 60000,
"description": "Interval for GET /device-status polling from the PC host."
},
"token_poll_ms": {
"type": "integer",
"default": 30000,
"minimum": 1000,
"maximum": 600000
},
"aux_poll_ms": {
"type": "integer",
"default": 30000,
"minimum": 1000,
"maximum": 600000
},
"weather_poll_ms": {
"type": "integer",
"default": 600000,
"minimum": 1000,
"maximum": 3600000
},
"weather_retry_ms": {
"type": "integer",
"default": 10000,
"minimum": 1000,
"maximum": 600000
},
"http_timeout_ms": {
"type": "integer",
"default": 5000,
"minimum": 1000,
"maximum": 60000
},
"instance_id": {
"type": "string",
"description": "Optional stable id used for worker queue and async job names."
}
}
}Dashboard Tool Call Inputs
Show the dashboard with PC polling enabled:
{
"path": "{CUR_SKILL_DIR}/scripts/token_usage.lua",
"args": {
"host": "192.168.1.20",
"port": 8080
},
"timeout_ms": 0
}Show the dashboard UI without PC polling when the host is unknown:
{
"path": "{CUR_SKILL_DIR}/scripts/token_usage.lua",
"args": {},
"timeout_ms": 0
}Use a custom heartbeat interval when push is unavailable:
{
"path": "{CUR_SKILL_DIR}/scripts/token_usage.lua",
"args": {
"host": "192.168.1.20",
"heartbeat_ms": 15000
},
"timeout_ms": 0
}Dashboard Recommended Flow
Run the bundled Lua script asynchronously so the LVGL dashboard stays alive:
- Script:
{CUR_SKILL_DIR}/scripts/token_usage.lua - Capability:
lua_run_script_async - Timeout:
0 - Name:
token_usage - Exclusive:
display - Replace:
true - Args: optional object
- Activate the
board_hardware_infoskill and confirm that adisplay_lcddevice is listed. - If no display is listed, tell the user that the board does not declare a display and stop.
- Ask for the PC host IP when the user wants live Cursor, Deepseek, standing, or weather data. Pass it as
hostorpc_ip. - If the host is unknown, run the script with empty
argsto show the local UI without Windows polling. - Run
{CUR_SKILL_DIR}/scripts/token_usage.luawith the resolvedargs. - Report the start result or error directly to the user.
- Use
lua_get_async_joborlua_tail_async_jobwhen the user asks for runtime status or logs. - Stop the async Lua job named
token_usagewhen the user asks to close the dashboard.
Configuration
Install and schedule tunables live in {CUR_SKILL_DIR}/scripts/token_usage_config.lua — snapshot interval, letter cron expression, default letter language, letter persona name, and default port. After editing the config, run {CUR_SKILL_DIR}/scripts/install_token.lua again to update the scheduler entries and router rules.
Persona
Installation copies {CUR_SKILL_DIR}/soul_token.md to memory/soul.md under the device DATA root. ESP-Claw speaks as a warm desk-side colleague with gentle, good-natured teasing — not a status dashboard. Scheduled hourly letters follow the same voice: human, caring, and concise.
Behavior
The dashboard script initializes display_lcd and optional lcd_touch, builds a single-page LVGL dashboard, and keeps running until the async job is stopped.
When host is set, the script polls the PC over HTTP in the main loop (no extra Lua worker task):
GET /cursor-statuseverycursor_poll_ms/status_poll_ms(default 1s)GET /deepseek-balance,/deepseek-account-balance,/weatheron their own intervals
Polling runs in the same async job as the LVGL UI to avoid spawning a second 32KB Lua task on memory-constrained boards.
The UI merges cursor_status and codex_status locally for the four-state IDE indicator.
The standing icon is drawn directly on an LVGL canvas in the bottom-left area of the dashboard.
Touching the screen during an active standing reminder window confirms that hour's pill.
After installation, {CUR_SKILL_DIR}/scripts/token_usage_snapshot.lua runs every hour to sample local environmental sensors (temperature, humidity, pressure, estimated CO2) plus PC data (DeepSeek token balance, account balance, outdoor weather, Cursor/Codex activity) and local standing count from the dashboard state file, append {CUR_SKILL_DIR}/telemetry_history/, and call memory_store with tags token_usage,environment,standing,weather,cursor.
{CUR_SKILL_DIR}/scripts/token_usage_letter.lua runs synchronously (no async task spawned) every minute via scheduler, but only composes and sends a letter at the top of each clock hour. It reads telemetry history and recent long-term memory (memory_recall on the token_usage label), then broadcasts the greeting to known IM chats. Letters weave desk air, outdoor weather, standing progress, token trends, and agent workload into everyday language with one caring suggestion — not a technical report. Synchronous execution avoids a 32KB Lua task allocation that would fail when internal DRAM is fragmented.
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.

