slack-development

作者: sentry

使用正確的 Slack 文件記錄訊息格式、入站提及/事件路由以及長時間執行任務的使用者體驗來實作 Slack 機器人行為。在要求「格式化…」時使用。

npx skills add https://github.com/getsentry/junior --skill slack-development

Implement Slack-facing behavior with predictable formatting, inbound routing, and responsive long-running UX.

Step 1: Classify the requested change

Determine which category applies before writing code:

CategoryTypical requestPrimary reference
Output formatting"Fix markdown", "why does Slack render this weirdly?"${CLAUDE_SKILL_ROOT}/references/slack-output-formatting.md
Slack event payloads"What does Slack send?", "why did raw event parsing fail?"${CLAUDE_SKILL_ROOT}/references/slack-inbound-message-formats.md
Chat SDK payload contract"What fields do handlers actually receive?", "which fields are reliable in onSubscribedMessage?"${CLAUDE_SKILL_ROOT}/references/chat-sdk-payload-contract.md
Thread routing"Passive detector skips thread replies", "reply/no-reply logic is wrong"${CLAUDE_SKILL_ROOT}/references/slack-thread-routing.md
Assistant-thread APIs"Why does assistant.threads.setStatus fail?", "should this DM have assistant status/title?", "does Chat tab DM count as an assistant thread?"Read Slack docs for assistant_thread_started, assistant_thread_context_changed, message.im, and assistant.threads.* first, then load ${CLAUDE_SKILL_ROOT}/references/assistant-thread-apis.md and ${CLAUDE_SKILL_ROOT}/references/chat-sdk-payload-contract.md
Long-running behavior"No feedback while it runs", "show progress", "stream output"${CLAUDE_SKILL_ROOT}/references/chat-sdk-patterns.md
Multiple categoriesChange touches formatting, routing, and/or runtime UXRead only the needed references above

If the request is ambiguous, ask one focused question and continue after clarification.

Step 2: Load only relevant references and implement

Use the selected reference files as the implementation guide. Keep SKILL.md high-level and put details in references.

Slack assistant-thread guardrails:

  1. Use Slack's current inbound event payload as the source of truth for assistant-thread API calls. For non-DM message events, use the live channel plus thread_ts ?? ts. For message.im, require the live channel and explicit thread_ts. For lifecycle events, use assistant_thread.channel_id and assistant_thread.thread_ts.
  2. Do not invent assistant-thread identifiers from persisted state unless Slack's docs explicitly require it.
  3. Separate reply continuity from assistant-thread API eligibility. A stored root timestamp can be valid for reply threading without being valid for assistant.threads.*.
  4. Treat assistant_thread_started and assistant_thread_context_changed differently. Context changes can refresh prompts/context, but should not clobber a conversation-specific thread title back to a generic default.
  5. Conversation-specific thread titles should come from the earliest human message the runtime actually knows about for that thread, using the lightweight title model. Do not base titles on assistant reply text or a later follow-up.
  6. Title generation may run in parallel with the main assistant turn, but it must not delay assistant reply generation or visible reply delivery.
  7. Assistant status is best effort. Do not make Slack status writes part of the critical path for tool/model execution.
  8. If debugging a live repro through the example app, verify whether the app is executing packages/junior/dist/* output before trusting source edits against runtime behavior.

Step 3: Enforce project conventions

When modifying this repository:

  1. Keep tool behavior aligned with AI Gateway primitives already in use.
  2. Avoid reintroducing deprecated custom search integrations when Gateway-native tools exist.
  3. Preserve webhook waitUntil behavior so long-running handlers finish after HTTP response.

Step 4: Validate before finalizing

Use this checklist:

  • Rendering: message examples render correctly in Slack (mrkdwn expectations, escapes, mentions/links).
  • Inbound formats: routing uses documented Chat SDK payload fields first; raw Slack parsing only when necessary.
  • Thread routing: explicit bot mention paths bypass passive no-reply classification.
  • Assistant threads: assistant.threads.* calls use the live inbound assistant-thread context; non-DM message events may use thread_ts ?? ts, message.im must carry explicit thread_ts, and runtime code does not synthesize DM assistant roots for status/title updates.
  • Accessibility: block messages include an adequate top-level fallback text strategy.
  • Latency UX: user sees immediate feedback for long-running tasks.
  • Streaming/progress: behavior is observable during tool/model execution, not only at completion.
  • Failure mode: errors return actionable responses rather than silent stalls.

來自 sentry 的更多技能

add-ai-integration
sentry
在 Sentry JavaScript SDK 中新增一個 AI 提供者整合。用於貢獻新的 AI 檢測工具(OpenAI、Anthropic、Vercel AI、LangChain 等)時使用…
add-cdn-bundle
sentry
為瀏覽器套件建立一個包含指定功能的新 CDN 套件組合
agent-prompt
sentry
撰寫有效代理提示與技能的參考指南。適用於建立新技能、審查提示品質或理解 Warden 的提示…
agents-md
sentry
當使用者要求「建立 AGENTS.md」、「更新 AGENTS.md」、「維護代理文件」、「設定 CLAUDE.md」或需要保持代理…時,應使用此技能。
agents-md
sentry
建立並維護精簡、高訊號的代理文件,內容不超過60行。強制採用經研究驗證的代理文件最佳實踐;指令品質會隨長度下降。需包含三個核心章節:套件管理器、檔案範圍指令(每個檔案的測試/語法檢查/型別檢查),以及帶有代理身份的提交歸屬。分析專案結構(鎖定檔案、語法檢查器設定、CI指令、單一儲存庫指標)以決定檔案中應包含的內容。僅使用標題與項目符號;參考...
agents-md
sentry
當使用者要求「建立 AGENTS.md」、「更新 AGENTS.md」、「維護代理文件」、「設定 CLAUDE.md」或需要保持代理…時,應使用此技能。
ai-sdk
sentry
ai-sdk — 一個可安裝的 AI 代理技能,由 getsentry/webvitals.com 發布。
analytics
sentry
在 Sentry 的前端 UI 中檢測並探索分析事件。用於在按鈕、頁面、模態框或自訂互動中添加追蹤,以及定義新的…