Content as Code - Time-Based Publishing Architecture
This repository serves as the central hub for automated social media and blog publishing across multiple platforms using a revolutionary "directory timestamps as schedule" approach.
Centralized content management and automated publishing system for:
- LinkedIn, Twitter/X, Facebook, Instagram, TikTok, YouTube
- Company and personal account management
- Time-based scheduling with immediate publishing capability
- Organized content lifecycle management
Revolutionary Simplification: Directory names ARE the complete metadata. No external files or JSON manifests needed.
content/
├── approved/ # Human-reviewed content pool
├── scheduled/ # Time-based execution queue with platform metadata
│ ├── 2025-08-14T15-45-00Z_x_personal/ # Future time + platform + account = wait until then
│ ├── 2025-08-14T17-30-00Z_linkedin_company/ # Platform-specific directories
│ └── 2020-01-01T00-00-00Z_substack_ai-weekly/ # Past time = publish immediately
├── published/ # Successfully published (preserves directory names)
│ ├── 2025-08-13T10-00-00Z_linkedin_company/
│ └── 2025-08-13T15-45-00Z_x_personal/
└── failed/ # Needs manual intervention (preserves directory names)
└── 2025-08-12T08-00-00Z_x_personal/
calendar/
├── schedules/ # Human-readable planning files
│ └── week-32-2025.yml
└── processed/ # Archived schedules
- Directory names are metadata - Timestamp directories define when to publish
- Content files never renamed - Only moved between directories
- All times are UTC - No timezone confusion
- Pastime = immediate - Any past timestamp triggers immediate publishing
- Directory-based metadata - All metadata embedded in directory names (
timestamp_platform_account)
Add content to content/approved/ with proper frontmatter:
---
title: "Your Article Title"
status: approved
---
Your content here...Create schedule file in calendar/schedules/:
week: 32
year: 2025
posts:
- path: content/approved/article.md
publish_date: 2025-08-08T14:30:00 # Future = scheduled
platforms: linkedin:company, x:personal
- path: content/approved/urgent.md
publish_date: 2020-01-01T00:00:00 # Past = immediate
platforms: linkedin:company- Weekly: Schedule files processed automatically (Friday 8 AM UTC)
- Every 20 minutes: Content in past-timestamp directories publishes automatically
- Results: Content organized in
published/orfailed/by year/week
Triggers: Weekly cron, Git push, manual dispatch
- Validates content exists with
status: approved - Copies content to platform-specific directories:
content/scheduled/YYYY-MM-DDTHH-MM-SSZ_platform_account/ - Creates separate directory per platform (multi-platform content gets multiple directories)
- Archives processed schedule
Automated: Weekly (Monday 9 AM UTC), content changes, manual dispatch
Local: make enhance-content updates files, you commit manually
- Auto-detects suitable platforms for content based on analysis
- Updates frontmatter with
platforms_suitablefield - GitHub workflow commits changes automatically
- Creates GitHub issues for content optimization needs
Triggers: Every 20 minutes
- Scans timestamped directories
- Publishes content from past-timestamp directories
- Sends JWT webhooks to n8n
- Moves directories to
published/(success) orfailed/(failure)
Simple Directory-Based Recovery
- Failed content stays in
content/failed/YYYY-MM-DDTHH-MM-SSZ_platform_account/ - To republish: Simply move the directory back to scheduled
- System will automatically retry on next publishing cycle
Republishing Examples:
# Move specific failed content back to scheduled for immediate retry
mv content/failed/2025-08-14T15-45-00Z_x_personal/ content/scheduled/
# Schedule failed content for future time (optional - rename directory)
mv content/failed/2025-08-14T15-45-00Z_x_personal/ content/scheduled/2025-08-15T10-00-00Z_x_personal/
# Bulk republish all failed content
mv content/failed/*/ content/scheduled/Why This Works:
- Directory names contain all metadata (platform, account, content)
- No external files to synchronize or update
- Content and metadata move together atomically
- System treats moved directories as new publishing attempts
- Time-Based Publishing - Directory timestamps control publishing
- Immediate Publishing - Past timestamps publish immediately
- Auto-Platform Detection - AI-powered platform suitability analysis
- Automatic Metadata Enhancement - Frontmatter automatically updated with suitable platforms
- Content Optimization Issues - GitHub issues created for platform compatibility problems
- Simple Platform Files - Plain text instead of complex JSON
- Organized Results - Automatic year/week organization
- No Task Files - Directory structure IS the schedule
- JWT Security - Signed webhooks to n8n
- Rich Logging - Detailed publishing logs and validation reports
- Company Information: Context-Company.md - Detailed company, product, and brand information for corporate posting
- Personal Information: Context-Personal.md - Personal context for individual account posting
This system can be executed through:
- Manual n8n/Zapier/Make automation workflows
- AI agent tools like Claude Code
- Autonomous Marketing Engine (AME) integration
- GitHub Actions automation
This system automates content distribution, not community management. Social media requires two-way communication - the system doesn't handle:
- Incoming comments or direct messages
- Brand mentions monitoring
- Community engagement
Recommended Addition: Implement a separate engagement workflow using social listening tools (Brand24, Mentionlytics) with AI-powered triage for human community management.
Consider integrating with open-source SMM platforms like Postiz or Mixpost as the publishing engine while focusing custom development on unique content generation and analytics.
📚 docs/ - All documentation is organized in the docs directory
- WORKFLOW_GUIDE.md - User guide for content creation and scheduling
- TECHNICAL_REFERENCE.md - Technical architecture and implementation
- TESTING.md - Complete testing guide
- MAKEFILE_GUIDE.md - Using Make commands
- FIELD_SPECIFICATIONS.md - Platform-specific requirements
- strategy-templates/ - Growth strategy templates (50K-100K targets)
- cadence.yml - Active content cadence and posting rhythm
# What's pending?
ls content/scheduled/
# What published this week?
ls content/published/2025/week-32/
# Any failures?
ls content/failed/2025/week-32/
# Check logs
cat logs/publishing/2025/week-32/summary.jsonThis architecture embodies true "Content as Code" principles where the filesystem structure IS the application state, providing intuitive debugging, easy recovery, and Git-friendly operations.