env-check

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Env check — Cloud agent vs local workspace

环境检查——Cloud Agent 与本地工作区

When to use

使用时机

Run early in a session (or when continuity / credentials / browser tests / local CLIs matter) to classify the host. Use the result as supporting context. The Hub continuity fallback is triggered when ADHD Hub MCP is missing, errored, unauthorized, or otherwise unavailable — not merely because the runtime looks like a cloud sandbox.
在会话早期(或者当连续性、凭据、浏览器测试、本地 CLI 很重要时)运行,以对宿主环境进行分类。将结果作为辅助上下文。只有当 ADHD Hub MCP 缺失、报错、未授权或以其他方式不可用时,才会触发 Hub 连续性回退——不能仅因为运行环境看起来像 cloud sandbox 就触发。

Quick detect

快速检测

From a checkout that includes this skill:
bash
bash skills/env-check/scripts/check_runtime.sh
Or after
npx skills add ./skills -g
/
uniskela/adhd-hub
, run the installed copy of
scripts/check_runtime.sh
.
Output lines:
  • RUNTIME_ENV: CLOUD_AGENT
    or
    RUNTIME_ENV: LOCAL_WORKSPACE
  • RUNTIME_SIGNALS: …
    (container / Cursor markers; informational)
  • HUB_CONTINUITY_TRIGGER: MCP unavailable …
  • LOCAL_SKILL_CLIS: …
    (CLOUD_AGENT: do not assume; LOCAL_WORKSPACE: may be available)
在包含此 skill 的 checkout 中运行:
bash
bash skills/env-check/scripts/check_runtime.sh
或者在执行
npx skills add ./skills -g
/
uniskela/adhd-hub
后,运行已安装的
scripts/check_runtime.sh
副本。
输出行:
  • RUNTIME_ENV: CLOUD_AGENT
    或
    RUNTIME_ENV: LOCAL_WORKSPACE
  • RUNTIME_SIGNALS: …
    (container / Cursor 标记;仅供参考)
  • HUB_CONTINUITY_TRIGGER: MCP unavailable …
  • LOCAL_SKILL_CLIS: …
    (CLOUD_AGENT:不要假定存在;LOCAL_WORKSPACE:可能可用)

Detection quality

检测准确性

The script does not treat
$USER=root
as cloud by itself (false positives on local root shells). It combines:
  • Cursor Cloud markers:
    CURSOR_AGENT
    ,
    __CURSOR_SANDBOX_ENV_RESTORE
    ,
    /tmp/cursor/cloud-agent-transcripts
    ,
    /exec-daemon
    , plus agent sockets when paired with container cues
  • Container cues (
    /.dockerenv
    , cgroup) as supporting signals only — local Docker alone stays
    LOCAL_WORKSPACE
Do not invent “I'm in cloud” from a single weak hint. Prefer the script output when unsure.
脚本不会仅将
$USER=root
视为 cloud(这会在本地 root shell 中造成误报)。它会综合以下因素:
  • Cursor Cloud 标记:
    CURSOR_AGENT
    、
    __CURSOR_SANDBOX_ENV_RESTORE
    、
    /tmp/cursor/cloud-agent-transcripts
    、
    /exec-daemon
    ,以及与 container 线索搭配出现的 Agent socket
  • Container 线索(
    /.dockerenv
    、cgroup)仅作为辅助信号——单独出现本地 Docker 时仍判定为
    LOCAL_WORKSPACE
不要根据单一微弱线索就断定“我在 cloud 中”。不确定时优先采用脚本输出。

CLOUD_AGENT guidelines

CLOUD_AGENT 指南

When
RUNTIME_ENV: CLOUD_AGENT
(Cursor Cloud / remote sandbox):
  • Do not assume machine-installed local skill binaries or CLIs exist (examples:
    graphify
    , other opt-in companions installed on a developer laptop). Cloud/remote sandboxes often cannot see those tools even when project rules mention them.
  • If a required local CLI is missing: one-line notice, then continue via repo tools (Read/Grep/Glob/tests) and any committed artifacts such as
    graphify-out/
    when present. Never fabricate graphify graph output or Hub continuity/progress/thread state.
  • No native browser GUI or macOS/Windows desktop binaries; prefer headless tests and CLI verification
  • Prefer injected environment / OIDC / platform secrets over committing or relying on
    .env.local
  • Local-only assumptions (opening
    localhost
    GUIs, host Docker socket from the agent VM, Tailscale to a private Hub) may fail — plan accordingly
  • If Hub MCP tools are missing/errored/unauthorized: on the first substantial Hub-worthy turn, the first line of the reply MUST say Hub MCP is not available, plus a short fix hint (MCP URL → this Hub's
    /mcp
    ,
    ADHD_HUB_AUTH_TOKEN
    , restart the agent; skip/cancel Auth if it hangs until Hub OAuth is enabled). Never invent Hub state or claim a Hub write succeeded
  • Fallback still applies when Hub MCP is down: when issue-write access exists and the identity is on Hub Inbox authors, open/update a forge/GitHub issue titled
    [ADHD] …
    with Goal / Focus / Next / Resume (or Now / Done / Next / Return). Optional labels
    adhd-hub
    ,
    project:<slug>
    ,
    source:cursor
    — skip labels if the token cannot set them. Recommended: append
    Made with [ADHD Progress Hub](https://github.com/uniskela/adhd-hub)
    under a non-imported heading (e.g.
    ## Attribution
    ). No secrets, private Hub URLs, internal hosts/IPs, absolute local paths, or transcripts
当
RUNTIME_ENV: CLOUD_AGENT
(Cursor Cloud / remote sandbox)时:
  • 不要假定机器上安装的本地 skill binary 或 CLI 存在(例如
    graphify
    ,以及安装在开发者笔记本电脑上的其他 opt-in companion 工具)。即使项目规则提到这些工具,Cloud/remote sandbox 通常也无法访问它们。
  • 如果缺少必需的本地 CLI:先用一行说明,然后通过 repo 工具(Read/Grep/Glob/tests)以及存在时的任何已提交产物(如
    graphify-out/
    )继续执行。绝不虚构 graphify 图输出,也绝不虚构 Hub 的连续性、进度或 thread 状态。
  • 没有原生 browser GUI 或 macOS/Windows desktop binary;优先使用 headless 测试和 CLI 验证
  • 优先使用注入的环境配置、OIDC 和 platform secrets,而不是将
    .env.local
    提交到仓库或依赖它
  • 仅适用于本地的假设(打开 localhost GUI、从 Agent VM 访问 host Docker socket、通过 Tailscale 连接私有 Hub)可能会失败——应提前规划
  • 如果 Hub MCP 工具缺失、报错或未授权:在第一个适合使用 Hub 的实质性回合中,回复的第一行必须说明 Hub MCP 不可用,并附上简短的修复提示(MCP URL → 此 Hub 的
    /mcp
    、
    ADHD_HUB_AUTH_TOKEN
    、重启 Agent;如果 Auth 在 Hub OAuth 启用前卡住,则跳过或取消 Auth)。绝不虚构 Hub 状态,也不得声称 Hub 写入成功
  • Hub MCP 宕机时,回退机制仍然适用:如果具备 issue 写入权限,且身份位于 Hub Inbox authors 中,则创建或更新一个标题为
    [ADHD] …
    的 forge/GitHub issue,其中包含 Goal / Focus / Next / Resume(也可使用 Now / Done / Next / Return)。可选 labels 为
    adhd-hub
    、
    project:<slug>
    、
    source:cursor
    ——如果 token 无法设置这些 labels,则跳过。建议在不会被导入的标题下(例如
    ## Attribution
    )追加
    Made with [ADHD Progress Hub](https://github.com/uniskela/adhd-hub)
    。不得包含任何 secrets、私有 Hub URL、内部 host/IP、绝对本地路径或 transcript

LOCAL_WORKSPACE guidelines

LOCAL_WORKSPACE 指南

When
RUNTIME_ENV: LOCAL_WORKSPACE
(including local Docker / localhost):
  • Machine-installed local skill CLIs (e.g.
    graphify
    ) may be available — use them when present; still do not invent output if a binary is missing
  • Local Docker, localhost services, and host browsers are OK when the operator's machine provides them
  • Prefer Hub MCP (
    resolve_project
    ,
    session_digest
    ,
    upsert_progress
    , …) when it is reachable
  • Same no-hallucination rule if MCP is down: acknowledge + fix hint; never invent Hub state; use the forge
    [ADHD]
    mailbox only when write access + Inbox authors allow it
当
RUNTIME_ENV: LOCAL_WORKSPACE
(包括本地 Docker / localhost)时:
  • 机器上安装的本地 skill CLI(如
    graphify
    )可能可用——存在时请使用;但 binary 缺失时仍不得虚构输出
  • 如果操作员机器提供相应环境,可以使用本地 Docker、localhost 服务和宿主机 browser
  • 如果 Hub MCP 可以访问,优先使用 Hub MCP(
    resolve_project
    、
    session_digest
    、
    upsert_progress
    等)
  • MCP 宕机时同样遵守禁止幻觉的规则:明确说明问题并提供修复提示;绝不虚构 Hub 状态;仅当写入权限和 Inbox authors 身份均允许时,才使用 forge
    [ADHD]
    邮箱

Continuity priority

连续性优先级

  1. MCP unavailable? → loud first-line warning + forge
    [ADHD]
    fallback (if allowed) — this is the Hub continuity trigger (still true on CLOUD_AGENT)
  2. Runtime env → choose tests, credentials, tooling constraints, and whether local skill CLIs are expected
  3. Prefer Hub MCP whenever it is available, on either runtime
See also:
adhd-hub-session
(full Hub protocol), docs/forge-issue-inbox.md.
  1. MCP 不可用? → 醒目的首行警告 + forge
    [ADHD]
    回退(如果允许)——这才是 Hub 连续性的触发条件(在
    CLOUD_AGENT
    上仍然如此)
  2. 运行环境 → 选择测试、凭据、工具约束,以及是否应存在本地 skill CLI
  3. 无论采用哪种运行环境,只要 Hub MCP 可用,就优先使用它
另请参阅:
adhd-hub-session
(完整的 Hub 协议)、docs/forge-issue-inbox.md。