← Back to Skills Marketplace
embracex1998

Feishu Agent Bind

by Embracex1998 · GitHub ↗ · v1.0.1 · MIT-0
cross-platform ✓ Security Clean
160
Downloads
0
Stars
0
Active Installs
2
Versions
Install in OpenClaw
/install feishu-agent-bind
Description
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...
README (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.

Usage Guidance
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.
Capability Analysis
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.
Capability Assessment
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.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install feishu-agent-bind
  3. After installation, invoke the skill by name or use /feishu-agent-bind
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
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.
Metadata
Slug feishu-agent-bind
Version 1.0.1
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 2
Frequently Asked Questions

What is 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... It is an AI Agent Skill for Claude Code / OpenClaw, with 160 downloads so far.

How do I install Feishu Agent Bind?

Run "/install feishu-agent-bind" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is Feishu Agent Bind free?

Yes, Feishu Agent Bind is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does Feishu Agent Bind support?

Feishu Agent Bind is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created Feishu Agent Bind?

It is built and maintained by Embracex1998 (@embracex1998); the current version is v1.0.1.

💬 Comments