content-agent
Generates personalized marketing content for Unite-Hub. Creates followup emails, proposals, and case studies based on contact data and interaction history. Uses Claude AI for high-quality, contextual content generation.
What this skill does
# Content Generation Agent Skill
## Overview
The Content Agent creates personalized, high-converting marketing content by:
1. Reading contact profiles and interaction history
2. Analyzing engagement patterns and sentiment
3. Generating contextually relevant content using Claude
4. Storing drafts for human review/approval
5. Tracking performance metrics
## Content Types
### 1. Followup Email
**When to generate:**
- Contact received email 7+ days ago (nextFollowUp date passed)
- Status is "lead" or "prospect"
- AI score > 60 (engaged)
**Context to include:**
- Reference their last interaction
- Mention their company/industry
- Highlight relevant case study or service
- Include clear CTA
**Example prompt:**
```
Generate a professional followup email for:
- Name: John Smith
- Company: TechStartup Inc
- Job Title: CEO
- Last interaction: "Interested in Q4 marketing services"
- Sentiment: positive
- Industry: Technology
The email should:
1. Reference their interest in partnership
2. Mention 1 specific success story relevant to tech startups
3. Propose a 15-minute strategy call
4. Be warm but professional
5. Keep under 150 words
```
### 2. Proposal Email
**When to generate:**
- Contact has shown high engagement (AI score > 80)
- Status is "prospect"
- Multiple positive interactions
**Context to include:**
- Personalized value proposition
- Estimated ROI/results
- Timeline and deliverables
- Investment/pricing range
- Next steps
**Example prompt:**
```
Generate a proposal email for:
- Name: Lisa Johnson
- Company: eCommerce Solutions
- Pain point: "Revamping marketing strategy"
- Budget indicator: Mid-market (medium budget)
- Timeline: Q4 2024
The proposal should:
1. Address their specific pain point
2. Outline 3-4 key deliverables
3. Mention expected metrics (e.g., "35% revenue increase")
4. Suggest 60-day engagement
5. Request a call to discuss
```
### 3. Case Study Reference
**When to generate:**
- Contact from specific industry
- AI score indicates readiness
- Relevant success story exists
**Context to include:**
- Similar company/industry case study
- Key metrics and results
- How it applies to their situation
## How the Agent Works
### Step 1: Identify Target Contacts
Query contacts where:
```
status = "prospect" OR "lead"
aiScore > 60
nextFollowUp <= NOW
```
### Step 2: For Each Contact
**A. Load Contact History**
```
GET contact details
GET contact's emails (interaction history)
GET any previous generated content for this contact
```
**B. Build Context Object**
```
{
name: "John Smith",
company: "TechStartup Inc",
jobTitle: "CEO",
industry: "Technology",
aiScore: 78,
sentiment: "positive",
lastInteraction: "Interested in Q4 partnership",
emailsSent: 2,
engagementDays: 15,
hasProposalBefore: false
}
```
**C. Determine Content Type**
Logic:
```
IF aiScore > 80 AND !hasProposalBefore
→ Generate "proposal"
ELSE IF aiScore > 60 AND lastInteraction > 7 days ago
→ Generate "followup"
ELSE IF industry has matching case study
→ Generate "case_study_reference"
ELSE
→ Generate "general_followup"
```
**D. Build Claude Prompt**
Template:
```
You are a professional B2B marketing copywriter for a marketing agency.
Generate a [CONTENT_TYPE] email for:
- Name: [NAME]
- Company: [COMPANY]
- Job Title: [JOB_TITLE]
- Industry: [INDUSTRY]
- Last interaction: [LAST_INTERACTION]
- Sentiment of previous emails: [SENTIMENT]
- Our success with similar companies: [CASE_STUDY_BRIEF]
Requirements:
1. Personalized to their specific situation
2. Reference their industry/company when possible
3. Include specific, measurable outcomes (if proposal)
4. Professional but warm tone
5. Clear call-to-action
6. [TYPE_SPECIFIC_REQUIREMENTS]
Keep under [WORD_LIMIT] words.
Generate the email body only (no "Subject:" or greeting).
```
**E. Call Claude API**
```
POST https://api.anthropic.com/v1/messages
{
"model": "claude-sonnet-4-5-20250929",
"max_tokens": 1000,
"system": "You are an expert B2B marketing copywriter...",
"messages": [
{
"role": "user",
"content": "[BUILT_PROMPT]"
}
]
}
```
**F. Parse Response**
Extract text from response:
```
response.content[0].text
```
**G. Store as Draft**
Call Convex mutation:
```
POST convex mutation content.store({
orgId: "...",
workspaceId: "...",
contactId: "[CONTACT_ID]",
contentType: "[TYPE]",
title: "[AUTO_GENERATED_TITLE]",
prompt: "[USED_PROMPT]",
text: "[CLAUDE_RESPONSE]",
aiModel: "sonnet",
htmlVersion: null // Optional HTML formatting
})
```
**H. Log Audit Event**
```
POST convex mutation system.logAudit({
orgId: "...",
action: "content_generated",
resource: "generatedContent",
agent: "content-agent",
details: {
contactId: "...",
contentType: "[TYPE]",
aiScore: 78,
tokensUsed: 234
},
status: "success"
})
```
### Step 3: Summary Report
Output:
```
✅ Content Generation Complete
Total generated: X
Followup emails: X
Proposals: X
Case studies: X
Drafts awaiting approval: X
By AI score:
- High priority (>80): X contacts
- Medium priority (60-80): X contacts
Sample generated content:
- John Smith (TechStartup): Followup email
- Lisa Johnson (eCommerce): Proposal
Next steps:
1. Review drafts in dashboard
2. Approve/edit content
3. Schedule for sending
4. Track performance metrics
```
## Error Handling
If Claude API call fails:
```
Log audit event with status: "error"
Try fallback: Use template-based content
Continue to next contact
```
If contact data incomplete:
```
Skip contact with warning
Log as skipped in audit trail
```
## Performance Tracking
After content is approved and sent:
```
Track:
- Opens (if integration available)
- Clicks
- Replies
- Conversions
Update generatedContent record with metrics:
{
status: "sent",
sentAt: timestamp,
performanceMetrics: {
opens: 0,
clicks: 0,
replies: 0
}
}
```
Related in AI Agents
skill-development
IncludedComprehensive meta-skill for creating, managing, validating, auditing, and distributing Claude Code skills and slash commands (unified in v2.1.3+). Provides skill templates, creation workflows, validation patterns, audit checklists, naming conventions, YAML frontmatter guidance, progressive disclosure examples, and best practices lookup. Use when creating new skills, validating existing skills, auditing skill quality, understanding skill architecture, needing skill templates, learning about YAML frontmatter requirements, progressive disclosure patterns, tool restrictions (allowed-tools), skill composition, skill naming conventions, troubleshooting skill activation issues, creating custom slash commands, configuring command frontmatter, using command arguments ($ARGUMENTS, $1, $2), bash execution in commands, file references in commands, command namespacing, plugin commands, MCP slash commands, Skill tool configuration, or deciding between skills vs slash commands. Delegates to docs-management skill for official documentation.
reprompter
IncludedTransform messy prompts into well-structured, effective prompts — single or multi-agent. Use when: "reprompt", "reprompt this", "clean up this prompt", "structure my prompt", rough text needing XML tags and best practices, "reprompter teams", "repromptception", "run with quality", "smart run", "smart agents", multi-agent tasks, audits, parallel work, anything going to agent teams. Don't use when: simple Q&A, pure chat, immediate execution-only tasks. See "Don't Use When" section for details. Outputs: Structured XML/Markdown prompt, quality score (before/after), optional team brief + per-agent sub-prompts, agent team output files. Success criteria: Single mode quality score ≥ 7/10; Repromptception per-agent prompt quality score 8+/10; all required sections present, actionable and specific.
adaptive-compaction
IncludedAdaptive add-on policy and recovery layer that decides WHEN to compact, prune, snapshot, or fork -- replacing fixed-percent auto-compaction across Claude Code, Codex, and MCP-capable hosts. Trigger on auto-compact timing or damage: "when should I compact", "is it safe to compact now or start a fresh session", "auto-compact fires too early/mid-task", "switching to an unrelated task but the window still has space", "context rot", "answers get worse the longer the session runs", "the agent forgot the plan or my decisions after it summarized", "add a layer on top that manages context without changing the agent", raising autoCompactWindow to give the policy room, or installing/tuning a cross-tool compaction policy or PreCompact hook -- even when "compaction" is never said but the problem is context-window pressure or post-summarization memory loss. Do NOT use to summarize a conversation, build RAG, write a summarization prompt (decides WHEN not HOW), or answer max-context-length trivia.
agent-skill-creator
IncludedCreate cross-platform agent skills from workflow descriptions. Activates when users ask to create an agent, automate a repetitive workflow, create a custom skill, or need advanced agent creation. Triggers on phrases like create agent for, automate workflow, create skill for, every day I have to, daily I need to, turn process into agent, need to automate, create a cross-platform skill, validate this skill, export this skill, migrate this skill. Supports single skills, multi-agent suites, transcript processing, template-based creation, interactive configuration, cross-platform export, and spec validation.
llm-wiki
IncludedUse when building or maintaining a persistent personal knowledge base (second brain) in Obsidian where an LLM incrementally ingests sources, updates entity/concept pages, maintains cross-references, and keeps a synthesis current. Triggers include "second brain", "Obsidian wiki", "personal knowledge management", "ingest this paper/article/book", "build a research wiki", "compound knowledge", "Memex", or whenever the user wants knowledge to accumulate across sessions instead of being re-derived by RAG on every query.
skill-master
IncludedAgent Skills authoring, evaluation, and optimization. Create, edit, validate, benchmark, and improve skills following the agentskills.io specification. Use when designing SKILL.md files, structuring skill folders (references, scripts, assets), ingesting external documentation into skills, running trigger evals, benchmarking skill quality, optimizing descriptions, or performing blind A/B comparisons. Keywords: agentskills.io, SKILL.md, skill authoring, eval, benchmark, trigger optimization.