| name | content-pipeline |
| description | 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 |
| user-invokable | true |
Social Media Content Pipeline
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 Management
State file: ~/.claude/loop-recipes/content-pipeline-state.md
Content queue: ~/.claude/loop-recipes/content-queue.md
On Start — Read State
-
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
---
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:
- If
locked_by timestamp is less than 60 minutes old: a previous iteration is still running. Output "Previous iteration still running — skipping." and stop.
- If
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).
On End — Write State
After every iteration:
- Clear
locked_by, set status: idle
- Update
last_checkpoint to current timestamp
- Update
last_session_scan to current timestamp
- Update
total_drafts count
- Append iteration summary to log section
Iteration Logic
Step 1: Scan Git Activity
Read 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.
Step 2: Scan Session Activity
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.
Step 3: Filter — Is This Interesting?
Git Commits
Classify each commit as interesting or mundane:
Mundane (skip):
- Typo fixes, formatting-only changes
- Dependency bumps (package-lock.json, yarn.lock only)
- Merge commits
- CI config tweaks with no behavioral change
- Linting fixes
Interesting (draft content):
- New features or capabilities
- Bug fixes (especially tricky ones)
- Architectural decisions or refactors
- Performance improvements with measurable results
- Interesting debugging stories (multi-commit sequences showing investigation)
Session Conversations
Classify each session as interesting or mundane:
Mundane (skip):
- Quick file lookups or reads with no narrative
- Simple configuration or setup tasks
- Routine command execution with no problem-solving
- Sessions with fewer than three user-assistant turn pairs beyond simple acknowledgments
Interesting (draft content):
- Debugging narratives — a problem described, investigated, and resolved
- Architectural decisions with rationale discussed in the conversation
- Problem-solving journeys — especially with dead ends, pivots, or surprising solutions
- Novel approaches or creative uses of tools/libraries
- Technical discoveries — learning something unexpected about a system or technology
If ALL git commits are mundane AND all sessions are mundane: output "Nothing interesting this cycle." Update checkpoints. Stop.
Step 4: Deduplicate Sources
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.
Step 5: Assess Activity Scale
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 |
Step 6: Generate Platform-Specific Content
For each content-worthy activity, generate drafts for both platforms:
Reddit Draft
- Tone: Casual, technical, community-oriented
- Structure: Hook question or statement → context → what you did → what you learned
- Include: Code snippets if relevant, specific numbers/metrics
- Avoid: Self-promotion feel, corporate speak, "we're excited to announce"
- Suggest subreddit: Based on tech stack (r/programming, r/webdev, r/typescript, etc.)
LinkedIn Draft
- Tone: Professional, insight-driven, career/industry framing
- Structure: Opening insight → the challenge → the approach → the takeaway
- Include: Broader industry relevance, lessons learned
- Avoid: Too much code, jargon without context, humble-bragging
Step 7: Content Safety Check
Before writing any draft, verify:
- No private code snippets (internal APIs, secrets, proprietary logic)
- No references to internal tools, repos, or systems by name unless they're public
- No customer/user data
- No security vulnerabilities being disclosed
- No conversation fragments that reveal internal debugging approaches or proprietary architecture (session-sourced content)
- No file paths, API responses, or error messages that expose internal infrastructure (session-sourced content)
If a draft references potentially private content, add a **Warning:** Contains potentially private references — review carefully note.
Step 8: Write to Review Queue
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
---
Stop Conditions
This skill is designed to run indefinitely. The user should stop the loop when:
- They're done developing for the session
- The content queue has enough drafts to review
- They want to switch to a different task