Skip to content

mileson/agent-onboarding

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Agent Onboarding Skill

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)

入职新 Agent

# 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.service

目录结构

agent-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

入职检查清单(16 项)

一个可上线的 Agent 需要满足以下 16 项:

  1. openclaw.json.agents.list 有该 agent
  2. openclaw.json.bindingschannel=feishu + accountId={agent-id}
  3. openclaw.json.channels.feishu.accountsappId/appSecret
  4. openclaw.json.channels.feishu.userIdentities 有 operator open_id
  5. $OPENCLAW_HOME/agents/{agent-id}/agent 目录存在
  6. $OPENCLAW_HOME/agents/{agent-id}/sessions 目录存在
  7. workspace-{agent-id} 存在且有 IDENTITY.md
  8. IDENTITY.md 含三要素:Name / 岗位职责 / 核心工作(>=3)
  9. MEMORY.md 已注入项目化消息铁律
  10. openclaw-feishu-delivery 项目目录存在且可读
  11. openclaw-feishu-delivery/runtime/accounts.local.json 已有该 agent
  12. ✅ 目标群组已完成加群
  13. agent-roster.json 已纳入该 agent
  14. dispatch-board.json 已出现可用窗口
  15. TASK_POLICY.md 已落地并通过任务合同校验
  16. ✅ 已完成首次私聊 identity 补齐

开发与测试

# 快速验证 skill 完整性
python3 scripts/quick_validate.py

# 输出 JSON 格式
python3 scripts/quick_validate.py --json

许可证

MIT License

相关项目

About

OpenClaw Feishu Agent 入职标准化工具 - 覆盖配置 upsert、identity 补齐、角色文档模板渲染、飞书与任务合同规范校验

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors