.cursor/skills/simplemesh/agent/SKILL.md
Agent 专用约束:状态机唯一入口、backhaul 先于 MQTT、both 模式从 UCI、周期任务用 main_task。修改 src/agent_sm.c、agent 状态机、backhaul/MQTT 连接逻辑时使用。
npx skillsauth add ddb65536/SimpleMesh simplemesh-agentInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
接到与 Agent 相关的修改时,先判断是否符合本 skill 与全局架构;若有偏离,先简要说明再确认是否执行。
agent_sm.h):AGENT_STATE_INIT → AGENT_STATE_CONNECTING → AGENT_STATE_CONNECTED → AGENT_STATE_ONLINE。agent_connection_state_machine_task(main_task 周期任务)可以修改 ctx->state。其他位置(如 agent_mqtt_on_connect、agent_mqtt_on_disconnect、agent_sm_start、agent_sm_stop)不得改状态,只做标志或清理。ctx->state == AGENT_STATE_ONLINE(或 state >= AGENT_STATE_CONNECTED 视需求)。不要在 agent_ctx 里维护 mqtt_connected;底层连接状态用 ctx->mqtt.connected(mqtt_client_t 的字段)即可。config_load_simplemesh() 填充 uci_cfg.mode;agent_sm_init() 中 strcmp(uci_cfg.mode, "both") == 0 时设 ctx->is_both_mode = 1。agent_connection_state_machine_task 中,若 ac->is_both_mode 为真,则 bh_connected = 1,不调用 backhaul_is_connected(iface);否则 bh_connected = backhaul_is_connected(iface)。both 模式下不依赖实际回传即可连 MQTT。simplemesh.wifi.wifi_iface 对全部 interface 连接 hostapd(ubus 订阅);收到事件后及时打印处理。agent_connection_state_machine_task 根据 backhaul(或 both)决定是否连 MQTT → connected → online。backhaul_is_connected(bh_iface));可结合 simplemesh.backhaul 的 ssid/key 做扫描连接与周期检查(如 20s)。main_task_add 注册,由 task_timer_cb → agent_main_task_tick → main_task_tick 驱动)。不要用独立的 conn_retry、report_timer;连接与上报节奏由 agent_connection_state_machine_task、agent_join_query_task、agent_topology_query_task 等 main_task 任务完成。state == AGENT_STATE_ONLINE 时启动/续期 heartbeat(uloop_timeout_set(&ctx->heartbeat, ...))。platform/config_uci.c,config_load_simplemesh)读取;命令行 -b/-p 可选,未传时用 UCI。both 仅看 UCI mode,不看 -m。agent_connection_state_machine_task 内修改 state 及触发 MQTT 连接/断开、topology_query、heartbeat 启动。main_task_add 注册到 ctx->main_tasks,不要在 agent 里增加新的 uloop_timeout 做连接重试或周期上报(除非明确是 heartbeat 等已约定定时器)。ctx->mqtt.connected,不要恢复 agent_ctx.mqtt_connected 字段。.cursor/skills/simplemesh/SKILL.mdsrc/agent_sm.c 中 agent_connection_state_machine_task、main_task_add、agent_main_task_tick、agent_sm_init(is_both_mode 从 UCI)。tools
Controller 专用约束:只做策略 + MQTT 收发,不连 hostapd/system_monitor/backhaul。修改 src/controller.c、controller 策略或 MQTT 订阅/发布时使用。
testing
SimpleMesh2 全局框架约束。涉及入口、UCI、MQTT 文档、uloop、角色划分、文件映射时使用。Agent/Controller 具体逻辑见各自 skill。
testing
Create, edit, improve, or audit AgentSkills. Use when creating a new skill from scratch or when asked to improve, review, audit, tidy up, or clean up an existing skill or SKILL.md file. Also use when editing or restructuring a skill directory (moving files to references/ or scripts/, removing stale content, validating against the AgentSkills spec). Triggers on phrases like "create a skill", "author a skill", "tidy up a skill", "improve this skill", "review the skill", "clean up the skill", "audit the skill".
testing
Host security hardening and risk-tolerance configuration for OpenClaw deployments. Use when a user asks for security audits, firewall/SSH/update hardening, risk posture, exposure review, OpenClaw cron scheduling for periodic checks, or version status checks on a machine running OpenClaw (laptop, workstation, Pi, VPS).