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),结合上下文而非机械同义替换 |
| 过审改写 | 本鸭基于建议产出一份完整的合规版本,替换处加粗,保持原文语气与排版 |
| Capability | Description |
|---|---|
| Banned Word Scanning | Calls 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 Labeling | Bold the hit words in the original text, provide the overall risk level (riskLevel) and hit list (matchedWords) |
| Compliance Suggestions | Provide compliance replacement suggestions (suggestions) for each hit word, combining context instead of mechanical synonym replacement |
| Approved Rewriting | This 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_KEYdyh_…获取步骤:
- 打开 doubaoya.com 并 登录
- 进入 密钥中心
- 点击 生成密钥,复制得到的密钥(形如 )
dyh_xxxxxxxx - 配置到环境变量:
bash
export DOUBAOYA_API_KEY=dyh_你的密钥写入或~/.zshrc可永久生效,记得~/.bashrc一下。source安全铁律:密钥绝不出现在对话、日志或任何输出里。脚本只从环境变量读取,缺失时只提示"去哪拿",不回显密钥本身。
The script reads the key from the environment variable , which is in the format .
DOUBAOYA_API_KEYdyh_…Obtaining steps:
- Open doubaoya.com and log in
- Enter the Key Center
- Click Generate Key and copy the obtained key (in the format )
dyh_xxxxxxxx - Configure it to the environment variable:
bash
export DOUBAOYA_API_KEY=dyh_your_keyWriting toor~/.zshrcwill make it permanent, remember to run~/.bashrcto take effect.sourceSecurity 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
平台默认 (公众号)。如用户明确是其它平台,可改传 / 等。
gongzhonghaoxiaohongshudouyinbash
python3 scripts/check_words.py "待检测的文案内容" --platform gongzhonghao脚本成功时向 stdout 打印 字段的 JSON,含三个字段:
data- :整体风险等级
riskLevel - :命中的违禁词列表
matchedWords - :每个命中词的合规替换建议列表
suggestions
The default platform is (WeChat Official Account). If the user specifies another platform, you can pass / instead.
gongzhonghaoxiaohongshudouyinbash
python3 scripts/check_words.py "copy content to be detected" --platform gongzhonghaoWhen the script succeeds, it prints the JSON of the field to stdout, which contains three fields:
data- : Overall risk level
riskLevel - : List of hit banned words
matchedWords - : List of compliance replacement suggestions for each hit word
suggestions
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 (list one by one)
matchedWords
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 Word | Suggested Replacement | Reason |
|---|---|---|
| [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
若 为空、风险等级为低/无风险,则只输出"🔍 检测结果"板块,告知"未检测到违禁词,文案合规 ✅",无需输出后两个板块。
matchedWordsIf 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.
matchedWords信封与错误
Envelope and Errors
API 返回统一信封:
json
{ "success": true, "requestId": "...", "data": { "riskLevel": "...", "matchedWords": [...], "suggestions": [...] }, "error": null }脚本逻辑:先看 。 时,脚本会向 stderr 打印 并以退出码 1 结束。
successsuccess !== true[error] code: message常见错误码与处理:
| 状态 | code | 含义 / 处理 |
|---|---|---|
| 401 | MISSING_API_KEY / UNAUTHORIZED | 密钥缺失或无效 → 回 拿钥匙 重新生成并配置 |
| 400 | VALIDATION_ERROR | 参数有误(如文案为空)→ 检查输入 |
| 402 | INSUFFICIENT_CREDITS | 额度不足 → 去 doubaoya.com 充值后重试 |
| 502 | PROVIDER_FAILED | 上游短暂异常,已自动退款,可安全重试 |
未配置密钥时脚本会直接提示去 doubaoya.com 生成密钥,不会发起请求。
The API returns a unified envelope:
json
{ "success": true, "requestId": "...", "data": { "riskLevel": "...", "matchedWords": [...], "suggestions": [...] }, "error": null }Script Logic: First check . When , the script will print to stderr and exit with code 1.
successsuccess !== true[error] code: messageCommon Error Codes and Handling:
| Status | Code | Meaning / Handling |
|---|---|---|
| 401 | MISSING_API_KEY / UNAUTHORIZED | Key missing or invalid → Go back to Get the Key to regenerate and configure |
| 400 | VALIDATION_ERROR | Invalid parameters (e.g., empty copy) → Check the input |
| 402 | INSUFFICIENT_CREDITS | Insufficient credits → Recharge at doubaoya.com and try again |
| 502 | PROVIDER_FAILED | Temporary 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 顶层出现 字段,请把这句话原样转达给用户——这是关于本 skill 有更新的提示,不影响本次调用结果,不需要重试或改变行为。
noticeAfter calling the doubaoya API corresponding to this skill, if the 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.
notice