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/post-bluesky.sh

View on GitHub
#!/usr/bin/env bash
# post-bluesky.sh <post.txt> [--dry-run]  exit: 0 ok / 3 no creds / other fail
set -uo pipefail
source "$(dirname "${BASH_SOURCE[0]}")/lib.sh"
TXT_FILE="${1:?usage: post-bluesky.sh <post.txt> [--dry-run]}"
DRY="${2:-}"
TEXT="$(cat "$TXT_FILE")"

HANDLE="$(secret '.bluesky.handle')"
APPPW="$(secret '.bluesky.app_password')"
[[ -n "$HANDLE" && -n "$APPPW" ]] || { echo "bluesky: no creds" >&2; exit 3; }

if [[ "$DRY" == "--dry-run" ]]; then echo "bluesky would post: $TEXT"; exit 0; fi

PDS="https://bsky.social"
sess="$(curl -fsS -X POST "$PDS/xrpc/com.atproto.server.createSession" \
  -H 'Content-Type: application/json' \
  -d "$(jq -nc --arg id "$HANDLE" --arg pw "$APPPW" '{identifier:$id,password:$pw}')")" \
  || { echo "bluesky session failed" >&2; exit 1; }
JWT="$(echo "$sess" | jq -r .accessJwt)"; DID="$(echo "$sess" | jq -r .did)"
[[ -n "$JWT" && "$JWT" != "null" ]] || { echo "bluesky auth failed: $sess" >&2; exit 1; }

NOW="$(date -u +%Y-%m-%dT%H:%M:%S.000Z)"
rec="$(jq -nc --arg t "$TEXT" --arg now "$NOW" --arg did "$DID" \
  '{repo:$did,collection:"app.bsky.feed.post",record:{ "$type":"app.bsky.feed.post", text:$t, createdAt:$now }}')"
resp="$(curl -fsS -X POST "$PDS/xrpc/com.atproto.repo.createRecord" \
  -H "Authorization: Bearer $JWT" -H 'Content-Type: application/json' -d "$rec")" \
  || { echo "bluesky post failed: $resp" >&2; exit 1; }
uri="$(echo "$resp" | jq -r .uri)"
rkey="${uri##*/}"
echo "url=https://bsky.app/profile/$HANDLE/post/$rkey"
echo "post_id=$rkey"
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: 323kUpdated Claude CodeCodexVerifiedInstall
requesting-code-reviewobra/superpowersUse when completing tasks, implementing major features, or before merging to verify work meets requirementsStars: 323kUpdated 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: 323kUpdated 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: 323kUpdated Claude CodeCodexVerifiedInstall