jianshuo/claude-skills / wjs-tweeting-from-articles
wjs-tweeting-from-articles
UnverifiedUse when the user wants to post a daily X/Twitter tweet inspired by one of their recently-published 微信公众号 articles. Picks the newest article that hasn't been tweeted yet, drafts 3 tweet candidates from it (different angles — quote / metaphor / one-liner), posts the chosen one via xurl, records to history. Triggers — "每天发一个 tweet", "从文章里发推", "今天的 tweet", "/wjs-tweeting-from-articles".
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 7.7 KB |
| com.jianshuo.wjs-tweeting-from-articles.plist.template | other | 1.0 KB |
| daily.shexecutable | script | 6.0 KB |
| scripts/mirror-articles.pyexecutable | script | 2.1 KB |
| scripts/pick-next-article.shexecutable | script | 2.7 KB |
| scripts/pick-next-article.sh.bak.1779689674executable | script | 1.7 KB |
| setup.shexecutable | script | 2.4 KB |
| state/.gitignore | other | 8 B |
| state/queue-2026-05-24.tsv | other | 4.4 KB |
| uninstall.shexecutable | script | 510 B |
scripts/mirror-articles.py
View on GitHub#!/usr/bin/env python3
"""Mirror the iCloud wechat-publish articles to a LOCAL dir so the (bash)
tweet picker never has to read iCloud from launchd.
Why: launchd-spawned bash doesn't get TCC Full Disk Access reliably (the
picker rests with "backlog empty"), but python3 DOES read iCloud fine from
launchd (proven by the multicam render job). So daily.sh runs THIS first to
copy each article's article.md (+ meta.json) into ~/.local/share, preserving
mtime (the picker sorts by mtime). Tiny text files, fast.
"""
import os, glob, sys
SRC = os.path.expanduser("~/code/wechat-publish/articles")
DST = os.path.expanduser("~/.local/share/wjs-tweet-articles/articles")
def safe_copy(src, dst):
"""Buffered read→write copy that preserves mtime.
Deliberately avoids shutil.copy2/copyfile: on macOS APFS those call
_fastcopy_fcopyfile (a clone syscall) which deadlocks (EDEADLK / errno 11,
"Resource deadlock avoided") against the iCloud daemon for synced files.
Plain open/read/write never touches fcopyfile, so it's iCloud-safe.
"""
with open(src, "rb") as fsrc, open(dst, "wb") as fdst:
while True:
buf = fsrc.read(1 << 20)
if not buf:
break
fdst.write(buf)
st = os.stat(src)
os.utime(dst, (st.st_atime, st.st_mtime)) # preserve mtime (picker sorts by it)
os.makedirs(DST, exist_ok=True)
n = 0
fail = 0
for d in glob.glob(os.path.join(SRC, "[0-9]*-*/")):
slug = os.path.basename(d.rstrip("/"))
amd = os.path.join(d, "article.md")
if not os.path.isfile(amd):
continue
outdir = os.path.join(DST, slug)
os.makedirs(outdir, exist_ok=True)
try:
safe_copy(amd, os.path.join(outdir, "article.md"))
meta = os.path.join(d, "meta.json")
if os.path.isfile(meta):
safe_copy(meta, os.path.join(outdir, "meta.json"))
n += 1
except OSError as e:
fail += 1
print(f"[mirror] WARN skip {slug}: {e}", file=sys.stderr)
print(f"[mirror] {n} articles → {DST}" + (f" ({fail} skipped)" if fail else ""),
file=sys.stderr)
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack." | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |