{"skill":{"slug":"social-media-autopilot","displayName":"Social Media Autopilot","summary":"Schedule, compose, and publish social media posts across X (Twitter), LinkedIn, and Instagram from OpenClaw. Manage a content calendar, queue posts with appr...","description":"---\nname: social-media-autopilot\ndescription: \"Schedule, compose, and publish social media posts across X (Twitter), LinkedIn, and Instagram from OpenClaw. Manage a content calendar, queue posts with approval workflows, track engagement analytics, and maintain brand voice consistency. Use when: (1) scheduling or publishing social media posts, (2) managing a content calendar, (3) drafting posts for multiple platforms, (4) reviewing post performance/analytics, (5) setting up automated posting workflows, or (6) maintaining a social media presence.\"\n---\n\n# Social Media Autopilot\n\nMulti-platform social media management from your OpenClaw agent. Schedule posts, manage a content calendar, get approval before publishing, and track performance.\n\n## Setup\n\n### Required API Credentials\n\nConfigure in your environment or `.env` file:\n\n- **X (Twitter):** Requires `xurl` skill or X API v2 credentials (`X_BEARER_TOKEN`, `X_API_KEY`, `X_API_SECRET`, `X_ACCESS_TOKEN`, `X_ACCESS_SECRET`)\n- **LinkedIn:** `LINKEDIN_ACCESS_TOKEN` (OAuth 2.0 — see `references/linkedin-setup.md`)\n- **Instagram:** `INSTAGRAM_ACCESS_TOKEN` + `INSTAGRAM_BUSINESS_ID` (Meta Graph API — see `references/instagram-setup.md`)\n\n### Content Directory\n\nAll content lives in `~/.openclaw/workspace/social-media/`:\n\n```\nsocial-media/\n├── calendar.json        # Scheduled posts\n├── drafts/              # Posts awaiting approval\n├── published/           # Archive of sent posts\n├── templates/           # Reusable post templates\n└── analytics/           # Performance data\n```\n\nRun `scripts/init-workspace.sh` to create this structure.\n\n## Core Workflows\n\n### 1. Draft & Schedule Posts\n\nTo create a post:\n\n1. Run `scripts/draft-post.sh --platform <x|linkedin|instagram|all> --text \"Post content\" [--media path/to/image] [--schedule \"2026-02-25 09:00 PST\"]`\n2. Post saves to `drafts/` as a JSON file with metadata\n3. If `--schedule` is set, it's added to `calendar.json`\n4. Without `--schedule`, it queues for immediate review\n\nDraft JSON format:\n```json\n{\n  \"id\": \"uuid\",\n  \"platforms\": [\"x\", \"linkedin\"],\n  \"text\": \"Post content here\",\n  \"media\": [],\n  \"scheduled_at\": \"2026-02-25T17:00:00Z\",\n  \"status\": \"draft\",\n  \"created_at\": \"2026-02-23T22:00:00Z\",\n  \"approved\": false,\n  \"tags\": [\"product-launch\"],\n  \"thread\": false\n}\n```\n\n### 2. Approval Workflow\n\nBefore any post goes live:\n\n1. Agent presents the draft to the user with platform previews\n2. User approves, edits, or rejects\n3. Only approved posts get published\n4. Use `scripts/approve-post.sh <post-id>` or `scripts/reject-post.sh <post-id> --reason \"...\"`\n\n**Never auto-publish without explicit approval** unless the user has configured `auto_approve: true` in `social-media/config.json`.\n\n### 3. Publishing\n\nRun `scripts/publish-post.sh <post-id>` to publish an approved post.\n\nThe script:\n- Validates the post is approved\n- Adapts content per platform (character limits, hashtag style, media format)\n- Posts via each platform's API\n- Saves response data (post IDs, URLs) to `published/`\n- Updates `calendar.json` status\n\nPlatform-specific adaptations:\n- **X:** 280 char limit, auto-thread if longer, image upload via media endpoint\n- **LinkedIn:** 3000 char limit, supports articles and documents\n- **Instagram:** Requires media (image/video), caption limit 2200 chars\n\n### 4. Content Calendar\n\nView and manage scheduled content:\n\n- `scripts/calendar.sh --week` — Show this week's schedule\n- `scripts/calendar.sh --month` — Monthly overview\n- `scripts/calendar.sh --gaps` — Find gaps in posting schedule\n- `scripts/calendar.sh --reschedule <post-id> \"new-datetime\"` — Move a post\n\n### 5. Analytics\n\nPull engagement data for published posts:\n\n- `scripts/analytics.sh --last 7d` — Last 7 days performance\n- `scripts/analytics.sh --post <post-id>` — Single post performance\n- `scripts/analytics.sh --report weekly` — Generate weekly report\n\nMetrics tracked: impressions, engagements, clicks, replies, reposts, likes, followers gained.\n\n### 6. Templates & Brand Voice\n\nStore reusable templates in `templates/`:\n\n```json\n{\n  \"name\": \"product-announcement\",\n  \"platforms\": [\"x\", \"linkedin\"],\n  \"template\": \"🚀 {product_name} is here!\\n\\n{description}\\n\\n{link}\\n\\n{hashtags}\",\n  \"variables\": [\"product_name\", \"description\", \"link\", \"hashtags\"],\n  \"voice_notes\": \"Excited but professional. No ALL CAPS.\"\n}\n```\n\nWhen composing posts, reference `social-media/brand-voice.md` for tone guidelines if it exists.\n\n## Cron Integration\n\nAdd to OpenClaw cron for automated workflows:\n\n- **Publish scheduled posts:** Check `calendar.json` every 15 min, publish any due approved posts\n- **Daily digest:** Summarize yesterday's analytics each morning\n- **Gap alerts:** Notify if no posts scheduled for next 48h\n\n## Error Handling\n\n- API rate limits: Back off and retry with exponential delay\n- Failed posts: Move to `drafts/` with `status: \"failed\"` and error message\n- Expired tokens: Alert user to re-authenticate\n\n## References\n\n- `references/linkedin-setup.md` — LinkedIn OAuth setup guide\n- `references/instagram-setup.md` — Instagram/Meta Graph API setup guide\n- `references/platform-limits.md` — Character limits, media specs, rate limits per platform\n","tags":{"automation":"1.0.0","latest":"1.0.0","social-media":"1.0.0"},"stats":{"comments":0,"downloads":298,"installsAllTime":0,"installsCurrent":0,"stars":0,"versions":1},"createdAt":1771912516359,"updatedAt":1779078744398},"latestVersion":{"version":"1.0.0","createdAt":1771912516359,"changelog":"Initial release","license":null},"metadata":null,"owner":{"handle":"reighlan","userId":"s176t3enhma27126tjq358btsx884rys","displayName":"Tyler Hill","image":"https://avatars.githubusercontent.com/u/5706227?v=4"},"moderation":{"isSuspicious":false,"isMalwareBlocked":false,"verdict":"clean","reasonCodes":["review.llm_review"],"summary":"Review: review.llm_review","engineVersion":"v2.4.24","updatedAt":1780089731365}}