feishu-webhook-message-formatting

feishu-webhook-message-formatting is a skill for Claude Code, Codex from magic3007/dotfiles. It costs 159 tokens per session (3,058 once invoked), scanned B, original, MIT.

A guide for sending correctly formatted messages through a Feishu custom bot webhook. Feishu is a workplace messaging platform, and a webhook is a URL that accepts automated messages from another program.

In plain words
What is it for?
Use it to test a webhook with a simple text message, format post-style rich text, and check rows, text, links, mentions, and styling fields.
Why use it?
It helps diagnose Feishu error 19002 and JSON parsing failures caused by invalid rich-text message structures or special characters.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: mentions Claude Code.

Good fit Use it to test a webhook with a simple text message, format post-style rich text, and check rows, text, links, mentions, and styling fields.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/magic3007/dotfiles/feishu-webhook-message-formatting
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add magic3007/dotfiles --skill feishu-webhook-message-formatting
Clone the repo
git clone --depth 1 https://github.com/magic3007/dotfiles

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for feishu-webhook-message-formatting

README.md
[![agentmods](https://agentmods.dev/badge/skills/magic3007/dotfiles/feishu-webhook-message-formatting/github.svg)](https://agentmods.dev/skills/magic3007/dotfiles/feishu-webhook-message-formatting)
Your own site
<a href="https://agentmods.dev/skills/magic3007/dotfiles/feishu-webhook-message-formatting"><img src="https://agentmods.dev/badge/skills/magic3007/dotfiles/feishu-webhook-message-formatting/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for feishu-webhook-message-formatting

Your own site · 80×15
<a href="https://agentmods.dev/skills/magic3007/dotfiles/feishu-webhook-message-formatting"><img src="https://agentmods.dev/badge/skills/magic3007/dotfiles/feishu-webhook-message-formatting.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 159 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,058 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 2 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00159 $0.03058
Opus 5.5 $0.00064 $0.01223
Sonnet 5.5 $0.00032 $0.00612
Haiku 4.5 $0.00016 $0.00306

Measured 2mo ago against content hash 458c02b72df5, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade B, and why

feishu-webhook-message-formatting scanned grade B with 2 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Sends data to an external URLmediumData exfiltration

A POST to an outside endpoint may be telemetry or may be exfiltration; either way the mod talks to somewhere, and you should know where.

curl -X POST -H "Content-Type: application/json" -d '{

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

curl -X POST -H "Content-Type: application/json" -d '{
skills/feishu-webhook-message-formatting/SKILL.md · 215 lines

How it starts

The opening of the file, as written. The whole thing — 215 lines — stays where its author put it; the contents beside it link to each section on GitHub.

飞书Webhook消息格式指南

Problem

飞书自定义机器人webhook对消息格式有严格要求,富文本(post类型)格式容易出现参数错误,且错误提示不明确(仅返回"params error, unknown content value"),导致调试困难。

Context / Trigger Conditions

  • 调用飞书webhook发送消息时返回错误码19002
  • 错误信息:"params error, unknown content value"
  • post类型富文本消息格式调试耗时
  • 需要快速验证webhook是否可用
  • 返回错误码230051:"The message hits DLP control, failed to send"
  • 简单测试消息能发出,但业务消息稳定失败(内容合规问题而非格式问题)

Solution

1. 优先使用简单文本格式验证

在调试初期,先使用最简单的text格式确保webhook可以正常工作:

curl -X POST -H "Content-Type: application/json" -d '{
  "msg_type": "text",
  "content": {
    "text": "测试消息\n第二行内容"
  }
}' "$FEISHU_WEBHOOK_URL"

2. 富文本(post类型)正确格式

如果需要使用富文本,遵循以下格式要求:

  • content是二维数组,每个子数组代表一行内容
  • 每行内容由多个富文本元素组成
  • 标签包括:text(普通文本)、a(链接)、at(@用户)
  • style属性用于设置粗体、斜体等样式,值为字符串而非对象

⚠️ style 格式关键点: style 的值必须是字符串(如 "bold"),不能是对象(如 {"bold": true})。使用对象格式会导致 19002 错误!

正确示例:

{
  "msg_type": "post",
  "content": {
    "post": {
      "zh_cn": {
        "title": "消息标题",
        "content": [
          [{"tag": "text", "text": "第一行内容"}],
          [{"tag": "text", "text": "第二行:"}],
          [
            {"tag": "text", "text": "粗体文本", "style": "bold"},
            {"tag": "text", "text": " 普通文本 "}
          ],
          [
            {"tag": "a", "text": "链接文本", "href": "https://example.com"},
            {"tag": "text", "text": " 更多内容"}
          ]
        ]
      }
    }
  }
}

3. 常见格式错误

错误码 19002:params error, unknown content value
  • 原因:post类型富文本消息格式不符合飞书要求
  • 解决方案:参考本指南的post格式示例,确保content是二维数组结构
  • 建议:优先使用text类型消息,避免复杂的post格式
错误码 9499:Bad Request
  • 原因:JSON请求体格式错误,通常是特殊字符未正确转义或shell解析问题
  • 常见场景:
    • 文本内容中的双引号没有正确转义
    • 特殊字符(如中文引号、emoji)编码问题
    • JSON结构不完整或语法错误
    • 在bash/zsh中使用单引号包裹curl的JSON参数时,如果内容中包含单引号,会打断shell的引号匹配,导致后续内容被shell解析(如**被当成通配符展开,$开头内容被当成变量替换),出现"no matches found"等错误
  • 解决方案:
    • 确保所有双引号在JSON中正确转义为 "
    • 在bash/zsh curl命令中,内容中的单引号需要转义为 '''
    • 使用JSON校验工具验证请求体格式正确性
    • 避免直接在curl命令中拼接复杂内容,建议使用文件或变量传递
    • 若出现"no matches found"错误,可在执行curl前运行setopt noglob(zsh)或set -o noglob(bash)临时关闭通配符解析

Read the full file on GitHub · 215 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2mo ago Changed · +65 lines · +66 tokens per session 458c02b72df5
  2. 3mo ago First seen · 150 lines · 93 tokens per session scan B dc598948c1ac

Subscribe to this mod's changes

feishu-webhook-message-formatting is a skill published in the GitHub repository magic3007/dotfiles (11 stars, last pushed 5d ago), licensed MIT. It adds 159 tokens to every session and 3,058 once invoked, about $0.0006 per session on Opus 5.5. A static security scan graded it B with 2 findings (sends data to an external url, makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

feishu-webhook-message-formatting compared with skills from other repositories

feishu-webhook-message-formatting next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
feishu-webhook-message-formattingmagic3007/dotfilesSkill115d agoMITB159Claude Code, Codex
create-oss-skillurmzd/dotfilesSkill64d agoApache-2.0A63Claude Code
extend-oss-skills-to-claudeurmzd/dotfilesSkill64d agoApache-2.0A74Claude Code
scaffold-nodeurmzd/dotfilesSkill64d agoApache-2.0A119Claude Code
test-codeurmzd/dotfilesSkill64d agoApache-2.0A101Claude Code
scaffold-docsurmzd/dotfilesSkill64d agoApache-2.0A196Claude Code
merge-readyurmzd/dotfilesSkill64d agoApache-2.0A208Claude Code