.cursor/skills/simplemesh/SKILL.md
SimpleMesh2 全局框架约束。涉及入口、UCI、MQTT 文档、uloop、角色划分、文件映射时使用。Agent/Controller 具体逻辑见各自 skill。
npx skillsauth add ddb65536/SimpleMesh simplemesh-globalInstall 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.
接到修改/新增需求时,先判断是否与 doc/0_architecture.md 及本 skill 的模块划分一致;若有偏离,先简要说明架构上的影响,再确认是否按该方式实现。
src/main_uloop.c。解析 -m controller|agent|both、-b、-p;启动 uloop;可选同时跑 controller + agent。-b/-p 时从 UCI /etc/config/simplemesh 的 simplemesh.global 读取(mqtt_broker、mqtt_port)。mode(controller/agent/both)仅从 UCI simplemesh.global.mode 读取,用于 both 模式判断(见 Agent skill)。config_load_simplemesh() 填充 struct simplemesh_uci_config.mode,Agent 在 init 时据此设 is_both_mode。不得在 agent 内依赖命令行 -m both 做 backhaul 逻辑。| 职责 | 路径 |
|------------|------|
| 入口、-m | src/main_uloop.c |
| Agent 状态机 | src/agent_sm.c、agent_sm.h → 见 Agent skill |
| Controller | src/controller.c、controller.h → 见 Controller skill |
| 硬件/系统通用 | src/platform/system_api.c、system_api.h:设备 MAC、接口等通用参数;init_device_info 供 Controller 与 Agent 共用;新增硬件或系统级读取统一放此处。 |
| UCI 配置 | src/platform/config_uci.c、config_uci.h(global:broker、port、mode;wifi;backhaul) |
| MQTT/报文 | src/transport/mqtt_client.c、mesh_mqtt.c、mqtt_topics.h |
| 周期任务 | src/main_task.c、main_task.h(controller/agent 共用) |
| 日志 | src/log_simple.c、log_simple.h |
transport/mqtt_topics.h 或 doc/1_mqtt_topic.md 中定义;实现与文档一致。.cursor/skills/simplemesh/agent/SKILL.md.cursor/skills/simplemesh/controller/SKILL.mdtools
Controller 专用约束:只做策略 + MQTT 收发,不连 hostapd/system_monitor/backhaul。修改 src/controller.c、controller 策略或 MQTT 订阅/发布时使用。
testing
Agent 专用约束:状态机唯一入口、backhaul 先于 MQTT、both 模式从 UCI、周期任务用 main_task。修改 src/agent_sm.c、agent 状态机、backhaul/MQTT 连接逻辑时使用。
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).