← 返回 Skills 市场
embracex1998

Feishu Agent Bind

作者 Embracex1998 · GitHub ↗ · v1.0.1 · MIT-0
cross-platform ✓ 安全检测通过
160
总下载
0
收藏
0
当前安装
2
版本数
在 OpenClaw 中安装
/install feishu-agent-bind
功能描述
Bind a Feishu group chat to a specific OpenClaw agent. Use when user wants to route a Feishu group to a dedicated agent (e.g., devops, hr, pm). Covers agent...
使用说明 (SKILL.md)

Feishu Group → Agent Binding

Route a Feishu group to a specific agent with isolated workspace.

Prerequisites

  • Agent must exist in agents.list (create via openclaw agents add \x3Cid>)
  • Agent must have its own workspace (NOT shared with main)
  • Gateway running

Steps

1. Ensure agent has independent workspace

# Check current config
openclaw config get agents.list | jq '.[] | select(.id=="\x3CagentId>") | .workspace'

If workspace is shared with main (~/.openclaw/workspace), create a dedicated one:

mkdir -p ~/.openclaw/workspace-\x3CagentId>/memory

Write at minimum SOUL.md and AGENTS.md into the new workspace. Then update config:

import json
with open(os.path.expanduser('~/.openclaw/openclaw.json')) as f:
    c = json.load(f)
for a in c['agents']['list']:
    if a['id'] == '\x3CagentId>':
        a['workspace'] = os.path.expanduser(f'~/.openclaw/workspace-\x3CagentId>')
        break
with open(os.path.expanduser('~/.openclaw/openclaw.json'), 'w') as f:
    json.dump(c, f, indent=2, ensure_ascii=False)

2. Add group to channels.feishu.groups (optional but recommended)

# Add group config
fs_groups = c['channels']['feishu'].setdefault('groups', {})
fs_groups['\x3Cchat_id>'] = {'requireMention': False}

3. Add binding with accountId (CRITICAL)

Must include accountId matching the Feishu account (usually "main"), otherwise the binding is silently ignored during route matching.

bindings = c.get('bindings', [])
bindings.append({
    "agentId": "\x3CagentId>",
    "match": {
        "channel": "feishu",
        "peer": {"kind": "group", "id": "\x3Cchat_id>"},
        "accountId": "\x3Cfeishu_account_id>"  # e.g. "main"
    }
})
c['bindings'] = bindings

Or via CLI:

# Get existing bindings first
openclaw config get bindings

# Set all bindings (existing + new)
openclaw config set --json bindings '[...existing..., {"agentId":"\x3CagentId>","match":{"channel":"feishu","peer":{"kind":"group","id":"\x3Cchat_id>"},"accountId":"main"}}]'

4. Clean up stale sessions

If the group was previously handled by another agent, delete its old session to avoid cache issues:

# Find old sessions
openclaw sessions --all-agents --json | grep "\x3Cchat_id>"

# Delete from the old agent's session store
python3 -c "
import json, glob
for f in glob.glob(os.path.expanduser('~/.openclaw/agents/*/sessions/sessions.json')):
    with open(f) as fh: d = json.load(fh)
    keys = [k for k in d if '\x3Cchat_id>' in k]
    if keys:
        for k in keys: del d[k]
        with open(f,'w') as fh: json.dump(d, fh)
        print(f'Cleaned {f}: {keys}')
"

5. Restart gateway

openclaw gateway restart

6. Verify

# Check bindings
openclaw config get bindings

# Check sessions hit the right agent
openclaw status | grep "\x3Cchat_id>"
# Should show agent:\x3CagentId>:feishu:group:\x3Cchat_id>

Pitfalls (learned the hard way)

  1. Missing accountId in binding: Binding without accountId defaults to matching account "default", not "main". The Feishu plugin passes its actual account ID (e.g. "main"), so the binding is never matched. Always set accountId explicitly.

  2. Shared workspace: If multiple agents share the same workspace, they read the same SOUL.md/BOOTSTRAP.md and confuse identities. Always use separate workspaces.

  3. Stale sessions: Old sessions cached under a different agent persist after binding changes. Delete them manually.

  4. Gateway restart required: Binding changes need a full gateway restart to take effect.

  5. openclaw agents bind CLI pitfall: The CLI command openclaw agents bind --agent X --bind feishu:\x3Cchat_id> sets accountId=\x3Cchat_id> instead of peer.id=\x3Cchat_id>. This is wrong for group routing. Use config set --json bindings directly instead.

  6. Binding order matters: When multiple bindings match, first one wins. Put specific peer bindings before account-level bindings.

安全使用建议
This skill is coherent with its purpose but performs direct edits to your OpenClaw configuration and session stores — do not run the snippets blindly. Before applying: 1) make a backup of ~/.openclaw/openclaw.json and any sessions files; 2) ensure you replace placeholders (<agentId>, <chat_id>, <feishu_account_id>) correctly; 3) prefer to manually inspect the JSON you will write (use openclaw config get and openclaw config set safely); 4) be aware the cleanup step deletes session entries across all agents — confirm those files/keys before removal; 5) note small bugs in snippets (missing imports/undefined variables) — adapt them to your environment. If you want, provide your openclaw.json (sanitized) or the exact commands you plan to run and I can help craft safe, correct commands.
功能分析
Type: OpenClaw Skill Name: feishu-agent-bind Version: 1.0.1 The skill bundle provides administrative instructions and scripts for binding Feishu group chats to specific OpenClaw agents. It involves standard configuration tasks such as modifying the local 'openclaw.json' file, creating workspace directories, and cleaning up session files via Python and shell commands. All actions are transparently documented in SKILL.md and are strictly aligned with the stated purpose of managing agent routing and workspace isolation without any indicators of malicious intent or data exfiltration.
能力评估
Purpose & Capability
Name/description (bind Feishu group to an agent) match the SKILL.md steps: creating per-agent workspace, updating openclaw.json bindings, cleaning sessions, and restarting the gateway. All requested actions are coherent for this purpose.
Instruction Scope
SKILL.md instructs direct modification of ~/.openclaw/openclaw.json, adding bindings, creating per-agent workspace directories, and deleting session entries across ~/.openclaw/agents/*/sessions/sessions.json. These are powerful file-write operations but are within scope for reassigning group routing. The doc contains small code-snippet issues (e.g., use of os without import, reliance on an earlier 'c' variable) — those are usability bugs, not evidence of malicious intent. Users should back up config files before applying changes.
Install Mechanism
Instruction-only skill with no install spec and no code files; nothing is written to disk by an installer and there are no remote downloads or package installs to inspect.
Credentials
No environment variables, credentials, or external tokens are requested. The single critical requirement noted in the doc is to set the correct 'accountId' inside the local OpenClaw binding — this is configuration data, not a secret. No disproportionate credential access is requested.
Persistence & Privilege
The skill is not always-enabled and does not request persistent platform privileges. It instructs local edits to OpenClaw config and session files (expected for its purpose) but does not modify other skills or system-wide settings beyond OpenClaw's own config.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install feishu-agent-bind
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /feishu-agent-bind 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.1
修复:优化发布流程
v1.0.0
feishu-agent-bind v1.0.0 - Initial release to route Feishu group chats to specific OpenClaw agents with isolated workspaces. - Includes documentation on agent workspace setup, group and account binding configuration, and session management. - Highlights critical requirements such as `accountId` inclusion and session cleanup steps. - Lists common pitfalls to avoid misconfiguration and troubleshooting tips. - Requires a gateway restart after binding changes for them to take effect.
元数据
Slug feishu-agent-bind
版本 1.0.1
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 2
常见问题

Feishu Agent Bind 是什么?

Bind a Feishu group chat to a specific OpenClaw agent. Use when user wants to route a Feishu group to a dedicated agent (e.g., devops, hr, pm). Covers agent... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 160 次。

如何安装 Feishu Agent Bind?

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

Feishu Agent Bind 是免费的吗?

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

Feishu Agent Bind 支持哪些平台?

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

谁开发了 Feishu Agent Bind?

由 Embracex1998(@embracex1998)开发并维护,当前版本 v1.0.1。

💬 留言讨论