Claude Templates / A-tier · High leverage

Outreach

The Publishing Pipeline Playbook

Scheduled posts, a scheduler tick, provider guards, and per-platform normalization.

PUBLISHING-PIPELINE-PLAYBOOK.md · 17 sections · 3,170 words · 25 KB · markdown

For any app that pushes content to external APIs on a schedule. A scheduled_posts queue, a tick worker that can't double-send, per-platform payload normalization, character and media gates, and failure handling that surfaces in the UI instead of dying silently.

What's inside

When to use it

Any app that publishes to third-party APIs.

Straight from the file

The browser may dispatch but never await. Manual "Post Now" inserts a scheduled_posts row with publish_at = now() and lets the same worker pick it up — the manual path and scheduled path share one publish surface so they cannot drift apart.

Table of contents

  1. 0. Use this spec
  2. 1. Architecture
  3. 2. The Universal-Worker rule
  4. 3. Schema
  5. 4. Cross-instance advisory lock (provider-call-guard)
  6. 5. Platform-name normalization (wire-platform.ts)
  7. 6. Per-platform text truncation (platform-limits.ts)
  8. 7. Reconciler with terminal-history gate
  9. 8. Stage-failure vs post-call ambiguity (the retry-revert)
  10. 9. Pre-flight media check
  11. 10. Media URL handling — never store provider URLs
  12. 11. Per-gc staging cache (dedupe.ts)
  13. 12. Generic webhook publisher (HMAC + SSRF)
  14. 13. Status aggregation (sync-generated-content-status)
  15. 14. Common pitfalls
  16. 15. Test plan (smoke)
  17. 16. Kickoff prompt

How to run it

Drop PUBLISHING-PIPELINE-PLAYBOOK.md into your repo, then tell Claude Code: “Read PUBLISHING-PIPELINE-PLAYBOOK.md and implement it in this codebase.” It's written for an agent to execute end to end. Search the file for angle-bracket placeholders and swap in your own project names, domains, and keys before the first run.

↓ Download the playbook

More outreach playbooks

← All 28 Claude templates