Skip to content

jianshuo/claude-skills / wjs-syndicating-articles

wjs-syndicating-articles

Verified

Use 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".

scripts/test/test_e2e_dryrun.sh

View on GitHub
#!/usr/bin/env bash
# Exercises the mechanical pipeline (pick -> dry-run posts -> outbox -> history)
# without network or live SKILL.md orchestration.
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 '手感这东西,得每天练。' > "$F/article.md"
printf 'PNG' > "$F/cover.png"
CFG="$TMP/config.json"; jq --arg d "$ART" '.articles_dir=$d' "$SKILL/config.json" > "$CFG"
export SYND_CONFIG="$CFG"; export SYND_HISTORY="$TMP/history.jsonl"; : > "$SYND_HISTORY"
export SYND_SECRETS="$TMP/none.json"   # no creds -> bluesky/threads/linkedin degrade

# pick
PICK="$(bash "$SKILL/scripts/pick-next-article.sh")"
assert_eq "$(basename "$PICK")" "2026-05-20-demo" "e2e: picks the demo article"

# write post.txt (simulating Claude's Step 2) — keep it outside the outbox dir
# so build-outbox.sh can cp it in without a self-copy error
POST_TXT="$TMP/post.txt"
printf '手感这东西,得每天练。\nhttps://mp.weixin.qq.com/x' > "$POST_TXT"
OB="$TMP/outbox/2026-05-20-demo"; mkdir -p "$OB"

# X dry-run ok
bash "$SKILL/scripts/post-x.sh" "$POST_TXT" --dry-run >/dev/null; assert_exit $? 0 "e2e: x dry-run ok"
# bluesky/threads/linkedin degrade (exit 3) with no creds
bash "$SKILL/scripts/post-bluesky.sh" "$POST_TXT" >/dev/null 2>&1; assert_exit $? 3 "e2e: bluesky degrades"
bash "$SKILL/scripts/post-threads.sh" "$POST_TXT" >/dev/null 2>&1; assert_exit $? 3 "e2e: threads degrades"
bash "$SKILL/scripts/post-linkedin.sh" "$POST_TXT" >/dev/null 2>&1; assert_exit $? 3 "e2e: linkedin degrades"

# outbox builds
bash "$SKILL/scripts/build-outbox.sh" "$F" "$POST_TXT" "$OB" >/dev/null
assert_file "$OB/OPEN.md" "e2e: outbox OPEN.md exists"
assert_file "$OB/image.png" "e2e: outbox image exists"

finish test_e2e_dryrun
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 implementationStars: 322kUpdated Claude CodeCodexVerifiedInstall
requesting-code-reviewobra/superpowersUse when completing tasks, implementing major features, or before merging to verify work meets requirementsStars: 322kUpdated Claude CodeCodexVerifiedInstall
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 fallbackStars: 322kUpdated Claude CodeCodexVerifiedInstall
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 alwaysStars: 322kUpdated Claude CodeCodexVerifiedInstall