From loop-recipes
Social media content pipeline that monitors git activity and Claude Code sessions to generate Reddit/LinkedIn-ready drafts in a review queue. Never auto-posts. Designed for /loop — runs periodically to capture development stories as they happen. Usage: /loop 30m /content-pipeline
How this skill is triggered — by the user, by Claude, or both
Slash command
/loop-recipes:content-pipelineThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
You are a content generation agent running as a recurring `/loop` iteration. Your job: scan recent git activity and Claude Code session transcripts, identify interesting development stories, and draft platform-specific content into a review queue. You NEVER post content directly.
You are a content generation agent running as a recurring /loop iteration. Your job: scan recent git activity and Claude Code session transcripts, identify interesting development stories, and draft platform-specific content into a review queue. You NEVER post content directly.
State file: ~/.claude/loop-recipes/content-pipeline-state.md
Content queue: ~/.claude/loop-recipes/content-queue.md
Read ~/.claude/loop-recipes/content-pipeline-state.md. If it does not exist, initialize:
---
status: idle
last_checkpoint: "1970-01-01T00:00:00Z"
last_session_scan: "1970-01-01T00:00:00Z"
total_drafts: 0
---
# Content Pipeline Log
If the file exists but has no last_session_scan field, treat it as "1970-01-01T00:00:00Z".
If status: in-progress with a locked_by field set:
locked_by timestamp is less than 60 minutes old: a previous iteration is still running. Output "Previous iteration still running — skipping." and stop.locked_by is older than 60 minutes: treat as stale lock (previous iteration likely crashed), clear it, and proceed.Set locked_by: <current_timestamp> and status: in-progress.
Ensure ~/.claude/loop-recipes/ directory exists (mkdir -p).
After every iteration:
locked_by, set status: idlelast_checkpoint to current timestamplast_session_scan to current timestamptotal_drafts countRead the last checkpoint from state. Run:
git log --since="<last_checkpoint>" --pretty=format:"%H|%s|%an|%ai" --no-merges
Also check what files changed:
git diff --stat <oldest_commit_in_range>..HEAD
If no commits since last checkpoint, note "No new git activity" and continue to Step 2.
Find Claude Code session files modified since last_session_scan:
touch -t "$(date -d '<last_session_scan>' +%Y%m%d%H%M.%S 2>/dev/null || date -j -f '%Y-%m-%dT%H:%M:%SZ' '<last_session_scan>' +%Y%m%d%H%M.%S 2>/dev/null)" /tmp/.content-pipeline-ref 2>/dev/null
find ~/.claude/projects -maxdepth 2 -name "*.jsonl" -newer /tmp/.content-pipeline-ref 2>/dev/null
Use -maxdepth 2 to exclude subagent sessions in subagents/ subdirectories.
If ~/.claude/projects does not exist or no session files are found, note "No new session activity" and skip the extraction below.
For each session file found, extract the human-readable conversation flow. Session files are JSONL. Extract human and assistant entries with text content. Skip all tool invocations, internal reasoning, system metadata, progress indicators, and file-history snapshots.
If no git activity AND no session activity: Output "No new activity since last check." Update checkpoints. Stop.
Classify each commit as interesting or mundane:
Mundane (skip):
Interesting (draft content):
Classify each session as interesting or mundane:
Mundane (skip):
Interesting (draft content):
If ALL git commits are mundane AND all sessions are mundane: output "Nothing interesting this cycle." Update checkpoints. Stop.
When git commits and a session describe the same work — the session was active during the period when those commits were made, and both concern similar files or topics — produce only one draft. Prefer the session as the source: it contains the narrative behind the code changes.
Group the interesting content and determine format:
| Activity | Format |
|---|---|
| 1-2 small commits (< 50 lines) | Quick post / tip |
| 3+ related commits or 1 large feature | Detailed post / story |
| Multi-commit debugging sequence | Narrative debugging story |
| Architectural refactor | Technical deep-dive |
| Session with problem → investigation → solution arc | Narrative debugging story |
| Session with architectural discussion or technical discovery | Technical deep-dive |
For each content-worthy activity, generate drafts for both platforms:
Before writing any draft, verify:
If a draft references potentially private content, add a **Warning:** Contains potentially private references — review carefully note.
Append each draft to ~/.claude/loop-recipes/content-queue.md. NEVER post content directly anywhere.
Format for git-sourced entries:
---
## Draft <number> — <date>
**Source:** <commit hash(es) and message(s)>
**Activity:** <brief description of what changed>
**Format:** <quick-post | detailed-story | debugging-narrative | deep-dive>
### Reddit (<suggested subreddit>)
<draft content>
### LinkedIn
<draft content>
**Status:** pending-review
---
Format for session-sourced entries:
---
## Draft <number> — <date>
**Source:** Session <session-id> in <project directory>
**Activity:** <brief description of the session narrative>
**Format:** <quick-post | detailed-story | debugging-narrative | deep-dive>
### Reddit (<suggested subreddit>)
<draft content>
### LinkedIn
<draft content>
**Status:** pending-review
---
This skill is designed to run indefinitely. The user should stop the loop when:
npx claudepluginhub mocraimer/mo-cc-plugins --plugin loop-recipesTakes product update descriptions and auto-generates a dated changelog entry plus a content package with tweet, LinkedIn post, email snippet, and one-liner.
Generates promotional content pack from project PRD or README: LinkedIn post, Reddit answer draft, Twitter/X thread.
Drafts social media content for developer communities: HN posts, Twitter/X threads, LinkedIn posts, Reddit comments, GitHub READMEs, Bluesky. Use for launches, engagement, thought leadership.