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 |
setup.sh
View on GitHub#!/usr/bin/env bash
# One-time setup: check prereqs, install launchd plist for daily 09:00 run.
# Re-runnable: safe to run multiple times.
set -euo pipefail
HERE="$(cd "$(dirname "$0")" && pwd)"
LABEL="com.jianshuo.wjs-tweeting-from-articles"
PLIST_DEST="${HOME}/Library/LaunchAgents/${LABEL}.plist"
LOG_DIR="${HOME}/Library/Logs/wjs-tweeting-from-articles"
echo "=== wjs-tweeting-from-articles setup ==="
# 1. Prereqs
echo "→ checking prereqs..."
for bin in claude xurl jq; do
if ! command -v "$bin" >/dev/null 2>&1; then
echo "✗ missing: $bin"
case "$bin" in
jq) echo " install: brew install jq" ;;
xurl) echo " install: brew install xurl, then xurl auth login" ;;
claude) echo " install: see https://claude.com/code" ;;
esac
exit 1
fi
done
echo "✓ claude, xurl, jq present"
# 2. xurl auth
echo "→ verifying xurl auth..."
if ! xurl whoami >/dev/null 2>&1; then
echo "✗ xurl whoami failed. Run: xurl auth login"
exit 1
fi
user=$(xurl whoami 2>/dev/null | jq -r '.data.username // .data.name // empty')
echo "✓ xurl authenticated as: ${user:-<unknown>}"
# 3. State + log dirs
mkdir -p "${HERE}/state" "$LOG_DIR"
touch "${HERE}/state/history.jsonl"
# 4. Install plist
echo "→ installing launchd plist at ${PLIST_DEST}"
if launchctl print "gui/$(id -u)/${LABEL}" >/dev/null 2>&1; then
echo " unloading existing job..."
launchctl bootout "gui/$(id -u)" "$PLIST_DEST" 2>/dev/null || true
fi
mkdir -p "$(dirname "$PLIST_DEST")"
sed -e "s|__DAILY_SH__|${HERE}/daily.sh|g" \
-e "s|__HOME__|${HOME}|g" \
"${HERE}/com.jianshuo.wjs-tweeting-from-articles.plist.template" > "$PLIST_DEST"
launchctl bootstrap "gui/$(id -u)" "$PLIST_DEST"
launchctl enable "gui/$(id -u)/${LABEL}"
echo "✓ loaded + enabled. Next run: tomorrow 09:00 (your local time)."
cat <<EOF
=== setup complete ===
Schedule: Daily at 09:00 (macOS launchd, local time)
Log: ${LOG_DIR}/daily-YYYY-MM-DD.log
launchd: ${PLIST_DEST}
Useful commands:
${HERE}/scripts/pick-next-article.sh # see what tomorrow will pick
DRY_RUN=1 ${HERE}/daily.sh # full dry-run (draft, no post)
${HERE}/daily.sh # force a real run now
launchctl print gui/$(id -u)/${LABEL} # inspect launchd state
${HERE}/uninstall.sh # stop auto-runs
To trigger the job manually now:
launchctl kickstart -k gui/$(id -u)/${LABEL}
tail -f ${LOG_DIR}/daily-\$(date +%Y-%m-%d).log
EOF
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 |