Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Content Agent

An AI content agent that drafts long-form content in a defined brand voice. It combines:

  • Anthropic Claude for the writing
  • an optional Notion-backed brand knowledge base (voice, product info, guidelines, examples)
  • a lightweight skills system for reusable copywriting expertise
  • a small Express API you can call from anywhere

Point it at your own brand and it drafts marketing, email, social, documentation, or support content that stays on-voice.

How it works

POST /api/generate-content
  → load brand context (Notion, or the built-in default template)
  → load relevant skills for the content type
  → build a system prompt from brand voice + guidelines + skills
  → Claude generates the content
  → returns { content, metadata }

Brand knowledge lives outside the code. With no Notion credentials it uses the generic template in src/brand-context.ts; with Notion connected, non-technical teammates can edit brand voice and guidelines directly in Notion and the agent picks it up (cached, 5-min TTL).

Quick start

npm install
cp .env.example .env    # add your ANTHROPIC_API_KEY
npm run dev
curl -X POST http://localhost:3000/api/generate-content \
  -H "Content-Type: application/json" \
  -d '{
    "type": "marketing",
    "brief": "Landing page hero for a returns-automation tool",
    "context": { "audience": "e-commerce ops leads", "length": "short" }
  }'

Configuration

Variable Required Purpose
ANTHROPIC_API_KEY yes Claude API access
NOTION_TOKEN no Enables the Notion-backed brand knowledge base
NOTION_DATABASE_ID no The Notion database holding brand pages
PORT no Server port (default 3000)

Without the Notion variables, the agent runs on the default brand template — good for trying it out.

Notion database shape (optional)

A database with these properties: Name (title), Category (select: Brand Voice, Product Info, Guidelines, Examples, Company Background), Tags (multi-select), Active (checkbox). Page body becomes the content.

Content types

marketing · email · social · documentation · support — each gets tailored instructions in the system prompt. Requests are validated with zod.

Skills

Drop reusable expertise into .agents/skills/<name>/SKILL.md. The loader maps content types to skills in src/services/skills.ts (e.g. marketingcopywriting, marketing-psychology). Two example skills are included.

Project structure

src/
  index.ts              Express server + routes
  agent/
    contentAgent.ts     orchestration
    systemPrompt.ts     prompt construction
  services/
    anthropic.ts        Claude calls
    notion.ts           brand knowledge base
    skills.ts           skills loader
  types/index.ts        zod schemas + types
  brand-context.ts      default brand template (swap for your own)
.agents/skills/         reusable copywriting skills

License

MIT

About

AI content agent that writes long-form content in a defined brand voice (Anthropic API + optional Notion knowledge base)

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages