Skip to content

Navigation Menu

Sign in
Sign up

Repository files navigation

WeChat Draft Guard

A small command line quality gate for WeChat Official Account article drafts.

It validates a draft JSON file before publishing or uploading. The first release focuses on practical checks:

  • required article fields
  • title and digest length
  • comment settings
  • local image references
  • placeholder text
  • common AI-sounding phrases in Chinese copy
  • explicit save-draft vs direct-publish intent
  • generic interaction-bait endings

The project is intentionally small so maintainers can extend rules without needing a full CMS or publishing pipeline.

See publishing workflow notes for practical WeChat release guidance captured from real publishing operations.

Install

python -m pip install -e .

Usage

wechat-draft-guard validate examples/draft.valid.json

Use JSON output when integrating with scripts:

wechat-draft-guard validate examples/draft.valid.json --format json

Use a project-specific rule config:

wechat-draft-guard validate examples/draft.valid.json --config examples/rules.config.json

Run a daily operations review from a metrics CSV:

wechat-draft-guard review-daily examples/daily-metrics.csv --date 2026年06月02日

The daily review compares the target date with the previous publishing date and flags:

  • severe total-view drops
  • batches where most articles have 10 views or fewer
  • zero recommendation-source reads when that column is available
  • entertainment titles that are too long or too explanatory

Draft Format

The JSON shape is documented in schema/draft.schema.json.

{
 "title": "Example title",
 "digest": "Short summary",
 "content": "<p>Article HTML or plain text.</p>",
 "thumb_media_path": "images/cover.jpg",
 "need_open_comment": 1,
 "only_fans_can_comment": 1,
 "publish_mode": "save_draft"
}

Exit Codes

  • 0: no issues found
  • 1: warnings or errors found
  • 2: invalid input or unreadable file

Roadmap

  • HTML structure checks for WeChat article body
  • image size and dimension validation
  • exportable pre-publish report
  • optional integration with WeChat draft upload scripts

Contributing

See CONTRIBUTING.md.

License

MIT

About

Command line quality gate for WeChat Official Account article drafts.

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

AltStyle によって変換されたページ (->オリジナル) /