agent-content-pipeline
v0.3.0
Published
Safe content automation for AI agents. Draft → Review → Revise (via pi) → Approve → Post.
Downloads
174
Maintainers
Readme
agent-content-pipeline
Safe content automation for AI agents. Draft → Review → Revise → Approve → Post.
The pattern: Your AI drafts content. You review and give feedback. A pi agent rewrites it in your voice. You approve. You post.
Why?
AI agents shouldn't post directly to social media. Too risky. But they're great at drafting.
This kit enforces human-in-the-loop:
- Agent → writes drafts, pi rewrites based on your feedback
- Human → reviews, gives feedback, approves, posts
Install
npm install -g agent-content-pipelineRequires pi on your PATH for the rewrite step.
Includes built-in posters for LinkedIn, X/Twitter, Reddit (experimental), dev.to, and Hashnode.
Quick Start
# 1. Initialize in your workspace (creates folders + global config)
content init .
# 2. Authenticate (once per platform)
content auth linkedin # Opens browser for login
content auth x # Extracts tokens from Firefox (or paste manually)
content auth reddit # Creates Reddit API app credentials
content auth devto # dev.to API key
content auth hashnode # Hashnode token + publication ID
# 3. Create a new post request — pi drafts it in your voice
content new
# 4. Review: give feedback OR approve
content review drafts/my-post.md
# → Enter feedback → pi rewrites it → moved to revised/
# → No feedback → asks "Approve?" → moved to approved/
# 5. Review the revised version, repeat until happy
# 6. Post when approved
content post approved/my-post.mdcontent init <dir> sets up ~/.content-pipeline.json with your workspace path, so commands work from any directory.
CLI command: content (alias: content-pipeline).
Content Folders
drafts/ # Initial drafts land here
reviewed/ # You reviewed, pi is rewriting
revised/ # Rewritten, ready for another look
approved/ # You approved, ready to post
posted/ # Archive after posting
templates/ # Review and customize these
.content-pipeline/threads/ # Feedback thread logs (not posted)The Workflow
┌─────────┐ ┌──────────┐ ┌─────────┐ ┌──────────┐ ┌────────┐
│ drafts/ │ ──▶ │ reviewed/│ ──▶ │ revised/│ ──▶ │ approved/│ ──▶ │ posted/│
└─────────┘ └──────────┘ └─────────┘ └──────────┘ └────────┘
agent/pi human pi rewrites human human
drafts reviews in your voice approves posts
▲ │
└────────────────┘
more feedbackWhen you give feedback in content review, pi spins up with claude-opus-4-6 and the scribe skill loaded, rewrites the draft in your voice, and drops the result into revised/. No manual agent interaction needed.
Secure Mode (Cryptographic Approval)
For extra assurance that content was human-approved, use --secure:
content init . --secureThis creates an Ed25519 signing keypair:
- Private key — encrypted with your password, stored in
.content-pipeline-key - Public key — embedded in the key file for verification
How it works:
- When you approve content, you enter your password
- The content is signed with your private key
- When posting, the signature is verified
- If content was modified after approval, posting is blocked
Files:
.content-pipeline-key— your encrypted keypair (add to.gitignore!)- Approved posts get
approval_signatureandcontent_hashin frontmatter
CLI Reference
# Setup
content init <dir> # Initialize content structure + global config
content init <dir> --secure # Also enable cryptographic approval signatures
content auth <platform> # Authenticate (linkedin, x, reddit, devto, hashnode)
# Workflow
content new # Create a post request, pi drafts it in your voice
content list # Show all folders with timestamps
content review <file> # Review: give feedback (pi rewrites) OR approve
content mv <dest> <file> # Move file to drafts/reviewed/revised/approved/posted
content edit <file> # Open in $EDITOR
content post <file> # Post (shows preview, asks confirmation)
content post <file> -n # Dry-run (--dry-run)
content thread <file> # Add a note to the feedback thread
content platforms # List available platformsPlatforms
- Playwright browser automation
- Session stored in
~/.content-pipeline/
X (Twitter)
- Uses bird CLI
- Tokens extracted from Firefox, or paste
auth_tokenandct0manually:- Open x.com and log in
- DevTools → Application → Cookies → https://x.com
- Copy
auth_tokenandct0
Reddit (experimental)
- Uses snoowrap API wrapper
- Requires a Reddit "script" app (create at reddit.com/prefs/apps)
- Frontmatter requires
subreddit:field
dev.to
- Uses @sinedied/devto-cli via npx
- Get your API key at https://dev.to/settings/extensions
- Frontmatter:
titlerequired,tagsoptional
Hashnode
- Direct GraphQL API
- Get your Personal Access Token at https://hashnode.com/settings/developer
- Find your Publication ID at https://hashnode.com/settings/blogs
- Frontmatter:
titlerequired,tags(array of slugs),canonical_url,cover_imageoptional
pi Integration
The rewrite step uses pi in headless RPC mode. It is triggered automatically on content review (when you give feedback) and content new.
Pi must be installed and on your PATH with a configured API key. If pi is not found the rewrite step is skipped and the draft is left unchanged.
Configuration
Add any of these to your .content-pipeline.json:
{
"piModel": "anthropic/claude-opus-4-6",
"piSkill": "scribe",
"piSystemPrompt": "You are a concise, direct writer. No filler. Match the author's voice."
}| Key | Default | Description |
|---|---|---|
| piModel | anthropic/claude-opus-4-6 | Any model available in your pi install |
| piSkill | (none) | Pi skill name to activate before rewriting. Must exist at ~/.pi/agent/skills/<name>/SKILL.md. |
| piSystemPrompt | built-in | System prompt used when no skill is configured. Ignored if piSkill is set and found. |
If piSkill is set but the skill file is not found on disk, the tool warns and falls back to the system prompt.
For AI Agents
- ✅ Write to
drafts/ - ✅ Move reviewed files to
revised/ - ❌ Cannot approve or post
License
MIT — Lars de Ridder
