Architecture
The pipeline runs in four phases. The leverage is grounding every phase in the brand’s real site instead of a blank prompt.- Gather crawls the whole marketing site to Markdown (Web Scraping API) and pulls the brand kit (Brand API) and design tokens (Styleguide API).
- Distill runs the product-marketing-context skill over the crawl to capture positioning, audience, and voice, turns the brand kit into a design guide, and generates net-new campaign ideas grounded in that positioning.
- Write runs the copywriting skill on the chosen idea for an on-brand headline, supporting line, and CTA.
- Render lays out the creative from the design guide and copy, then rasterizes it to each platform size.
Prerequisites
- A Context.dev API key. Grab one from the dashboard and export it as
CONTEXT_DEV_API_KEY. - An Anthropic API key for the model calls in Steps 2 through 4. Export it as
ANTHROPIC_API_KEY. - The Context.dev SDK for your backend:
Step 1. Gather the brand’s site
The first step is always to understand the product deeply. To do this, your AI agent needs context. It needs to know what your product does and who it’s for. You will also need your brand’s logos and styleguides. For this we’ll use:- The Brand API to get brand name, description, slogans, backdrops, and all logo variants.
- The Web Scraping API to crawl reachable marketing-site pages as clean Markdown.
- The Styleguide API to get exact colors, component CSS, spacing, fonts, shadows, etc.
maxPages (default 100, max 500) and urlRegex to crawl fewer, more specific pages.
Step 2. Distill positioning and generate ideas
Next, we need the agent to come up with campaign ideas. Instead of trying to engineer the perfect prompt, we recommend using a skill. Run Corey Haines’ product-marketing-context on your coding agent with access to all the context we gathered in the last step. Make sure to specifically prompt it to generate 10 ideas for social media campaigns.Step 3. Write the copy
Now you need to pick the ideas you like best. You can also fix or add new ideas. Then run Corey Haines’ copywriting skill on it, with a prompt specifying how you want the output.Step 4. Render the creative across sizes
Before we get an LLM to render the images, we need to specify the sizes. This script contains 6 of the most popular social media post sizes:- Instagram Story
- Instagram Square Post
- Instagram Portrait Post
- X image card
- LinkedIn Banner
- YouTube video thumbnail
System prompt for the creative designer
Next steps
Web Scraping API
Crawl a whole site to clean Markdown, the corpus the positioning skill reads.
Styleguide API
Fonts, colors, and component CSS for the design guide.
product-marketing-context skill
Turns the crawl into positioning, audience, and brand voice.
copywriting skill
Writes on-brand copy from that positioning.