feishu-notify

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Feishu/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
feishu.json
config exists, this skill does nothing and returns silently. All existing workflows are completely unaffected.
本技能为ARIS提供Feishu/Lark集成功能,是一款内部实用工具——其他技能会在关键事件(实验完成、评审打分、等待检查点输入)时调用它,也可手动触发。
零影响保障:若不存在
feishu.json
配置文件,本技能将不执行任何操作并静默返回,所有现有工作流完全不受影响。

Configuration

配置说明

The skill reads
~/.claude/feishu.json
. If this file does not exist, all Feishu functionality is disabled — skills behave exactly as before.
本技能会读取
~/.claude/feishu.json
文件。若该文件不存在,所有Feishu功能将被禁用——技能的表现与之前完全一致。

Config 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
"mode"
value
What it doesRequires
Off
"off"
or file absent
Nothing. Pure CLI as-isNothing
Push only
"push"
Send webhook notifications at key events. Mobile push, no replyFeishu bot webhook URL
Interactive
"interactive"
Full bidirectional. Approve/reject from Feishu, reply to checkpointsfeishu-claude-code running
模式
"mode"
取值
功能说明所需条件
关闭
"off"
或文件不存在
不执行任何操作,保持纯CLI原有状态
仅推送
"push"
在关键事件时发送webhook通知,支持移动端推送,无回复功能Feishu机器人webhook地址
交互式
"interactive"
完整双向交互,可在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
  • "mode": "off"
    → return silently, do nothing
  • "mode": "push"
    → proceed to Step 2 (push)
  • "mode": "interactive"
    → proceed to Step 3 (interactive)
bash
cat ~/.claude/feishu.json 2>/dev/null
  • 文件不存在 → 静默返回,不执行任何操作
  • "mode": "off"
    → 静默返回,不执行任何操作
  • "mode": "push"
    → 进入步骤2(推送模式)
  • "mode": "interactive"
    → 进入步骤3(交互式模式)

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:
EventTitleColorBody
experiment_done
Experiment Complete
green
Results table, delta vs baseline
review_scored
Review Round N: X/10
blue
(≥6) /
orange
(<6)
Score, verdict, top 3 weaknesses
checkpoint
Checkpoint: Waiting for Input
yellow
Question, options, context
error
Error: [type]
red
Error message, what failed
pipeline_done
Pipeline Complete
purple
Final summary, deliverables
custom
Custom
blue
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"}
      ]
    }
  }'
按事件类型分类的卡片模板
事件标题颜色内容
experiment_done
实验完成
green
结果表格、与基准值的差异
review_scored
第N轮评审:X/10分
blue
(≥6分)/
orange
(<6分)
分数、评审结论、Top3问题点
checkpoint
检查点:等待输入
yellow
问题、选项、上下文信息
error
错误:[类型]
red
错误信息、失败内容
pipeline_done
流水线完成
purple
最终总结、交付物
custom
自定义通知
blue
来自$ARGUMENTS的自由格式消息
发送curl请求后立即返回——推送模式从不等待响应。

Step 3: Interactive Notification (bidirectional)

步骤3:交互式通知(双向)

Interactive mode uses feishu-claude-code as a bridge:
  1. 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"]}'
  2. Wait for reply (with timeout):
    bash
    curl -s "$BRIDGE_URL/poll?timeout=$TIMEOUT_SECONDS"
    Returns:
    {"reply": "approve"}
    or
    {"reply": "reject"}
    or
    {"reply": "user typed message"}
    or
    {"timeout": true}
  3. On timeout: Fall back to
    AUTO_PROCEED
    behavior (proceed with default option).
  4. Return the user's reply to the calling skill so it can act on it.
交互式模式使用feishu-claude-code作为桥接服务:
  1. 向桥接服务发送消息
    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"]}'
  2. 等待回复(带超时)
    bash
    curl -s "$BRIDGE_URL/poll?timeout=$TIMEOUT_SECONDS"
    返回结果示例:
    {"reply": "approve"}
    {"reply": "reject"}
    {"reply": "用户输入的消息"}
    {"timeout": true}
  3. 超时处理:回退到
    AUTO_PROCEED
    行为(使用默认选项继续执行)。
  4. 将用户回复返回给调用技能,以便其执行后续操作。

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
undefined

Feishu Notification (if configured)

Feishu通知(若已配置)

Check if
~/.claude/feishu.json
exists and mode is not "off":
  • 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.
检查
~/.claude/feishu.json
是否存在且模式不为"off":
  • 若为推送模式:发送包含事件摘要的webhook通知
  • 若为交互式模式:发送通知并等待用户回复
  • 若为关闭模式或文件不存在:完全跳过(无操作)

**该检查始终受保护**。若配置文件不存在,技能会完全跳过通知模块——无额外开销、无副作用。

Event Catalog

事件目录

Skills send these events at these moments:
SkillEventWhen
/auto-review-loop
review_scored
After each round's review score
/auto-review-loop
pipeline_done
Loop complete (positive or max rounds)
/auto-paper-improvement-loop
review_scored
After each round's review score
/auto-paper-improvement-loop
pipeline_done
All rounds complete
/run-experiment
experiment_done
Screen session finishes
/idea-discovery
checkpoint
Between phases (if interactive)
/idea-discovery
pipeline_done
Final report ready
/monitor-experiment
experiment_done
Results collected
/research-pipeline
checkpoint
Between workflow stages
/research-pipeline
pipeline_done
Full pipeline complete
各技能会在以下时机发送对应事件:
技能事件触发时机
/auto-review-loop
review_scored
每轮评审打分完成后
/auto-review-loop
pipeline_done
循环完成时(无论通过还是达到最大轮次)
/auto-paper-improvement-loop
review_scored
每轮评审打分完成后
/auto-paper-improvement-loop
pipeline_done
所有轮次完成时
/run-experiment
experiment_done
屏幕会话结束时
/idea-discovery
checkpoint
各阶段之间(若为交互式模式)
/idea-discovery
pipeline_done
最终报告生成时
/monitor-experiment
experiment_done
结果收集完成时
/research-pipeline
checkpoint
工作流各阶段之间
/research-pipeline
pipeline_done
完整流水线完成时

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
    AUTO_PROCEED
    : In interactive mode, if the user doesn't reply within timeout, use the same auto-proceed logic as the calling skill.
  • No secrets in notifications. Never include API keys, tokens, or passwords in Feishu messages.
  • 绝不要因Feishu不可用而阻塞工作流,始终采用故障开放策略(允许流程继续执行)。
  • 绝不强制要求配置Feishu——所有技能在无配置时必须正常工作。
  • 配置文件不存在即等同于关闭模式,无错误、无警告、无日志。
  • 推送模式为“一发即忘”:发送curl请求,检查退出码,然后继续执行。
  • 交互式模式超时即自动继续:不要一直挂起等待回复。
  • 遵循
    AUTO_PROCEED
    规则
    :在交互式模式下,若用户未在超时时间内回复,使用与调用该技能的父技能相同的自动继续逻辑。
  • 通知中不得包含敏感信息:绝不要在Feishu消息中加入API密钥、令牌或密码。