OpenClaw Feishu Agent 入职标准化工具,覆盖配置 upsert、identity(open_id) 补齐、角色文档模板渲染、飞书与任务合同规范校验、roster/board 同步与重启前审计。
- 配置管理:自动 upsert agent 配置到
openclaw.json - 身份补齐:自动捕获首次私聊 pairing 信息,补齐
open_id - 文档生成:基于模板自动生成 IDENTITY.md、MEMORY.md、AGENTS.md、TASK_POLICY.md
- 规范校验:校验任务合同铁律、消息发送规范
- 群组管理:自动将 bot 加入指定飞书群组
- 培训交接:可选的 coach 培训交接流程
- Python 3.10+
- 已配置的 OpenClaw 环境(
~/.openclaw/openclaw.json) - 飞书开发者账号(App ID / App Secret)
# Step 1: 配置 upsert(先 dry-run)
python3 scripts/ensure_feishu_agent.py upsert \
--agent-id {agent-id} \
--agent-name "{agent-name}" \
--app-id {app-id} \
--app-secret {app-secret} \
--operator-open-id {operator-open-id} \
--dry-run
# 正式执行
python3 scripts/ensure_feishu_agent.py upsert \
--agent-id {agent-id} \
--agent-name "{agent-name}" \
--app-id {app-id} \
--app-secret {app-secret} \
--operator-open-id {operator-open-id}
# Step 2: 捕获首次私聊 identity
python3 scripts/capture_feishu_owner_identity.py \
--account-id {agent-id} \
--approve-pairing
# Step 3: 接入 delivery runtime
python3 scripts/ensure_delivery_runtime_account.py \
--agent-id {agent-id} \
--apply
# Step 4: 渲染角色文档
python3 scripts/scaffold_agent_workspace_docs.py \
--agent-id {agent-id} \
--agent-name "{agent-name}" \
--workspace-dir $OPENCLAW_HOME/workspace-{agent-id} \
--role-summary "{岗位职责}" \
--core-work "{核心工作1}" \
--core-work "{核心工作2}" \
--core-work "{核心工作3}" \
--force
# Step 5: 注入 MEMORY 项目铁律
python3 scripts/inject_agent_memory_rules.py \
--agent-id {agent-id} \
--workspace-dir $OPENCLAW_HOME/workspace-{agent-id} \
--apply
# Step 6: 强制校验
python3 scripts/ensure_feishu_agent.py audit
python3 scripts/validate_memory_feishu_rules.py --agent-id {agent-id}
python3 scripts/validate_agent_workspace_identity.py \
--agent-id {agent-id} \
--agent-name "{agent-name}" \
--workspace-dir $OPENCLAW_HOME/workspace-{agent-id}
python3 scripts/validate_agent_task_contract_rules.py --agent-id {agent-id}
# Step 7: 加入默认群组
python3 scripts/feishu_group_membership.py ensure-bot-groups \
--target-account-id {agent-id} \
--scenario agent_onboarding
# Step 8: 同步 roster/board
python3 scripts/sync_agent_roster.py
# Step 9: 重启 gateway
systemctl --user restart openclaw-gateway.serviceagent-onboarding/
├── SKILL.md # Skill 主文档
├── README.md # 本文件
├── LICENSE # MIT License
├── .gitignore # Git 忽略规则
├── agents/
│ └── openai.yaml # OpenAI Agent 配置模板
├── assets/
│ └── agent-template/ # Agent 文档模板
│ ├── *.tpl # 文档模板文件
│ └── presets/ # 预设配置
├── examples/
│ ├── sample-product-onboarding.md
│ └── sample-repair-onboarding.md
├── references/
│ ├── agent-responsibilities.md
│ ├── cron-template.md
│ ├── identity-template.md
│ ├── memory-template.md
│ ├── openclaw-feishu-best-practice.md
│ ├── supervision-rules.md
│ └── task-contract-spec.md
└── scripts/
├── backfill_agent_task_contract_docs.py
├── capture_feishu_owner_identity.py
├── ensure_delivery_runtime_account.py
├── ensure_feishu_agent.py
├── ensure_python_dependency.py
├── feishu_group_membership.py
├── inject_agent_memory_rules.py
├── openclaw_paths.py
├── quick_validate.py
├── scaffold_agent_workspace_docs.py
├── sync_agent_roster.py
├── trigger_coach_training_handoff.py
├── validate_agent_task_contract_rules.py
├── validate_agent_workspace_identity.py
└── validate_memory_feishu_rules.py
一个可上线的 Agent 需要满足以下 16 项:
- ✅
openclaw.json.agents.list有该 agent - ✅
openclaw.json.bindings有channel=feishu + accountId={agent-id} - ✅
openclaw.json.channels.feishu.accounts有appId/appSecret - ✅
openclaw.json.channels.feishu.userIdentities有 operatoropen_id - ✅
$OPENCLAW_HOME/agents/{agent-id}/agent目录存在 - ✅
$OPENCLAW_HOME/agents/{agent-id}/sessions目录存在 - ✅
workspace-{agent-id}存在且有IDENTITY.md - ✅
IDENTITY.md含三要素:Name / 岗位职责 / 核心工作(>=3) - ✅
MEMORY.md已注入项目化消息铁律 - ✅
openclaw-feishu-delivery项目目录存在且可读 - ✅
openclaw-feishu-delivery/runtime/accounts.local.json已有该 agent - ✅ 目标群组已完成加群
- ✅
agent-roster.json已纳入该 agent - ✅
dispatch-board.json已出现可用窗口 - ✅
TASK_POLICY.md已落地并通过任务合同校验 - ✅ 已完成首次私聊 identity 补齐
# 快速验证 skill 完整性
python3 scripts/quick_validate.py
# 输出 JSON 格式
python3 scripts/quick_validate.py --json- OpenClaw - 多渠道 AI Agent 编排框架
- openclaw-feishu-delivery - 飞书消息投递服务