openclaw-agent-feishu-onboarding
by @absolins
Create OpenClaw agents and onboard Feishu routing with explicit multi-step confirmations. Use when the user needs to (1) define a new agent role and workspac...
clawhub install openclaw-agent-feishu-onboardingπ About This Skill
name: openclaw-agent-feishu-onboarding description: Create OpenClaw agents and onboard Feishu routing with explicit multi-step confirmations. Use when the user needs to (1) define a new agent role and workspace, (2) collect and confirm Feishu route fields including peer.id, (3) apply account/peer bindings, and (4) validate routing and rollback safely.
OpenClaw Agent Feishu Onboarding
Standardize creation of new OpenClaw agents and Feishu route binding. Use this skill for operational execution with strict confirmations.
Runtime Prerequisites
openclaw (CLI available in PATH)
- python (3.x, used by scripts/validate_feishu_bindings.py)
openclaw --version
- python --version
openclaw.json / OPENCLAW_CONFIG_PATH)
- May write local agent and routing state (agents.list[], bindings[])
- Do not run on machines where local config access is not permittedCore Scope
agents.list + workspace + identity).bindings.match with channel/accountId/peer.Required Inputs
agentId (lowercase, digits, hyphen).
- workspace path.
- model id.
- Identity object in agents.list[]:
- use identity object (for example identity.name, identity.emoji, identity.theme)
- do not rely on top-level name only
match.channel: feishu
- match.accountId: for example main
- match.peer.kind: group (or dm when needed)
- match.peer.id: Feishu session id (group id like oc_xxx or dm id)Hard Validation Gates (Must Pass)
agents.list[] entry for new agent must include identity object.identity.name must be set for human-readable routing/debug checks.match.accountId must be one of channels.feishu.accounts keys (for example main).oc_xxx) into match.accountId.match.peer = { kind: "group", id: "oc_xxx" }.match.peer is missing, abort and correct config before continuing.Multi-Step Confirmation Protocol
Do not skip confirmations. Ask and confirm in this exact order.1. Confirmation A: Agent Goal
- Confirm what this agent should do.
- Confirm what this agent must not do.
2. Confirmation B: Agent Configuration
- Confirm agentId, workspace, model, identity fields.
- Confirm naming conventions and collision check (agentId uniqueness).
3. Confirmation C: Feishu Routing Target
- Confirm accountId.
- Confirm peer.kind.
- Confirm peer.id (explicitly state this is the Feishu session id).
- Confirm whether this is a precise peer binding or account-level fallback.
4. Confirmation D: Execution Approval
- Summarize all fields in one compact block.
- Ask for final go/no-go before writing config.
Execution Workflow
1. Discover current state: -openclaw agents list
- openclaw config get agents.list --json
- openclaw config get channels.feishu.accounts --json
- openclaw directory groups list --channel feishu --account --query "" --json
- openclaw config get bindings --json
2. Create agent:
- openclaw agents add ...
- Optional: openclaw agents set-identity ...
3. Apply routing:
- Use openclaw agents bind for account-scoped binding when needed.
- Ensure peer-precise rule exists in top-level bindings[] with match.peer.
4. Validate:
- python -X utf8 ./scripts/validate_feishu_bindings.py --config
- openclaw config validate --json
- ensure target agents.list[] entry has identity.name
- Check bindings[] entry content and ordering.
- Ensure every group-targeted rule has match.peer.kind = "group" and match.peer.id = "oc_xxx".
5. Reload/restart gateway if required by deployment policy.Routing Rules
peer rule is the precise route key for a specific Feishu conversation.match.peer.id to bind a specific session (group oc_xxx).match.accountId: "oc_xxx" without match.peer.Agent list entry should follow this shape:
{
"id": "data-analyst",
"workspace": "C:\\Users\\Administrator\\.openclaw\\workspace-dataAnalysis",
"agentDir": "C:\\Users\\Administrator\\.openclaw\\agents\\data-analyst\\agent",
"identity": {
"name": "data-analyst"
}
}
Canonical peer binding object:
{
"agentId": "",
"match": {
"channel": "feishu",
"accountId": "main",
"peer": {
"kind": "group",
"id": "oc_xxx"
}
}
}
Safety and Rollback
bindings, capture current bindings snapshot.Why It Still Routes to main
peer.id (most common).bindings[] was written but gateway runtime did not reload the latest config.match.accountId mismatched current Feishu account key.agents.list[] entry is malformed (missing required fields such as identity object expected by your convention).