← 返回 Skills 市场
montycn

Channel Management

作者 Monty · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ 安全检测通过
130
总下载
0
收藏
2
当前安装
1
版本数
在 OpenClaw 中安装
/install channel-management
功能描述
Manage multiple communication channels, admin identity recognition, and primary channel configuration
使用说明 (SKILL.md)

Channel Management Skill

Identity Recognition

When receiving a message in any room, determine the sender's identity. The rules differ by context:

DM (any channel)

All DM senders are Human Admin — OpenClaw allowlist guarantees only the admin can DM you.

Matrix Group Room

Matrix rooms may contain the admin, Workers, trusted contacts, and unknown users. Identify by Matrix user ID:

Sender How to identify Action
Human Admin @${HICLAW_ADMIN_USER}:${HICLAW_MATRIX_DOMAIN} Full trust — execute any request
Worker Registered in ~/workers-registry.json Normal Worker interaction (task handoffs, status updates)
Trusted Contact {"channel": "matrix", "sender_id": "\x3Cmatrix_user_id>"} in ~/trusted-contacts.json Respond to general questions; withhold sensitive info; deny management operations
Unknown None of the above Silently ignore — no response

Non-Matrix Group Room (Discord, Telegram, etc.)

Sender How to identify Action
Human Admin sender_id matches primary-channel.json's sender_id (same channel type) Full trust
Trusted Contact {channel, sender_id} in ~/trusted-contacts.json Restricted trust (same rules as above)
Unknown None of the above Silently ignore

Trusted Contacts

File: ~/trusted-contacts.json

{
  "contacts": [
    {
      "channel": "discord",
      "sender_id": "987654321098765432",
      "approved_at": "2026-02-23T10:00:00Z",
      "note": "optional label"
    }
  ]
}

Adding a Trusted Contact

Trigger: unknown sender messages in a group room → silently ignore. If the human admin then says "you can talk to the person who just messaged" (or equivalent):

  1. Identify the most recent unknown sender's channel and sender_id from the current session context
  2. Append to trusted-contacts.json:
    # Read existing, append, write back (use jq)
    jq --arg ch "\x3Cchannel>" --arg sid "\x3Csender_id>" --arg ts "\x3CISO-8601 now>" \
      '.contacts += [{"channel": $ch, "sender_id": $sid, "approved_at": $ts, "note": ""}]' \
      ~/trusted-contacts.json > /tmp/tc.json && \
      mv /tmp/tc.json ~/trusted-contacts.json
    
    If file doesn't exist yet: echo '{"contacts":[]}' > ~/trusted-contacts.json first.
  3. Confirm to admin in their language, e.g.: "OK, I'll engage with them. Note: I won't share any sensitive information with them."

Communicating with Trusted Contacts

When a trusted contact sends a message:

  • Respond normally to general questions
  • Never share: API keys, tokens, passwords, Worker credentials, internal system configuration, or any other sensitive operational data
  • Never execute: management operations (create/delete workers, change config, assign tasks, etc.)
  • If they ask for something outside their role, decline politely and suggest they contact the admin directly

Removing a Trusted Contact

When admin revokes access ("don't talk to X anymore"):

jq --arg ch "\x3Cchannel>" --arg sid "\x3Csender_id>" \
  '.contacts |= map(select(.channel != $ch or .sender_id != $sid))' \
  ~/trusted-contacts.json > /tmp/tc.json && \
  mv /tmp/tc.json ~/trusted-contacts.json

Primary Channel State

File: ~/primary-channel.json

{
  "confirmed": true,
  "channel": "discord",
  "to": "user:123456789012345678",
  "sender_id": "123456789012345678",
  "channel_name": "Discord",
  "confirmed_at": "2026-02-22T10:00:00Z"
}

Fields:

  • confirmed: true = use this channel for proactive notifications; false = Matrix DM fallback
  • channel: channel identifier string, used as the channel parameter when calling the message tool (e.g. "discord", "telegram", "slack")
  • to: recipient identifier, used as the target parameter when calling the message tool. Format varies by channel:
    • Discord DM: user:USER_ID (e.g. user:123456789012345678)
    • Feishu DM: open_id,即 ou_ 开头的字符串(e.g. ou_abc123def456);群聊则用 chat_idoc_ 开头)
    • Telegram: chat ID (e.g. 123456789)
    • WhatsApp/Signal: phone number (e.g. +15551234567)
  • sender_id: the admin's raw ID on that channel (used for identity tracking)
  • channel_name: human-readable name for display (e.g. "Discord", "飞书")
  • confirmed_at: ISO-8601 timestamp when the admin confirmed this choice

Read with:

bash /opt/hiclaw/agent/skills/channel-management/scripts/manage-primary-channel.sh --action show

Sending Messages to Primary Channel

Use the built-in message tool to send proactive notifications (daily reminders, heartbeat check-ins, task updates, escalation questions) to the admin on their primary channel.

Steps

  1. Read primary-channel.json:

    bash /opt/hiclaw/agent/skills/channel-management/scripts/manage-primary-channel.sh --action show
    
  2. If confirmed is true and channel is not "matrix", call the message tool:

    Parameter Value
    channel .channel from the file (e.g. "discord")
    target .to from the file (e.g. "user:123456789012345678")
    message Your notification text
  3. If confirmed is false, .channel is "matrix", or the file doesn't exist — fall back to Matrix DM.

Example

Given primary-channel.json:

{"confirmed": true, "channel": "discord", "to": "user:123456789012345678"}

Call the message tool with:

  • channel: "discord"
  • target: "user:123456789012345678"
  • message: "You have 2 tasks pending review. Want me to summarize?"

Notes

  • The message tool is a built-in OpenClaw tool — no HTTP calls or scripts needed.
  • When calling message from within a Matrix session, you MUST explicitly set channel and target; otherwise the message goes to the current Matrix room.
  • The target parameter corresponds to the to field in primary-channel.json. Despite the name difference, pass the value directly without transformation.

First-Contact Protocol

Trigger: admin sends a DM from a channel that doesn't match primary-channel.json's .channel.

Steps:

  1. Read primary-channel.json — check if .channel matches the current session's channel:
    bash /opt/hiclaw/agent/skills/channel-management/scripts/manage-primary-channel.sh --action show
    
  2. Respond to the admin's message normally
  3. Send a follow-up asking about primary channel preference, in the same language the admin used in their message:

    I noticed this is your first time contacting me via [Channel Name]. Would you like to set [Channel Name] as your primary channel? If so, my daily reminders and proactive notifications will be sent here instead of Matrix DM. Reply "yes" to confirm, or "no" to keep using Matrix DM.

  4. On "yes" / "confirm" / 「是」/ 「确认」 (or equivalent in their language):
    bash /opt/hiclaw/agent/skills/channel-management/scripts/manage-primary-channel.sh \
      --action confirm --channel "\x3Cchannel>" --to "\x3Cto>" \
      --sender-id "\x3Csender_id>" --channel-name "\x3CChannel Name>"
    
  5. On 「否」/ "no":
    bash /opt/hiclaw/agent/skills/channel-management/scripts/manage-primary-channel.sh --action reset
    
    Matrix DM remains primary.
  6. On no reply (session ends): leave unchanged; Matrix DM remains primary

Changing Primary Channel

When admin requests a switch (e.g. "switch to Discord as primary", "切换到飞书作为主频道", etc.), in any language:

  1. Read current state:
    bash /opt/hiclaw/agent/skills/channel-management/scripts/manage-primary-channel.sh --action show
    
  2. Update to the new channel:
    bash /opt/hiclaw/agent/skills/channel-management/scripts/manage-primary-channel.sh \
      --action confirm --channel "\x3Cchannel>" --to "\x3Cto>" \
      --sender-id "\x3Csender_id>" --channel-name "\x3CChannel Name>"
    
  3. Confirm in the admin's language, e.g.: "Primary channel switched to [Channel Name]. Daily reminders and proactive notifications will now be sent there."

Cross-Channel Escalation

When blocked on an admin decision while working in a Matrix room:

When to Use

  • Blocked on irreversible action needing explicit approval
  • Worker/project is stalled and needs admin judgment call
  • Cannot wait for next heartbeat or scheduled DM check-in

How to Escalate

  1. Resolve the notification channel:

    bash /opt/hiclaw/agent/skills/task-management/scripts/resolve-notify-channel.sh
    
  2. If a non-Matrix primary channel is confirmed, use the message tool to send the question directly:

    Parameter Value
    channel .channel from the file
    target .to from the file
    message A clear, friendly escalation message containing the question and asking the admin to reply
  3. After sending, note the pending escalation in your memory so you can connect the admin's reply back to the blocked workflow when it arrives.

Reply Handling

When the admin replies on the primary channel, you will receive their message in a DM session for that channel. At that point:

  1. Recognize the reply as the answer to the pending escalation
  2. Continue the blocked workflow in the original Matrix room
  3. @mention relevant workers in the room with the outcome

Fallback

If primary-channel.json is missing, confirmed is false, or channel is matrix: fall back to @mentioning the admin in the current Matrix room.

Troubleshooting

通知发送到错误目标:管理员反映收不到通知。检查 primary-channel.jsonto 字段是否正确,向管理员确认其频道 ID 后重新写入。

Message tool send failure: 使用 message 工具发送到主用频道失败时:

  1. Is openclaw running? (ps aux | grep openclaw)
  2. Is the target channel configured in openclaw? (check the corresponding channel config, e.g. channels.discord.enabled)
  3. Is the to value in primary-channel.json correct for the channel format? (see "Primary Channel State" field descriptions above)
  4. Fallback to Matrix DM is automatic; no manual intervention needed for individual failures

Admin confirmed wrong channel: Admin wants to revert to Matrix DM:

bash /opt/hiclaw/agent/skills/channel-management/scripts/manage-primary-channel.sh --action reset

\x3C!-- hiclaw-builtin-end -->

安全使用建议
This skill appears to do what it claims: manage a primary notification channel and maintain a trusted-contacts list. Before installing, verify the following: (1) inspect scripts/manage-primary-channel.sh yourself (it's short and readable) and confirm you are comfortable with it writing ~/primary-channel.json; (2) confirm jq is available in your agent environment (the SKILL.md and provided commands use jq for atomic edits); (3) check the contents and permissions of ~/workers-registry.json (if present) and ~/trusted-contacts.json because the skill will read/update these files — ensure they do not contain secrets you wouldn't want an agent to access; (4) remember the agent may be allowed to invoke the skill autonomously (this skill is not always:true, but model invocation is enabled by default) so limit which agents/users can trigger admin actions and review audit/logging for changes to the JSON files. If any of these points are unacceptable, review or modify the skill files before enabling it.
功能分析
Type: OpenClaw Skill Name: channel-management Version: 1.0.0 The channel-management skill bundle is designed to manage communication preferences and user identity recognition for an OpenClaw agent. It includes instructions in SKILL.md for identifying admins and 'Trusted Contacts' while explicitly directing the agent to ignore unknown users and withhold sensitive information from non-admins. The provided shell script, scripts/manage-primary-channel.sh, safely manages local configuration files using jq with proper argument handling to prevent injection, and no evidence of data exfiltration or malicious execution was found.
能力评估
Purpose & Capability
The name/description match the actual behavior: identifying admin/trusted contacts and managing a primary channel. It reads and writes files in the user's home (~/primary-channel.json and ~/trusted-contacts.json) and references ~/workers-registry.json for Worker identification — the latter file is not declared in the registry metadata but is plausibly part of the agent runtime.
Instruction Scope
SKILL.md explicitly instructs the agent to read and atomically update JSON files in the user's home and to use the built-in message tool for notifications. Those actions are within the skill's scope, but they do mean the agent will execute jq-based shell commands and read files that may contain potentially sensitive runtime data (e.g., workers-registry.json). The skill also instructs to 'silently ignore' unknown senders and to never share secrets — the policy is explicit.
Install Mechanism
This is an instruction-only skill with no install spec. The included shell script is small, self-contained, and stored under scripts/. No downloads or external installers are used.
Credentials
No environment variables or external credentials are requested, which is proportional. One operational omission: the instructions and scripts rely on jq being available but the skill metadata does not declare jq as a required binary; ensure jq is present in the execution environment before relying on atomic JSON updates.
Persistence & Privilege
The skill is not always-enabled and does not request elevated platform privileges. It reads/writes files in the user's home and does not modify other skills or system-wide configuration.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install channel-management
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /channel-management 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
Channel management skill initial release: - Admin identity recognition by channel and sender. - Trusted contacts system for limited interactions; includes add/remove workflows and JSON file storage. - Support for managing and confirming a primary communication channel with file-based state. - Proactive notifications sent via the admin’s chosen channel, with fallback to Matrix DM. - Administrative commands to update or reset the primary channel. - Clear separation of permissions for humans, trusted contacts, and unknown senders.
元数据
Slug channel-management
版本 1.0.0
许可证 MIT-0
累计安装 2
当前安装数 2
历史版本数 1
常见问题

Channel Management 是什么?

Manage multiple communication channels, admin identity recognition, and primary channel configuration. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 130 次。

如何安装 Channel Management?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install channel-management」即可一键安装,无需额外配置。

Channel Management 是免费的吗?

是的,Channel Management 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Channel Management 支持哪些平台?

Channel Management 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Channel Management?

由 Monty(@montycn)开发并维护,当前版本 v1.0.0。

💬 留言讨论