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/pick-next-article.sh.bak.1779689674
View on GitHub#!/usr/bin/env bash
# Find the most recent 微信公众号 article that hasn't been tweeted yet.
# Output: absolute path to the article folder (one line), or empty + exit 1
# if no unposted article in last 14 days.
#
# Rotation rule: newest article first; skip if its slug appears in
# history.jsonl with status="posted".
set -u
HERE="$(cd "$(dirname "$0")" && pwd)"
SKILL_DIR="$(cd "$HERE/.." && pwd)"
HISTORY="$SKILL_DIR/state/history.jsonl"
ARTICLES_DIR="$HOME/Library/Mobile Documents/com~apple~CloudDocs/my/我的项目/我的创作/wechat-publish/articles"
MAX_AGE_DAYS=14
[[ -d "$ARTICLES_DIR" ]] || { echo "error: $ARTICLES_DIR not found" >&2; exit 2; }
[[ -f "$HISTORY" ]] || touch "$HISTORY"
today_epoch=$(date +%s)
# Walk articles by article.md mtime (most-recently-touched first). Folder-name
# date is the publish date, but multiple articles can share a date; mtime is
# the true "freshness" signal.
SORTED=$(for d in "$ARTICLES_DIR"/[0-9]*-*/; do
[[ -f "${d}article.md" ]] || continue
printf '%s\t%s\n' "$(stat -f %m "${d}article.md")" "$d"
done | sort -rn | cut -f2)
while IFS= read -r folder; do
[[ -n "$folder" ]] || continue
slug=$(basename "$folder")
date_part="${slug:0:10}" # YYYY-MM-DD
folder_epoch=$(date -j -f "%Y-%m-%d" "$date_part" +%s 2>/dev/null || echo 0)
[[ "$folder_epoch" -gt 0 ]] || continue
age_days=$(( (today_epoch - folder_epoch) / 86400 ))
[[ "$age_days" -gt "$MAX_AGE_DAYS" ]] && continue
[[ -f "${folder}article.md" ]] || continue
# Skip if already posted
if grep -F "\"slug\":\"${slug}\"" "$HISTORY" 2>/dev/null \
| grep -qF "\"status\":\"posted\""; then
continue
fi
echo "${folder%/}"
exit 0
done <<< "$SORTED"
echo "no unposted article in last $MAX_AGE_DAYS days" >&2
exit 1
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: 196k | 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: 196k | 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: 196k | Updated | Claude CodeCodex | Verified | Install |