TikTok Content Pipeline
by @matttandy855
Automates TikTok carousel content creation, smart scheduling, publishing via Postiz API, and analytics-driven optimization for niche accounts.
clawhub install tiktok-content-pipelineπ About This Skill
TikTok Content Pipeline β OpenClaw Skill
Automated TikTok carousel content generation, publishing, scheduling, and analytics-driven optimization for any niche.
Overview
This skill provides a complete content pipeline for TikTok accounts. It handles:
Required Credentials
| Credential | Purpose | How to Obtain | |---|---|---| | Postiz API Key | Publishing & analytics via Postiz CLI | Sign up at postiz.com β Settings β API Keys | | TikTok Integration ID | Links your TikTok account to Postiz | Postiz dashboard β Integrations β Add TikTok |
Credential Storage (Important)
Recommended: Set POSTIZ_API_KEY as an environment variable (e.g. in ~/.zshrc or ~/.bashrc) rather than storing it in config files. The pipeline checks for this env var first.
Alternative: Store in accounts/ under postiz.apiKey. If using this approach, ensure the file is not committed to version control (add to .gitignore).
The Integration ID is account-specific and stored in per-account config.json.
Security Notes
postiz CLI via shell commands. All arguments are escaped to prevent injection.accounts/ and output/ directories.auto-improve mode can modify account configs and auto-post β test on a throwback account first.npm audit after installing dependencies to check for known vulnerabilities.Quick Setup
1. Set your Postiz API key: export POSTIZ_API_KEY="your-key-here"
2. Copy config.example.json to accounts/
3. Fill in your TikTok integration ID
4. Create or adapt a template in templates/ for your niche
5. Run: node cli.js create
See SETUP.md for the full setup guide.
How to Use This Skill
1. Create a New Account
node cli.js create my-brand --template example-nostalgia
This copies the template into accounts/my-brand/ and sets createdAt to now.
2. Configure the Account
Edit accounts/my-brand/config.json:
{
"account": { "name": "my-brand", "handle": "@mybrand", "niche": "your-niche", "createdAt": "2026-01-15T00:00:00Z" },
"postiz": { "apiKey": "YOUR_KEY", "integrationId": "YOUR_TIKTOK_ID" },
"posting": { "timezone": "Europe/London" }
}
Or use the CLI:
node cli.js config my-brand --handle @mybrand --integration-id YOUR_ID --api-key YOUR_KEY
3. Generate Content
node cli.js generate my-brand --type showcase
node cli.js generate my-brand --type showcase --post # Generate and post as draft
The generator uses the template's generator.js to create carousel slides, applies hooks from config, adds keyword overlays for TikTok SEO, and outputs to accounts/my-brand/output/.
4. Check the Posting Schedule
node cli.js schedule my-brand # This week's schedule
node cli.js schedule my-brand --next # Next optimal posting slot
The scheduler automatically adjusts frequency based on account age:
5. Run Analytics
node cli.js analytics my-brand --days 7
node cli.js analytics my-brand --days 7 --auto-improve # Auto-implement fixes
Research-Backed Viral Mechanics
These findings are baked into the framework's scheduling, optimization, and content scoring:
Algorithm Priority Signals
1. Watch time & completion rate β most critical signal. 80%+ completion = 5x reach. 2. First 3-second hook β determines whether content gets distributed at all. 3. Shares β strongest engagement signal for virality. 4. Saves β growing importance. 15%+ save-to-view = high-value content. 5. Comment engagement β quality conversations > generic comments.Posting Strategy
Carousel Advantages
Hook Patterns That Work
| Type | Example | Avg Engagement | |------|---------|---------------| | Contradiction | "Everyone thinks X, but actually..." | 9%+ | | Challenge | "If you used X, you had no skill π" | 11%+ | | Gatekeeping | "Only real ones remember..." | 8%+ | | POV | "POV: You just discovered..." | 7%+ | | Nostalgia | "Remember this? π₯" | 6%+ | | Question | "Would you do this? Yes or no π" | 8%+ |Content Scoring
The ViralOptimizer scores content before posting (0-100):Verdicts:
Diagnostic Matrix
When analyzing post performance, use this matrix to decide what to fix:
| Views | Engagement | Diagnosis | Action | |-------|-----------|-----------|--------| | High (>1000) | High (>5%) | SCALE | Create 3 variations of this content. Test same hook with different visuals. | | High (>1000) | Low (<3%) | FIX CTA | Hook is working β add stronger call-to-action. Add opinion-split or challenge. | | Low (<500) | High saves (>10%) | FIX HOOK | Content converts β needs better opening hook. Test trending audio. Stronger first-slide text. | | Low (<500) | Low (<3%) | FULL RESET | Try radically different format. Research top creators in niche. Test different posting time. |
Key Thresholds
| Metric | Target | Viral | Poor | |--------|--------|-------|------| | Completion rate | 80% | 90% | 40% | | Save-to-view ratio | 15% | 25% | 3% | | Share rate | 8% | 15% | 2% | | Comment rate | 5% | 10% | 1% | | Profile visit rate | 12% | 20% | 3% | | Follower conversion | 8% | 15% | 2% |Creating a Custom Template
Templates define the content types, hooks, hashtags, and generation logic for a niche.
Template Structure
templates/your-niche/
βββ config.json # Content types, hooks, hashtags, settings
βββ generator.js # Content generation logic (extends ContentGenerator)
βββ README.md # Template documentation
config.json Required Fields
{
"account": { "template": "your-niche", "niche": "Your Niche" },
"content": {
"types": {
"your-content-type": { "description": "...", "slides": 6 }
},
"hashtagSets": {
"default": ["#yourniche", "#fyp"]
}
},
"hooks": {
"your-content-type": ["Hook text 1", "Hook with {placeholder} 2"]
},
"posting": { "timezone": "Europe/London" }
}
generator.js Pattern
const ContentGenerator = require('../../core/ContentGenerator');class YourNicheGenerator extends ContentGenerator {
getSupportedTypes() {
return Object.keys(this.config.content.types);
}
async _generateContent(contentType, options, outputDir) {
this._ensureOutputDir(outputDir);
const hook = this.getSlide1Hook(contentType, options);
// Generate slides using sharp/canvas/ImageMagick
// Return { slides: [...paths], hook: hook.text, caption: '...' }
}
}
module.exports = YourNicheGenerator;
Architecture
tiktok-content-pipeline/
βββ cli.js # Universal CLI
βββ core/
β βββ ContentGenerator.js # Abstract base for content generation
β βββ Publisher.js # Postiz API integration
β βββ PostingScheduler.js # Smart scheduling engine
β βββ ViralOptimizer.js # Content scoring & optimization
β βββ AnalyticsEngine.js # Performance tracking & insights
βββ accounts/ # Per-account configs & output (created at runtime)
βββ templates/ # Niche templates
βββ example-nostalgia/ # Example template to fork