jianshuo/claude-skills / wjs-syndicating-articles
wjs-syndicating-articles
VerifiedUse when the user wants to auto-syndicate their latest 微信公众号 article across social platforms — picks the newest un-syndicated article, extracts one core copy, auto-posts to API platforms (X / Bluesky / Threads / LinkedIn) and prepares a copy-paste outbox for manual platforms (Facebook / 小红书 / 即刻 / 知乎). Triggers — "分发文章到各平台", "同步到社交平台", "今天的文章发各平台", "/wjs-syndicating-articles".
| File | Kind | Size |
|---|---|---|
| .gitignore | other | 51 B |
| SKILL.md | skill md | 4.8 KB |
| config.json | config | 708 B |
| run-scheduled.sh | script | 1.5 KB |
| scripts/build-outbox.shexecutable | script | 2.0 KB |
| scripts/history.shexecutable | script | 1.4 KB |
| scripts/lib.sh | script | 886 B |
| scripts/pick-next-article.shexecutable | script | 630 B |
| scripts/post-bluesky.sh | script | 1.5 KB |
| scripts/post-linkedin.sh | script | 1.2 KB |
| scripts/post-threads.sh | script | 1.3 KB |
| scripts/post-x.sh | script | 815 B |
| scripts/syndicate.shexecutable | script | 2.6 KB |
| scripts/test/assert.sh | script | 955 B |
| scripts/test/test_build_outbox.sh | script | 1.7 KB |
| scripts/test/test_e2e_dryrun.sh | script | 1.9 KB |
| scripts/test/test_history.sh | script | 1.5 KB |
| scripts/test/test_pick.sh | script | 1.0 KB |
| scripts/test/test_post_bluesky.sh | script | 1.1 KB |
| scripts/test/test_post_linkedin.sh | script | 824 B |
| scripts/test/test_post_threads.sh | script | 735 B |
| scripts/test/test_post_x.sh | script | 581 B |
| scripts/test/test_syndicate.sh | script | 2.7 KB |
| secrets.json.example | other | 263 B |
scripts/test/test_syndicate.sh
View on GitHub#!/usr/bin/env bash
set -uo pipefail
HERE="$(cd "$(dirname "$0")" && pwd)"
source "$HERE/assert.sh"
SKILL="$(cd "$HERE/../.." && pwd)"
TMP="$(mktemp -d)"; trap 'rm -rf "$TMP"' EXIT
ART="$TMP/articles"; F="$ART/2026-05-20-demo"; mkdir -p "$F"; printf 'P' > "$F/cover.png"
PT="$TMP/post.txt"; printf '一套文案。\nhttps://mp.weixin.qq.com/x' > "$PT"
export SYND_HISTORY="$TMP/history.jsonl"; : > "$SYND_HISTORY"
export SYND_SECRETS="$TMP/none.json" # no creds -> api platforms degrade
export SYND_TW_HISTORY="$TMP/tw_none.jsonl"; : > "$SYND_TW_HISTORY"
SYN="$SKILL/scripts/syndicate.sh"
# --- dry-run writes NO history ---
CFG_DRY="$TMP/cfg_dry.json"; jq --arg d "$ART" '.articles_dir=$d' "$SKILL/config.json" > "$CFG_DRY"
export SYND_CONFIG="$CFG_DRY"
OUT="$(bash "$SYN" "$F" "$PT" --dry-run)"; CODE=$?
assert_exit "$CODE" 0 "dry-run exits 0"
assert_contains "$OUT" "2026-05-20-demo" "dry-run prints basename slug"
assert_eq "$(wc -l < "$SYND_HISTORY" | tr -d ' ')" "0" "dry-run writes no history"
# --- real run with X forced to outbox mode (no network at all) ---
CFG="$TMP/cfg.json"; jq --arg d "$ART" '.articles_dir=$d | .platforms.x.mode="outbox"' "$SKILL/config.json" > "$CFG"
export SYND_CONFIG="$CFG"
: > "$SYND_HISTORY"
bash "$SYN" "$F" "$PT" >/dev/null
# slug recorded must be the basename
assert_eq "$(jq -r 'select(.platform=="bluesky").slug' "$SYND_HISTORY")" "2026-05-20-demo" "history slug = folder basename"
# bluesky/threads/linkedin degrade to queued no_creds
assert_eq "$(jq -r 'select(.platform=="bluesky").status' "$SYND_HISTORY")" "queued" "bluesky queued (no creds)"
assert_eq "$(jq -r 'select(.platform=="bluesky").reason' "$SYND_HISTORY")" "no_creds" "bluesky reason no_creds"
# all 8 platforms recorded exactly once
assert_eq "$(wc -l < "$SYND_HISTORY" | tr -d ' ')" "8" "all 8 platforms recorded once"
# outbox built (no double date prefix)
assert_file "$SKILL/outbox/2026-05-20-demo/OPEN.md" "outbox OPEN.md at outbox/<basename>"
# idempotent: rerun does not add duplicates
bash "$SYN" "$F" "$PT" >/dev/null
assert_eq "$(wc -l < "$SYND_HISTORY" | tr -d ' ')" "8" "rerun adds no duplicates (idempotent)"
# --- X cross-skill dedup: tweeting history already posted this slug -> x skipped, no network ---
CFG2="$TMP/cfg2.json"; jq --arg d "$ART" '.articles_dir=$d' "$SKILL/config.json" > "$CFG2" # x stays api
export SYND_CONFIG="$CFG2"
: > "$SYND_HISTORY"
echo '{"slug":"2026-05-20-demo","status":"posted"}' > "$SYND_TW_HISTORY"
bash "$SYN" "$F" "$PT" >/dev/null
assert_eq "$(jq -r 'select(.platform=="x").status' "$SYND_HISTORY")" "skipped" "x skipped via tweeting-skill dedup (no real post)"
# cleanup any outbox this test created
rm -rf "$SKILL/outbox/2026-05-20-demo"
finish test_syndicate
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| receiving-code-reviewobra/superpowersUse when receiving code review feedback, before implementing suggestions, especially if feedback seems unclear or technically questionable - requires technical rigor and verification, not performative agreement or blind implementation | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| requesting-code-reviewobra/superpowersUse when completing tasks, implementing major features, or before merging to verify work meets requirements | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| using-git-worktreesobra/superpowersUse when starting feature work that needs isolation from current workspace or before executing implementation plans - ensures an isolated workspace exists via native tools or git worktree fallback | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| verification-before-completionobra/superpowersUse when about to claim work is complete, fixed, or passing, before committing or creating PRs - requires running verification commands and confirming output before making any success claims; evidence before assertions always | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |