返回顶部
l

linear-webhook线性网络钩子

Comment @mason or @eureka in Linear issues to dispatch tasks to agents. Webhook receives Linear comments and routes to correct agent.

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 1.0.0
安全检测
已通过
1,695
下载量
免费
免费
0
收藏
概述
安装方式
版本历史

linear-webhook

Linear Webhook 技能

支持通过 Linear 问题的评论 @提及 将任务分派给 Clawdbot 智能体。

工作原理

  1. 1. 在 Linear 中评论: @mason 实现用户认证 或 @eureka 规划 Q2 路线图
  2. Linear webhook 触发 在评论创建时
  3. Clawdbot 接收 webhook 通过暴露的端点
  4. 转换模块解析载荷:
- 提取 @mason 或 @eureka 提及 - 获取问题上下文(标题、描述、标签) - 准备任务提示
  1. 5. 路由到智能体会话:
- @mason → mason 智能体(代码/实现) - @eureka → eureka 智能体(规划/策略)
  1. 6. 智能体处理任务 并返回结果
  2. 结果回帖 作为 Linear 评论

设置

1. 配置 Clawdbot Webhook

添加到您的 config.json5:

json5
{
hooks: {
enabled: true,
token: your-secret-token-here, // 使用 openssl rand -base64 32 生成
path: /hooks,
transformsDir: /home/sven/clawd-mason/skills/linear-webhook,
mappings: [
{
name: linear,
match: {
path: /linear,
method: POST
},
action: agent,
transform: {
module: ./linear-transform.js,
export: transformLinearWebhook
},
deliver: false, // 不自动发送到聊天 - Linear 评论处理响应
}
]
}
}

2. 暴露 Webhook 端点

使用 Cloudflare Tunnel 或 Tailscale Funnel 使 webhook 可公开访问:

选项 A:Cloudflare Tunnel(推荐)
bash

如需安装


brew install cloudflared

启动隧道(替换为您的域名)

cloudflared tunnel --url http://localhost:18789

选项 B:Tailscale Funnel
bash

启用 funnel


tailscale funnel 18789

记下公共 URL(例如 https://your-tunnel.trycloudflare.com)

3. 配置 Linear Webhook

  1. 1. 进入 Linear 设置 → API → Webhooks
  2. 点击创建新 webhook
  3. 设置 URL:https://your-tunnel.trycloudflare.com/hooks/linear
  4. 添加自定义标头:x-clawdbot-token: your-secret-token-here
  5. 选择事件:评论 → 已创建
  6. 保存 webhook

4. 测试

在 Linear 问题中评论:

@mason 在登录页面添加用户认证

预期流程:

  1. 1. Webhook 触发到 Clawdbot
  2. Mason 智能体接收任务
  3. Mason 实现或响应
  4. 结果回帖到 Linear 问题作为评论

智能体路由

  • - @mason → 代码实现、调试、技术任务
  • @eureka → 规划、策略、研究、沟通
  • 其他提及 → 忽略(不处理)

提供的问题上下文

智能体接收:

  • - 问题标题
  • 问题描述
  • 问题标签
  • 评论文本(@提及)
  • 问题 URL
  • 评论者姓名

自定义

添加更多智能体

编辑 linear-transform.js:

javascript
const AGENT_MENTIONS = {
@mason: mason,
@eureka: eureka,
@designer: designer, // 添加您自己的智能体
};

更改响应行为

修改配置中的 deliver 和 channel:

json5
{
deliver: true,
channel: telegram,
to: 1878354815, // 您的 Telegram 聊天 ID
}

这也会将智能体响应发送到 Telegram。

安全性

  • - 切勿将 hook 令牌 提交到版本控制
  • 使用环境变量:CLAWDBOTHOOKTOKEN
  • 验证 webhook 来源(必要时使用 Linear 的 IP 范围)
  • 仅使用 HTTPS(Cloudflare Tunnel 提供此功能)

故障排除

Webhook 未触发

  • - 检查 Linear webhook 日志(设置 → API → Webhooks → 查看日志)
  • 验证隧道正在运行:curl https://your-tunnel.trycloudflare.com/hooks/linear
  • 检查 Clawdbot 日志:clawdbot gateway logs

智能体未响应

  • - 检查转换模块是否加载:查看网关日志中的错误
  • 验证智能体会话存在:clawdbot sessions list
  • 手动测试转换模块:node linear-transform.js

响应未发布到 Linear

  • - 在转换模块中实现 Linear API 评论发布
  • 将 Linear API 令牌添加到配置
  • 参见 linear-transform.js 示例

Linear API 访问

要将评论回帖到 Linear,您需要一个 Linear API 令牌:

  1. 1. 进入 Linear 设置 → API → 个人 API 密钥
  2. 创建具有 write 作用域的新令牌
  3. 添加到环境:CLAWDBOTLINEARAPIKEY=linapi_...
  4. 转换模块将使用此令牌发布响应

文件

  • - SKILL.md - 本文档
  • linear-transform.js - Webhook 载荷解析器和智能体路由器
  • linear-api.js - Linear GraphQL API 客户端(用于发布评论)
  • example-payload.json - 用于测试的示例 Linear webhook 载荷

参考

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 linear-webhook-1776378934 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 linear-webhook-1776378934 技能

通过命令行安装

skillhub install linear-webhook-1776378934

下载

⬇ 下载 linear-webhook v1.0.0(免费)

文件大小: 13.02 KB | 发布时间: 2026-4-17 14:31

v1.0.0 最新 2026-4-17 14:31
Initial release of linear-webhook skill.

- Enables dispatching tasks to Clawdbot agents through @mentions in Linear issue comments.
- Webhook listens for Linear comment events and routes tasks to the correct agent (e.g., @mason for implementation, @eureka for strategy).
- Includes detailed setup and configuration instructions for webhooks, agent routing, and security.
- Supports customization for adding more agents and changing response behavior.
- Provides troubleshooting and Linear API integration guidance.

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部