CRITICAL — Before starting, MUST first use the Read tool to read ../lark-shared/SKILL.md, which contains authentication and permission handling
Applicable Scenarios
- "Zhang San is starting today, help him get set up" / "new hire onboarding"
- "Execute new hire onboarding checklist: Zhang San, Engineering Department" / "onboarding guidance"
- "Help me run through the new employee onboarding process" / "onboarding process"
- "A new colleague is starting, help him create onboarding tasks" / "welcome new hire"
Prerequisites
Mixed identity:user(create groups, create tasks, schedules) and bot(send messages).
lark-cli auth login --domain im,contact,task,calendar
Workflow
{新员工信息: 姓名, 部门, 岗位, [HR open_id], [直属经理 open_id]}
│
├── contact +search-user ─────────► 查找新员工 open_id
│
├── im +messages-send ────────────► ① 发送欢迎消息
│
├── im chat.members create ───────► ② 添加到部门群/项目群
│
├── task +create ─────────────────► ③ 创建入职任务清单(串行,间隔 1s)
│
├── calendar +create ─────────────► ④ 设置日历提醒
│ ├── 30天试用期评估
│ └── 团队迎新会
│
└── im +messages-send ────────────► ⑤ 通知 HR + 直属经理
Step 1: Find the new employee
lark-cli contact +search-user --query "<新员工姓名>" --as user
Extract from the returned result open_id(ou_xxx format). If not found, prompt the user to provide the name or open_id.
Step 2: Send welcome message
lark-cli im +messages-send \
--user-id "<new_user_open_id>" \
--markdown "欢迎加入{公司/团队名}!
以下是入职指南:
1. 完成账号和权限初始化
2. 加入相关群聊
3. 领取办公设备
4. 了解团队协作方式
如有任何问题,随时联系你的导师或 HR。" \
--as bot
Note: The welcome message can be customized based on department and position. Company wiki links, employee handbook, and other resources can be attached.
Step 3: Add to group chat
# 先查看 schema 确认参数
lark-cli schema im.chat.members.create
# 添加到部门群(需要 user 身份)
lark-cli im chat.members create \
--params '{"chat_id":"<dept_chat_id>","member_id_type":"open_id","succeed_type":1}' \
--data '{"id_list":["<new_user_open_id>"]}' \
--as user
If multiple groups need to be added, call them one by one with a 1-second interval between each call.
Note:
succeed_type: 1=join directly without verification (suitable for internal groups)- If the bot is not in the group, the bot needs to be added to the group first
- The other party must be a user within the same tenant
Step 4: Create onboarding task checklist
Create onboarding tasks one by one (1-second interval between each, to avoid rate limiting):
# 任务1:领取办公设备
lark-cli task +create \
--summary "领取办公设备({姓名})" \
--description "联系 IT 部门领取笔记本电脑、显示器等办公设备" \
--due "<7天后日期>" \
--as user
# 任务2:完成入职培训
lark-cli task +create \
--summary "完成入职培训({姓名})" \
--description "完成公司在线培训课程,包括安全培训、合规培训等" \
--due "<14天后日期>" \
--as user
# 任务3:认识团队成员
lark-cli task +create \
--summary "认识团队成员({姓名})" \
--description "与团队成员逐一交流,了解协作方式和项目背景" \
--due "<7天后日期>" \
--as user
# 任务4:完成试用期目标设定
lark-cli task +create \
--summary "完成试用期目标设定({姓名})" \
--description "与直属经理讨论并确定试用期工作目标和考核标准" \
--due "<14天后日期>" \
--as user
Note:
--dueUse the systemdatecommand to calculate the target date, do not calculate mentally. Record task_id after task creation.
Step 5: Set calendar reminders
# 30天试用期评估提醒
lark-cli calendar +create \
--summary "30天试用期评估 - {姓名}" \
--start "<30天后 10:00>" \
--end "<30天后 11:00>" \
--as user
# 团队迎新会(如适用)
lark-cli calendar +create \
--summary "团队迎新会 — 欢迎{姓名}" \
--start "<本周五 15:00>" \
--end "<本周五 16:00>" \
--attendee-ids "<new_user_open_id>,<manager_open_id>" \
--as user
Note: Confirm the time and content with the user before creating schedules to avoid misoperation.
Step 6: Notify HR and direct manager
# 通知 HR
lark-cli im +messages-send \
--user-id "<hr_open_id>" \
--markdown "新员工入职通知
姓名:{姓名}
部门:{部门}
岗位:{岗位}
入职日期:{日期}
入职引导已完成以下操作:
- 已发送欢迎消息
- 已添加到部门群
- 已创建入职任务清单
- 已设置试用期评估提醒" \
--as bot
# 通知直属经理
lark-cli im +messages-send \
--user-id "<manager_open_id>" \
--markdown "您团队的新成员 {姓名} 今日入职!
已为 {姓名} 创建了入职任务清单和试用期评估提醒。
请在本周内与 {姓名} 讨论试用期目标。" \
--as bot
Fallback Strategy
| Scenario | Fallback Plan |
|---|---|
| New employee not found | Prompt the user to provide open_id |
| Failed to add to group chat | List the failed group chats and let the user add manually |
| Task creation rate limit | Slow down creation speed, 2-second interval |
| Schedule creation failed | Only create tasks, let the user add schedules manually |
| HR/manager open_id unknown | Ask the user to provide it, or skip the notification step |
Permission Table
| Command | Required scope |
|---|---|
contact +search-user |
contact:user.base:readonly |
im +messages-send |
im:message |
im chat.members create |
im:chat.member:write |
task +create |
task:task:write |
calendar +create |
calendar:calendar:write, calendar:event:write |
References
../lark-contact/SKILL.md— Contact query../lark-im/SKILL.md— IM operations../lark-task/SKILL.md— Task management../lark-calendar/SKILL.md— Calendar operations