Skip to content
reaatech

Files · Product Launch to Social Media Calendar

69 (1 binary, 600.4 kB total)attempt 3

README.md·4131 B·markdown
markdown
# Product Launch to Social Media Calendar
 
> Automatically generate a month of social posts from product release notes.
 
A reference recipe demonstrating how to build a document-pipeline AI system that ingests product release notes (markdown with YAML frontmatter) and generates a 30-day social media calendar with platform-specific copy for LinkedIn, Twitter/X, and Facebook.
 
## Problem
 
A 5-person B2B startup launches a new feature every two weeks. The marketing lead spends 2 days per month manually writing social media posts. They often miss key features or post inconsistently.
 
## Solution
 
This recipe ingests internal product release notes and automatically generates a 30-day social media calendar with:
- **Platform-specific copy**: professional LinkedIn posts, punchy Twitter/X posts, conversational Facebook posts
- **Content variety**: announcement, feature highlight, use case, customer story, tip/trick, behind-the-scenes
- **Smart scheduling**: posts distributed across 30 days, avoiding weekends, rotating platforms
- **Quality linting**: validates generated posts for empty content, character limits, and scheduling issues
 
## How It Works
 
1. **Parse** — release notes (markdown with YAML frontmatter) are validated using `@reaatech/agents-markdown` schemas
2. **Validate** — document structure is checked via `@reaatech/agents-markdown-validator`
3. **Plan** — content is distributed across 30 days with varied post types and platform rotation
4. **Generate** — the Vercel AI SDK (`ai@6`) calls a provider-agnostic LLM to write platform-specific copy
5. **Lint** — the calendar is linted for quality issues using `@reaatech/agents-markdown-reporter`
6. **Observe** — all pipeline operations are logged via `@reaatech/agents-markdown-observability`
 
## Tech Stack
 
- **Framework**: Next.js 16+ (App Router)
- **LLM SDK**: Vercel AI SDK 6 (`ai@6.0.193`) with `@ai-sdk/openai-compatible` adapter
- **Schema Validation**: `zod@4.4.3`
- **Concurrency**: `p-limit` (max 3 concurrent LLM calls)
- **REAA Packages**: `@reaatech/agents-markdown`, `@reaatech/agents-markdown-scaffold`, `@reaatech/agents-markdown-mcp-server`, `@reaatech/agents-markdown-validator`, `@reaatech/agents-markdown-reporter`, `@reaatech/agents-markdown-observability`
 
## Quick Start
 
```bash
pnpm install
pnpm dev
```
 
Then POST your release notes:
 
```bash
curl -X POST http://localhost:3000/api/generate \
  -H "Content-Type: application/json" \
  -d '{
    "releaseNotes": "---\ntitle: V2.5 Launch\ndate: 2026-06-10\n---\n- Dark mode support\n- SSO integration",
    "tone": "professional"
  }'
```
 
## API
 
### `POST /api/generate`
 
Generate a social media calendar from release notes.
 
**Request body:**
 
| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `releaseNotes` | string | yes | Markdown with YAML frontmatter (`title`, `date`) and bulleted features |
| `tone` | string | no | `"professional"` (default), `"casual"`, or `"enthusiastic"` |
 
**Response:** `{ calendar: SocialCalendar, report: string }`
 
### `GET /api/calendar`
 
Retrieve the last generated calendar.
 
| Query param | Value | Description |
|-------------|-------|-------------|
| `format` | `"markdown"` | Returns a markdown lint report instead of JSON |
 
## Environment Variables
 
| Variable | Required | Description |
|----------|----------|-------------|
| `OPENAI_COMPATIBLE_BASE_URL` | Yes | Base URL for the LLM provider (default: `https://api.openai.com/v1`) |
| `OPENAI_COMPATIBLE_API_KEY` | Yes | API key for the provider |
| `LLM_MODEL` | No | Model identifier (default: `gpt-5.2`) |
 
## Provider Setup
 
This recipe is provider-agnostic. Configure any OpenAI-compatible provider:
 
| Provider | `OPENAI_COMPATIBLE_BASE_URL` |
|----------|------------------------------|
| OpenAI | `https://api.openai.com/v1` |
| OpenRouter | `https://openrouter.ai/api/v1` |
| DeepSeek | `https://api.deepseek.com` (uses `/v1` suffix) |
| Groq | `https://api.groq.com/openai/v1` |
| Together | `https://api.together.xyz/v1` |
| Local (Ollama) | `http://localhost:11434/v1` |
 
## License
 
MIT — see [LICENSE](./LICENSE).