@growthub/cli 0.3.56 → 0.3.58

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/assets/worker-kits/growthub-zernio-social-v1/QUICKSTART.md +209 -0
  2. package/assets/worker-kits/growthub-zernio-social-v1/brands/NEW-CLIENT.md +74 -0
  3. package/assets/worker-kits/growthub-zernio-social-v1/brands/_template/brand-kit.md +131 -0
  4. package/assets/worker-kits/growthub-zernio-social-v1/brands/growthub/brand-kit.md +141 -0
  5. package/assets/worker-kits/growthub-zernio-social-v1/bundles/growthub-zernio-social-v1.json +55 -0
  6. package/assets/worker-kits/growthub-zernio-social-v1/docs/ai-caption-layer.md +132 -0
  7. package/assets/worker-kits/growthub-zernio-social-v1/docs/local-adapters.md +123 -0
  8. package/assets/worker-kits/growthub-zernio-social-v1/docs/platform-coverage.md +112 -0
  9. package/assets/worker-kits/growthub-zernio-social-v1/docs/postiz-ui-shell-integration.md +166 -0
  10. package/assets/worker-kits/growthub-zernio-social-v1/docs/posts-and-queues-layer.md +208 -0
  11. package/assets/worker-kits/growthub-zernio-social-v1/docs/zernio-api-integration.md +265 -0
  12. package/assets/worker-kits/growthub-zernio-social-v1/examples/analytics-brief-sample.md +97 -0
  13. package/assets/worker-kits/growthub-zernio-social-v1/examples/client-proposal-sample.md +106 -0
  14. package/assets/worker-kits/growthub-zernio-social-v1/examples/content-calendar-sample.md +74 -0
  15. package/assets/worker-kits/growthub-zernio-social-v1/examples/social-campaign-sample.md +105 -0
  16. package/assets/worker-kits/growthub-zernio-social-v1/growthub-meta/README.md +146 -0
  17. package/assets/worker-kits/growthub-zernio-social-v1/growthub-meta/kit-standard.md +120 -0
  18. package/assets/worker-kits/growthub-zernio-social-v1/kit.json +104 -0
  19. package/assets/worker-kits/growthub-zernio-social-v1/output/README.md +63 -0
  20. package/assets/worker-kits/growthub-zernio-social-v1/output-standards.md +132 -0
  21. package/assets/worker-kits/growthub-zernio-social-v1/runtime-assumptions.md +170 -0
  22. package/assets/worker-kits/growthub-zernio-social-v1/setup/check-deps.mjs +117 -0
  23. package/assets/worker-kits/growthub-zernio-social-v1/setup/check-deps.sh +86 -0
  24. package/assets/worker-kits/growthub-zernio-social-v1/setup/install-mcp.mjs +177 -0
  25. package/assets/worker-kits/growthub-zernio-social-v1/setup/setup.mjs +247 -0
  26. package/assets/worker-kits/growthub-zernio-social-v1/setup/verify-env.mjs +138 -0
  27. package/assets/worker-kits/growthub-zernio-social-v1/skills.md +332 -0
  28. package/assets/worker-kits/growthub-zernio-social-v1/templates/analytics-brief.md +101 -0
  29. package/assets/worker-kits/growthub-zernio-social-v1/templates/caption-copy-deck.md +105 -0
  30. package/assets/worker-kits/growthub-zernio-social-v1/templates/client-proposal.md +98 -0
  31. package/assets/worker-kits/growthub-zernio-social-v1/templates/content-calendar.md +70 -0
  32. package/assets/worker-kits/growthub-zernio-social-v1/templates/platform-publishing-plan.md +86 -0
  33. package/assets/worker-kits/growthub-zernio-social-v1/templates/scheduling-manifest.md +92 -0
  34. package/assets/worker-kits/growthub-zernio-social-v1/templates/social-campaign-brief.md +102 -0
  35. package/assets/worker-kits/growthub-zernio-social-v1/validation-checklist.md +85 -0
  36. package/assets/worker-kits/growthub-zernio-social-v1/workers/zernio-social-operator/CLAUDE.md +307 -0
  37. package/package.json +1 -1
@@ -0,0 +1,132 @@
1
+ # AI Caption Layer
2
+
3
+ The AI caption layer is the operator's methodology for drafting platform-adapted captions at volume while preserving brand voice.
4
+
5
+ The kit produces **A/B/C variants** for every post. Each variant is meaningfully different. This document defines what "meaningfully different" means and how to get there.
6
+
7
+ ---
8
+
9
+ ## Caption Source
10
+
11
+ - Primary source: Claude (the agent running the operator). Uses the local `ANTHROPIC_API_KEY` only when explicitly configured for enhanced drafting.
12
+ - Secondary source: Zernio's own caption service (not used by this kit).
13
+
14
+ The kit produces captions deterministically from the agent. The Zernio account's AI configuration is never invoked as part of scheduled manifest creation.
15
+
16
+ ---
17
+
18
+ ## Variant Contract
19
+
20
+ Every post in the Caption Copy Deck has exactly three variants:
21
+
22
+ | Variant | Hook style | When to pick it |
23
+ |---|---|---|
24
+ | A — Direct | Declarative fact or benefit in the first line | Product announcements, educational content, lead gen |
25
+ | B — Narrative | Story beat, anecdote, or "I / we used to..." opening | Brand building, founder voice, community posts |
26
+ | C — Question | Question or provocation as the opener | Engagement-driven posts, polls, community prompts |
27
+
28
+ Variants must differ in:
29
+
30
+ - Opening hook
31
+ - Structural rhythm (list vs. paragraph vs. question-answer)
32
+ - Called-out angle (data, emotion, curiosity)
33
+
34
+ Minor word swaps (e.g., "great" → "excellent") do not count as separate variants. If three variants cannot be meaningfully differentiated for a post, collapse it to one and note the reason in the Caption Copy Deck.
35
+
36
+ ---
37
+
38
+ ## Per-Platform Character Targets
39
+
40
+ | Platform | Hard limit | Optimal target | Notes |
41
+ |---|---|---|---|
42
+ | `twitter` | 280 | 200–240 | Reserve space for quote-share |
43
+ | `instagram` | 2,200 | 125–150 above the "more" fold | Emoji usage moderate |
44
+ | `facebook` | 63,206 | 100–250 | Longer works but engagement peaks under 250 |
45
+ | `linkedin` | 3,000 | 1,200–2,000 for thought leadership | First 210 chars are the preview |
46
+ | `tiktok` | 2,200 | 100–150 | First 150 chars decide watch-through |
47
+ | `youtube` | Title 100 / Description 5,000 | Title 55–65 / Description 1,500 | Put key benefit in title |
48
+ | `pinterest` | 500 | 200–300 | Keyword-dense; no emoji |
49
+ | `reddit` | Varies | Subreddit-native (read mods' pinned post) | No marketing voice |
50
+ | `bluesky` | 300 | 180–240 | No hashtags, context only |
51
+ | `threads` | 500 | 200–350 | Text-first, image secondary |
52
+ | `googlebusiness` | 1,500 | 150–250 | Lead with action or offer |
53
+ | `telegram` | 4,096 | 300–800 (channel posts) | Preview shows first 2 lines |
54
+ | `snapchat` | 80 (snap overlay) | ≤60 | Must read without audio |
55
+ | `whatsapp` | 1,024 | ≤200 | Personal tone |
56
+
57
+ ---
58
+
59
+ ## Hashtag Rules
60
+
61
+ | Platform | Count | Rule |
62
+ |---|---|---|
63
+ | `instagram` | 3–5 | Mix branded + niche; skip filler (#love, #instagood) |
64
+ | `linkedin` | 3–5 | Professional and topical only |
65
+ | `tiktok` | 3–6 | Mix trending + niche; avoid banned tags |
66
+ | `pinterest` | 2–3 | Keyword hashtags matched to pin description |
67
+ | `twitter` | 1–2 | One branded max; one topical max |
68
+ | `bluesky` | 0 | Platform convention is no hashtags |
69
+ | `threads` | 0–1 | Hashtags used sparingly |
70
+ | `reddit` | 0 | Hashtags read as marketing; remove them |
71
+ | `googlebusiness` | 0 | Not used by platform |
72
+ | `facebook` | 1–2 | Optional; brand-specific |
73
+ | `youtube` | 3–5 in description, 1 in title if relevant | Descriptions tolerate more |
74
+ | `telegram` | 0–2 | Channel-culture dependent |
75
+ | `snapchat` | 0 | Not used by platform |
76
+ | `whatsapp` | 0 | Not used by platform |
77
+
78
+ ---
79
+
80
+ ## Brand Voice Preservation
81
+
82
+ Every variant must pass these guardrails drawn from the active brand kit (`brands/<client-slug>/brand-kit.md`):
83
+
84
+ 1. Tone matches the brand's voice spec (e.g., "direct, technically credible")
85
+ 2. No blocked words (from the brand kit's "Words to Avoid")
86
+ 3. Preferred words are represented where natural (from "Words to Use")
87
+ 4. Emoji usage respects per-platform limits from the brand kit
88
+ 5. CTA matches the client's approved CTA style
89
+
90
+ If a variant cannot satisfy all five guardrails, regenerate — do not ship it.
91
+
92
+ ---
93
+
94
+ ## CTA Catalog
95
+
96
+ Pick one CTA per post. "Learn more" is acceptable; blank is not. Examples mapped to common objectives:
97
+
98
+ | Objective | CTA options |
99
+ |---|---|
100
+ | Brand awareness | "Follow for more", "Save for later", "Share with your team" |
101
+ | Lead generation | "Get the guide", "Request a demo", "Join the waitlist" |
102
+ | Engagement | "What's your take?", "Drop a comment", "Tag a friend" |
103
+ | Product launch | "Try it today", "See what's new", "Book a walkthrough" |
104
+ | Community | "Join the conversation", "Share your build", "Introduce yourself" |
105
+ | Local (Google Business) | "Visit us today", "Claim the offer", "Call to book" |
106
+
107
+ ---
108
+
109
+ ## Media Notes in Captions
110
+
111
+ If a post depends on a media asset (image, video, carousel, reel, short, story):
112
+
113
+ - Include one line in the Media Notes column of the Content Calendar
114
+ - Cite: dimensions, duration, required overlays, brand safe zones, version (landscape/portrait)
115
+ - For carousels, note slide count and order of slides (1 = hook, last = CTA)
116
+ - For videos, note captions-on-by-default requirement and soundtrack licensing status
117
+
118
+ Captions must never describe content that the media does not contain.
119
+
120
+ ---
121
+
122
+ ## AI Enhancement Workflow
123
+
124
+ When `ANTHROPIC_API_KEY` is present and the user asks for enhanced drafting:
125
+
126
+ 1. Draft the three variants with the rules above
127
+ 2. Run a quality pass asking: "which variant would an experienced social editor ship?"
128
+ 3. Revise the other two so they represent genuinely different angles — not alternate phrasings
129
+ 4. Score each variant against the brand voice guardrails
130
+ 5. Store scores in the Caption Copy Deck table
131
+
132
+ This workflow runs entirely inside the agent. No calls go to Zernio for caption content generation.
@@ -0,0 +1,123 @@
1
+ # Local Adapters — IDE Matrix
2
+
3
+ This kit is **IDE-agnostic by design**. The agent entrypoint (`workers/zernio-social-operator/CLAUDE.md`) is plain Markdown, the runtime calls Zernio's hosted REST API via Node's built-in `fetch()`, and no module inside the kit depends on any particular IDE's SDK.
4
+
5
+ That means you can drive the operator from any local coding agent that supports either:
6
+
7
+ 1. A **Working Directory** config field (the canonical growthub-local primitive — see `docs/WORKER_KITS.md` at the repo root for details), or
8
+ 2. An **MCP server** config (for IDEs that speak the Model Context Protocol)
9
+
10
+ ---
11
+
12
+ ## Why no "new adapter" for this kit
13
+
14
+ - **Zernio is hosted SaaS.** There is no self-hostable Zernio component, so a local adapter on the Zernio side would just wrap `fetch()`.
15
+ - The `@paperclipai/adapter-*` packages registered in `server/src/adapters/registry.ts` implement the `ServerAdapterModule` interface — they are **agent executors** (Claude / Codex / Cursor / Gemini / OpenCode / Pi / Hermes), not downstream REST API wrappers. Adding Zernio to that registry would be a category error.
16
+ - Zernio itself ships an official **MCP server** (bundled inside the `zernio-python` SDK: `pip install zernio-sdk[mcp]`) and a **Claude Code skill** (`npx clawhub@latest install zernio-api`). Both are complementary, not required.
17
+
18
+ The result: this kit runs as-is under every local IDE listed below.
19
+
20
+ ---
21
+
22
+ ## Adapter Matrix
23
+
24
+ | IDE / Adapter | Integration path | How to set up |
25
+ |---|---|---|
26
+ | **Claude Code** (CLI) | Working Directory + slash-command conventions | Point `--working-dir` at the exported kit folder; open the session and talk to `zernio-social-operator`. |
27
+ | **Claude Desktop** | MCP server | Add Zernio's MCP server block (see `setup/install-mcp.mjs` for the JSON) to `~/Library/Application Support/Claude/claude_desktop_config.json` (Mac) or `%APPDATA%/Claude/claude_desktop_config.json` (Windows). |
28
+ | **Codex** (OpenAI) | Working Directory | Point Codex at the exported kit folder. The operator law in `CLAUDE.md` works identically under Codex's reading model. |
29
+ | **Cursor** | Working Directory + optional MCP | Open the exported folder as the Cursor workspace. Optionally add Zernio's MCP server to Cursor's MCP config (`~/.cursor/mcp.json`). |
30
+ | **Gemini CLI** | Working Directory | Point Gemini at the exported kit folder. |
31
+ | **OpenCode** | Working Directory | Point OpenCode at the exported kit folder. |
32
+ | **Qwen Code CLI** | Working Directory | Point Qwen at the exported kit folder. |
33
+ | **Open Agents** | Working Directory + durable runs | Wire the kit folder as the agent's workspace; `/zernio` flows map to Open Agents' prompt-session model. |
34
+ | **Any MCP-compatible IDE** | MCP server | Use `setup/install-mcp.mjs` to print the Zernio MCP server config JSON; drop it into your IDE's MCP config file. |
35
+
36
+ ---
37
+
38
+ ## The Three Integration Layers (in order of simplicity)
39
+
40
+ ### Layer 1 — Working Directory only (always works, zero extra install)
41
+
42
+ ```
43
+ growthub kit download growthub-zernio-social-v1
44
+ # ⇒ ~/paperclip/kits/exports/growthub-agent-worker-kit-zernio-social-v1/
45
+
46
+ # Mac / Linux
47
+ open ~/paperclip/kits/exports/growthub-agent-worker-kit-zernio-social-v1
48
+ # Windows PowerShell
49
+ start $HOME\paperclip\kits\exports\growthub-agent-worker-kit-zernio-social-v1
50
+ ```
51
+
52
+ Then:
53
+
54
+ 1. Open your IDE (Claude Code, Codex, Cursor, Gemini, OpenCode, Qwen)
55
+ 2. Point the Working Directory at that folder
56
+ 3. Tell the operator: *"Plan a 30-day Instagram + LinkedIn campaign for [brand]"*
57
+
58
+ That's it. The 10-step workflow in `workers/zernio-social-operator/CLAUDE.md` runs regardless of which IDE is reading it.
59
+
60
+ ### Layer 2 — Zernio's official MCP server (opt-in, one-time install)
61
+
62
+ When your IDE supports MCP (Claude Desktop, Cursor, any MCP-compatible client), plug in Zernio's own MCP server so the agent can call Zernio endpoints directly as tool calls instead of curl.
63
+
64
+ ```bash
65
+ # Python runtime needed
66
+ pip install zernio-sdk[mcp]
67
+
68
+ # Print the per-IDE MCP config JSON:
69
+ node setup/install-mcp.mjs
70
+ ```
71
+
72
+ The installer prints copy-paste blocks for:
73
+
74
+ - Claude Desktop (`claude_desktop_config.json`)
75
+ - Claude Code (`~/.claude/mcp.json`)
76
+ - Cursor (`~/.cursor/mcp.json`)
77
+ - Generic `servers.mcp` JSON (other MCP-compatible IDEs)
78
+
79
+ Then the agent's Zernio API calls can go through MCP tool invocations in addition to — or instead of — raw HTTP fetch. Either path produces the same manifest-submission result.
80
+
81
+ ### Layer 3 — Zernio's Claude Code skill (Claude Code only, optional)
82
+
83
+ For Claude Code users who want Zernio's API surface taught as a first-class Claude skill:
84
+
85
+ ```bash
86
+ npx clawhub@latest install zernio-api
87
+ ```
88
+
89
+ This installs Zernio's official Claude Code skill (docs + examples) alongside this kit. The skill teaches Claude the API shape; this kit provides the operator law, templates, and output contract. They complement each other.
90
+
91
+ ---
92
+
93
+ ## Which layer should you use?
94
+
95
+ | If you want... | Use |
96
+ |---|---|
97
+ | Simplest possible setup; agent-only mode included | Layer 1 (Working Directory) |
98
+ | Typed tool calls from the agent to Zernio | Layer 1 + Layer 2 (MCP) |
99
+ | First-class Zernio knowledge baked into Claude Code | Layer 1 + Layer 3 (Claude Code skill) |
100
+ | Postiz UI shell with Zernio as the engine | See `docs/postiz-ui-shell-integration.md` |
101
+
102
+ All four paths work from the same kit folder. You can layer them — they are strictly additive.
103
+
104
+ ---
105
+
106
+ ## What the kit does NOT do
107
+
108
+ - Does **not** ship any Zernio SDK (Node, Python, Go, Ruby, Java, PHP, .NET, Rust). The agent uses raw REST via `fetch()` so nothing is installed transitively.
109
+ - Does **not** register a new entry in `server/src/adapters/registry.ts` or `cli/src/adapters/registry.ts`. Those registries implement the `ServerAdapterModule` / `CLIAdapterModule` contracts for agent executors; Zernio is a REST API, not an executor.
110
+ - Does **not** fork the externally-maintained `@paperclipai/adapter-claude-local` / `adapter-codex-local` / `adapter-cursor-local` / `adapter-gemini-local` / `adapter-opencode-local` / `adapter-pi-local` / `hermes-paperclip-adapter` packages. They remain untouched.
111
+ - Does **not** add a new entry to the `Agent Harness` discovery menu. This kit is a Worker Kit, not a harness.
112
+
113
+ This keeps the diff surface minimal and the kit strictly reusable across every local IDE already supported by growthub-local.
114
+
115
+ ---
116
+
117
+ ## See also
118
+
119
+ - `../QUICKSTART.md` — one-command setup + per-OS notes
120
+ - `../setup/setup.mjs` — cross-platform bootstrap
121
+ - `../setup/install-mcp.mjs` — per-IDE MCP config printer
122
+ - `./zernio-api-integration.md` — Zernio REST contract
123
+ - `./postiz-ui-shell-integration.md` — pair the kit with the Postiz UI kit
@@ -0,0 +1,112 @@
1
+ # Platform Coverage
2
+
3
+ **Supported Zernio platform IDs, format specs, and character limits.**
4
+
5
+ **Frozen at kit creation: 2026-04-15. Confirm live with `GET /api/v1/platforms` when Zernio adds new integrations.**
6
+
7
+ ---
8
+
9
+ ## Platform Reference Table
10
+
11
+ | Platform | Zernio ID | Auth (Zernio-managed) | Post Types | Char Limit | Image Spec | Video Spec |
12
+ |---|---|---|---|---|---|---|
13
+ | X/Twitter | `twitter` | Twitter OAuth 2.0 | text, image, video, thread | 280 | 1200×675, ≤5MB | MP4/MOV, ≤2min 20s |
14
+ | Instagram | `instagram` | Meta OAuth | image, video, reel, story, carousel | 2,200 | 1080×1080 or 1080×1350 | 1080×1920 (reels), MP4, ≤90s |
15
+ | Facebook | `facebook` | Meta OAuth | text, image, video, reel, story, carousel | 63,206 | 1200×628, PNG/JPG | MP4, ≤240min |
16
+ | LinkedIn | `linkedin` | LinkedIn OAuth | text, image, video, document/carousel | 3,000 | 1200×627, PNG/JPG | MP4, ≤10 min |
17
+ | TikTok | `tiktok` | TikTok OAuth | video only | 2,200 | — | 1080×1920, MP4/MOV, 15s–10min |
18
+ | YouTube | `youtube` | Google OAuth | video (long-form), shorts | N/A (title + description) | Thumbnail: 1280×720 | MP4, any length; Shorts ≤60s, 1080×1920 |
19
+ | Pinterest | `pinterest` | Pinterest OAuth | image, video, idea pin | 500 | 1000×1500 (2:3) | MP4, 4s–15min |
20
+ | Reddit | `reddit` | Reddit OAuth | text, image, video, link | Subreddit-specific | Varies by subreddit | MP4, ≤15min |
21
+ | Bluesky | `bluesky` | AT Protocol | text, image, video | 300 | Up to 4 images, 1×1 to 3×4 | MP4, ≤60s |
22
+ | Threads | `threads` | Meta OAuth | text, image, video, thread | 500 | 1:1 square; 4:5 portrait | MP4, ≤5min |
23
+ | Google Business | `googlebusiness` | Google OAuth | update, offer, event | 1,500 | 720×720 minimum | MP4, ≤30s |
24
+ | Telegram | `telegram` | Bot API token | text, image, video, document | 4,096 | JPEG, ≤10MB | MP4, ≤50MB |
25
+ | Snapchat | `snapchat` | Snapchat Marketing API | image, video, story | 80 | 1080×1920 | MP4, ≤60s |
26
+ | WhatsApp | `whatsapp` | WhatsApp Business API | text, image, video, document | 1,024 | JPEG/PNG, ≤5MB | MP4, ≤16MB |
27
+
28
+ **Source for IDs:** Zernio platform id is the canonical slug used inside every `POST /api/v1/posts` body's `platforms[].platform` field and every `/api/v1/connect/<platform>` OAuth entrypoint.
29
+
30
+ ---
31
+
32
+ ## Platform Selection Guidance
33
+
34
+ ### Audience Demographics (2026 data — refine per client brand kit)
35
+
36
+ | Platform | Primary Demographic | Dominant Use Case |
37
+ |---|---|---|
38
+ | X/Twitter | 18–49 (male-skewed) | News, opinion, live commentary |
39
+ | Instagram | 18–34 (55% female) | Visual branding, lifestyle, product showcase |
40
+ | Facebook | 35–65 | Community groups, local business, events |
41
+ | LinkedIn | 25–55 (professional) | B2B, thought leadership, hiring |
42
+ | TikTok | 18–34 | Short-form entertainment, product discovery |
43
+ | YouTube | All ages (18–49 core) | Education, reviews, entertainment |
44
+ | Pinterest | 25–44 (female-skewed 70%) | Discovery, DIY, home, fashion, recipes |
45
+ | Reddit | 18–49 (male-skewed) | Community discussion, niche interests |
46
+ | Bluesky | 25–45 (tech-skewed) | Tech commentary, open-source community |
47
+ | Threads | 18–34 | Text-first companion to Instagram audiences |
48
+ | Google Business | Local search audience | Local business discovery, reviews |
49
+ | Telegram | 18–44 (international) | Channels, bots, direct community |
50
+ | Snapchat | 13–34 | Short-form, ephemeral content |
51
+ | WhatsApp | 18+ (international, business) | Direct conversations, business messaging |
52
+
53
+ ### Recommended posting cadence per platform
54
+
55
+ | Platform | Min / Max per week | Notes |
56
+ |---|---|---|
57
+ | X/Twitter | 5 / 30 | Highest-cadence platform. Multiple per day is acceptable. |
58
+ | Instagram | 3 / 10 | Feed posts 3–5/week; Stories daily acceptable. |
59
+ | Facebook | 3 / 10 | Mirror Instagram for B2C. |
60
+ | LinkedIn | 3 / 5 | Never post more than 1x/day for a brand. |
61
+ | TikTok | 3 / 21 | Daily posting drives algorithm signal. |
62
+ | YouTube | 1 / 3 | Long-form is weekly; Shorts can be daily. |
63
+ | Pinterest | 3 / 15 | Batch-pin from hero assets. |
64
+ | Reddit | 1 / 5 | Subreddit etiquette outranks brand cadence. |
65
+ | Bluesky | 3 / 14 | Text-forward; 1–2x/day is common. |
66
+ | Threads | 3 / 14 | Pair with Instagram rhythm. |
67
+ | Google Business | 1 / 3 | Updates + offers + events; don't over-post. |
68
+ | Telegram | 1 / 7 | Channels tolerate quality over quantity. |
69
+ | Snapchat | 3 / 14 | Short daily pulses work well. |
70
+ | WhatsApp | 0 / 2 broadcast | Direct conversation first; broadcast sparingly. |
71
+
72
+ ### Carousel support
73
+
74
+ Carousel posts are supported on: `instagram`, `linkedin`, `pinterest`, `facebook`.
75
+ They are **not** supported on: `tiktok`, `twitter`, `bluesky`, `threads`, `youtube`, `googlebusiness`, `telegram`, `snapchat`, `whatsapp`, `reddit`.
76
+
77
+ ### Thread support
78
+
79
+ Native thread posts are supported on: `twitter`, `bluesky`, `threads`. Everywhere else, use carousel or long-form caption.
80
+
81
+ ### Messaging-only platforms
82
+
83
+ `telegram` and `whatsapp` require follower opt-in through the Zernio-connected account. Do not plan broadcast-style campaigns on these platforms without confirming consent flows with the client.
84
+
85
+ ---
86
+
87
+ ## Per-platform Tone Snapshot
88
+
89
+ | Platform | Tone | Opening-hook rule |
90
+ |---|---|---|
91
+ | `twitter` | Concise, punchy, declarative | First 80 chars decide re-share |
92
+ | `instagram` | Visual-first; caption secondary | First 150 chars above the "more" fold |
93
+ | `facebook` | Conversational, community-oriented | First sentence is the hook |
94
+ | `linkedin` | Professional, credibility-first | Lead with outcome or lesson, not greeting |
95
+ | `tiktok` | Casual, trend-aware | First 150 chars drive completion rate |
96
+ | `youtube` | Benefit + specificity in title; hook in first 8 seconds of video | Title carries the weight |
97
+ | `pinterest` | Descriptive, keyword-dense | Pin title is the hook |
98
+ | `reddit` | Subreddit-native — no marketing voice | First line must read like a genuine user post |
99
+ | `bluesky` | Honest, tech-fluent, link-sparse | Skip hashtags; context carries it |
100
+ | `threads` | Casual, text-forward | Treat as "tweets for Instagram audiences" |
101
+ | `googlebusiness` | Operational, benefit-first, local | Include location or offer specifics |
102
+ | `telegram` | Long-form friendly, channel voice | First two lines in notification preview |
103
+ | `snapchat` | Playful, immediate | Hook must work without audio |
104
+ | `whatsapp` | Direct, 1:1 voice | Treat as personal message, not broadcast |
105
+
106
+ ---
107
+
108
+ ## Cross-reference
109
+
110
+ For caption character limits and variant rules see `docs/ai-caption-layer.md`.
111
+ For scheduling + queue format see `docs/posts-and-queues-layer.md`.
112
+ For API auth, endpoints, rate limits, and error codes see `docs/zernio-api-integration.md`.
@@ -0,0 +1,166 @@
1
+ # Postiz UI Shell + Zernio Engine — Integration Recipe
2
+
3
+ This document is the canonical recipe for running `growthub-zernio-social-v1` as the engine layer underneath the stable `growthub-postiz-social-v1` kit's UI shell.
4
+
5
+ **Read order:** `../runtime-assumptions.md` → `./zernio-api-integration.md` → this file.
6
+
7
+ ---
8
+
9
+ ## Architectural split
10
+
11
+ | Layer | Owned by | What it does |
12
+ |---|---|---|
13
+ | Presentation | `growthub-postiz-social-v1` (Postiz UI) | Calendar, compose, analytics shell, team workspace |
14
+ | Engine | `growthub-zernio-social-v1` (this kit) | Posts, queues, media, inbox, analytics transport against Zernio REST API |
15
+
16
+ **Core principle:** Postiz stays the UI. Zernio replaces Postiz's native provider/posting engine. Nothing in Postiz's own database schema, Redis queue runner, React app, or auth/team/workspace system changes. The diff surface is the provider + publish-bridge layers only.
17
+
18
+ ---
19
+
20
+ ## The 7 Module Integration Map
21
+
22
+ ### Module 1 — Provider Override (Zernio as the transport)
23
+
24
+ Postiz's provider system is where per-platform OAuth and posting normally live. Replace it with a single `ZernioProvider`:
25
+
26
+ - `baseUrl` → `https://zernio.com/api/v1`
27
+ - `authHeader` → `Authorization: Bearer ${ZERNIO_API_KEY}`
28
+ - All 14 platforms route through this one provider — no per-platform OAuth apps on the Postiz side
29
+ - Postiz's "Connect Account" UI validates `ZERNIO_API_KEY` instead of OAuth dancing — Zernio handles all OAuth upstream
30
+
31
+ The config for this provider mirrors exactly `buildZernioSocialConfig()` in `cli/src/kits/core/index.ts`:
32
+
33
+ ```ts
34
+ {
35
+ providerId: "zernio",
36
+ providerName: "Zernio (hosted)",
37
+ providerBaseUrl: "https://zernio.com/api/v1",
38
+ providerAuthField: "Authorization",
39
+ apiKeyEnvVar: "ZERNIO_API_KEY",
40
+ additionalRequiredEnvVars: ["ZERNIO_API_URL"],
41
+ }
42
+ ```
43
+
44
+ ### Module 2 — Post Submission Bridge
45
+
46
+ The Zernio operator already produces manifests shaped as valid `POST /api/v1/posts` bodies. The bridge:
47
+
48
+ 1. Intercepts Postiz's internal `publishPost()` call
49
+ 2. Transforms the Postiz post into a Zernio manifest entry (see `./posts-and-queues-layer.md`)
50
+ 3. Fires `POST ${ZERNIO_API_URL}/posts` with `Authorization: Bearer ${ZERNIO_API_KEY}` and `Idempotency-Key: <clientPostId>`
51
+ 4. Feeds Zernio's response back into Postiz's job tracker
52
+
53
+ `clientPostId` format stays `<client-slug>-<YYYYMMDD>-<sequence>`. Re-submitting the same manifest under the same key is safe.
54
+
55
+ ### Module 3 — Queue Sync Layer
56
+
57
+ Postiz's queue concept maps 1:1 onto Zernio queues (`POST /api/v1/queues`):
58
+
59
+ - Postiz queue scheduler → Zernio `queues` endpoint (create) / `queues/<queueId>` (update)
60
+ - `Idempotency-Key: queue-<name>` prevents double-fire on retry
61
+ - Posts attached to a queue omit `scheduledFor` and include `queueId`
62
+ - The 10-step `zernio-social-operator` workflow becomes the execution contract for each queue job
63
+
64
+ ### Module 4 — AI Caption Layer Surface
65
+
66
+ The agent-side `/zernio` command surface replaces Postiz's native AI composer:
67
+
68
+ - Postiz compose textarea → `/zernio captions` (or `/zernio campaign` for full scope)
69
+ - Caption drafts come from the A/B/C variant rules in `./ai-caption-layer.md`
70
+ - Claude Code runs as a background operator session; Postiz compose UI is the front-end trigger
71
+ - The 10 `/zernio` subcommands wire into Postiz's compose surface as slash-quick-actions
72
+
73
+ ### Module 5 — Platform Coverage Config
74
+
75
+ `./platform-coverage.md` is the source of truth for Postiz channel configuration:
76
+
77
+ - Disable native Postiz channel handlers
78
+ - Register 14 channels pointing to the Zernio transport from Module 1
79
+ - The per-platform format spec (char limits, aspect ratios, post types, carousel eligibility, thread support, cadence) drives Postiz's per-channel validation + preview rendering
80
+ - `skills.md` per-platform tone rules feed the compose UI's voice hints
81
+
82
+ ### Module 6 — ENV + Secret Surface
83
+
84
+ Direct alignment — the cleanest module:
85
+
86
+ | Kit env var | Postiz field |
87
+ |---|---|
88
+ | `ZERNIO_API_KEY` | provider credentials field (replaces all per-platform OAuth tokens) |
89
+ | `ZERNIO_API_URL` | provider baseUrl override (regional/proxy deployments only) |
90
+ | `ZERNIO_PROFILE_ID` | default profile scope for all write requests |
91
+ | `ZERNIO_TIMEZONE` | default posting timezone when the profile's timezone isn't used |
92
+
93
+ `setup/verify-env.mjs` and `setup/check-deps.sh` run as Postiz's pre-start health checks. The secret-hygiene scan (`sk_` + 64-hex leak detection from the kit test suite) is the canonical gate on any output or log line.
94
+
95
+ ### Module 7 — Workspace CLI Entry Point
96
+
97
+ `@growthub/cli >= 0.3.57` is the operator terminal that sits beside Postiz:
98
+
99
+ - `growthub kit download growthub-zernio-social-v1` — materialize the kit
100
+ - `growthub kit path growthub-zernio-social-v1` — print the working-directory path
101
+ - Point a Claude Code session at that folder; the operator handles the full 10-step workflow
102
+ - Postiz UI reflects the output — scheduled posts, queue runs, generated captions, analytics
103
+ - The 7 artifacts declared by `buildZernioSocialConfig()` (brief, calendar, publishing plan, caption deck, scheduling manifest, analytics brief, client proposal) are the canonical source of truth for what the UI shows
104
+
105
+ ---
106
+
107
+ ## Integration Sequence (request path)
108
+
109
+ ```
110
+ Postiz UI (compose / schedule)
111
+
112
+ Module 2 — Post Submission Bridge
113
+
114
+ Module 1 — ZernioProvider (Authorization: Bearer ZERNIO_API_KEY)
115
+
116
+ Zernio API → POST /api/v1/posts
117
+ + POST /api/v1/queues
118
+ + POST /api/v1/media
119
+ + GET /api/v1/inbox
120
+ + GET /api/v1/analytics/*
121
+
122
+ Module 3 — Queue Sync reads back status
123
+
124
+ Postiz Calendar / Analytics shell renders state
125
+ ```
126
+
127
+ Claude Code + the `/zernio` surface sits **laterally** — it feeds the compose box in Postiz before submission, not inside the request path. This keeps the agent lane non-blocking for end-user UI latency.
128
+
129
+ ---
130
+
131
+ ## What Stays Untouched in Postiz
132
+
133
+ | Layer | Status |
134
+ |---|---|
135
+ | Postgres schema | Unchanged |
136
+ | Redis queue runner | Unchanged (different job payloads, same runner) |
137
+ | React frontend | Unchanged (except the compose AI hook in Module 4) |
138
+ | Auth / team / workspace | Unchanged |
139
+ | Existing Postiz kit payload (`growthub-postiz-social-v1`) | Unchanged — it remains valid for self-hosted-only operators |
140
+
141
+ This keeps the diff surface minimal and keeps `growthub-zernio-social-v1` fully isolated as the engine layer.
142
+
143
+ ---
144
+
145
+ ## Operator Setup Order (when paired with Postiz UI shell)
146
+
147
+ 1. Stand up Postiz via its own kit (`growthub kit download growthub-postiz-social-v1`) — optional if only the UI layer is desired
148
+ 2. Download this kit: `growthub kit download growthub-zernio-social-v1`
149
+ 3. Fill `.env` — `ZERNIO_API_KEY`, `ZERNIO_API_URL`, `ZERNIO_PROFILE_ID`
150
+ 4. Run `node setup/verify-env.mjs` (kit-level) and the Postiz pre-start checks
151
+ 5. Apply Modules 1–3 inside the Postiz fork (provider override, publish bridge, queue sync). Everything else stays default.
152
+ 6. Open Claude Code at the Zernio kit's exported folder for the `/zernio` surface
153
+
154
+ Standalone (without Postiz UI): everything still works — the kit is self-contained, and Modules 1–3 are optional.
155
+
156
+ ---
157
+
158
+ ## Validation Before Go-Live
159
+
160
+ - [ ] Zernio API key scope is `read-write`
161
+ - [ ] `GET /api/v1/accounts?profileId=...` returns at least one connected platform
162
+ - [ ] A dry-run manifest round-trips through Module 2 with a successful 2xx from `POST /api/v1/posts`
163
+ - [ ] A queue definition round-trips through Module 3 with a returned `queueId`
164
+ - [ ] Postiz channel list surfaces all 14 Zernio platform slugs from `./platform-coverage.md`
165
+ - [ ] Compose surface calls into `/zernio captions` and renders A/B/C variants
166
+ - [ ] Kit secret-hygiene scan on the Postiz fork's logs is clean