aiworkskills/wechat-article-skills / skills/aws-wechat-article-images
aws-wechat-article-images
Verified公众号封面|公众号配图|公众号插图|AI 生图 — 公众号 AI 封面与配图生成,按文章标题与内容自动匹配画风,一稿多方案,多风格预设可复用。面向公众号编辑、自媒体、品牌设计。触发词:「封面」「配图」「插图」「生成图片」「给文章加图」「做个封面」「文章插图」「配个图」。不写正文只发一组图请走 aws-wechat-sticker;需要多环节串联(写+审+排+配图+发)请走 aws-wechat-article-main。
scripts/user_image_prepare.py
View on GitHub#!/usr/bin/env python3
"""
用户供图准备工具:
- 确保本篇 imgs/ 目录存在
- 基于 imgs/ 下的图片文件生成 img_analysis.md 模板
- 强制“推荐用途:封面”只能有一个
用法:
python user_image_prepare.py drafts/20260402-slug
python user_image_prepare.py drafts/20260402-slug --cover 02-taomi.png
"""
from __future__ import annotations
import argparse
import sys
from pathlib import Path
IMAGE_EXTS = {".png", ".jpg", ".jpeg", ".webp", ".gif"}
def _err(msg: str):
print(f"[ERROR] {msg}", file=sys.stderr)
sys.exit(1)
def _ok(msg: str):
print(f"[OK] {msg}")
def _info(msg: str):
print(f"[INFO] {msg}")
def _list_images(imgs_dir: Path) -> list[Path]:
files = [p for p in sorted(imgs_dir.iterdir()) if p.is_file() and p.suffix.lower() in IMAGE_EXTS]
return files
def _build_analysis_md(files: list[Path], cover_name: str | None) -> str:
if not files:
return "# 图片分析(img_analysis)\n\n> imgs/ 下暂无图片,请先上传后重跑。\n"
if cover_name:
matched = [p for p in files if p.name == cover_name]
if not matched:
_err(f"--cover 指定的文件不存在于 imgs/:{cover_name}")
cover = matched[0]
else:
cover = files[0]
lines = [
"# 图片分析(img_analysis)",
"",
"> 说明:`推荐用途` 中“封面”只能出现一次;其余图片请标注“正文”。",
"",
]
for p in files:
use = "封面" if p.name == cover.name else "正文"
lines.extend(
[
f"## {p.name}",
f"- 文件名:{p.name}",
"- 图片内容:待补充(请描述画面主体、动作、场景)",
"- 建议章节:待补充(例如:选米 / 淘米 / 浸泡 / 煮饭)",
f"- 推荐用途:{use}",
"- 图注建议:待补充",
"",
]
)
return "\n".join(lines).rstrip() + "\n"
def main():
parser = argparse.ArgumentParser(description="为用户上传图片生成 img_analysis.md 模板")
parser.add_argument("article_dir", help="本篇目录,例如 drafts/20260402-slug")
parser.add_argument("--cover", help="指定封面文件名(必须位于 imgs/)")
parser.add_argument("--overwrite", action="store_true", help="覆盖已存在的 img_analysis.md")
args = parser.parse_args()
article_dir = Path(args.article_dir).resolve()
if not article_dir.exists():
_err(f"文章目录不存在:{article_dir}")
imgs_dir = article_dir / "imgs"
imgs_dir.mkdir(parents=True, exist_ok=True)
_info(f"已确保目录存在:{imgs_dir}")
analysis_path = article_dir / "img_analysis.md"
if analysis_path.exists() and not args.overwrite:
_err(f"img_analysis.md 已存在:{analysis_path}(如需覆盖请加 --overwrite)")
files = _list_images(imgs_dir)
content = _build_analysis_md(files, args.cover)
analysis_path.write_text(content, encoding="utf-8")
_ok(f"已写入:{analysis_path}")
_info("请补充“图片内容/建议章节/图注建议”,并确保推荐用途里“封面”仅 1 处。")
if __name__ == "__main__":
main()
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| writing-skillsobra/superpowersUse when creating new skills, editing existing skills, or verifying skills work before deployment | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| xlsxanthropics/skillsUse this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing .xlsx, .xlsm, .xltx, .csv, or .tsv file (e.g., adding columns, computing formulas, formatting, charting, cleaning messy data); create a new spreadsheet from scratch or from other data sources; or convert between tabular file formats. Trigger especially when the user references a spreadsheet file by name or path — even casually (like "the xlsx in my downloads") — and wants something done to it or produced from it. Also trigger for cleaning or restructuring messy tabular data files (malformed rows, misplaced headers, junk data) into proper spreadsheets. The deliverable must be a spreadsheet file. Do NOT trigger when the primary deliverable is a Word document, HTML report, standalone Python script, database pipeline, or Google Sheets API integration, even if tabular data is involved. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| shipping-and-launchaddyosmani/agent-skillsPrepares production launches. Use when preparing to deploy to production, or when asking what needs to be in place before shipping. Use when you need a pre-launch checklist, when setting up monitoring, when planning a staged rollout, or when you need a rollback strategy. | Stars: 119k | Updated | Claude CodeCodex | Verified | Install |
| childhoodthedotmack/claude-memBabysit a shipped release after merge, publication, or deployment. Verify published packages, production behavior, installed plugins, and late CI or user reports until the observation window is clean; use babysit for PR readiness before release. | Stars: 118k | Updated | Claude CodeCodex | Verified | Install |