Skip to content

Repository files navigation

content-engine-cron

A weekly content pipeline for solo creators. One Anthropic API call a week plans your posts, drops them straight into your phone calendar, and measures what worked. No servers, no auto-posting, no databases.

You write the posts. The pipeline tells you when, what about, and how it's doing.


How it works

Sunday  →  weekly_planner.py     (Claude + web_search → next week's cues)
        →  build_calendar.py     (cues + your schedule → .ics file)
        →  publish.sh            (.ics → public Gist)
                ↓
          iPhone calendar subscription refreshes ~12h
                ↓
Mon–Sat →  Each slot fires as a calendar event with a cue + template ref
        →  You write the post, hit publish
                ↓
Sunday  →  Drop analytics CSV in data/, run score.py, read what worked

Five posts a day, six weekdays + a Sunday block. All times, slots, and themes live in schedule.json — change them however you like.


Quickstart

git clone https://github.com/<your-username>/content-engine-cron.git
cd content-engine-cron

bash setup.sh

setup.sh is idempotent. It:

  • Copies each *.example.* file to its real name (only if missing — won't clobber)
  • Creates a Python venv at .venv and installs requirements.txt
  • Prints next-step instructions

Then:

# 1. Edit configs
$EDITOR .env             # paste your ANTHROPIC_API_KEY
$EDITOR profile.json     # who you are, your voice, your topics
$EDITOR schedule.json    # slot times + weekly themes (defaults are sensible)

# 2. Smoke test — no API call, no cost. Confirms your configs parse and
#    shows the prompt the planner will send to Claude.
source .venv/bin/activate
python3 weekly_planner.py --dry-run

# 3. Authenticate the GitHub CLI for gist publishing
gh auth login

# 4. Run the pipeline
bash sunday_run.sh

The script prints a Gist URL on first run. On iPhone: Settings → Calendar → Accounts → Add Account → Other → Add Subscribed Calendar → paste the URL → Save. Re-runs update the same Gist; iOS auto-refreshes within ~12h.


File map

.env.example                # Placeholder — copy to .env, add ANTHROPIC_API_KEY
profile.example.json        # Identity + voice + search topics + rules
schedule.example.json       # Slot times, Sunday block, weekly themes
score_config.example.json   # Pillar/hook keywords for auto-tagging
templates.example.md        # Reusable post templates
tracker.example.csv         # Header-only template

setup.sh                    # One-command bootstrap (run this first)
weekly_planner.py           # Claude + web_search → cues for next week
build_calendar.py           # Cues + schedule → content_schedule.ics
publish.sh                  # Push .ics to a public Gist
sunday_run.sh               # plan + build + publish (run weekly)
score.py                    # Analytics CSVs → tracker → weekly_report.md
requirements.txt            # Just `anthropic`

.github/workflows/sunday.yml   # Optional: GitHub Actions weekly cron

data/x_raw/                 # Drop X analytics CSV exports here
data/yt_raw/                # Drop YouTube Studio CSV exports here

*.example.* files are committed templates. Your live configs (profile.json, schedule.json, etc.) and all generated artifacts are gitignored.


Customizing for your niche

You only need to edit two files to make this yours:

profile.json — who you are

  • name, handle, bio_paragraph — what the planner says about you in its system prompt
  • domain_descriptor — e.g. "DeFi and AI-agent", "climate-tech", "open-source ML"
  • slot_topics — what each of your 5 daily slots is about
  • search_queries — the planner uses these as web search seeds, in order
  • rules — non-negotiable constraints the planner must follow when writing cues

schedule.json — when and what

  • daily_slots — five slots a day (time, duration, summary, description). Slots 2/3/4 receive an AI cue; slots 1 and 5 are static.
  • sunday_events — the Sunday block (thread / batch / review).
  • weekly_themes — array of themes to rotate through. Each has a name, a Sunday-thread suggestion, and template cues for Mon–Sat that fall back if the planner is offline.

score_config.json and templates.md (optional)

Defaults work out of the box. Edit the keywords in score_config.json to match your domain so the scorer can auto-tag posts into pillars (e.g. gm, personal, builder, your-thing) and hook types (contrarian, proof_of_work, etc.).


Weekly ritual

# Sunday, 15 min:
# 1. Export X analytics CSV → drop in data/x_raw/
# 2. Export YouTube Studio CSV → drop in data/yt_raw/  (optional)
# 3. Score
python3 score.py
# 4. Read weekly_report.md, mark 1–2 winners
# 5. Plan + publish next week
bash sunday_run.sh

Virality score

score = impressions
      + 20 * reposts
      + 15 * bookmarks
      + 10 * replies
      + 25 * new_follows
      +  5 * profile_visits

Optimizes for reach × quality × audience growth, not vanity likes. Tune the weights in score.py:score_row if you want a different signal.


Automating the Sunday run

Pick one. All three do the same thing — run sunday_run.sh weekly.

A. macOS launchd

mkdir -p ~/Library/LaunchAgents
cat > ~/Library/LaunchAgents/com.content-engine-cron.plist <<PLIST
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
  <key>Label</key><string>com.content-engine-cron</string>
  <key>ProgramArguments</key>
  <array>
    <string>/bin/bash</string>
    <string>-lc</string>
    <string>cd \$HOME/projects/content-engine-cron && bash sunday_run.sh >> sunday_run.log 2>&1</string>
  </array>
  <key>StartCalendarInterval</key>
  <dict>
    <key>Weekday</key><integer>0</integer>
    <key>Hour</key><integer>18</integer>
    <key>Minute</key><integer>0</integer>
  </dict>
</dict>
</plist>
PLIST
launchctl load ~/Library/LaunchAgents/com.content-engine-cron.plist

Stop with launchctl unload ~/Library/LaunchAgents/com.content-engine-cron.plist.

B. Linux / cron

0 18 * * 0  cd $HOME/projects/content-engine-cron && bash sunday_run.sh >> sunday_run.log 2>&1

C. GitHub Actions (no machine needed)

.github/workflows/sunday.yml runs the pipeline on GitHub's runners every Sunday. Setup:

  1. Fork this repo.
  2. Settings → Secrets and variables → Actions → New repository secret. Add:
    • ANTHROPIC_API_KEY — your Anthropic API key
    • PROFILE_JSON — full contents of your profile.json
    • SCHEDULE_JSON — full contents of your schedule.json
    • GH_PAT_GIST — a Personal Access Token with gist scope (the default GITHUB_TOKEN can't edit gists)
  3. First run: trigger the workflow manually from the Actions tab. It creates a public gist and prints its ID in the run logs.
  4. Add that ID as a fourth secret named GIST_ID so subsequent runs update the same gist instead of creating new ones.

Subscribe iOS to the gist's raw URL exactly as in step 4 of Quickstart.


Privacy

What gets sent off your machine, ever:

  • One Anthropic API call per week (your system prompt + a web-search request).
  • The generated .ics file gets pushed to your own public Gist for iOS to subscribe to.

Gitignored, never published:

  • .env (your API key)
  • profile.json, schedule.json, score_config.json, templates.md
  • tracker.csv (your post-level analytics)
  • data/*/raw/*.csv, current_week.json, weekly_report.md, content_schedule.ics, .gist_id

Forks have their own everything. There is no shared backend.


Cost

One Anthropic API call per week:

  • Claude Opus 4.7 with adaptive thinking + web_search
  • 16k output tokens cap (usually less)
  • Cents to a couple of dollars per run depending on how much search/reasoning happens

Pricing: https://www.anthropic.com/pricing


Not in scope

  • Auto-posting. The pipeline drafts and measures. You hit publish.
  • API ingestion. CSV-export → drop-in-folder is the cheap path. Add X / YouTube API ingestion if rate-limit and OAuth complexity feel worth it to you.

License

MIT. See LICENSE.

About

Weekly content pipeline for solo creators: Claude + web_search plans your posts, .ics calendar drops them on your phone, scorer tells you what worked.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages