PRD: Automatos Blog Widget

Introduction

Add an embeddable blog widget to the Automatos Widget SDK that lets users display AI-agent-authored blog posts on any website. Agents research, write, and publish posts via a platform tool. Users embed a <script> tag and get a self-updating blog powered by their Automatos workspace. The automatos.app landing site is customer #1 — dog-fooding the widget to showcase agent-generated content.

This turns Automatos from a tool users log into, to a platform that's visible on their customers' websites. Every blog post published reinforces the value loop: agents produce content, content drives traffic, traffic justifies the subscription.

Goals

  • Let agents publish blog posts via platform_publish_blog_post tool

  • Provide an embeddable blog widget (@automatos/blog-widget) matching the existing chat widget architecture

  • Expose a public Blog API for fetching published posts (no auth required for reads)

  • Ship blog management UI in the Automatos dashboard (create, edit, schedule, unpublish)

  • Deploy the blog widget on automatos.app as the first integration

  • Support theming, layout variants, and SEO-friendly rendering

User Stories

US-001: Blog posts database schema

Description: As a developer, I need to store blog posts with metadata so they can be queried and displayed.

Acceptance Criteria:

US-002: Blog API — public read endpoints

Description: As a widget consumer, I need public endpoints to fetch published posts without authentication so the widget can render on any site.

Acceptance Criteria:

US-003: Blog API — authenticated management endpoints

Description: As a workspace owner or agent, I need CRUD endpoints to manage blog posts.

Acceptance Criteria:

US-004: Platform tool — platform_publish_blog_post

Description: As an agent, I need a tool to write and publish blog posts to my workspace so I can automate content creation.

Acceptance Criteria:

US-005: Platform tool — platform_list_blog_posts

Description: As an agent, I need to list existing blog posts so I can check what's already published before writing new content.

Acceptance Criteria:

US-006: Blog widget package — @automatos/blog-widget

Description: As a website owner, I need an embeddable blog widget that displays my workspace's published posts.

Acceptance Criteria:

US-007: Blog widget — post detail rendering

Description: As a reader, I need to view full blog post content with proper typography and formatting.

Acceptance Criteria:

US-008: Loader integration — widget type "blog"

Description: As a developer, I need to initialize the blog widget via the same script tag loader used for chat.

Acceptance Criteria:

US-009: React wrapper for blog widget

Description: As a React developer, I need a React component to embed the blog widget.

Acceptance Criteria:

US-010: Landing site blog page — dog-food integration

Description: As the Automatos team, we need a /blog page on automatos.app that uses our own blog widget to prove the product works.

Acceptance Criteria:

US-011: Dashboard blog management UI

Description: As a workspace owner, I need a UI to manage blog posts (create, edit, review agent drafts, publish/unpublish).

Acceptance Criteria:

Functional Requirements

  • FR-1: Blog posts are scoped to a workspace. One workspace's posts are never visible in another's widget

  • FR-2: Slugs are auto-generated from title (kebab-case, deduplicated with numeric suffix)

  • FR-3: Reading time calculated as word_count / 200 (rounded up to nearest minute)

  • FR-4: Markdown rendered server-side for the public API (returns HTML), client-side in the widget as fallback

  • FR-5: Cover images are URLs (not uploaded to Automatos — users provide external URLs or use workspace file URLs)

  • FR-6: Published posts are publicly readable. No authentication for widget GET endpoints

  • FR-7: Agents can only publish to their own workspace

  • FR-8: The platform_publish_blog_post tool follows the 3-file pattern: platform_actions.py, platform_executor.py, auto.py keywords

  • FR-9: Blog widget bundle target: <15KB gzipped (similar to chat widget)

  • FR-10: Widget supports server-side rendering hints via <noscript> fallback with post titles/links for SEO crawlers

Non-Goals

  • No comment system (v1 is publish-only, not social)

  • No multi-author workflows or editorial approval queue (agents publish directly, humans review in dashboard)

  • No image upload/hosting (use external URLs)

  • No analytics beyond view_count (no click tracking, heatmaps, etc.)

  • No RSS/Atom feed generation (can add later)

  • No scheduled publishing automation (scheduled_for field exists but cron job is out of scope for v1)

  • No i18n or multi-language support

  • No full-text search within blog posts

Technical Considerations

  • Blog widget reuses @automatos/core for API client, auth, and event bus

  • Markdown parser in @automatos/chat-widget should be extracted to @automatos/core or a shared package so blog-widget can reuse it

  • Public blog endpoints should be aggressively cached (Cache-Control: public, max-age=300 for listings, max-age=3600 for individual posts)

  • Widget should lazy-load post detail content (don't fetch full markdown in listing response)

  • Consider using Intersection Observer for infinite scroll on post listings

  • The blog widget needs a different mount pattern than chat (inline container vs. floating FAB). The config option containerSelector determines where it renders

Design Considerations

  • Blog widget should feel native to the host site. Minimal chrome, maximum theme customization

  • Post cards in grid layout: cover image top, title, excerpt, meta row (author, date, reading time)

  • Post detail: full-width cover image hero, then centered content column (max-width ~720px)

  • Typography should be excellent — this is a reading experience. Use the host site's font via --aw-font or default to a clean serif/sans pair

  • Dark/light theme support via same --aw-* CSS variables as chat widget

  • Loading skeletons should match the layout variant (grid skeleton vs. list skeleton)

Success Metrics

  • Blog widget renders published posts on automatos.app within 500ms of page load

  • Agent can publish a blog post end-to-end (research, write, publish) without human intervention

  • Widget bundle size <15KB gzipped

  • At least 3 agent-authored posts published on automatos.app/blog within first week

Open Questions

  • Should the blog widget support pagination or infinite scroll? (Recommendation: pagination for v1, simpler)

  • Should post URLs be handled by the widget (SPA-style) or should we generate static URLs that the host site routes? (Recommendation: widget handles it internally with containerSelector, host site can optionally add routes for SEO)

  • Should we add an "edit in Automatos" link visible only to authenticated workspace owners viewing their own widget? (Nice for quick fixes)

  • Should the widget preload the next page of posts for instant pagination?

Last updated