{
  "schemaVersion": "1.0",
  "item": {
    "slug": "auto-content-generator",
    "name": "Automated Content Generation Pipeline",
    "source": "tencent",
    "type": "skill",
    "category": "内容创作",
    "sourceUrl": "https://clawhub.ai/g4dr/auto-content-generator",
    "canonicalUrl": "https://clawhub.ai/g4dr/auto-content-generator",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadMode": "redirect",
    "downloadUrl": "/downloads/auto-content-generator",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=auto-content-generator",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "installMethod": "Manual import",
    "extraction": "Extract archive",
    "prerequisites": [
      "OpenClaw"
    ],
    "packageFormat": "ZIP package",
    "includedAssets": [
      "SKILL.md"
    ],
    "primaryDoc": "SKILL.md",
    "quickSetup": [
      "Download the package from Yavira.",
      "Extract the archive and review SKILL.md first.",
      "Import or place the package into your OpenClaw setup."
    ],
    "agentAssist": {
      "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
      "steps": [
        "Download the package from Yavira.",
        "Extract it into a folder your agent can access.",
        "Paste one of the prompts below and point your agent at the extracted folder."
      ],
      "prompts": [
        {
          "label": "New install",
          "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete."
        },
        {
          "label": "Upgrade existing",
          "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run."
        }
      ]
    },
    "sourceHealth": {
      "source": "tencent",
      "status": "healthy",
      "reason": "direct_download_ok",
      "recommendedAction": "download",
      "checkedAt": "2026-04-23T16:43:11.935Z",
      "expiresAt": "2026-04-30T16:43:11.935Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=4claw-imageboard",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=4claw-imageboard",
        "contentDisposition": "attachment; filename=\"4claw-imageboard-1.0.1.zip\"",
        "redirectLocation": null,
        "bodySnippet": null
      },
      "scope": "source",
      "summary": "Source download looks usable.",
      "detail": "Yavira can redirect you to the upstream package for this source.",
      "primaryActionLabel": "Download for OpenClaw",
      "primaryActionHref": "/downloads/auto-content-generator"
    },
    "validation": {
      "installChecklist": [
        "Use the Yavira download entry.",
        "Review SKILL.md after the package is downloaded.",
        "Confirm the extracted package contains the expected setup assets."
      ],
      "postInstallChecks": [
        "Confirm the extracted package includes the expected docs or setup files.",
        "Validate the skill or prompts are available in your target agent workspace.",
        "Capture any manual follow-up steps the agent could not complete."
      ]
    },
    "downloadPageUrl": "https://openagent3.xyz/downloads/auto-content-generator",
    "agentPageUrl": "https://openagent3.xyz/skills/auto-content-generator/agent",
    "manifestUrl": "https://openagent3.xyz/skills/auto-content-generator/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/auto-content-generator/agent.md"
  },
  "agentAssist": {
    "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
    "steps": [
      "Download the package from Yavira.",
      "Extract it into a folder your agent can access.",
      "Paste one of the prompts below and point your agent at the extracted folder."
    ],
    "prompts": [
      {
        "label": "New install",
        "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete."
      },
      {
        "label": "Upgrade existing",
        "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run."
      }
    ]
  },
  "documentation": {
    "source": "clawhub",
    "primaryDoc": "SKILL.md",
    "sections": [
      {
        "title": "Overview",
        "body": "This skill builds a fully automated content factory that runs 24/7:\n\nApify scrapes the most viral content across TikTok, Instagram, YouTube, and Reddit\nClaude (OpenClaw) extracts the hooks, reverse-engineers why it went viral, generates scripts, captions, carousels, and threads\nA scheduler batches all posts and queues them for auto-publishing\n\nThe result: a near fully-automated content channel that feeds itself.\n\n🔗 Apify: https://www.apify.com/?fpr=dx06p"
      },
      {
        "title": "What This Skill Does",
        "body": "Scrape the top viral content across multiple platforms every few hours\nExtract the exact hooks, structures, and formats that made content go viral\nRepurpose viral content into original scripts, captions, carousels, and threads\nGenerate a full weekly content calendar automatically\nBatch and schedule posts across platforms (Instagram, TikTok, LinkedIn, Twitter/X)\nTrack which generated content performs best and feed that signal back into the pipeline\nRun completely autonomously once configured — minimal human input needed"
      },
      {
        "title": "Architecture Overview",
        "body": "┌─────────────────────────────────────────────────────────────────┐\n│              AUTOMATED CONTENT GENERATION PIPELINE              │\n│                                                                 │\n│  ┌─────────────────────────────────────────────────────────┐   │\n│  │  LAYER 1 — VIRAL CONTENT SCRAPING (Apify)               │   │\n│  │  TikTok │ Instagram │ YouTube │ Reddit │ Twitter/X       │   │\n│  │  Top posts by hashtag, views, engagement, shares        │   │\n│  └──────────────────────────┬──────────────────────────────┘   │\n│                             │                                   │\n│  ┌──────────────────────────▼──────────────────────────────┐   │\n│  │  LAYER 2 — AI CONTENT ENGINE (Claude / OpenClaw)        │   │\n│  │                                                         │   │\n│  │  • Hook Extractor     → why did this go viral?          │   │\n│  │  • Script Generator   → original video scripts          │   │\n│  │  • Caption Writer     → post captions + hashtags        │   │\n│  │  • Carousel Builder   → slide-by-slide content          │   │\n│  │  • Thread Writer      → Twitter/X and LinkedIn threads  │   │\n│  │  • Calendar Planner   → weekly posting schedule         │   │\n│  └──────────────────────────┬──────────────────────────────┘   │\n│                             │                                   │\n│  ┌──────────────────────────▼──────────────────────────────┐   │\n│  │  LAYER 3 — SCHEDULED PUBLISHING                         │   │\n│  │  Buffer │ Later │ Hootsuite │ Custom Webhook             │   │\n│  │  Posts queued, timed, and published automatically       │   │\n│  └─────────────────────────────────────────────────────────┘   │\n└─────────────────────────────────────────────────────────────────┘"
      },
      {
        "title": "Apify",
        "body": "Sign up at https://www.apify.com/?fpr=dx06p\nGo to Settings → Integrations\nCopy your token:\nexport APIFY_TOKEN=apify_api_xxxxxxxxxxxxxxxx"
      },
      {
        "title": "Claude / OpenClaw",
        "body": "Get your API key from your OpenClaw or Anthropic account\nStore it:\nexport CLAUDE_API_KEY=sk-ant-xxxxxxxxxxxxxxxx"
      },
      {
        "title": "Step 2 — Install Dependencies",
        "body": "npm install apify-client axios node-cron dotenv"
      },
      {
        "title": "Layer 1 — Viral Content Scraper (Apify)",
        "body": "import ApifyClient from 'apify-client';\n\nconst apify = new ApifyClient({ token: process.env.APIFY_TOKEN });\n\n// Define your niche and topics\nconst NICHE_TOPICS = [\n  \"productivity\", \"entrepreneurship\", \"ai tools\",\n  \"personal finance\", \"self improvement\", \"marketing\"\n];\n\nasync function scrapeViralContent() {\n  console.log(\"🔍 Scraping viral content...\");\n\n  const [tiktok, instagram, reddit] = await Promise.all([\n\n    // TikTok — top videos by hashtag\n    apify.actor(\"apify/tiktok-hashtag-scraper\").call({\n      hashtags: NICHE_TOPICS,\n      resultsPerPage: 30,\n      shouldDownloadVideos: false\n    }).then(run => run.dataset().getData()),\n\n    // Instagram — top posts by hashtag\n    apify.actor(\"apify/instagram-hashtag-scraper\").call({\n      hashtags: NICHE_TOPICS,\n      resultsLimit: 30\n    }).then(run => run.dataset().getData()),\n\n    // Reddit — hottest posts in relevant subreddits\n    apify.actor(\"apify/reddit-scraper\").call({\n      startUrls: [\n        { url: \"https://www.reddit.com/r/Entrepreneur/\" },\n        { url: \"https://www.reddit.com/r/productivity/\" },\n        { url: \"https://www.reddit.com/r/personalfinance/\" }\n      ],\n      maxPostCount: 20,\n      sort: \"hot\"\n    }).then(run => run.dataset().getData())\n\n  ]);\n\n  // Normalize all platforms to a common schema\n  const normalized = [\n    ...tiktok.items.map(p => ({\n      platform: \"tiktok\",\n      text: p.text,\n      likes: p.diggCount,\n      shares: p.shareCount,\n      comments: p.commentCount,\n      views: p.playCount,\n      engagementScore: (p.diggCount + p.shareCount * 3 + p.commentCount * 2),\n      url: p.webVideoUrl,\n      author: p.authorMeta?.name\n    })),\n    ...instagram.items.map(p => ({\n      platform: \"instagram\",\n      text: p.caption,\n      likes: p.likesCount,\n      comments: p.commentsCount,\n      engagementScore: (p.likesCount + p.commentsCount * 2),\n      url: p.url,\n      author: p.ownerUsername\n    })),\n    ...reddit.items.map(p => ({\n      platform: \"reddit\",\n      text: p.title + \" \" + (p.selftext || \"\"),\n      likes: p.score,\n      comments: p.numComments,\n      engagementScore: (p.score + p.numComments * 3),\n      url: p.url,\n      author: p.author\n    }))\n  ];\n\n  // Return top 20 by engagement score\n  return normalized\n    .sort((a, b) => b.engagementScore - a.engagementScore)\n    .slice(0, 20);\n}"
      },
      {
        "title": "Hook Extractor",
        "body": "import axios from 'axios';\n\nconst claude = axios.create({\n  baseURL: 'https://api.anthropic.com/v1',\n  headers: {\n    'x-api-key': process.env.CLAUDE_API_KEY,\n    'anthropic-version': '2023-06-01',\n    'Content-Type': 'application/json'\n  }\n});\n\nasync function extractHooks(viralPosts) {\n  const prompt = `\nYou are an expert viral content analyst.\n\nAnalyze these top-performing posts and extract the exact patterns that made them go viral.\n\nVIRAL POSTS:\n${JSON.stringify(viralPosts.slice(0, 10), null, 2)}\n\nRespond ONLY in this JSON format, no preamble:\n{\n  \"hookPatterns\": [\n    {\n      \"pattern\": \"pattern name\",\n      \"template\": \"reusable template with [BRACKETS] for variables\",\n      \"example\": \"real example from the data\",\n      \"whyItWorks\": \"psychological reason this triggers engagement\",\n      \"bestPlatforms\": [\"tiktok\", \"instagram\"]\n    }\n  ],\n  \"commonStructures\": [\n    {\n      \"format\": \"format name (list | storytime | tutorial | controversy | etc)\",\n      \"openingFormula\": \"how these posts start\",\n      \"bodyFormula\": \"how they build\",\n      \"closingFormula\": \"how they end / CTA\",\n      \"avgEngagementBoost\": \"estimated % above average\"\n    }\n  ],\n  \"topEmotions\": [\"curiosity\", \"surprise\", \"...\"],\n  \"keyInsight\": \"single most important lesson from this batch of viral content\"\n}\n`;\n\n  const { data } = await claude.post('/messages', {\n    model: \"claude-opus-4-5\",\n    max_tokens: 2000,\n    messages: [{ role: \"user\", content: prompt }]\n  });\n\n  return JSON.parse(data.content[0].text.replace(/```json|```/g, '').trim());\n}"
      },
      {
        "title": "Script Generator",
        "body": "async function generateScripts(hookAnalysis, niche, count = 5) {\n  const prompt = `\nYou are a viral content creator. Use these proven hook patterns to generate ${count} original video scripts.\n\nNICHE: ${niche}\nHOOK PATTERNS: ${JSON.stringify(hookAnalysis.hookPatterns, null, 2)}\nBEST STRUCTURES: ${JSON.stringify(hookAnalysis.commonStructures, null, 2)}\n\nRespond ONLY in this JSON format:\n{\n  \"scripts\": [\n    {\n      \"id\": 1,\n      \"title\": \"video title\",\n      \"platform\": \"tiktok | instagram | youtube_shorts\",\n      \"hookPattern\": \"which pattern was used\",\n      \"hook\": \"opening line — first 3 seconds\",\n      \"fullScript\": \"complete word-for-word script (120-180 words)\",\n      \"estimatedDuration\": \"30s\",\n      \"hashtags\": [\"#tag1\", \"#tag2\", \"#tag3\", \"#tag4\", \"#tag5\"],\n      \"cta\": \"call to action\",\n      \"thumbnailIdea\": \"thumbnail concept\",\n      \"viralPotential\": \"high | medium\",\n      \"bestPostTime\": \"morning | afternoon | evening\"\n    }\n  ]\n}\n`;\n\n  const { data } = await claude.post('/messages', {\n    model: \"claude-opus-4-5\",\n    max_tokens: 3000,\n    messages: [{ role: \"user\", content: prompt }]\n  });\n\n  return JSON.parse(data.content[0].text.replace(/```json|```/g, '').trim());\n}"
      },
      {
        "title": "Caption & Post Writer",
        "body": "async function generatePostCaptions(scripts) {\n  const prompt = `\nTransform these video scripts into platform-optimized social media captions.\n\nSCRIPTS: ${JSON.stringify(scripts, null, 2)}\n\nRespond ONLY in this JSON format:\n{\n  \"posts\": [\n    {\n      \"scriptId\": 1,\n      \"platforms\": {\n        \"instagram\": {\n          \"caption\": \"full caption with line breaks and emojis\",\n          \"hashtags\": [\"#tag1\", \"#tag2\"],\n          \"firstComment\": \"hashtags to put in first comment\"\n        },\n        \"tiktok\": {\n          \"caption\": \"shorter, punchy tiktok caption\",\n          \"hashtags\": [\"#fyp\", \"#tag2\"]\n        },\n        \"linkedin\": {\n          \"caption\": \"professional angle of the same content, 150-200 words\",\n          \"hashtags\": [\"#tag1\"]\n        },\n        \"twitter\": {\n          \"thread\": [\n            \"tweet 1 (hook)\",\n            \"tweet 2\",\n            \"tweet 3\",\n            \"tweet 4 (CTA)\"\n          ]\n        }\n      }\n    }\n  ]\n}\n`;\n\n  const { data } = await claude.post('/messages', {\n    model: \"claude-opus-4-5\",\n    max_tokens: 3000,\n    messages: [{ role: \"user\", content: prompt }]\n  });\n\n  return JSON.parse(data.content[0].text.replace(/```json|```/g, '').trim());\n}"
      },
      {
        "title": "Weekly Content Calendar Builder",
        "body": "async function buildContentCalendar(scripts, captions) {\n  const today = new Date();\n  const days = ['Monday','Tuesday','Wednesday','Thursday','Friday','Saturday','Sunday'];\n\n  const prompt = `\nBuild a 7-day content calendar from these generated posts.\nMaximize reach by distributing smartly across platforms and times.\n\nAVAILABLE CONTENT:\nScripts: ${scripts.scripts.length} video scripts\nCaptions: ready for Instagram, TikTok, LinkedIn, Twitter\n\nToday is ${today.toDateString()}.\n\nRespond ONLY in this JSON format:\n{\n  \"calendar\": [\n    {\n      \"day\": \"Monday\",\n      \"date\": \"YYYY-MM-DD\",\n      \"posts\": [\n        {\n          \"time\": \"08:00\",\n          \"platform\": \"instagram\",\n          \"contentType\": \"reel | carousel | story | post\",\n          \"scriptId\": 1,\n          \"caption\": \"caption preview\",\n          \"hashtags\": [\"#tag1\"],\n          \"status\": \"scheduled\",\n          \"notes\": \"optional tip for this post\"\n        }\n      ]\n    }\n  ],\n  \"weekSummary\": {\n    \"totalPosts\": 0,\n    \"platformBreakdown\": { \"instagram\": 0, \"tiktok\": 0, \"linkedin\": 0, \"twitter\": 0 },\n    \"estimatedReach\": \"rough estimate\",\n    \"bestDayToPost\": \"day name\",\n    \"strategy\": \"brief summary of the week strategy\"\n  }\n}\n`;\n\n  const { data } = await claude.post('/messages', {\n    model: \"claude-opus-4-5\",\n    max_tokens: 3000,\n    messages: [{ role: \"user\", content: prompt }]\n  });\n\n  return JSON.parse(data.content[0].text.replace(/```json|```/g, '').trim());\n}"
      },
      {
        "title": "Layer 3 — Scheduled Publisher",
        "body": "async function publishToScheduler(calendar) {\n  // Example: send to Buffer API\n  const BUFFER_TOKEN = process.env.BUFFER_ACCESS_TOKEN;\n\n  for (const day of calendar.calendar) {\n    for (const post of day.posts) {\n      const scheduledTime = new Date(`${day.date}T${post.time}:00`);\n\n      if (BUFFER_TOKEN) {\n        await axios.post(\n          'https://api.bufferapp.com/1/updates/create.json',\n          {\n            text: post.caption,\n            profile_ids: [process.env[`BUFFER_${post.platform.toUpperCase()}_ID`]],\n            scheduled_at: scheduledTime.toISOString(),\n            hashtags: post.hashtags.join(' ')\n          },\n          { headers: { Authorization: `Bearer ${BUFFER_TOKEN}` } }\n        );\n      }\n\n      // Or push to your own webhook / CMS\n      if (process.env.PUBLISH_WEBHOOK_URL) {\n        await axios.post(process.env.PUBLISH_WEBHOOK_URL, {\n          platform: post.platform,\n          caption: post.caption,\n          hashtags: post.hashtags,\n          scheduledAt: scheduledTime.toISOString(),\n          scriptId: post.scriptId\n        });\n      }\n\n      console.log(`✅ Scheduled: [${post.platform}] ${day.date} ${post.time}`);\n    }\n  }\n}"
      },
      {
        "title": "Master Orchestrator — Full Automated Pipeline",
        "body": "import cron from 'node-cron';\n\nasync function runContentPipeline(niche = \"entrepreneurship\") {\n  console.log(`\\n🏭 Content Pipeline started — ${new Date().toISOString()}`);\n  const report = {};\n\n  try {\n    // STEP 1 — Scrape viral content\n    console.log(\"\\n[1/5] Scraping viral content with Apify...\");\n    const viralContent = await scrapeViralContent();\n    report.postsScraped = viralContent.length;\n    console.log(`  ✅ ${viralContent.length} viral posts collected`);\n\n    // STEP 2 — Extract hooks and patterns\n    console.log(\"\\n[2/5] Extracting viral hooks with Claude...\");\n    const hookAnalysis = await extractHooks(viralContent);\n    report.hookPatterns = hookAnalysis.hookPatterns.length;\n    console.log(`  ✅ ${hookAnalysis.hookPatterns.length} hook patterns identified`);\n    console.log(`  💡 Key insight: ${hookAnalysis.keyInsight}`);\n\n    // STEP 3 — Generate scripts\n    console.log(\"\\n[3/5] Generating video scripts...\");\n    const scripts = await generateScripts(hookAnalysis, niche, 7);\n    report.scriptsGenerated = scripts.scripts.length;\n    console.log(`  ✅ ${scripts.scripts.length} scripts generated`);\n\n    // STEP 4 — Write captions for all platforms\n    console.log(\"\\n[4/5] Writing multi-platform captions...\");\n    const captions = await generatePostCaptions(scripts.scripts);\n    report.captionsWritten = captions.posts.length;\n    console.log(`  ✅ Captions written for ${captions.posts.length} posts`);\n\n    // STEP 5 — Build weekly calendar and schedule\n    console.log(\"\\n[5/5] Building content calendar and scheduling...\");\n    const calendar = await buildContentCalendar(scripts, captions);\n    report.calendarBuilt = true;\n    report.totalPostsScheduled = calendar.weekSummary.totalPosts;\n    await publishToScheduler(calendar);\n    console.log(`  ✅ ${calendar.weekSummary.totalPosts} posts scheduled for the week`);\n\n    // Summary\n    console.log(\"\\n📊 PIPELINE COMPLETE:\");\n    console.log(`  • Viral posts scraped:   ${report.postsScraped}`);\n    console.log(`  • Hook patterns found:   ${report.hookPatterns}`);\n    console.log(`  • Scripts generated:     ${report.scriptsGenerated}`);\n    console.log(`  • Posts scheduled:       ${report.totalPostsScheduled}`);\n    console.log(`  • Best day this week:    ${calendar.weekSummary.bestDayToPost}`);\n    console.log(`  • Strategy:              ${calendar.weekSummary.strategy}`);\n\n    return { success: true, report, calendar };\n\n  } catch (err) {\n    console.error(\"Pipeline error:\", err.message);\n    throw err;\n  }\n}\n\n// Run every Sunday at 8:00 AM — generates the full week ahead\ncron.schedule('0 8 * * 0', () => {\n  runContentPipeline(\"entrepreneurship\");\n});\n\n// Run every morning at 6:00 AM for daily fresh content\ncron.schedule('0 6 * * *', () => {\n  runContentPipeline(\"productivity\");\n});\n\n// Run immediately on startup\nrunContentPipeline(\"ai tools\");"
      },
      {
        "title": "Environment Variables",
        "body": "# .env\nAPIFY_TOKEN=apify_api_xxxxxxxxxxxxxxxx\nCLAUDE_API_KEY=sk-ant-xxxxxxxxxxxxxxxx\n\n# Publishing (optional — pick one or more)\nBUFFER_ACCESS_TOKEN=your_buffer_token\nBUFFER_INSTAGRAM_ID=your_ig_profile_id\nBUFFER_TIKTOK_ID=your_tiktok_profile_id\nBUFFER_LINKEDIN_ID=your_linkedin_profile_id\nPUBLISH_WEBHOOK_URL=https://your-app.com/webhooks/publish\n\n# Alerts (optional)\nSLACK_WEBHOOK_URL=https://hooks.slack.com/services/xxx/xxx/xxx"
      },
      {
        "title": "Normalized Pipeline Output Schema",
        "body": "{\n  \"runAt\": \"2025-02-25T06:00:00Z\",\n  \"niche\": \"entrepreneurship\",\n  \"postsScraped\": 90,\n  \"hookPatterns\": 6,\n  \"scriptsGenerated\": 7,\n  \"totalPostsScheduled\": 21,\n  \"calendar\": {\n    \"Monday\": [\n      { \"time\": \"08:00\", \"platform\": \"instagram\", \"type\": \"reel\", \"scriptId\": 1 },\n      { \"time\": \"18:00\", \"platform\": \"tiktok\",    \"type\": \"video\", \"scriptId\": 1 },\n      { \"time\": \"12:00\", \"platform\": \"linkedin\",  \"type\": \"post\",  \"scriptId\": 2 }\n    ]\n  },\n  \"weekSummary\": {\n    \"totalPosts\": 21,\n    \"platformBreakdown\": {\n      \"instagram\": 7, \"tiktok\": 7, \"linkedin\": 4, \"twitter\": 3\n    },\n    \"bestDayToPost\": \"Tuesday\",\n    \"strategy\": \"Lead with curiosity hooks on TikTok early week, repurpose as LinkedIn insights mid-week, close with engagement posts on weekends\"\n  }\n}"
      },
      {
        "title": "Best Practices",
        "body": "Scrape wide, publish narrow — collect 50+ viral posts, produce 5–7 pieces of original content\nNever copy — use viral posts as structural inspiration only, always generate original text\nSet cron to run on Sunday evening to pre-fill the full week ahead\nUse 3–5 niches max to keep the content focused and the audience growing\nTrack which posts actually perform and feed that back as additional context to Claude\nCombine with the Trend Radar skill to inject real-time trend data into the pipeline\nFor maximum automation, connect the video scripts to InVideo (see Short Video Creator skill)"
      },
      {
        "title": "Requirements",
        "body": "Apify account → https://www.apify.com/?fpr=dx06p\nClaude / OpenClaw API key\nNode.js 18+ with apify-client, axios, node-cron\nOptional: Buffer, Later, or Hootsuite account for automated publishing\nOptional: InVideo account for auto video production from generated scripts"
      }
    ],
    "body": "Automated Content Generation Pipeline Skill\nOverview\n\nThis skill builds a fully automated content factory that runs 24/7:\n\nApify scrapes the most viral content across TikTok, Instagram, YouTube, and Reddit\nClaude (OpenClaw) extracts the hooks, reverse-engineers why it went viral, generates scripts, captions, carousels, and threads\nA scheduler batches all posts and queues them for auto-publishing\n\nThe result: a near fully-automated content channel that feeds itself.\n\n🔗 Apify: https://www.apify.com/?fpr=dx06p\n\nWhat This Skill Does\nScrape the top viral content across multiple platforms every few hours\nExtract the exact hooks, structures, and formats that made content go viral\nRepurpose viral content into original scripts, captions, carousels, and threads\nGenerate a full weekly content calendar automatically\nBatch and schedule posts across platforms (Instagram, TikTok, LinkedIn, Twitter/X)\nTrack which generated content performs best and feed that signal back into the pipeline\nRun completely autonomously once configured — minimal human input needed\nArchitecture Overview\n┌─────────────────────────────────────────────────────────────────┐\n│              AUTOMATED CONTENT GENERATION PIPELINE              │\n│                                                                 │\n│  ┌─────────────────────────────────────────────────────────┐   │\n│  │  LAYER 1 — VIRAL CONTENT SCRAPING (Apify)               │   │\n│  │  TikTok │ Instagram │ YouTube │ Reddit │ Twitter/X       │   │\n│  │  Top posts by hashtag, views, engagement, shares        │   │\n│  └──────────────────────────┬──────────────────────────────┘   │\n│                             │                                   │\n│  ┌──────────────────────────▼──────────────────────────────┐   │\n│  │  LAYER 2 — AI CONTENT ENGINE (Claude / OpenClaw)        │   │\n│  │                                                         │   │\n│  │  • Hook Extractor     → why did this go viral?          │   │\n│  │  • Script Generator   → original video scripts          │   │\n│  │  • Caption Writer     → post captions + hashtags        │   │\n│  │  • Carousel Builder   → slide-by-slide content          │   │\n│  │  • Thread Writer      → Twitter/X and LinkedIn threads  │   │\n│  │  • Calendar Planner   → weekly posting schedule         │   │\n│  └──────────────────────────┬──────────────────────────────┘   │\n│                             │                                   │\n│  ┌──────────────────────────▼──────────────────────────────┐   │\n│  │  LAYER 3 — SCHEDULED PUBLISHING                         │   │\n│  │  Buffer │ Later │ Hootsuite │ Custom Webhook             │   │\n│  │  Posts queued, timed, and published automatically       │   │\n│  └─────────────────────────────────────────────────────────┘   │\n└─────────────────────────────────────────────────────────────────┘\n\nStep 1 — Get Your API Keys\nApify\nSign up at https://www.apify.com/?fpr=dx06p\nGo to Settings → Integrations\nCopy your token:\nexport APIFY_TOKEN=apify_api_xxxxxxxxxxxxxxxx\n\nClaude / OpenClaw\nGet your API key from your OpenClaw or Anthropic account\nStore it:\nexport CLAUDE_API_KEY=sk-ant-xxxxxxxxxxxxxxxx\n\nStep 2 — Install Dependencies\nnpm install apify-client axios node-cron dotenv\n\nLayer 1 — Viral Content Scraper (Apify)\nimport ApifyClient from 'apify-client';\n\nconst apify = new ApifyClient({ token: process.env.APIFY_TOKEN });\n\n// Define your niche and topics\nconst NICHE_TOPICS = [\n  \"productivity\", \"entrepreneurship\", \"ai tools\",\n  \"personal finance\", \"self improvement\", \"marketing\"\n];\n\nasync function scrapeViralContent() {\n  console.log(\"🔍 Scraping viral content...\");\n\n  const [tiktok, instagram, reddit] = await Promise.all([\n\n    // TikTok — top videos by hashtag\n    apify.actor(\"apify/tiktok-hashtag-scraper\").call({\n      hashtags: NICHE_TOPICS,\n      resultsPerPage: 30,\n      shouldDownloadVideos: false\n    }).then(run => run.dataset().getData()),\n\n    // Instagram — top posts by hashtag\n    apify.actor(\"apify/instagram-hashtag-scraper\").call({\n      hashtags: NICHE_TOPICS,\n      resultsLimit: 30\n    }).then(run => run.dataset().getData()),\n\n    // Reddit — hottest posts in relevant subreddits\n    apify.actor(\"apify/reddit-scraper\").call({\n      startUrls: [\n        { url: \"https://www.reddit.com/r/Entrepreneur/\" },\n        { url: \"https://www.reddit.com/r/productivity/\" },\n        { url: \"https://www.reddit.com/r/personalfinance/\" }\n      ],\n      maxPostCount: 20,\n      sort: \"hot\"\n    }).then(run => run.dataset().getData())\n\n  ]);\n\n  // Normalize all platforms to a common schema\n  const normalized = [\n    ...tiktok.items.map(p => ({\n      platform: \"tiktok\",\n      text: p.text,\n      likes: p.diggCount,\n      shares: p.shareCount,\n      comments: p.commentCount,\n      views: p.playCount,\n      engagementScore: (p.diggCount + p.shareCount * 3 + p.commentCount * 2),\n      url: p.webVideoUrl,\n      author: p.authorMeta?.name\n    })),\n    ...instagram.items.map(p => ({\n      platform: \"instagram\",\n      text: p.caption,\n      likes: p.likesCount,\n      comments: p.commentsCount,\n      engagementScore: (p.likesCount + p.commentsCount * 2),\n      url: p.url,\n      author: p.ownerUsername\n    })),\n    ...reddit.items.map(p => ({\n      platform: \"reddit\",\n      text: p.title + \" \" + (p.selftext || \"\"),\n      likes: p.score,\n      comments: p.numComments,\n      engagementScore: (p.score + p.numComments * 3),\n      url: p.url,\n      author: p.author\n    }))\n  ];\n\n  // Return top 20 by engagement score\n  return normalized\n    .sort((a, b) => b.engagementScore - a.engagementScore)\n    .slice(0, 20);\n}\n\nLayer 2 — AI Content Engine (Claude / OpenClaw)\nHook Extractor\nimport axios from 'axios';\n\nconst claude = axios.create({\n  baseURL: 'https://api.anthropic.com/v1',\n  headers: {\n    'x-api-key': process.env.CLAUDE_API_KEY,\n    'anthropic-version': '2023-06-01',\n    'Content-Type': 'application/json'\n  }\n});\n\nasync function extractHooks(viralPosts) {\n  const prompt = `\nYou are an expert viral content analyst.\n\nAnalyze these top-performing posts and extract the exact patterns that made them go viral.\n\nVIRAL POSTS:\n${JSON.stringify(viralPosts.slice(0, 10), null, 2)}\n\nRespond ONLY in this JSON format, no preamble:\n{\n  \"hookPatterns\": [\n    {\n      \"pattern\": \"pattern name\",\n      \"template\": \"reusable template with [BRACKETS] for variables\",\n      \"example\": \"real example from the data\",\n      \"whyItWorks\": \"psychological reason this triggers engagement\",\n      \"bestPlatforms\": [\"tiktok\", \"instagram\"]\n    }\n  ],\n  \"commonStructures\": [\n    {\n      \"format\": \"format name (list | storytime | tutorial | controversy | etc)\",\n      \"openingFormula\": \"how these posts start\",\n      \"bodyFormula\": \"how they build\",\n      \"closingFormula\": \"how they end / CTA\",\n      \"avgEngagementBoost\": \"estimated % above average\"\n    }\n  ],\n  \"topEmotions\": [\"curiosity\", \"surprise\", \"...\"],\n  \"keyInsight\": \"single most important lesson from this batch of viral content\"\n}\n`;\n\n  const { data } = await claude.post('/messages', {\n    model: \"claude-opus-4-5\",\n    max_tokens: 2000,\n    messages: [{ role: \"user\", content: prompt }]\n  });\n\n  return JSON.parse(data.content[0].text.replace(/```json|```/g, '').trim());\n}\n\nScript Generator\nasync function generateScripts(hookAnalysis, niche, count = 5) {\n  const prompt = `\nYou are a viral content creator. Use these proven hook patterns to generate ${count} original video scripts.\n\nNICHE: ${niche}\nHOOK PATTERNS: ${JSON.stringify(hookAnalysis.hookPatterns, null, 2)}\nBEST STRUCTURES: ${JSON.stringify(hookAnalysis.commonStructures, null, 2)}\n\nRespond ONLY in this JSON format:\n{\n  \"scripts\": [\n    {\n      \"id\": 1,\n      \"title\": \"video title\",\n      \"platform\": \"tiktok | instagram | youtube_shorts\",\n      \"hookPattern\": \"which pattern was used\",\n      \"hook\": \"opening line — first 3 seconds\",\n      \"fullScript\": \"complete word-for-word script (120-180 words)\",\n      \"estimatedDuration\": \"30s\",\n      \"hashtags\": [\"#tag1\", \"#tag2\", \"#tag3\", \"#tag4\", \"#tag5\"],\n      \"cta\": \"call to action\",\n      \"thumbnailIdea\": \"thumbnail concept\",\n      \"viralPotential\": \"high | medium\",\n      \"bestPostTime\": \"morning | afternoon | evening\"\n    }\n  ]\n}\n`;\n\n  const { data } = await claude.post('/messages', {\n    model: \"claude-opus-4-5\",\n    max_tokens: 3000,\n    messages: [{ role: \"user\", content: prompt }]\n  });\n\n  return JSON.parse(data.content[0].text.replace(/```json|```/g, '').trim());\n}\n\nCaption & Post Writer\nasync function generatePostCaptions(scripts) {\n  const prompt = `\nTransform these video scripts into platform-optimized social media captions.\n\nSCRIPTS: ${JSON.stringify(scripts, null, 2)}\n\nRespond ONLY in this JSON format:\n{\n  \"posts\": [\n    {\n      \"scriptId\": 1,\n      \"platforms\": {\n        \"instagram\": {\n          \"caption\": \"full caption with line breaks and emojis\",\n          \"hashtags\": [\"#tag1\", \"#tag2\"],\n          \"firstComment\": \"hashtags to put in first comment\"\n        },\n        \"tiktok\": {\n          \"caption\": \"shorter, punchy tiktok caption\",\n          \"hashtags\": [\"#fyp\", \"#tag2\"]\n        },\n        \"linkedin\": {\n          \"caption\": \"professional angle of the same content, 150-200 words\",\n          \"hashtags\": [\"#tag1\"]\n        },\n        \"twitter\": {\n          \"thread\": [\n            \"tweet 1 (hook)\",\n            \"tweet 2\",\n            \"tweet 3\",\n            \"tweet 4 (CTA)\"\n          ]\n        }\n      }\n    }\n  ]\n}\n`;\n\n  const { data } = await claude.post('/messages', {\n    model: \"claude-opus-4-5\",\n    max_tokens: 3000,\n    messages: [{ role: \"user\", content: prompt }]\n  });\n\n  return JSON.parse(data.content[0].text.replace(/```json|```/g, '').trim());\n}\n\nWeekly Content Calendar Builder\nasync function buildContentCalendar(scripts, captions) {\n  const today = new Date();\n  const days = ['Monday','Tuesday','Wednesday','Thursday','Friday','Saturday','Sunday'];\n\n  const prompt = `\nBuild a 7-day content calendar from these generated posts.\nMaximize reach by distributing smartly across platforms and times.\n\nAVAILABLE CONTENT:\nScripts: ${scripts.scripts.length} video scripts\nCaptions: ready for Instagram, TikTok, LinkedIn, Twitter\n\nToday is ${today.toDateString()}.\n\nRespond ONLY in this JSON format:\n{\n  \"calendar\": [\n    {\n      \"day\": \"Monday\",\n      \"date\": \"YYYY-MM-DD\",\n      \"posts\": [\n        {\n          \"time\": \"08:00\",\n          \"platform\": \"instagram\",\n          \"contentType\": \"reel | carousel | story | post\",\n          \"scriptId\": 1,\n          \"caption\": \"caption preview\",\n          \"hashtags\": [\"#tag1\"],\n          \"status\": \"scheduled\",\n          \"notes\": \"optional tip for this post\"\n        }\n      ]\n    }\n  ],\n  \"weekSummary\": {\n    \"totalPosts\": 0,\n    \"platformBreakdown\": { \"instagram\": 0, \"tiktok\": 0, \"linkedin\": 0, \"twitter\": 0 },\n    \"estimatedReach\": \"rough estimate\",\n    \"bestDayToPost\": \"day name\",\n    \"strategy\": \"brief summary of the week strategy\"\n  }\n}\n`;\n\n  const { data } = await claude.post('/messages', {\n    model: \"claude-opus-4-5\",\n    max_tokens: 3000,\n    messages: [{ role: \"user\", content: prompt }]\n  });\n\n  return JSON.parse(data.content[0].text.replace(/```json|```/g, '').trim());\n}\n\nLayer 3 — Scheduled Publisher\nasync function publishToScheduler(calendar) {\n  // Example: send to Buffer API\n  const BUFFER_TOKEN = process.env.BUFFER_ACCESS_TOKEN;\n\n  for (const day of calendar.calendar) {\n    for (const post of day.posts) {\n      const scheduledTime = new Date(`${day.date}T${post.time}:00`);\n\n      if (BUFFER_TOKEN) {\n        await axios.post(\n          'https://api.bufferapp.com/1/updates/create.json',\n          {\n            text: post.caption,\n            profile_ids: [process.env[`BUFFER_${post.platform.toUpperCase()}_ID`]],\n            scheduled_at: scheduledTime.toISOString(),\n            hashtags: post.hashtags.join(' ')\n          },\n          { headers: { Authorization: `Bearer ${BUFFER_TOKEN}` } }\n        );\n      }\n\n      // Or push to your own webhook / CMS\n      if (process.env.PUBLISH_WEBHOOK_URL) {\n        await axios.post(process.env.PUBLISH_WEBHOOK_URL, {\n          platform: post.platform,\n          caption: post.caption,\n          hashtags: post.hashtags,\n          scheduledAt: scheduledTime.toISOString(),\n          scriptId: post.scriptId\n        });\n      }\n\n      console.log(`✅ Scheduled: [${post.platform}] ${day.date} ${post.time}`);\n    }\n  }\n}\n\nMaster Orchestrator — Full Automated Pipeline\nimport cron from 'node-cron';\n\nasync function runContentPipeline(niche = \"entrepreneurship\") {\n  console.log(`\\n🏭 Content Pipeline started — ${new Date().toISOString()}`);\n  const report = {};\n\n  try {\n    // STEP 1 — Scrape viral content\n    console.log(\"\\n[1/5] Scraping viral content with Apify...\");\n    const viralContent = await scrapeViralContent();\n    report.postsScraped = viralContent.length;\n    console.log(`  ✅ ${viralContent.length} viral posts collected`);\n\n    // STEP 2 — Extract hooks and patterns\n    console.log(\"\\n[2/5] Extracting viral hooks with Claude...\");\n    const hookAnalysis = await extractHooks(viralContent);\n    report.hookPatterns = hookAnalysis.hookPatterns.length;\n    console.log(`  ✅ ${hookAnalysis.hookPatterns.length} hook patterns identified`);\n    console.log(`  💡 Key insight: ${hookAnalysis.keyInsight}`);\n\n    // STEP 3 — Generate scripts\n    console.log(\"\\n[3/5] Generating video scripts...\");\n    const scripts = await generateScripts(hookAnalysis, niche, 7);\n    report.scriptsGenerated = scripts.scripts.length;\n    console.log(`  ✅ ${scripts.scripts.length} scripts generated`);\n\n    // STEP 4 — Write captions for all platforms\n    console.log(\"\\n[4/5] Writing multi-platform captions...\");\n    const captions = await generatePostCaptions(scripts.scripts);\n    report.captionsWritten = captions.posts.length;\n    console.log(`  ✅ Captions written for ${captions.posts.length} posts`);\n\n    // STEP 5 — Build weekly calendar and schedule\n    console.log(\"\\n[5/5] Building content calendar and scheduling...\");\n    const calendar = await buildContentCalendar(scripts, captions);\n    report.calendarBuilt = true;\n    report.totalPostsScheduled = calendar.weekSummary.totalPosts;\n    await publishToScheduler(calendar);\n    console.log(`  ✅ ${calendar.weekSummary.totalPosts} posts scheduled for the week`);\n\n    // Summary\n    console.log(\"\\n📊 PIPELINE COMPLETE:\");\n    console.log(`  • Viral posts scraped:   ${report.postsScraped}`);\n    console.log(`  • Hook patterns found:   ${report.hookPatterns}`);\n    console.log(`  • Scripts generated:     ${report.scriptsGenerated}`);\n    console.log(`  • Posts scheduled:       ${report.totalPostsScheduled}`);\n    console.log(`  • Best day this week:    ${calendar.weekSummary.bestDayToPost}`);\n    console.log(`  • Strategy:              ${calendar.weekSummary.strategy}`);\n\n    return { success: true, report, calendar };\n\n  } catch (err) {\n    console.error(\"Pipeline error:\", err.message);\n    throw err;\n  }\n}\n\n// Run every Sunday at 8:00 AM — generates the full week ahead\ncron.schedule('0 8 * * 0', () => {\n  runContentPipeline(\"entrepreneurship\");\n});\n\n// Run every morning at 6:00 AM for daily fresh content\ncron.schedule('0 6 * * *', () => {\n  runContentPipeline(\"productivity\");\n});\n\n// Run immediately on startup\nrunContentPipeline(\"ai tools\");\n\nEnvironment Variables\n# .env\nAPIFY_TOKEN=apify_api_xxxxxxxxxxxxxxxx\nCLAUDE_API_KEY=sk-ant-xxxxxxxxxxxxxxxx\n\n# Publishing (optional — pick one or more)\nBUFFER_ACCESS_TOKEN=your_buffer_token\nBUFFER_INSTAGRAM_ID=your_ig_profile_id\nBUFFER_TIKTOK_ID=your_tiktok_profile_id\nBUFFER_LINKEDIN_ID=your_linkedin_profile_id\nPUBLISH_WEBHOOK_URL=https://your-app.com/webhooks/publish\n\n# Alerts (optional)\nSLACK_WEBHOOK_URL=https://hooks.slack.com/services/xxx/xxx/xxx\n\nNormalized Pipeline Output Schema\n{\n  \"runAt\": \"2025-02-25T06:00:00Z\",\n  \"niche\": \"entrepreneurship\",\n  \"postsScraped\": 90,\n  \"hookPatterns\": 6,\n  \"scriptsGenerated\": 7,\n  \"totalPostsScheduled\": 21,\n  \"calendar\": {\n    \"Monday\": [\n      { \"time\": \"08:00\", \"platform\": \"instagram\", \"type\": \"reel\", \"scriptId\": 1 },\n      { \"time\": \"18:00\", \"platform\": \"tiktok\",    \"type\": \"video\", \"scriptId\": 1 },\n      { \"time\": \"12:00\", \"platform\": \"linkedin\",  \"type\": \"post\",  \"scriptId\": 2 }\n    ]\n  },\n  \"weekSummary\": {\n    \"totalPosts\": 21,\n    \"platformBreakdown\": {\n      \"instagram\": 7, \"tiktok\": 7, \"linkedin\": 4, \"twitter\": 3\n    },\n    \"bestDayToPost\": \"Tuesday\",\n    \"strategy\": \"Lead with curiosity hooks on TikTok early week, repurpose as LinkedIn insights mid-week, close with engagement posts on weekends\"\n  }\n}\n\nBest Practices\nScrape wide, publish narrow — collect 50+ viral posts, produce 5–7 pieces of original content\nNever copy — use viral posts as structural inspiration only, always generate original text\nSet cron to run on Sunday evening to pre-fill the full week ahead\nUse 3–5 niches max to keep the content focused and the audience growing\nTrack which posts actually perform and feed that back as additional context to Claude\nCombine with the Trend Radar skill to inject real-time trend data into the pipeline\nFor maximum automation, connect the video scripts to InVideo (see Short Video Creator skill)\nRequirements\nApify account → https://www.apify.com/?fpr=dx06p\nClaude / OpenClaw API key\nNode.js 18+ with apify-client, axios, node-cron\nOptional: Buffer, Later, or Hootsuite account for automated publishing\nOptional: InVideo account for auto video production from generated scripts"
  },
  "trust": {
    "sourceLabel": "tencent",
    "provenanceUrl": "https://clawhub.ai/g4dr/auto-content-generator",
    "publisherUrl": "https://clawhub.ai/g4dr/auto-content-generator",
    "owner": "g4dr",
    "version": "1.0.0",
    "license": null,
    "verificationStatus": "Indexed source record"
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/auto-content-generator",
    "downloadUrl": "https://openagent3.xyz/downloads/auto-content-generator",
    "agentUrl": "https://openagent3.xyz/skills/auto-content-generator/agent",
    "manifestUrl": "https://openagent3.xyz/skills/auto-content-generator/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/auto-content-generator/agent.md"
  }
}