mocreo-api

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

MOCREO API Skills

MOCREO API 技能

This is the root router skill. Load this skill first, then route to exactly one sub-skill.
Use this skill whenever the user is asking about a MOCREO device's battery, temperature, humidity, online status, alerts, or history, including English requests that only provide a device ID, node ID, SN, asset, or hub model without explicitly saying MOCREO.
这是根路由技能。请先加载此技能,然后路由至恰好一个子技能。
当用户询问MOCREO设备的电池、温度、湿度、在线状态、告警或历史数据时,包括仅提供设备ID、节点ID、SN、资产或集线器型号而未明确提及MOCREO的英文请求,均可使用此技能。

First-Time Setup

首次设置

Do not proactively read or inspect the
.env
file. Credentials are checked automatically when the login script runs. If either
v2_login.py
or
v3_login.py
exits with code
2
and stderr contains
MOCREO_CREDENTIALS_MISSING
, output the following message verbatim — do not summarize, rephrase, or shorten it. Then stop and wait for the user to confirm setup is complete before taking any further action.
请勿主动读取或检查
.env
文件。登录脚本运行时会自动验证凭证。如果
v2_login.py
v3_login.py
以代码
2
退出且标准错误输出包含
MOCREO_CREDENTIALS_MISSING
,请一字不差地输出以下消息——不要总结、改写或缩短。然后停止操作,等待用户确认设置完成后再采取进一步行动。

Credential Missing — Fixed Response

凭证缺失——固定回复


MOCREO credentials are not configured. Open a terminal, navigate to the runtime root, and run the setup script:
macOS / Linux / Windows
bash
python scripts/setup_credentials.py
The script will guide you through platform selection and prompt for your email and password (password input is hidden). Let me know once it's done and I will continue.

If the login script does find credentials but the login still fails, do not say setup is missing. Treat that as a configured-but-invalid state: the saved account, password, or selected platform is likely wrong. In that case, tell the user that the bootstrap may have saved credentials without proving they work, ask them to rerun the setup and confirm they picked the correct platform, and only mention platform mismatch as a possibility rather than a certainty.
Do NOT run
setup_credentials.py
or any login script yourself.
They require interactive terminal input (platform menus, hidden password) and will hang in a non-interactive AI shell.
The setup flow:
  • It asks guided terminal questions to identify the user's system.
  • It uses the following knowledge base:
    • MOCREO Sensor App
      ==
      MOCREO Sensor System
      ==
      MOCREO V2
    • MOCREO Smart App
      ==
      MOCREO Smart System
      ==
      MOCREO V3
    • V2 hubs:
      H1
      ,
      H2
    • V3 hubs:
      H3
      ,
      H5-Lite
      ,
      H5-Pro
      ,
      H6-Lite
      ,
      H6-Pro
    • V2-only sensors:
      ST1
      ,
      ST2
      ,
      ST3
      ,
      ST4
      ,
      ST7
      ,
      ST7-CL
      ,
      SS1
      ,
      NM1
    • V3-only sensors:
      MS2
      ,
      LS1
      ,
      LS2
      ,
      LS3
      ,
      LW1
      ,
      LD1
      ,
      LB1
      ,
      NS1
      ,
      NS2
      ,
      NS3
    • Shared sensors requiring a follow-up question:
      ST5
      ,
      ST6
      ,
      ST8
      ,
      ST9
      ,
      ST10
      ,
      MS1
      ,
      SW2
  • Password input is hidden via terminal secure entry and stored only in the local
    .env
    file.
  • In Claude marketplace deployments, shared runtime files such as
    .env
    and
    .mocreo_v3_apikeys.json
    live at the marketplace root rather than inside
    plugins/mocreo-api
    .
Never ask the user to send their password in chat. Never guess their platform. Never install Python dependencies without the user's permission. If a missing-package error appears, explain the install command first, warn when it may affect the current or global Python environment, and wait for approval before running it.

MOCREO凭证未配置。打开终端,导航至运行时根目录,运行设置脚本:
macOS / Linux / Windows
bash
python scripts/setup_credentials.py
该脚本会引导您完成平台选择,并提示您输入邮箱和密码(密码输入会被隐藏)。完成后请告知我,我将继续操作。

如果登录脚本找到凭证但登录仍失败,请不要说设置缺失。将其视为已配置但无效的状态:保存的账户、密码或所选平台可能有误。在这种情况下,告知用户引导程序可能保存了凭证但未验证其有效性,请求他们重新运行设置并确认选择了正确的平台,仅将平台不匹配作为一种可能性提及,而非确定性结论。
请勿自行运行
setup_credentials.py
或任何登录脚本
。它们需要交互式终端输入(平台菜单、隐藏密码),在非交互式AI shell中会挂起。
设置流程:
  • 它会在终端中提出引导式问题以识别用户的系统。
  • 它使用以下知识库:
    • MOCREO Sensor App
      ==
      MOCREO Sensor System
      ==
      MOCREO V2
    • MOCREO Smart App
      ==
      MOCREO Smart System
      ==
      MOCREO V3
    • V2集线器:
      H1
      ,
      H2
    • V3集线器:
      H3
      ,
      H5-Lite
      ,
      H5-Pro
      ,
      H6-Lite
      ,
      H6-Pro
    • 仅V2支持的传感器:
      ST1
      ,
      ST2
      ,
      ST3
      ,
      ST4
      ,
      ST7
      ,
      ST7-CL
      ,
      SS1
      ,
      NM1
    • 仅V3支持的传感器:
      MS2
      ,
      LS1
      ,
      LS2
      ,
      LS3
      ,
      LW1
      ,
      LD1
      ,
      LB1
      ,
      NS1
      ,
      NS2
      ,
      NS3
    • 需要后续确认的共享传感器:
      ST5
      ,
      ST6
      ,
      ST8
      ,
      ST9
      ,
      ST10
      ,
      MS1
      ,
      SW2
  • 密码输入通过终端安全输入隐藏,仅存储在本地
    .env
    文件中。
  • 在Claude市场部署中,共享运行时文件如
    .env
    .mocreo_v3_apikeys.json
    位于市场根目录,而非
    plugins/mocreo-api
    内部。
切勿要求用户在聊天中发送密码。切勿猜测用户的平台。 未经用户许可,切勿安装Python依赖项。如果出现缺失包的错误,请先解释安装命令,警告其可能影响当前或全局Python环境,等待用户批准后再运行。

Routing - Which Sub-Skill to Load

路由 - 加载哪个子技能

Read the user's request and load the appropriate sub-skill SKILL.md:
User mentionsLoad
"MOCREO Sensor App", "Sensor System", "V2", "H1", "H2", "node", "alert"Source / npx:
mocreo-sensor-system/SKILL.md
Claude marketplace:
skills/mocreo-sensor-system/SKILL.md
"MOCREO Smart App", "Smart System", "V3", "H3", "H5", "H6", "NS1", "NS2", "NS3", "asset", "API key"Source / npx:
mocreo-smart-system/SKILL.md
Claude marketplace:
skills/mocreo-smart-system/SKILL.md
Routing priority:
  • If
    setup_credentials.py
    has already saved
    MOCREO_PLATFORM
    , treat that saved platform as the primary source of truth.
  • Do not override the saved platform just because the user says generic words like
    sensor
    ,
    temperature
    ,
    humidity
    ,
    monitoring data
    , or
    device data
    .
  • The word
    sensor
    alone is not enough to choose
    mocreo-sensor-system
    , because both Smart System and Sensor System can include sensors.
  • Only use request keywords as a routing hint when the request includes system-specific evidence such as app name, hub family, explicit system name, or clearly system-bound entities like
    asset
    or
    API key
    .
If the system cannot be determined from the request but credentials are already configured, use the saved
MOCREO_PLATFORM
.
If the system cannot be determined and credentials are not configured yet, output the fixed "Credential Missing" response above instead of asking for free-form credential details in chat.
Once you identify the correct sub-skill, read its SKILL.md and follow the instructions there.
读取用户的请求并加载相应的子技能SKILL.md:
用户提及内容加载路径
"MOCREO Sensor App", "Sensor System", "V2", "H1", "H2", "node", "alert"源码 / npx:
mocreo-sensor-system/SKILL.md
Claude市场:
skills/mocreo-sensor-system/SKILL.md
"MOCREO Smart App", "Smart System", "V3", "H3", "H5", "H6", "NS1", "NS2", "NS3", "asset", "API key"源码 / npx:
mocreo-smart-system/SKILL.md
Claude市场:
skills/mocreo-smart-system/SKILL.md
路由优先级:
  • 如果
    setup_credentials.py
    已保存
    MOCREO_PLATFORM
    ,则将该保存的平台视为主要依据。
  • 不要仅因为用户提到
    sensor
    ,
    temperature
    ,
    humidity
    ,
    monitoring data
    , 或
    device data
    等通用词汇就覆盖已保存的平台。
  • sensor
    一词不足以选择
    mocreo-sensor-system
    ,因为Smart System和Sensor System都包含传感器。
  • 仅当请求包含系统特定证据(如应用名称、集线器系列、明确的系统名称,或与系统绑定的实体如
    asset
    API key
    )时,才将请求关键词作为路由提示。
如果无法从请求中确定系统但凭证已配置,请使用保存的
MOCREO_PLATFORM
。 如果无法确定系统且凭证尚未配置,请输出上述固定的“凭证缺失”回复,而非在聊天中询问自由格式的凭证详情。
一旦确定正确的子技能,请读取其SKILL.md并遵循其中的说明。

Before Every Shell Command

执行每个Shell命令之前

Before running any script, always output one short sentence in plain language explaining what you are about to do and why. Keep it under 15 words. Do this every time, without exception — it helps the user understand the permission prompt and feel confident approving it.
Examples:
  • Logging in to get an access token.
  • Fetching the list of sensors under your account.
  • Checking existing API keys on Home/Asset before creating a new one.
  • Deleting unused key
    testexamples123
    from Home/Asset as confirmed.
Never use technical jargon (no "Bearer token", no "exit code", no script names) in this sentence.
在运行任何脚本之前,始终用简单语言输出一句简短的话,解释您即将执行的操作及原因。控制在15字以内。每次都必须这样做——这有助于用户理解权限提示并放心批准。
示例:
  • 登录获取访问令牌。
  • 获取您账户下的传感器列表。
  • 创建新密钥前检查现有API密钥。
  • 按确认删除未使用的密钥
    testexamples123
在此句子中切勿使用技术术语(不要说“Bearer token”、“退出码”或脚本名称)。

Command Base Path

命令基础路径

Run all commands from the runtime root shown below, not from an individual sub-skill folder. Use the path variant that exists in the current install:
  • Source repo or
    npx skills add
    :
    python scripts/setup_credentials.py
    or
    python mocreo-smart-system/scripts/v3_login.py
  • Claude marketplace package:
    python scripts/setup_credentials.py
    or
    python skills/mocreo-smart-system/scripts/v3_login.py
从下面显示的运行时根目录运行所有命令,而非单个子技能文件夹。使用当前安装中存在的路径变体:
  • 源码仓库或
    npx skills add
    python scripts/setup_credentials.py
    python mocreo-smart-system/scripts/v3_login.py
  • Claude市场包:
    python scripts/setup_credentials.py
    python skills/mocreo-smart-system/scripts/v3_login.py

Runtime Layout

运行时布局

The runtime root for this skill should contain the files needed to execute commands directly.
Source repo and
npx skills add
layout:
runtime-root/
|- SKILL.md                      <- this file (router)
|- requirements.txt              <- shared Python dependencies
|- scripts/
|  \- setup_credentials.py       <- interactive shared credential setup (Python)
|- common/
|  \- mocreo_auth.py             <- shared credential and platform helpers
|- mocreo-sensor-system/
|  |- SKILL.md                   <- Sensor System instructions for AI
|  \- scripts/                   <- Sensor System Python scripts
|- mocreo-smart-system/
|  |- SKILL.md                   <- Smart System instructions for AI
|  \- scripts/                   <- Smart System Python scripts
|- openapi.en.yaml               <- Smart System OpenAPI reference
|- openapi.zh.yaml               <- Smart System OpenAPI reference (Chinese)
\- sensor-swagger.json          <- Sensor System Swagger reference
Claude marketplace package layout:
runtime-root/
|- .claude-plugin/
|  \- plugin.json                <- plugin manifest when packaged for Claude
|- requirements.txt
|- scripts/
|- common/
|- skills/
|  |- mocreo-api/
|  |  \- SKILL.md                <- this file (router)
|  |- mocreo-sensor-system/
|  |  |- SKILL.md
|  |  \- scripts/
|  \- mocreo-smart-system/
|     |- SKILL.md
|     \- scripts/
|- openapi.en.yaml
|- openapi.zh.yaml
\- sensor-swagger.json
In the canonical source repository, the Claude marketplace manifest lives at
.claude-plugin/marketplace.json
, and the self-contained Claude plugin package is generated under
plugins/mocreo-api/
. In Claude marketplace deployments, the shared
.env
,
.env.example
, and
.mocreo_v3_apikeys.json
live at the marketplace root outside the nested plugin folder.
此技能的运行时根目录应包含直接执行命令所需的文件。
源码仓库和
npx skills add
布局:
runtime-root/
|- SKILL.md                      <- 此文件(路由)
|- requirements.txt              <- 共享Python依赖项
|- scripts/
|  \- setup_credentials.py       <- 交互式共享凭证设置(Python)
|- common/
|  \- mocreo_auth.py             <- 共享凭证和平台助手
|- mocreo-sensor-system/
|  |- SKILL.md                   <- 传感器系统AI指令
|  \- scripts/                   <- 传感器系统Python脚本
|- mocreo-smart-system/
|  |- SKILL.md                   <- 智能系统AI指令
|  \- scripts/                   <- 智能系统Python脚本
|- openapi.en.yaml               <- 智能系统OpenAPI参考
|- openapi.zh.yaml               <- 智能系统OpenAPI参考(中文)
\- sensor-swagger.json          <- 传感器系统Swagger参考
Claude市场包布局:
runtime-root/
|- .claude-plugin/
|  \- plugin.json                <- 打包用于Claude的插件清单
|- requirements.txt
|- scripts/
|- common/
|- skills/
|  |- mocreo-api/
|  |  \- SKILL.md                <- 此文件(路由)
|  |- mocreo-sensor-system/
|  |  |- SKILL.md
|  |  \- scripts/
|  \- mocreo-smart-system/
|     |- SKILL.md
|     \- scripts/
|- openapi.en.yaml
|- openapi.zh.yaml
\- sensor-swagger.json
在标准源码仓库中,Claude市场清单位于
.claude-plugin/marketplace.json
,独立的Claude插件包生成在
plugins/mocreo-api/
下。在Claude市场部署中,共享的
.env
,
.env.example
, 和
.mocreo_v3_apikeys.json
位于嵌套插件文件夹之外的市场根目录。