Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
106 changes: 106 additions & 0 deletions skills/content-distributor/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
---
name: content-distributor
description: Distribute one image plus source text from OpenClaw to multiple social channels with platform-aware caption variants and a single dispatch step. Use when a user wants to turn a screenshot/photo + short message into cross-posts for LinkedIn, Threads, Facebook personal page, Instagram, YouTube feed/community post, Substack note/feed post, and TikTok image post.
---

# Content Distributor

Use this skill to replace manual copy/paste posting with one intake payload and one dispatch command.

## Workflow

### 1. Collect one source payload from OpenClaw

Require:

- `image_url` or local image path
- `text` (source caption/body)

Optional:

- `title`
- `channels` (defaults to all supported channels)
- `tags`
- `link`

If OpenClaw receives MMS or screenshot uploads, pass the resolved media URL/path and user text directly to the script.

### 2. Build channel-specific variants + dispatch

Run:

```bash
python3 skills/content-distributor/scripts/distribute_content.py \
--image "https://example.com/screenshot.jpg" \
--text "Your source post text here" \
--channels linkedin,threads,facebook,instagram,youtube,substack,tiktok \
--output-dir output/content-distributor \
--execute
```

Without `--execute`, the script runs in planning mode and only writes payload files.

The script:

- Normalizes whitespace and removes risky overlength captions
- Produces per-platform text variants
- Sends one JSON payload per channel to that channel's webhook endpoint
- Writes an audit file with per-channel delivery result

### 3. Connect each webhook to posting actions

Set one inbound webhook per platform in your automation layer (n8n, Make, Zapier, OpenClaw bridge, or internal workers):

- LinkedIn post worker
- Threads post worker
- Facebook personal posting worker
- Instagram image worker
- YouTube community/feed worker
- Substack note worker
- TikTok photo post worker

Each worker receives the same canonical payload schema from this skill and owns platform auth + retries.

## Required Environment

Set only the channels you actively use:

- `CONTENT_DISTRIBUTOR_WEBHOOK_LINKEDIN`
- `CONTENT_DISTRIBUTOR_WEBHOOK_THREADS`
- `CONTENT_DISTRIBUTOR_WEBHOOK_FACEBOOK`
- `CONTENT_DISTRIBUTOR_WEBHOOK_INSTAGRAM`
- `CONTENT_DISTRIBUTOR_WEBHOOK_YOUTUBE`
- `CONTENT_DISTRIBUTOR_WEBHOOK_SUBSTACK`
- `CONTENT_DISTRIBUTOR_WEBHOOK_TIKTOK`

Optional:

- `CONTENT_DISTRIBUTOR_SHARED_SECRET` (HMAC signature header for webhook verification)
- `CONTENT_DISTRIBUTOR_TIMEOUT_SECONDS` (default `20`)

## Canonical Payload Schema

Every webhook receives:

- `request_id`
- `timestamp_utc`
- `channel`
- `source.text`
- `source.title`
- `source.image`
- `source.link`
- `source.tags`
- `variant.text`
- `variant.hashtags`
- `variant.max_length`

## Safety Rules

- Never post without explicit `--execute`.
- If a channel webhook is missing, skip that channel and log it.
- Keep the source meaning intact across all variants; no fabricated claims.
- Keep per-platform tags concise and avoid repetitive hashtag stuffing.

## References

- `references/platform-notes.md`
4 changes: 4 additions & 0 deletions skills/content-distributor/agents/openai.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
interface:
display_name: "Content Distributor"
short_description: "Fan-out one image post across major social channels."
default_prompt: "Take this screenshot/image and caption, create platform-safe variants, and distribute to LinkedIn, Threads, Facebook, Instagram, YouTube, Substack Notes, and TikTok through configured webhooks with delivery audit output."
47 changes: 47 additions & 0 deletions skills/content-distributor/references/platform-notes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Platform Notes

Use this file as operational guardrails when wiring each channel webhook worker.

## LinkedIn

- Prefer first-party API posting through a member-authorized app.
- Keep post text concise; if long-form context is needed, link out.

## Threads

- Use Meta API flow tied to the connected account.
- Image + short caption is the default format.

## Facebook Personal Page

- Personal timeline posting via API can be restricted by Meta policy and app permissions.
- Keep a browser automation fallback (Playwright) if direct API is unavailable.

## Instagram

- Posting APIs are typically available for professional accounts.
- Validate image aspect ratio before dispatch.

## YouTube Feed/Community

- API coverage for community/feed posting is limited.
- Keep browser automation fallback ready and check account eligibility before publish.

## Substack Notes

- Substack supports notes in-product; API support may vary.
- Use browser automation fallback when direct API is not available.

## TikTok Image Post

- Content posting APIs may require specific account/app approval.
- Keep image-safe fallback path in automation.

## Worker Contract

Each platform worker should:

1. Validate incoming HMAC signature when `X-Content-Distributor-Signature` exists.
2. Enforce platform constraints (length, media shape, required fields).
3. Return JSON: `{ "ok": boolean, "external_id": "...", "error": "..." }`.
4. Implement retry with idempotency on `request_id + channel`.
Loading