Skills openclaw-agent-feishu-onboarding
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.
install
source · Clone the upstream repo
git clone https://github.com/openclaw/skills
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/openclaw/skills "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/absolins/openclaw-agent-feishu-onboarding" ~/.claude/skills/openclaw-skills-openclaw-agent-feishu-onboarding && rm -rf "$T"
OpenClaw · Install into ~/.openclaw/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/openclaw/skills "$T" && mkdir -p ~/.openclaw/skills && cp -r "$T/skills/absolins/openclaw-agent-feishu-onboarding" ~/.openclaw/skills/openclaw-skills-openclaw-agent-feishu-onboarding && rm -rf "$T"
manifest:
skills/absolins/openclaw-agent-feishu-onboarding/SKILL.mdsource content
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
- Required binaries:
(CLI available in PATH)openclaw
(3.x, used bypython
)scripts/validate_feishu_bindings.py
- Preflight checks:
openclaw --versionpython --version
- Data access behavior:
- Reads local OpenClaw config (
/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 permitted
- Reads local OpenClaw config (
Core Scope
- Create a new agent (
+ workspace + identity).agents.list - Confirm Feishu route target fields before any write.
- Bind routing using
withbindings.match
.channel/accountId/peer - Verify final route and provide rollback steps.
Required Inputs
- Agent intent:
- Agent purpose and responsibility boundary.
- Explicit out-of-scope items.
- Agent spec:
(lowercase, digits, hyphen).agentId
path.workspace
id.model- Identity object in
:agents.list[]- use
object (for exampleidentity
,identity.name
,identity.emoji
)identity.theme - do not rely on top-level
onlyname
- use
- Feishu route spec:
:match.channelfeishu
: for examplematch.accountIdmain
:match.peer.kind
(orgroup
when needed)dm
: Feishu session id (group id likematch.peer.id
or dm id)oc_xxx
Hard Validation Gates (Must Pass)
entry for new agent must includeagents.list[]
object.identity
must be set for human-readable routing/debug checks.identity.name
must be one ofmatch.accountId
keys (for examplechannels.feishu.accounts
).main- Never put Feishu group/session id (
) intooc_xxx
.match.accountId - Group routing must include
.match.peer = { kind: "group", id: "oc_xxx" } - If routing is for a specific group but
is missing, abort and correct config before continuing.match.peer - Before write, print the final binding object and require explicit confirmation.
Multi-Step Confirmation Protocol
Do not skip confirmations. Ask and confirm in this exact order.
- Confirmation A: Agent Goal
- Confirm what this agent should do.
- Confirm what this agent must not do.
- Confirmation B: Agent Configuration
- Confirm
,agentId
, model, identity fields.workspace - Confirm naming conventions and collision check (
uniqueness).agentId
- Confirm
- Confirmation C: Feishu Routing Target
- Confirm
.accountId - Confirm
.peer.kind - Confirm
(explicitly state this is the Feishu session id).peer.id - Confirm whether this is a precise peer binding or account-level fallback.
- Confirm
- Confirmation D: Execution Approval
- Summarize all fields in one compact block.
- Ask for final go/no-go before writing config.
Execution Workflow
- Discover current state:
openclaw agents listopenclaw config get agents.list --jsonopenclaw config get channels.feishu.accounts --jsonopenclaw directory groups list --channel feishu --account <account-id> --query "<keyword>" --jsonopenclaw config get bindings --json
- Create agent:
openclaw agents add ...- Optional:
openclaw agents set-identity ...
- Apply routing:
- Use
for account-scoped binding when needed.openclaw agents bind - Ensure peer-precise rule exists in top-level
withbindings[]
.match.peer
- Use
- Validate:
python -X utf8 ./scripts/validate_feishu_bindings.py --config <openclaw.json-path>openclaw config validate --json- ensure target
entry hasagents.list[]identity.name - Check
entry content and ordering.bindings[] - Ensure every group-targeted rule has
andmatch.peer.kind = "group"
.match.peer.id = "oc_xxx"
- Reload/restart gateway if required by deployment policy.
Routing Rules
rule is the precise route key for a specific Feishu conversation.peer- Use
to bind a specific session (groupmatch.peer.id
).oc_xxx - If both peer-level and account-level bindings exist, keep peer rule first.
- Avoid broad fallback rules until peer-specific routes are confirmed.
- Wrong example (forbidden):
withoutmatch.accountId: "oc_xxx"
.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": "<agent-id>", "match": { "channel": "feishu", "accountId": "main", "peer": { "kind": "group", "id": "oc_xxx" } } }
Safety and Rollback
- Never delete agents unless explicitly requested.
- Before changing
, capture currentbindings
snapshot.bindings - If wrong route is applied, revert to previous binding set and re-validate.
- Prefer reversible, explicit changes and post-change verification.
Why It Still Routes to main
main- Binding did not match the real incoming
(most common).peer.id
was written but gateway runtime did not reload the latest config.bindings[]
mismatched current Feishu account key.match.accountId- Target agent exists but
entry is malformed (missing required fields such asagents.list[]
object expected by your convention).identity - Message arrived in a different conversation than the configured group.
References
- Command examples and rollback snippets: commands.md
- Chinese runbook and confirmation checklist: usage-zh.md
- Auto-check script: validate_feishu_bindings.py