/dev-workflow:openclaw-opsfrom dev-workflow
Operate, configure, and debug a running OpenClaw installation from a host machine (locally or over SSH). Covers the whole runtime surface **except** building agent personalities/workspaces — channels, gateway, daemon/service, config (`openclaw.json`), models + auth, cron, hooks, plugins, sandbox, sessions, security audit, doctor, reset, uninstall. This skill MUST be invoked on any mention of `openclaw` CLI commands, `~/.openclaw`, `openclaw.json`, "restart gateway", "add a channel", "check why my bot isn't responding", "openclaw doctor", "channels status", "ssh into the OpenClaw box", and similar — also whenever a host has `~/.openclaw/openclaw.json` and OpenClaw work is implied even if not named. MUST hand off to **openclaw-agent-builder** for any work that creates or edits an agent's workspace files (SOUL.md / AGENTS.md / IDENTITY.md / USER.md / RAG knowledge / `agents.list[]` entries / `bindings[]`).
Ships in dev-workflow. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
在一台跑著 OpenClaw 的機器上(本機,或 SSH 進去的遠端)做運維、配置、診斷。
不寫 agent 人格與 workspace —— 那是 openclaw-agent-builder 的工作。
這份 skill 涵蓋:
~/.openclaw/openclaw.json 的讀寫、openclaw config get/set/unsetopenclaw models 的 list/status/set/authopenclaw cronopenclaw plugins、openclaw hooks、openclaw webhooksopenclaw sandboxopenclaw doctor、openclaw security audit、openclaw status、openclaw logsopenclaw reset / openclaw uninstall(高破壞性,額外保護)你不會動到的事:agent 的注入式檔案(SOUL/AGENTS/IDENTITY/USER)、
agents.list[]內容、bindings[]、agent workspace 的 RAG 知識文件。這些遇到了就轉交給 openclaw-agent-builder。
每一次任務的第一件事:這個 OpenClaw 跑在哪裡,你要怎麼操作它?
開門先問:
「要操作的 OpenClaw 是跑在這台機器(本機),還是要 SSH 連到別台?」
references/connect.md 的「SSH 連線設定」一節,問齊主機/帳號/驗證
方式(金鑰優先;密碼可接受但要提醒風險),建好可重用連線後再往下無論哪種,這份 runbook 後面所有 openclaw … 指令都在目標機器上執行。
在目標機器上跑這四件事,把脈絡攤開來:
openclaw --version # CLI 可用、版本為何
openclaw status # gateway 是否在跑、recent session
ls ~/.openclaw/ # state dir 與 workspace 樣貌
cat ~/.openclaw/openclaw.json # 讀現有設定(JSON5)
status 連不上 gateway 不一定是問題 —— 也許 gateway 還沒裝。先確認意圖:使用者是
要把它裝起來、跑起來,還是它已經該跑卻沒跑(那就進 debug 流程)。
關鍵狀態目錄(預設值,可被環境變數覆蓋,見 references/config-files.md):
| 用途 | 路徑 |
|---|---|
| state dir | ~/.openclaw/ |
| config 檔 | ~/.openclaw/openclaw.json (JSON5) |
| 憑證 | ~/.openclaw/credentials/ |
| sessions | ~/.openclaw/sessions/ (per-agent: ~/.openclaw/agents/<id>/sessions/) |
| agents | ~/.openclaw/agents/<id>/ |
| workspace | ~/.openclaw/workspace/ 或 ~/.openclaw/workspace-<agentId>/ |
| gateway port | 18789(預設) |
上面任何路徑被
OPENCLAW_STATE_DIR、OPENCLAW_CONFIG_PATH、OPENCLAW_OAUTH_DIR、OPENCLAW_GATEWAY_PORT覆蓋時,以實際解析結果為準。先看 env,再看 config, 別硬套預設值。
OpenClaw CLI 隨版本變化,flag 與 config key 都會搬。所以:
openclaw <command> --help 驗證選項真的存在。不要直接套這份 runbook
的 flag 名;runbook 是起點不是定論。openclaw config get <path> 試讀來確認鍵名(openclaw config schema
可看 schema)。寧可多探一句,不要寫錯設定。
你此刻是 host 上的高權限 operator,有完整 shell 和 openclaw CLI 存取。守住三條:
config set、channels add、channels remove、
gateway 重啟、reset、uninstall、security audit --fix、doctor --force)
都先把「會發生什麼、影響哪些線上行為」攤給使用者,取得明確同意再做。收到請求後,先分類,再決定要拉哪些 reference:
| 使用者說的話 | 屬於 | 主要 reference |
|---|---|---|
| 「新增/編輯 agent」「做一個 LINE bot」「改 SOUL.md」「換 bindings」 | agent-builder 的事 | 跟使用者說你會轉交 openclaw-agent-builder |
| 「加一個 Telegram channel」「換 Discord token」「移掉 Slack 帳號」 | 操作 — channel | references/operations.md(channels 一節) |
| 「啟動/重啟 gateway」「裝成 service」「gateway port 改一下」 | 操作 — gateway/daemon | references/operations.md(gateway 一節) |
| 「換模型」「設 fallback」「加一個 API key」 | 操作 — models | references/operations.md(models 一節) |
| 「加 cron job 每天 9 點…」 | 操作 — cron | references/operations.md(cron 一節) |
| 「安裝/啟用/停用 plugin」「裝 voicecall」 | 操作 — plugins | references/operations.md(plugins 一節) |
| 「改一個 config 值」「dmPolicy/session 設定」 | 操作 — config | references/config-files.md + operations.md(config) |
| 「批次發訊息」「發 poll」「對訊息按表情」「pin 一則」「開 thread」「Discord kick/ban/role」 | 操作 — messaging | references/messaging.md |
| 「接一台新 Pi」「Pi 看不到 gateway」「拍張照」「在 node 上跑 command」 | 操作 — nodes/node/devices | references/nodes-and-devices.md |
| 「用 browser 截圖 / 點某個鈕 / 填表」 | 操作 — browser | references/misc-modules.md(§1) |
| 「approve pairing」「approvals allowlist」「ACP 接 IDE」「QR」「dns setup」 | 操作 — 雜項模組 | references/misc-modules.md |
| 「bot 沒回應」「channel 連不上」「為什麼 X 不動」 | debug | references/debug.md(對應子系統 reference 的 debug 章) |
| 「health/status 看起來怪怪的」「跑 doctor」「安全稽核」 | debug + 稽核 | references/debug.md |
| 「整個砍掉重來」「reset」「uninstall」 | 破壞性 | references/destructive.md(必讀) |
openclaw doctor、openclaw status、openclaw channels status --probe,
或對應的子系統驗收指令,把結果回報給使用者cp ~/.openclaw/openclaw.json ~/.openclaw/openclaw.json.bak-<timestamp>當使用者說「壞了/不動/怪怪的」,不要亂改設定。先取證。
references/debug.md 有完整 runbook,核心套路如下:
openclaw doctor —— OpenClaw 自帶的健診,先跑(不加 --fix,純看報告)openclaw status --deep 或 openclaw status --all —— 全面狀態,包含 gateway、
channels、sessions、provider 額度openclaw channels status --probe —— 對每個 channel 做活探測openclaw gateway probe / gateway health —— 確認 gateway 真的可達且回應openclaw logs --follow —— 看即時 log(問題重現時最有用)openclaw channels logs --channel <ch> —— 看特定 channel 最近的 logopenclaw security audit —— 看有沒有設定上的安全 footgun 連帶造成行為怪openclaw sessions —— 看 session 路由有沒有走到對的 agentbindings)、agent 沒有對應的 channel
emit 權限、或 dmPolicy 擋下 → 看 channels logs、sessions,以及 agents list --bindingschannels status --probe + channels logsmodels status --probe,看 provider usageplugins doctor + plugins list,看 enabled 與 load 錯誤gateway status --deep 看系統服務狀態openclaw config get <path> 試讀;doctor 通常會點出來詳見 references/debug.md。
找到 root cause 才算完成。光是 workaround 別當結束。如果觀察到的證據對不上假設, 回到取證,別硬猜。
openclaw.json)兩條路:
openclaw config set/unset(優先)—— 走官方 CLI,會做 schema 校驗、$include 解析、
env 替換,不會把 runtime defaults 漏寫進檔。~/.openclaw/openclaw.json(當 CLI 不夠用時)—— JSON5 格式,可有註解。
改完務必檢查能不能被 JSON5 解析(用 node -e 或 openclaw doctor 驗證)。改任何 config 都要:
cp ~/.openclaw/openclaw.json ~/.openclaw/openclaw.json.bak-$(date +%Y%m%d-%H%M%S)openclaw doctor 與 openclaw status --deepconfig 結構與環境變數覆蓋,見 references/config-files.md。
reset、uninstall、--fix、--force、--delete、channels remove 沒 --account
全幹掉、gateway uninstall、刪 ~/.openclaw —— 這些都進 references/destructive.md。
執行前要做:
openclaw.json、credentials/、sessions/)--dry-run 看一遍(支援的指令都有)openclaw doctor 與 openclaw status 驗收兩條路徑後續的 runbook 內容完全一樣,差別只在「指令怎麼跑到目標機器上」。連線
細節、檔案讀寫範式、reusable connection、SSH 上做 interactive 操作的眉角,全部在
references/connect.md。
簡要範式:
# 本機
openclaw doctor
cat ~/.openclaw/openclaw.json
# SSH(已用 ControlMaster 建好連線後)
ssh oc-host "openclaw doctor"
ssh oc-host "cat ~/.openclaw/openclaw.json"
# SSH 寫檔(用 heredoc + tee;絕不在指令裡明文寫 token)
ssh oc-host "tee ~/.openclaw/openclaw.json.new" < /tmp/openclaw.json.draft
ssh oc-host "mv ~/.openclaw/openclaw.json.new ~/.openclaw/openclaw.json"
互動式指令的限制:
openclaw onboard、openclaw configure、openclaw channels login --channel whatsapp(掃 QR)等需要 TTY 的指令,在 SSH 上要分配 PTY(ssh -t)。 對 WhatsApp QR 這類,告知使用者要在那台機器上自己看終端(SSH 也可以,但要ssh -t且不能背景化)。
只在需要時讀對應的 reference,不要一次全讀。
references/cli-map.md —— OpenClaw 頂層指令樹完整地圖(從原始碼整理)。當你需要
確認「有沒有某個指令/某個 flag」時讀。references/connect.md —— 本機與 SSH 連線設定、reusable connection、SSH 上做檔案
讀寫與互動指令的範式。Phase 0 選 SSH 時讀。references/config-files.md —— ~/.openclaw/ 結構、openclaw.json 主要鍵、環境
變數覆蓋。改 config 之前讀。references/operations.md —— 常見 ops playbook(加 channel、換模型、改 port、
裝 plugin、加 cron…)。對應「操作」類請求時讀。references/messaging.md —— openclaw message 子指令族(send/broadcast/poll/
react/edit/delete/pin/thread/role/permissions/channel/member/event/emoji/sticker)。
寫自動化發訊或 Discord 管理時讀。references/nodes-and-devices.md —— nodes / node / devices / qr,以及
camera/canvas/screen/location 子表面。接 Pi/桌機/手機 node 時讀。references/misc-modules.md —— browser(專用 Chrome 全控)、approvals、
acp、pairing、system、dns、webhooks gmail、skills / memory /
update / dashboard / tui 等中小模組。references/debug.md —— 系統性 debug runbook,含分流表與常見故障 root cause。
對應「壞了/不動/怪怪的」時讀。各 reference 內部也都有自己的 debug 小節,先看
本檔的黃金順序,再深入子系統 reference。references/destructive.md —— reset / uninstall / --fix / --force 安全
檢查表與回滾。任何破壞性操作前讀。agents list --bindings、channels status --probe),但「寫 SOUL.md / 加
agents.list[] 項目 / 設 dmPolicy」是它的領域。ssh -O exit oc-host)references/cli-map.md (opens in a new tab)references/config-files.md (opens in a new tab)references/connect.md (opens in a new tab)references/debug.md (opens in a new tab)references/destructive.md (opens in a new tab)references/messaging.md (opens in a new tab)references/misc-modules.md (opens in a new tab)references/nodes-and-devices.md (opens in a new tab)references/operations.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub timlai666/skills --plugin dev-workflow4 skills in this plugin
/db-engineeringUniversal database engineering rules covering migration discipline, audit logging, soft delete, performance, and data integrity. This skill MUST be loaded before any database work, and MUST NOT be skipped because a schema change looks small or obvious. Triggers on: 任何資料庫相關工作, 建表, 改 schema, 寫 migration, DB design, database development, 設計資料庫, 改 DB 結構, 加欄位, 加索引, 改 table, SQL, 寫 trigger, 設計 API 的 DB 層, 查詢很慢, N+1, 效能優化, 資料完整性, CASCADE, 外鍵, 新增 table, 刪除資料, backup, 環境分離, dev prod 分開/openclaw-agent-builderCreate, configure, and edit OpenClaw agents from a host machine (locally or over SSH). This skill MUST be used whenever the user wants to add a new OpenClaw agent, build an agent for a business or organization (customer service, internal helpdesk, booking bot, etc.), scaffold agent workspace files (SOUL.md / AGENTS.md / IDENTITY.md / USER.md), wire channels (LINE / WhatsApp / Discord / Telegram / Slack and others) and bindings, set up an agent knowledge base (RAG), harden an agent against prompt injection and identity confusion, or edit / reconfigure / retune an existing OpenClaw agent. MUST trigger on any mention of OpenClaw agents, openclaw.json, agent bindings, agent workspace, "add an agent", "build a bot", "編一個 agent", "做一個客服 bot" — and also whenever ~/.openclaw or an openclaw.json file is present in the working host even if OpenClaw is not named./postgrest-baas-builderBuild services on PostgREST-compatible BaaS (Supabase / InsForge) — RLS, Auth, PostgREST queries, MCP settings. This skill MUST be loaded before writing any RLS policy or PostgREST query, and MUST NOT be skipped because the query looks like ordinary SQL. Triggers on: 用 Supabase / InsForge 做後端, 設計 RLS policy, 寫 PostgREST query, 處理 BaaS Auth, 設定 MCP, 推 Supabase production, 自架 Supabase, InsForge