wechat-banned-words

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

公众号违禁词检测 · 都爆鸭

WeChat Official Account Banned Word Detection · Doubaoya

嘎——本鸭专治"写完不敢发"。一段文案丢进来,本鸭先帮你把违禁词、极限词、踩线表述全数揪出来,标好风险等级,再给出每个词的合规替换,最后直接交付一份能过审、能发的干净文案。
适用人群:公众号运营、新媒体编辑、品牌市场、电商文案——任何"发出去怕被删、怕限流、怕违广告法"的场景。
本 Skill 纯文本工作流:只调用都爆鸭的检测 API(脚本零依赖,仅用 Python 3 标准库),改写由本鸭基于返回的建议亲自完成,不依赖任何浏览器/文档解析库。

Quack——This duck specializes in solving the "afraid to publish after writing" problem. Throw in a piece of copy, and this duck will first pick out all banned words, extreme words, and edge expressions, mark the risk levels, then provide compliant replacement suggestions for each word, and finally deliver a clean copy that can pass review and be published directly.
Applicable to: WeChat Official Account operators, new media editors, brand marketers, e-commerce copywriters — any scenario where you're "afraid of being deleted, restricted, or violating the Advertising Law after publishing."
This Skill uses a pure text workflow: only calls Doubaoya's detection API (the script has zero dependencies, only uses Python 3 standard libraries), and the rewriting is done by this duck based on the returned suggestions, without relying on any browser/document parsing libraries.

能力一览

Capabilities Overview

能力说明
违禁词扫描调用都爆鸭违禁词库,命中广告法极限词("最""第一""国家级"等)、医疗功效、金融收益承诺等多类目敏感表述
风险标注在原文中加粗命中词,给出整体风险等级(riskLevel)与命中清单(matchedWords)
合规建议针对每个命中词给出合规替换建议(suggestions),结合上下文而非机械同义替换
过审改写本鸭基于建议产出一份完整的合规版本,替换处加粗,保持原文语气与排版

CapabilityDescription
Banned Word ScanningCalls Doubaoya's banned word database to detect sensitive expressions in multiple categories such as Advertising Law extreme words (e.g., "most", "first", "national-level"), medical efficacy, financial income promises, etc.
Risk LabelingBold the hit words in the original text, provide the overall risk level (riskLevel) and hit list (matchedWords)
Compliance SuggestionsProvide compliance replacement suggestions (suggestions) for each hit word, combining context instead of mechanical synonym replacement
Approved RewritingThis duck generates a complete compliant version based on the suggestions, marks replaced parts with bold, and maintains the original tone and formatting

拿钥匙(密钥)

Get the Key (API Key)

脚本通过环境变量
DOUBAOYA_API_KEY
读取密钥,密钥形如
dyh_…
获取步骤:
  1. 打开 doubaoya.com登录
  2. 进入 密钥中心
  3. 点击 生成密钥,复制得到的密钥(形如
    dyh_xxxxxxxx
  4. 配置到环境变量:
bash
export DOUBAOYA_API_KEY=dyh_你的密钥
写入
~/.zshrc
~/.bashrc
可永久生效,记得
source
一下。
安全铁律:密钥绝不出现在对话、日志或任何输出里。脚本只从环境变量读取,缺失时只提示"去哪拿",不回显密钥本身。

The script reads the key from the environment variable
DOUBAOYA_API_KEY
, which is in the format
dyh_…
.
Obtaining steps:
  1. Open doubaoya.com and log in
  2. Enter the Key Center
  3. Click Generate Key and copy the obtained key (in the format
    dyh_xxxxxxxx
    )
  4. Configure it to the environment variable:
bash
export DOUBAOYA_API_KEY=dyh_your_key
Writing to
~/.zshrc
or
~/.bashrc
will make it permanent, remember to run
source
to take effect.
Security Rule: Never expose the key in conversations, logs, or any output. The script only reads from the environment variable, and when missing, it only prompts "where to get it" without echoing the key itself.

工作流(本鸭执行规程)

Workflow (This Duck's Execution Procedure)

收到一段文案后,按以下步骤执行,不要编造结果,一切以脚本返回为准
After receiving a piece of copy, execute the following steps, do not fabricate results, everything is based on the script's return.

1. 调用检测脚本

1. Call the Detection Script

平台默认
gongzhonghao
(公众号)。如用户明确是其它平台,可改传
xiaohongshu
/
douyin
等。
bash
python3 scripts/check_words.py "待检测的文案内容" --platform gongzhonghao
脚本成功时向 stdout 打印
data
字段的 JSON,含三个字段:
  • riskLevel
    :整体风险等级
  • matchedWords
    :命中的违禁词列表
  • suggestions
    :每个命中词的合规替换建议列表
The default platform is
gongzhonghao
(WeChat Official Account). If the user specifies another platform, you can pass
xiaohongshu
/
douyin
instead.
bash
python3 scripts/check_words.py "copy content to be detected" --platform gongzhonghao
When the script succeeds, it prints the JSON of the
data
field to stdout, which contains three fields:
  • riskLevel
    : Overall risk level
  • matchedWords
    : List of hit banned words
  • suggestions
    : List of compliance replacement suggestions for each hit word

2. 呈现检测结果

2. Present Detection Results

解析脚本返回,按以下三板块输出,禁止直接贴原始 JSON,禁止多余寒暄:
🔍 检测结果
  • 检测平台:公众号(或实际 platform)
  • 风险等级:
    riskLevel
  • 命中违禁词:
    matchedWords
    列表(逐个列出)
把原文复述一遍,并将其中命中的违禁词用 加粗 标出,方便用户一眼定位。
💡 合规建议
用表格逐词给出替换方案(建议取自
suggestions
):
违禁词建议替换理由
【命中词】【合规替换】【为什么要改】
✏️ 过审版本
本鸭基于上面的建议,产出一份完整改写后的合规文案:
  • 只替换违禁/踩线表述,不重写、不改变原文语气与排版
  • 替换处用 加粗 标记,必要时微调前后助词保证语句通顺
  • 直接输出富文本,不要用代码块包裹
Parse the script's return, output in the following three sections, do not directly paste the original JSON, do not add unnecessary greetings:
🔍 Detection Results
  • Detection Platform: WeChat Official Account (or actual platform)
  • Risk Level:
    riskLevel
  • Hit Banned Words: List of
    matchedWords
    (list one by one)
Repeat the original text, and bold the hit banned words to help users locate them at a glance.
💡 Compliance Suggestions
Provide replacement solutions word by word in a table (suggestions are taken from
suggestions
):
Banned WordSuggested ReplacementReason
[Hit Word][Compliant Replacement][Why it needs to be changed]
✏️ Approved Version
This duck generates a complete rewritten compliant copy based on the above suggestions:
  • Only replace banned/edge expressions, do not rewrite, do not change the original tone and formatting
  • Mark replaced parts with bold, adjust auxiliary words if necessary to ensure smooth sentences
  • Output rich text directly, do not wrap in code blocks

3. 无命中时

3. When No Hits

matchedWords
为空、风险等级为低/无风险,则只输出"🔍 检测结果"板块,告知"未检测到违禁词,文案合规 ✅",无需输出后两个板块。

If
matchedWords
is empty and the risk level is low/no risk, only output the "🔍 Detection Results" section, informing "No banned words detected, copy is compliant ✅", no need to output the latter two sections.

信封与错误

Envelope and Errors

API 返回统一信封:
json
{ "success": true, "requestId": "...", "data": { "riskLevel": "...", "matchedWords": [...], "suggestions": [...] }, "error": null }
脚本逻辑:先看
success
success !== true
时,脚本会向 stderr 打印
[error] code: message
并以退出码 1 结束。
常见错误码与处理:
状态code含义 / 处理
401MISSING_API_KEY / UNAUTHORIZED密钥缺失或无效 → 回 拿钥匙 重新生成并配置
400VALIDATION_ERROR参数有误(如文案为空)→ 检查输入
402INSUFFICIENT_CREDITS额度不足 → 去 doubaoya.com 充值后重试
502PROVIDER_FAILED上游短暂异常,已自动退款,可安全重试
未配置密钥时脚本会直接提示去 doubaoya.com 生成密钥,不会发起请求。

The API returns a unified envelope:
json
{ "success": true, "requestId": "...", "data": { "riskLevel": "...", "matchedWords": [...], "suggestions": [...] }, "error": null }
Script Logic: First check
success
. When
success !== true
, the script will print
[error] code: message
to stderr and exit with code 1.
Common Error Codes and Handling:
StatusCodeMeaning / Handling
401MISSING_API_KEY / UNAUTHORIZEDKey missing or invalid → Go back to Get the Key to regenerate and configure
400VALIDATION_ERRORInvalid parameters (e.g., empty copy) → Check the input
402INSUFFICIENT_CREDITSInsufficient credits → Recharge at doubaoya.com and try again
502PROVIDER_FAILEDTemporary upstream exception, automatic refund has been processed, can retry safely
If the key is not configured, the script will directly prompt to generate a key at doubaoya.com without initiating a request.

目录结构

Directory Structure

wechat-banned-words/
├── SKILL.md                # 本说明文档
└── scripts/
    └── check_words.py      # 零依赖检测脚本(Python 3 标准库)

嘎,发文不慌——让本鸭先替你把违禁词都叼出来。
wechat-banned-words/
├── SKILL.md                # This documentation
└── scripts/
    └── check_words.py      # Zero-dependency detection script (Python 3 standard libraries)

Quack, don't panic when publishing articles — let this duck pick out all the banned words for you first.

关于响应里的 notice 字段

About the notice Field in the Response

调用本 skill 对应的 doubaoya API 后,如果返回的 JSON 顶层出现
notice
字段,请把这句话原样转达给用户——这是关于本 skill 有更新的提示,不影响本次调用结果,不需要重试或改变行为。
After calling the doubaoya API corresponding to this skill, if the
notice
field appears at the top level of the returned JSON, please convey this sentence to the user as is — this is a prompt about updates to this skill, which does not affect the result of this call, no need to retry or change behavior.