AgentSkillsCN

slack-reporter

Slack Block Kit 格式化与报告发布规范

SKILL.md
--- frontmatter
name: slack-reporter
description: Slack Block Kit formatting and posting specification for reports
version: 0.1.0

Slack Reporter Skill

Specification for sending reports to Slack in Block Kit format.

Posting Method

Important: To prevent Japanese character encoding issues, always send via file.

bash
# 1. Save payload to file
cat > /tmp/slack_payload.json << 'EOF'
{
  "blocks": [...]
}
EOF

# 2. Send via file (-d @file format)
curl -X POST -H "Content-Type: application/json" \
  -d @/tmp/slack_payload.json \
  "$SLACK_WEBHOOK_URL"

Prohibited: Passing JSON directly with -d '{...}' causes Japanese character corruption.

Block Kit Structure

Reports support two languages: Japanese (ja) and English (en). Use the appropriate template based on the --lang option.

Japanese Report Layout (--lang ja, default)

json
{
  "blocks": [
    {
      "type": "header",
      "text": {
        "type": "plain_text",
        "text": "📊 X おすすめ分析レポート",
        "emoji": true
      }
    },
    {
      "type": "section",
      "fields": [
        {
          "type": "mrkdwn",
          "text": "*取得時刻:*\n2025-01-29 10:30 JST"
        },
        {
          "type": "mrkdwn",
          "text": "*取得件数:*\n10 件"
        }
      ]
    },
    {
      "type": "divider"
    },
    {
      "type": "section",
      "text": {
        "type": "mrkdwn",
        "text": "*📋 投稿サマリー*\n\n*<https://x.com/user1/status/123456789|@user1>*\n投稿の全文または要約(最大200文字)\n♡ 1.2K  🔁 234  💬 56  👁 12.3K\n\n*<https://x.com/user2/status/987654321|@user2>*\n投稿の全文または要約(最大200文字)\n♡ 890  🔁 123  💬 34  👁 8.5K"
      }
    },
    {
      "type": "divider"
    },
    {
      "type": "section",
      "text": {
        "type": "mrkdwn",
        "text": "*📈 トレンド分析*\n\n*🎯 注目テーマ:*\n• AI/LLM: OpenAI の発表が大きな議論を呼んでいる\n• 宇宙開発: SpaceX Starship の成功が話題に\n• 開発ツール: AI コーディング支援の進化\n\n*💻 技術動向:*\n• GPT-5 リリースで AGI タイムラインの議論が活発化\n• Copilot のマルチファイル編集機能が注目を集める\n• Rust のシステムプログラミングでの採用が拡大中\n\n*⚡ 注目の投稿:*\n• @elonmusk の Starship 投稿が最高エンゲージメント(125K いいね)\n• @OpenAI の発表に AI 安全性についての議論が集中\n\n*🌡️ センチメント:*\n• 全体的にポジティブ・興奮気味のトーン\n• AI 安全性に関する懸念も一部で見られる\n\n*🔥 新たな議論:*\n• オープン vs クローズド AI モデルの議論が加熱\n• 新しい JavaScript ランタイム「Bun」が注目を集める\n\n*✅ アクションアイテム:*\n• GPT-5 API の公開状況を確認: https://openai.com\n• Copilot マルチファイル機能を試す: @github の発表参照\n• @SpaceX をフォローして Starship の最新情報をチェック"
      }
    },
    {
      "type": "divider"
    },
    {
      "type": "context",
      "elements": [
        {
          "type": "mrkdwn",
          "text": "🤖 Generated by Claude Code | `/report-x-trends`"
        }
      ]
    }
  ]
}

English Report Layout (--lang en)

json
{
  "blocks": [
    {
      "type": "header",
      "text": {
        "type": "plain_text",
        "text": "📊 X For You Analysis Report",
        "emoji": true
      }
    },
    {
      "type": "section",
      "fields": [
        {
          "type": "mrkdwn",
          "text": "*Timestamp:*\n2025-01-29 10:30 JST"
        },
        {
          "type": "mrkdwn",
          "text": "*Posts:*\n10"
        }
      ]
    },
    {
      "type": "divider"
    },
    {
      "type": "section",
      "text": {
        "type": "mrkdwn",
        "text": "*📋 Post Summary*\n\n*<https://x.com/user1/status/123456789|@user1>*\nFull post content or summary (max 200 chars)\n♡ 1.2K  🔁 234  💬 56  👁 12.3K\n\n*<https://x.com/user2/status/987654321|@user2>*\nFull post content or summary (max 200 chars)\n♡ 890  🔁 123  💬 34  👁 8.5K"
      }
    },
    {
      "type": "divider"
    },
    {
      "type": "section",
      "text": {
        "type": "mrkdwn",
        "text": "*📈 Trend Analysis*\n\n*🎯 Key Topics:*\n• AI/LLM: OpenAI announcements driving major discussions\n• Space Tech: SpaceX Starship success generating buzz\n• Dev Tools: AI coding assistants evolving rapidly\n\n*💻 Tech Trends:*\n• GPT-5 release sparking debates about AGI timeline\n• Copilot multi-file editing feature gaining attention\n• Rust adoption growing in systems programming\n\n*⚡ Notable Posts:*\n• @elonmusk's Starship post has highest engagement (125K likes)\n• @OpenAI announcement generating AI safety discussions\n\n*🌡️ Sentiment:*\n• Overall positive/excited tone around tech announcements\n• Some AI safety concerns emerging in replies\n\n*🔥 Emerging Discussions:*\n• Open vs closed AI models debate heating up\n• New JavaScript runtime \"Bun\" gaining traction\n\n*✅ Action Items:*\n• Check GPT-5 API availability: https://openai.com\n• Try Copilot multi-file feature: see @github announcement\n• Follow @SpaceX for Starship updates"
      }
    },
    {
      "type": "divider"
    },
    {
      "type": "context",
      "elements": [
        {
          "type": "mrkdwn",
          "text": "🤖 Generated by Claude Code | `/report-x-trends`"
        }
      ]
    }
  ]
}

Block Types Reference

Block TypePurposeCharacter Limit
headerReport title150 chars
sectionBody text, fieldstext: 3000 chars
section.fieldsKey-value pairsEach field: 2000 chars, max 10 fields
dividerSeparator line-
contextFooter, metadataEach element: 2000 chars

Mrkdwn Formatting

StyleSyntaxExample
Bold*text**important*
Italic_text__note_
Strikethrough~text~~deleted~
Code`code``function()`
Link<url|text><https://x.com|X>
List• item• Item 1
Newline\nMulti-line text

Best Practices

  1. Include full context: Post summaries can be up to 200 chars; include engagement metrics
  2. Use emojis: Add emojis to section headers for better visibility
  3. Use hierarchy: Separate logical sections with dividers
  4. Detailed analysis: Trend analysis should explain why topics are trending, not just list them
  5. Engagement metrics: Always include ♡ (likes), 🔁 (reposts), 💬 (replies), 👁 (views)
  6. Clear actions: Present specific next steps with links or handles in "Action Items"

Error Response Format

Use the following format for error notifications:

json
{
  "blocks": [
    {
      "type": "header",
      "text": {
        "type": "plain_text",
        "text": "X Analysis Report - Error",
        "emoji": true
      }
    },
    {
      "type": "section",
      "text": {
        "type": "mrkdwn",
        "text": "*Error:*\nLogin required. Please log into X in Chrome and try again."
      }
    }
  ]
}