Community编程与开发github.com

ComposioHQ/Sentry-Triage

诊断 Sentry 问题,无需手动复制粘贴堆栈跟踪。使用 Composio CLI 拉取问题详情、事件、面包屑和可疑提交,然后将堆栈帧映射到本地源代码,让代理直接提出修复方案。

Sentry-Triage 是什么?

Sentry Triage 是一个 AI 代理技能,专为在 Sentry 错误监控平台上进行高效问题诊断而设计。它通过 Composio CLI 直接与 Sentry API 交互,自动获取问题详情、最新事件、完整堆栈跟踪和面包屑,甚至包括版本发布追踪中的可疑提交。该技能的核心优势在于消除了开发者手动复制粘贴堆栈跟踪的繁琐工作——代理可以自动将堆栈中的每个帧映射到本地源代码文件,并读取上下行代码,从而快速定位根因并提出带 diff 的修复方案。此外,它还支持批量分类未解决事件、生成排名摘要,并能与 Linear 或 Slack 等工具链集成,自动创建任务工单。该技能支持在 Claude Code、Cursor 或任何兼容 Composio 的终端环境或工作流文件中使用。

兼容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/ComposioHQ/awesome-codex-skills/tree/main/sentry-triage

Installed? Explore more 编程与开发 skills: steipete/bluebubbles, steipete/eightctl, steipete/blucli · View all 6 →

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

Sentry 分类

通过 Composio CLI 将 Sentry 问题、事件和可疑提交直接拉入代理。省去复制-粘贴-堆栈跟踪的繁琐过程。

使用时机

  • 收到新的 Sentry 警报时,希望代理进行调查,而不是仅仅引用标题行。
  • 诊断回归问题:找到发布版本、可疑提交和受影响文件。
  • 构建“前 10 个未解决问题”摘要,包含复现提示。

前置条件

curl -fsSL https://composio.dev/install | bash
composio login
composio link sentry        # 需要 event:read + project:read 权限的认证令牌

发现工具

composio search "get sentry issue" --toolkits sentry
composio search "list events for issue" --toolkits sentry
composio tools list sentry

常用操作标识(通过 --get-schema 验证):

  • SENTRY_GET_AN_ISSUE
  • SENTRY_LIST_AN_ISSUES_EVENTS
  • SENTRY_RETRIEVE_AN_EVENT_FOR_A_PROJECT
  • SENTRY_LIST_A_PROJECTS_ISSUES
  • SENTRY_UPDATE_AN_ISSUE

诊断单个问题

  1. 获取问题(使用短 ID,如 PROJ-1F4 或数字 ID):
    composio execute SENTRY_GET_AN_ISSUE -d '{"issue_id":"PROJ-1F4"}'
    
  2. 获取最新事件,包含完整堆栈和面包屑:
    composio execute SENTRY_LIST_AN_ISSUES_EVENTS \
      -d '{"issue_id":"PROJ-1F4","full":true,"limit":1}'
    
  3. 将每个堆栈帧映射到本地源代码。 对于堆栈中的每个 filename 和 lineno,代理打开文件并读取 ±20 行。无需手动复制粘贴。
  4. 检查可疑提交(当设置了版本发布追踪时,Sentry 会附加这些信息)—— 使用 git show <sha> 在本地打开它们。
  5. 提出修复方案,附带 diff,运行测试,测试通过后将问题标记为已解决:
    composio execute SENTRY_UPDATE_AN_ISSUE \
      -d '{"issue_id":"PROJ-1F4","status":"resolved","statusDetails":{"inNextRelease":true}}'
    

批量分类

composio execute SENTRY_LIST_A_PROJECTS_ISSUES -d '{
  "organization_slug":"acme",
  "project_slug":"api",
  "query":"is:unresolved age:-24h",
  "sort":"freq",
  "limit":20
}'

通过管道传递给 jq 以生成排名摘要:

composio execute SENTRY_LIST_A_PROJECTS_ISSUES -d '{"organization_slug":"acme","project_slug":"api","query":"is:unresolved"}' \
  | jq -r '.[] | "\(.count)\t\(.shortId)\t\(.title)"' | sort -rn | head

工作流文件

scripts/sentry-diag.ts,使用 composio run --file scripts/sentry-diag.ts -- --id PROJ-1F4 运行:

const id = process.argv[process.argv.indexOf("--id") + 1];

const issue = await execute("SENTRY_GET_AN_ISSUE", { issue_id: id });
const [event] = await execute("SENTRY_LIST_AN_ISSUES_EVENTS", {
  issue_id: id, full: true, limit: 1
});

const frames = (event?.entries ?? [])
  .filter(e => e.type === "exception")
  .flatMap(e => e.data.values.flatMap(v => v.stacktrace?.frames ?? []))
  .filter(f => f.inApp)
  .map(f => ({ file: f.filename, line: f.lineno, fn: f.function }));

console.log(JSON.stringify({ title: issue.title, culprit: issue.culprit, frames }, null, 2));

然后代理读取每个 file 在 line ± 20 的位置,并草拟补丁。

路由到 Linear / Slack

链式调用工具,为最严重的未解决问题创建工单:

composio run '
  const [top] = await execute("SENTRY_LIST_A_PROJECTS_ISSUES", {
    organization_slug: "acme", project_slug: "api",
    query: "is:unresolved", sort: "freq", limit: 1
  });
  await execute("LINEAR_CREATE_ISSUE", {
    teamId: "TEAM_ID",
    title: `[Sentry] ${top.title}`,
    description: `Short ID: ${top.shortId}\nPermalink: ${top.permalink}\nCount: ${top.count}`
  });
'

故障排除

  • 404 on issue_id → 使用短 ID(如 PROJ-1F4),而不是 URL 路径格式。
  • 空事件 → 问题已解决/归档;使用 query:"is:resolved" 查询或增加 limit。
  • 缺少可疑提交 → Sentry 中未配置版本发布追踪;在 CI 中设置 sentry-cli releases。
  • 没有 inApp 帧 → 未上传 source map;堆栈将仅显示供应商代码。

完整的 CLI 参考: docs.composio.dev/docs/cli

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

ComposioHQ/-21risk-automation

Automate 21risk tasks via Rube MCP (Composio). Always search tools first for current schemas.

ComposioHQ/-2chat-automation

Automate 2chat tasks via Rube MCP (Composio). Always search tools first for current schemas.

ComposioHQ/ably-automation

Automate Ably tasks via Rube MCP (Composio). Always search tools first for current schemas.

ComposioHQ/abstract-automation

Automate Abstract tasks via Rube MCP (Composio). Always search tools first for current schemas.

ComposioHQ/abuselpdb-automation

Automate Abuselpdb tasks via Rube MCP (Composio). Always search tools first for current schemas.

ComposioHQ/abyssale-automation

Automate Abyssale tasks via Rube MCP (Composio). Always search tools first for current schemas.

ComposioHQ/accelo-automation

Automate Accelo tasks via Rube MCP (Composio). Always search tools first for current schemas.

ComposioHQ/accredible-certificates-automation

Automate Accredible Certificates tasks via Rube MCP (Composio). Always search tools first for current schemas.

ComposioHQ/acculynx-automation

Automate Acculynx tasks via Rube MCP (Composio). Always search tools first for current schemas.

ComposioHQ/active-campaign-automation

Automate ActiveCampaign tasks via Rube MCP (Composio). Always search tools first for current schemas.

ComposioHQ/addresszen-automation

Automate Addresszen tasks via Rube MCP (Composio). Always search tools first for current schemas.

ComposioHQ/adobe-automation

Automate Adobe tasks via Rube MCP (Composio). Always search tools first for current schemas.

ComposioHQ/adrapid-automation

Automate Adrapid tasks via Rube MCP (Composio). Always search tools first for current schemas.

ComposioHQ/adyntel-automation

Automate Adyntel tasks via Rube MCP (Composio). Always search tools first for current schemas.

ComposioHQ/aeroleads-automation

Automate Aeroleads tasks via Rube MCP (Composio). Always search tools first for current schemas.

ComposioHQ/aero-workflow-automation

Automate Aero Workflow tasks via Rube MCP (Composio). Always search tools first for current schemas.

ComposioHQ/affinda-automation

Automate Affinda tasks via Rube MCP (Composio). Always search tools first for current schemas.

ComposioHQ/affinity-automation

Automate Affinity tasks via Rube MCP (Composio). Always search tools first for current schemas.

ComposioHQ/agencyzoom-automation

Automate Agencyzoom tasks via Rube MCP (Composio). Always search tools first for current schemas.

ComposioHQ/agent-deep-links

Build, validate, and troubleshoot deep links for Codex, Cursor, VS Code, Visual Studio, and similar tools. Use when users ask for clickable links (especially in Slack) that open threads, files, folders, or app settings.

相关技能