feishu-webhook-message-formatting

feishu-webhook-message-formatting is a skill for Claude Code, Codex from magic3007/dotfiles. It costs 93 tokens per session (1,701 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.

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.

agentmods
npx agentmods add skills/magic3007/dotfiles/feishu-webhook-message-formatting
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.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.svg" alt="Measured on agentmods" height="20"></a>
Per session 93 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,701 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 2 findings. Scan, not verified.
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.00093 $0.01701
Opus 5 $0.00046 $0.00851
Sonnet 5 $0.00019 $0.00340
Haiku 4.5 $0.00009 $0.00170

Measured 6d ago against content hash dc598948c1ac, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, 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 6d 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 '{
claude/skills/feishu-webhook-message-formatting/SKILL.md · 150 lines

How it starts

The opening of the file, as written. The whole thing — 150 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是否可用

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)临时关闭通配符解析
其他常见错误
  • ❌ 错误:在text内容中使用Markdown格式(如粗体),飞书不识别
  • ❌ 错误:content是一维数组而不是二维数组
  • ❌ 错误:每行内容包含多个元素但没有放在同一个数组里
  • ❌ 错误:style属性使用对象格式 {"bold": true},正确应为字符串格式 "bold"(会导致 19002 错误)
  • ❌ 错误:包含不支持的标签类型
  • ❌ 错误:文本内容中的特殊字符(如单引号、双引号)没有正确转义,导致JSON解析失败
    • 示例:文本中的 "Let's think step by step" 需要转义为 "Let'''s think step by step" 在bash curl命令中
    • 建议:使用JSON工具生成消息体,避免手动转义错误

Read the full file on GitHub · 150 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. 6d 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 yesterday), licensed MIT. It adds 93 tokens to every session and 1,701 once invoked, about $0.0005 per session on Opus 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

Other skills, from other repositories

orchestrate-agents

Orchestrate multiple agent CLIs (Claude, Codex, Antigravity) via tmux with a shared fleet store, dispatching one guardian subagent per pane. Survey-first: inspects and adopts existing tmux sessions, windows, and agent panes before creating anything new. Use when running a multi-agent session, dispatching parallel…

urmzd/dotfiles · 83 tokens

assess-quality

Foundational quality framework: the five questions (readable, easy to start, expands without bloat, consistent, intentional) every other dev skill is judged against, plus the dual-audience and workshop principles. Use when onboarding to a project, defining a quality bar, setting an assessment checklist, or arbitrating…

urmzd/dotfiles · 120 tokens

extend-oss-skills-to-claude

Extend standard agentskills.io skills with Claude Code-specific features. Invocation control, subagent execution, dynamic context injection, string substitutions, model/effort overrides, and deployment scoping. Use when adapting a portable skill for Claude Code, adding Claude-specific frontmatter, setting up subagent…

urmzd/dotfiles · 74 tokens

merge-ready

Drive an existing pull request to a mergeable state: get CI green, resolve merge conflicts with the base branch, address and resolve review comments, trigger required bot reviews/approvals (e.g. commenting '@claude review'), link associated issues, and clean up the PR title and description. Ends with a readiness…

urmzd/dotfiles · 208 tokens

test-code

Testing philosophy, test types (unit, integration, golden, fuzz, property, benchmark, smoke, E2E), per-language conventions (Rust, Go, Python, TypeScript), file organization, fixtures/mocks, CI strategy, and what NOT to test. Use when writing tests, reviewing test coverage, setting up test infrastructure, or deciding…

urmzd/dotfiles · 101 tokens

scaffold-terraform

Scaffold a Terraform infrastructure project with CI/CD (plan on PR, apply on push), AWS OIDC auth, .envrc, and standard files. Uses terraform CLI as the native tool. Loads on top of scaffold-project (run that first for cross-language standard files). Use when creating infrastructure repos, or when the user mentions…

urmzd/dotfiles · 115 tokens