Feishu Identity Routing
Use this skill when a workspace needs a reusable way to:
- - merge the same human across multiple Feishu apps/accounts
- store app-local
open_id under one canonical user subject - resolve the right
open_id for a target accountId / INLINECODE3 - route outbound actions correctly in multi-agent setups
What to create
Create these workspace files if missing:
- -
identity/feishu-user-master.json — canonical data store - INLINECODE5 — human-readable summary
Core rules
- 1. One person = one subject
- Merge by
union_id first, then INLINECODE7 - Treat
open_id as app-local only - Before any outbound action:
- resolve the user subject globally
- resolve the target app/account-specific
open_id
- build the provider target from that local identity
For Feishu DM routing, use:
- - INLINECODE10
- INLINECODE11
Scripts
Use bundled scripts when you need deterministic updates:
- -
scripts/merge_feishu_identity.js — merge one record - INLINECODE13 — merge many records
- INLINECODE14 — approve/reject pending merges
When to read references
- - Read
references/workflow.md when setting up or extending the process - Read
references/schema-example.json when creating a new master file - Read
references/pending-review-policy.md when conflicts appear - Read
references/outbound-routing-patterns.md when implementing outbound delivery or cross-agent routing - Read
references/examples.md when you want concrete merge/routing examples
Notes
- - Do not hardcode a specific agent like
main or infoIntelOfficer into the design. - Model routing as: global subject resolution → app-context identity selection → provider-specific outbound target.
- Keep the skill reusable across future agents and Feishu accounts.
飞书身份路由
当工作区需要一种可复用的方式来实现以下功能时,请使用此技能:
- - 将同一个人跨多个飞书应用/账号进行合并
- 在同一个规范用户主体下存储应用本地的 openid
- 为目标 accountId / appcontext 解析正确的 open_id
- 在多智能体设置中正确路由出站操作
需要创建的内容
如果缺少以下工作区文件,请创建它们:
- - identity/feishu-user-master.json — 规范数据存储
- identity/feishu-user-master.md — 人类可读的摘要
核心规则
- 1. 一个人 = 一个主体
- 优先按 unionid 合并,其次按 userid
- 将 open_id 视为仅限应用本地
- 在任何出站操作之前:
- 全局解析用户主体
- 解析目标应用/账号特定的 open_id
- 基于该本地身份构建提供者目标
对于飞书私信路由,请使用:
- - accountId=<目标账号>
- target=user:
脚本
当需要确定性更新时,请使用捆绑脚本:
- - scripts/mergefeishuidentity.js — 合并一条记录
- scripts/mergefeishuidentitybatch.js — 合并多条记录
- scripts/reviewfeishu_pending.js — 批准/拒绝待处理的合并
何时阅读参考资料
- - 设置或扩展流程时,阅读 references/workflow.md
- 创建新的主文件时,阅读 references/schema-example.json
- 出现冲突时,阅读 references/pending-review-policy.md
- 实现出站投递或跨智能体路由时,阅读 references/outbound-routing-patterns.md
- 需要具体的合并/路由示例时,阅读 references/examples.md
注意事项
- - 请勿将特定智能体(如 main 或 infoIntelOfficer)硬编码到设计中。
- 将路由建模为:全局主体解析 → 应用上下文身份选择 → 提供者特定出站目标。
- 保持该技能可在未来的智能体和飞书账号中复用。