Social Automation
How databayt turns an idea into a published social post across eight platforms — with Claude
writing the copy, /higgs making the media, and a thin gateway doing the broadcast. Each brand
(databayt, Hogwarts, Mkan, Moallimee, Sijillee) runs its own presence off this shared pipeline.
The brand rules every post obeys are in Brand & Voice; the build roadmap and
credential plan are internal (docs/SOCIAL-AUTOMATION.md).
Business models → who we're talking to
databayt runs on four business models. Social marketing serves each one differently — B2B storytelling for the first three, B2C reach for the SaaS products.
| Model | Type | What it sells | Social job |
|---|---|---|---|
| Per Project | B2B | Custom automation builds for partners | Show the work — case studies, "automate the boring" proof |
| Partners | B2B | Outsourced product dev + specialized talent | Attract teams & talent — founder story, capability posts |
| Codebase | B2B / B2C | Reusable components, contributor revenue-share (the sharing economy) | Grow the contributor community — open-source, dev-rel |
| SaaS | B2C / B2B | Ready-to-deploy products (Hogwarts, Mkan, Souq, Shifa, …) | Sell the product — per-brand consumer & buyer marketing |
The first three are the databayt umbrella story (B2B, developer- and partner-facing). The fourth is where the product brands live — each with its own audience, channel mix, and voice.
Strategy
How we actually win is its own page — Strategy: six lenses (organic · viral · when · grow · pay off · moral), the create-once-repurpose-everywhere multiplier that makes 5 brands × 8 channels feasible for a small team, per-brand cadence, and the kill criteria that keep social honest against the cash-flow-first drive.
Brand pages
Every brand has its own presence. Its audience, channel mix, content pillars, and account status live on its page:
- Databayt — the umbrella: open source, sharing economy, Kun & dev-rel (B2B)
- Hogwarts — school management SaaS (B2B schools + B2C parents)
- Mkan — property rentals (B2C renters + B2B hosts)
- Moallimee — teachers & tutoring (pre-launch)
- Sijillee — Sudan business accounting (pre-launch) (B2B)
Souq and Shifa are live SaaS products but are not in the current priority-5 social push. When they join, they get a page on this same template.
The pipeline
idea ──► draft ──► media ──► approve ──► schedule ──► publish ──► measure
│ │ │ │ │ │ │
content Claude /higgs human cron slot telegram|fb PostHog
calendar native text-free gate (one, 06:00) direct|Hermes + UTM
| Stage | Owner | Notes |
|---|---|---|
| Idea | content-calendar skill · weekly cadence · growth agent pillars | What to say, to whom, when |
| Draft | Claude, natively | Arabic-first bilingual copy, written against Brand & Voice |
| Media | /higgs | Text-free visuals, brand kit b0a3f528…; copy is overlaid in-post, never rendered |
| Approve | human (Abdout / Ali / Samia) | The gate — see Autonomy ladder |
| Schedule | one daily cron slot | No date-picker: 0 6 * * * + a 12h approval window. Real scheduling needs SocialPost/ScheduledPost persistence |
| Publish | Egress layer — Telegram + Facebook direct APIs · other channels via the Hermes gateway | Egress only — dumb relays, never the LLM |
| Measure | PostHog + per-platform analytics | UTM-tagged links → attribution |
Which of the three loops a post travels — Hub, cron draft-and-approve, or the inbound Hermes relay — plus the actor map, the cron inventory, and the keyword table, are on Architecture & Loops.
Layer boundaries
The one rule that keeps the architecture honest: Hermes is a broadcast relay, not a brain. Anthropic offers no native "post to X" primitive, so a self-hosted last-mile gateway is a legitimate egress — but the writing stays Claude-native. This is what reconciles a self-hosted gateway with the "anthropic-native over self-hosted" doctrine.
| Concern | Layer | Why here |
|---|---|---|
| Write the copy | Claude (in Claude Code / Cowork) | Best model, brand-aware, bilingual — never Hermes' LLM |
| Make the image/video | /higgs → Higgsfield CLI | Already governed by budget + brand kit |
| Decide it's good | Human (→ automated gate at L4) | Brand accounts are public and irreversible |
| Reach the platform | Egress layer, routed per channel | Telegram: direct Bot API (a plain HTTPS call — works from Vercel). Chat networks via the Hermes gateway (Slack today via SLACK_HOME_CHANNEL); more adapters as they land |
| Prove it worked | PostHog + UTM | Attribution back to site traffic / conversions |
Done (Phase 2, 2026-07-10). The old
generateAndPublishPostaction drafted via the gateway's own LLM and never published — a name that lied twice. Rather than rename it, Phase 2 removed the in-app draft lane entirely: drafting is Claude-native via the/socialskill, and the hub is compose → stage → publish only.
The eight channels
The full set: Facebook, Instagram, Telegram, TikTok, Snapchat, X, LinkedIn, WhatsApp. Each has a very different posting-API reality — some trivial, some paid, some with no organic-post API at all. Build order follows feasibility, not wish-list:
| Channel | Posting API | Effort | Note |
|---|---|---|---|
| Telegram | Bot API | Trivial | Live — wired direct (2026-07-10); needs the bot token + channel |
| X | API v2 | Easy (paid) | Pay-per-use since Feb 2026 (~$0.015/post) → /decide |
| Graph API | Medium | App review + business verification | |
| Graph API | Medium | Business account linked to a FB Page | |
| Posts API | Medium | Community Management API approval + page admin | |
| TikTok | Content Posting API | Hard | App audit (~1–4 wks); posts private until passed |
| Snapchat | Public Profile API | Limited | Allowlist-only via a Snap contact |
| (none) | Limited | No official organic-post API — community broadcast only |
Full matrix, costs, and the aggregator option (Ayrshare covers 7 of 8) are in the internal roadmap. Per-brand channel priorities are on each brand page.
Autonomy ladder
The north star is fully autonomous publishing. We climb to it in stages — not because autonomy is hard to code, but because handing a public brand account to an unsupervised bot needs guardrails first. We are at L2 on Telegram (staged: compose → one-click publish) and L1 elsewhere today.
| Level | What runs | Human role |
|---|---|---|
| L0 — Manual | Human writes and posts | Everything |
| L1 — Assisted | Claude drafts + /higgs media | Human posts manually |
| L2 — Staged | kun stages copy+media to the dashboard | One-click approve → publish |
| L3 — Semi-auto | Auto-publish low-risk channels (Telegram); gate brand channels | Approves brand posts only |
| L4 — Full-auto | Autonomous end-to-end | None — replaced by an automated gate |
L4 is gated behind /decide + credentials + an automated guardrail layer: an LLM-judge
content + Arabic-correctness check, per-channel rate limits, and a kill switch. Autonomy without
that layer is not a feature — it's an incident waiting to happen.
The /social keyword
Wired (2026-07-10) per the engine-parity recipe — skill + agent + vocabulary + counts + regenerated artifacts, health green:
- Skill —
.claude/skills/social/SKILL.md: resolve brand + channels → draft (Claude, Arabic-first variants per channel) → media (/higgs) → human approval gate → publish via the composer orscripts/post-to-hermes.mjs. - Agent —
.claude/agents/growth.mdgained a Social Automation section (it already owned "social media"); no new agent. - Vocabulary — the
socialspell lives in the Pensieve school next tohiggs:order: [{familiar, growth}, {skill, /social}].
Saying "social post" (or «منشور تواصل») in prose activates it — no slash needed.
Current status
The Social Hub at /social is multi-product (Phase 3, 2026-07-23):
- Works — bilingual (en/ar, RTL) composer with a config-driven channel registry (9 channels) × a product registry (hogwarts · mkan · databayt · sijillee · moalimee). A product select — same visual language as the shadcn theme selector — scopes the whole page: channel toggles, health checks, and publish all carry the chosen brand.
- Per-product Facebook — each brand has its own Page and its own permanent Page token, read
from
FACEBOOK_PAGE_ID_<PRODUCT>/FACEBOOK_PAGE_ACCESS_TOKEN_<PRODUCT>. The Egress panel names the Page the token resolved to, which is how you catch a crossed token before publishing. Live for hogwarts, mkan, and databayt; sijillee and moalimee have no Page yet. - Per-product wiring — a channel is publishable only when the global transport and that
brand's own destination are wired (
productChannelWired). Telegram and Slack staydatabayt-only: there is exactly one Telegram channel and one Slack channel, both org-level, so claiming them for a product brand would post "as Hogwarts" into the org channel. - Auto-post is draft-and-approve — a daily Vercel cron (
/api/social/cron,CRON_SECRET-guarded) drafts per opted-in product and sends the draft to a private review channel with a signed, 12-hour, one-click Publish link. Nothing publishes unattended. Opt in per product withSOCIAL_AUTOPOST_PRODUCTS; empty (the default) means the cron does nothing. - Inbound relay — because Vercel can never reach Hermes on
localhost,/api/social/relayinverts the arrow: Hermes drafts, a human approves in Slack, Hermes POSTs the approved text to kun, and kun delivers with its own tokens. Hermes never holds a Page token. - Drafting stays out of the relays —
SOCIAL_DRAFT_SOURCE=hermes(default) hands the ask to Hermes;=anthropicdrafts server-side via the API and is opt-in because the engine's billing posture is subscription-only. - Media — an optional public image URL (typically a
/higgsrender on the CDN) rides the whole chain: Facebook switches to the/photosedge with a caption, Telegram tosendPhoto(spilling over-long copy into a follow-up message rather than truncating it), and the signed approval token carries the media so approving a staged draft publishes the image, not just text. - Multi-channel, with per-channel truth — the picker selects any subset of a brand's wired channels, the three transports fan out in parallel, and the result names each channel individually. A half-landed post no longer reads as one flat failure.
- Stage for review from the Hub — the composer can push your own copy down the cron's approval path (signed 12h link into the private review channel) instead of publishing directly, for when someone else signs off.
- Removed — the in-app AI draft card: gateway-LLM drafting violated the layer boundary, so
drafting now lives in the
/socialskill (Claude-native). - Still pending — adapters beyond Slack (see Hermes), persistence
(
SocialPost) and therefore real scheduling, per-brand Telegram/Slack channels, and metrics pull-back — tracked indocs/SOCIAL-AUTOMATION.md.
See also
- Status — what is configured and live right now, versus what is merely wired.
- Channel Setup — per-platform setup guides, written to be usable on your own accounts.
- Brand & Voice — the rules every post obeys.
- Connectors — the MCP-backed service integrations.
/higgsskill — media generation ·content-calendarskill ·growthagent.