feishu-notify
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseFeishu/Lark Notification
Feishu/Lark 通知
Send a notification: $ARGUMENTS
发送通知:$ARGUMENTS
Overview
概述
This skill provides Feishu/Lark integration for ARIS. It is designed as an internal utility — other skills call it at key events (experiment done, review scored, checkpoint waiting). It can also be invoked manually.
Zero-impact guarantee: If no config exists, this skill does nothing and returns silently. All existing workflows are completely unaffected.
feishu.json本技能为ARIS提供Feishu/Lark集成功能,是一款内部实用工具——其他技能会在关键事件(实验完成、评审打分、等待检查点输入)时调用它,也可手动触发。
零影响保障:若不存在配置文件,本技能将不执行任何操作并静默返回,所有现有工作流完全不受影响。
feishu.jsonConfiguration
配置说明
The skill reads . If this file does not exist, all Feishu functionality is disabled — skills behave exactly as before.
~/.claude/feishu.json本技能会读取文件。若该文件不存在,所有Feishu功能将被禁用——技能的表现与之前完全一致。
~/.claude/feishu.jsonConfig Format
配置格式
json
{
"mode": "push",
"webhook_url": "https://open.feishu.cn/open-apis/bot/v2/hook/YOUR_WEBHOOK_ID",
"interactive": {
"bridge_url": "http://localhost:5000",
"timeout_seconds": 300
}
}json
{
"mode": "push",
"webhook_url": "https://open.feishu.cn/open-apis/bot/v2/hook/YOUR_WEBHOOK_ID",
"interactive": {
"bridge_url": "http://localhost:5000",
"timeout_seconds": 300
}
}Modes
模式说明
| Mode | | What it does | Requires |
|---|---|---|---|
| Off | | Nothing. Pure CLI as-is | Nothing |
| Push only | | Send webhook notifications at key events. Mobile push, no reply | Feishu bot webhook URL |
| Interactive | | Full bidirectional. Approve/reject from Feishu, reply to checkpoints | feishu-claude-code running |
| 模式 | | 功能说明 | 所需条件 |
|---|---|---|---|
| 关闭 | | 不执行任何操作,保持纯CLI原有状态 | 无 |
| 仅推送 | | 在关键事件时发送webhook通知,支持移动端推送,无回复功能 | Feishu机器人webhook地址 |
| 交互式 | | 完整双向交互,可在Feishu中进行审批/拒绝操作、回复检查点问题 | 运行feishu-claude-code桥接服务 |
Workflow
工作流
Step 1: Read Config
步骤1:读取配置
bash
cat ~/.claude/feishu.json 2>/dev/null- File not found → return silently, do nothing
- → return silently, do nothing
"mode": "off" - → proceed to Step 2 (push)
"mode": "push" - → proceed to Step 3 (interactive)
"mode": "interactive"
bash
cat ~/.claude/feishu.json 2>/dev/null- 文件不存在 → 静默返回,不执行任何操作
- → 静默返回,不执行任何操作
"mode": "off" - → 进入步骤2(推送模式)
"mode": "push" - → 进入步骤3(交互式模式)
"mode": "interactive"
Step 2: Push Notification (webhook)
步骤2:推送通知(webhook)
Send a rich card to the Feishu webhook:
bash
curl -s -X POST "$WEBHOOK_URL" \
-H "Content-Type: application/json" \
-d '{
"msg_type": "interactive",
"card": {
"header": {
"title": {"tag": "plain_text", "content": "TITLE"},
"template": "COLOR"
},
"elements": [
{"tag": "markdown", "content": "BODY"}
]
}
}'Card templates by event type:
| Event | Title | Color | Body |
|---|---|---|---|
| Experiment Complete | | Results table, delta vs baseline |
| Review Round N: X/10 | | Score, verdict, top 3 weaknesses |
| Checkpoint: Waiting for Input | | Question, options, context |
| Error: [type] | | Error message, what failed |
| Pipeline Complete | | Final summary, deliverables |
| Custom | | Free-form message from $ARGUMENTS |
Return immediately after curl — push mode never waits for a response.
向Feishu webhook发送富文本卡片:
bash
curl -s -X POST "$WEBHOOK_URL" \
-H "Content-Type: application/json" \
-d '{
"msg_type": "interactive",
"card": {
"header": {
"title": {"tag": "plain_text", "content": "TITLE"},
"template": "COLOR"
},
"elements": [
{"tag": "markdown", "content": "BODY"}
]
}
}'按事件类型分类的卡片模板:
| 事件 | 标题 | 颜色 | 内容 |
|---|---|---|---|
| 实验完成 | | 结果表格、与基准值的差异 |
| 第N轮评审:X/10分 | | 分数、评审结论、Top3问题点 |
| 检查点:等待输入 | | 问题、选项、上下文信息 |
| 错误:[类型] | | 错误信息、失败内容 |
| 流水线完成 | | 最终总结、交付物 |
| 自定义通知 | | 来自$ARGUMENTS的自由格式消息 |
发送curl请求后立即返回——推送模式从不等待响应。
Step 3: Interactive Notification (bidirectional)
步骤3:交互式通知(双向)
Interactive mode uses feishu-claude-code as a bridge:
-
Send message to the bridge:bash
curl -s -X POST "$BRIDGE_URL/send" \ -H "Content-Type: application/json" \ -d '{"type": "EVENT_TYPE", "title": "TITLE", "body": "BODY", "options": ["approve", "reject", "custom"]}' -
Wait for reply (with timeout):bash
curl -s "$BRIDGE_URL/poll?timeout=$TIMEOUT_SECONDS"Returns:or{"reply": "approve"}or{"reply": "reject"}or{"reply": "user typed message"}{"timeout": true} -
On timeout: Fall back tobehavior (proceed with default option).
AUTO_PROCEED -
Return the user's reply to the calling skill so it can act on it.
交互式模式使用feishu-claude-code作为桥接服务:
-
向桥接服务发送消息:bash
curl -s -X POST "$BRIDGE_URL/send" \ -H "Content-Type: application/json" \ -d '{"type": "EVENT_TYPE", "title": "TITLE", "body": "BODY", "options": ["approve", "reject", "custom"]}' -
等待回复(带超时):bash
curl -s "$BRIDGE_URL/poll?timeout=$TIMEOUT_SECONDS"返回结果示例:或{"reply": "approve"}或{"reply": "reject"}或{"reply": "用户输入的消息"}{"timeout": true} -
超时处理:回退到行为(使用默认选项继续执行)。
AUTO_PROCEED -
将用户回复返回给调用技能,以便其执行后续操作。
Step 4: Verify Delivery
步骤4:验证送达状态
- Push mode: Check curl exit code. If non-zero, log warning but do NOT block the workflow.
- Interactive mode: If bridge is unreachable, fall back to push mode (if webhook configured) or skip silently.
- 推送模式:检查curl退出码。若非零,记录警告但绝不阻塞工作流。
- 交互式模式:若桥接服务不可达,回退到推送模式(若已配置webhook)或静默跳过。
Helper Function (for other skills)
辅助函数(供其他技能调用)
Other skills should use this pattern to send notifications:
markdown
undefined其他技能应采用以下模式发送通知:
markdown
undefinedFeishu Notification (if configured)
Feishu通知(若已配置)
Check if exists and mode is not "off":
~/.claude/feishu.json- If push mode: send webhook notification with event summary
- If interactive mode: send notification and wait for user reply
- If off or file absent: skip entirely (no-op)
**This check is always guarded.** If the config file doesn't exist, the skill skips the notification block entirely — zero overhead, zero side effects.检查是否存在且模式不为"off":
~/.claude/feishu.json- 若为推送模式:发送包含事件摘要的webhook通知
- 若为交互式模式:发送通知并等待用户回复
- 若为关闭模式或文件不存在:完全跳过(无操作)
**该检查始终受保护**。若配置文件不存在,技能会完全跳过通知模块——无额外开销、无副作用。Event Catalog
事件目录
Skills send these events at these moments:
| Skill | Event | When |
|---|---|---|
| | After each round's review score |
| | Loop complete (positive or max rounds) |
| | After each round's review score |
| | All rounds complete |
| | Screen session finishes |
| | Between phases (if interactive) |
| | Final report ready |
| | Results collected |
| | Between workflow stages |
| | Full pipeline complete |
各技能会在以下时机发送对应事件:
| 技能 | 事件 | 触发时机 |
|---|---|---|
| | 每轮评审打分完成后 |
| | 循环完成时(无论通过还是达到最大轮次) |
| | 每轮评审打分完成后 |
| | 所有轮次完成时 |
| | 屏幕会话结束时 |
| | 各阶段之间(若为交互式模式) |
| | 最终报告生成时 |
| | 结果收集完成时 |
| | 工作流各阶段之间 |
| | 完整流水线完成时 |
Key Rules
核心规则
- NEVER block a workflow because Feishu is unreachable. Always fail open.
- NEVER require Feishu config — all skills must work without it.
- Config file absent = mode off. No error, no warning, no log.
- Push mode is fire-and-forget. Send curl, check exit code, move on.
- Interactive timeout = auto-proceed. Don't hang forever waiting for a reply.
- Respect : In interactive mode, if the user doesn't reply within timeout, use the same auto-proceed logic as the calling skill.
AUTO_PROCEED - No secrets in notifications. Never include API keys, tokens, or passwords in Feishu messages.
- 绝不要因Feishu不可用而阻塞工作流,始终采用故障开放策略(允许流程继续执行)。
- 绝不强制要求配置Feishu——所有技能在无配置时必须正常工作。
- 配置文件不存在即等同于关闭模式,无错误、无警告、无日志。
- 推送模式为“一发即忘”:发送curl请求,检查退出码,然后继续执行。
- 交互式模式超时即自动继续:不要一直挂起等待回复。
- 遵循规则:在交互式模式下,若用户未在超时时间内回复,使用与调用该技能的父技能相同的自动继续逻辑。
AUTO_PROCEED - 通知中不得包含敏感信息:绝不要在Feishu消息中加入API密钥、令牌或密码。