Skip to content

lm203688/china-compliance-skills-mirror / skills/cn-compliance-guard

cn-compliance-guard

Verified

Scan Chinese text for 200+ banned words across 6 legal categories (广告法/消费者权益保护法), check SEO compliance for 5 platforms (百度/小红书/抖音/淘宝/京东), and provide safe replacement suggestions. Detects 绝对化用语, 医疗效果承诺, 虚假宣传, 金融承诺, 诱导消费, 比较广告. Use when: checking Chinese marketing copy for legal compliance, reviewing product descriptions for advertising law violations, auditing content before publishing on Chinese platforms, replacing banned words with safe alternatives. RUN: ./check.sh '你的文案' --platform douyin for instant scan.

FileKindSize
SKILL.mdskill md10.0 KB
scripts/check.shscript6.0 KB
scripts/suggestions.shscript2.2 KB

scripts/suggestions.sh

View on GitHub
#!/usr/bin/env bash
# cn-seo-optimizer - Safe Replacement Suggestions
# Get safe replacement suggestions for banned/sensitive words
# Usage:
#   ./suggestions.sh "最好" --platform douyin
#   ./suggestions.sh "美白" --platform xiaohongshu

set -euo pipefail

SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
ENV_FILE="$SCRIPT_DIR/../.env"

if [[ -f "$ENV_FILE" ]]; then
  while IFS='=' read -r key value; do
    case "$key" in
      CN_COMPLIANCE_API_KEY|CN_COMPLIANCE_API_BASE)
        export "$key=$value"
        ;;
    esac
  done < <(grep -E '^(CN_COMPLIANCE_API_KEY|CN_COMPLIANCE_API_BASE)=' "$ENV_FILE" 2>/dev/null || true)
fi

API_BASE="${CN_COMPLIANCE_API_BASE:-https://1341839497-jv04655vcs.ap-shanghai.tencentscf.com}"
API_BASE="${API_BASE%/}"
PLATFORM="all"
WORD=""

while [[ $# -gt 0 ]]; do
  case "$1" in
    --platform|-p)
      PLATFORM="$2"
      shift 2
      ;;
    --help|-h)
      echo "用法: ./suggestions.sh \"违禁词\" --platform [baidu|douyin|xiaohongshu|taobao|wechat|all]"
      exit 0
      ;;
    *)
      if [[ -z "$WORD" ]]; then
        WORD="$1"
      fi
      shift
      ;;
  esac
done

if [[ -z "$WORD" ]]; then
  echo "用法: ./suggestions.sh \"违禁词\" --platform douyin" >&2
  exit 1
fi

# Call API
HTTP_RESPONSE=$(curl -s -w "\n%{http_code}" \
  -X GET \
  "$API_BASE/suggestions?word=$(python3 -c "import urllib.parse; print(urllib.parse.quote('$WORD'))")&platform=$PLATFORM" \
  --connect-timeout 10 \
  --max-time 15 2>&1) || {
  echo "错误: 网络连接失败"
  exit 1
}

HTTP_CODE=$(echo "$HTTP_RESPONSE" | tail -1)
BODY=$(echo "$HTTP_RESPONSE" | sed '$d')

if [[ "$HTTP_CODE" != "200" ]]; then
  echo "错误: 服务异常 (HTTP $HTTP_CODE)"
  exit 1
fi

# Format output
echo "$BODY" | python3 -c "
import json, sys
data = json.load(sys.stdin)
word = data.get('word', '')
suggestions = data.get('suggestions', [])
category = data.get('category', '')
severity = data.get('severity', '')

if severity == 'high':
    emoji = '🔴'
elif severity == 'medium':
    emoji = '🟡'
else:
    emoji = '🟢'

print(f'{emoji} \"{word}\" — 分类: {category}')
if suggestions:
    print(f'✅ 安全替换建议: {', '.join(suggestions)}')
else:
    print('⚠️ 建议直接删除或改写相关表述')
" 2>/dev/null
rea-analysis-optimizationmorluto/reaOptimize REA providers and shared analysis workflows for agent context, latency, CPU, and memory while preserving correctness and Evidence. Use for analysis bottlenecks and cache or query design; CI/test-suite optimization belongs to rea-ci-tests-audit.Stars: 472kUpdated Claude CodeCodexVerifiedInstall
rea-ci-tests-auditmorluto/reaAudit REA CI and test suites for correctness, fixture drift, false passes, and measured performance; use for suite or workflow investigations and efficiency changes, rather than ordinary feature testing or a single test failure.Stars: 472kUpdated Claude CodeCodexVerifiedInstall
rea-tool-designmorluto/reaAudit, investigate, design, or change REA investigation tools, CLI/MCP contracts, provider capabilities, and Evidence semantics.Stars: 472kUpdated Claude CodeCodexVerifiedInstall
ponytail-auditDietrichGebert/ponytailQuality audit of the whole repo: bugs, security, real load, missing tests, speed, and what to delete. Most important first.Stars: 196kUpdated Claude CodeCodexVerifiedInstall