Skip to Content
AgentsStrategy Writer

Strategy Writer

[Live] · agent__strategy-writer · Claude Sonnet 4.6

Writes the client’s marketing strategy document from the approved Client Context File, producing SMART goals, recommended channels, and a competitive positioning plan.


Overview

FunctionWrite the marketing strategy document from the approved Client Context File
TypeStrategy
ModelClaude Sonnet 4.6
Queueagent__strategy-writer
Concurrency3
Timeout8 min
Est. cost / task~$0.70
PlanFree+ (all tenants)

Triggers

Trigger typeWhenWho initiates
Scheduled / cronAuto-triggered when the tenant admin approves the Client Context File for the first timePlatform scheduler (event-chained from Context File Writer approval)
Human on-demand”Refresh Strategy” button in Dashboard → Strategy screenTenant admin
Activity Planner dispatchNot applicable — Strategy Writer runs before the Activity Planner exists in the pipeline

Input

interface StrategyWriterInput { tenantId: string; approvedContextFile: string; // Full Markdown of the approved Client Context File businessGoals: string[]; // Tenant-specified goals from onboarding (e.g. ["Increase local leads by 30%", "Build brand awareness in Ipswich"]) currentChannels: string[]; // Connected OAuth channels (e.g. ["google_search_console", "google_ads", "facebook_pages"]) planType: 'free' | 'pro' | 'agency' | 'enterprise'; refreshMode?: boolean; // true = updating existing strategy existingStrategy?: string; // Previous strategy Markdown — only if refreshMode = true }

Output

interface StrategyWriterOutput { tenantId: string; generatedAt: string; // ISO 8601 timestamp strategyMarkdown: string; // Full Markdown strategy document smartGoals: SmartGoal[]; // Extracted/structured form of the goals section recommendedChannels: string[]; // Channel slugs recommended (subset of available channels on their plan) wordCount: number; changesSummary?: string; // Only on refresh runs } interface SmartGoal { goal: string; // One sentence metric: string; // How it will be measured target: string; // Specific number or threshold timeframe: string; // e.g. "Within 6 months" channel?: string; // Primary channel this goal relates to }

Sample output excerpt

# Marketing Strategy — Clearflow Plumbing _Generated: March 2026 | Plan: Pro | Prepared by: Leadmetrics v3_ --- ## Executive Summary Clearflow Plumbing enters the next 12 months with a clear competitive advantage — transparent, published pricing — that no direct competitor has capitalised on in content or SEO. The strategy is built around three pillars: (1) owning the high-intent local search queries that competitors underserve, (2) establishing Clearflow as Brisbane's most trustworthy plumbing resource through educational content, and (3) converting organic traffic into booked jobs through a consistent Google Business Profile presence. --- ## Market Position Clearflow operates in a high-trust-deficit category. Homeowners searching for a plumber are primarily motivated by anxiety — fear of being overcharged, stood up, or misled. No competitor directly addresses this anxiety in their content. Clearflow's pricing transparency is not just a differentiator; it is a direct response to the market's number-one objection. **Position to own:** "The plumber who shows you the price before they show up." --- ## Goals (SMART) | Goal | Metric | Target | Timeframe | |---|---|---|---| | Grow organic search traffic | Google Search Console impressions | +40% | 6 months | | Increase booked jobs from website | Google Analytics goal completions | +25 enquiries/month | 3 months | | Build GBP authority in Ipswich | Google Business Profile views | 500 views/month | 4 months | | Establish content authority | Blog posts ranking on page 1 | 5 posts | 6 months | --- ## Recommended Channels Given the Pro plan and connected channels, the recommended priority order is: 1. **SEO + Blog** — Highest ROI for a local service business with a pricing transparency story. Target informational and commercial-investigation queries. 2. **Google Business Profile** — Critical for local pack rankings. Weekly posts, review responses, Q&A management. 3. **Google Ads** — Defensive spend on branded keywords and high-intent emergency queries (blocked drain, burst pipe). 4. **Facebook** — Secondary; supports retargeting and community trust-building. Not the primary lead channel. --- ## Competitive Advantage Three things Clearflow can do in content that no current competitor does: 1. **Publish price-anchored content** — "How much does a plumber cost in Brisbane?" pages with actual numbers 2. **Homeowner education series** — "When to call a plumber vs DIY" — no competitor has this 3. **Case study content** — Before/after job stories build social proof that generic competitors can't replicate --- ## What to Avoid - Do not invest in LinkedIn — zero evidence the target audience (homeowners) uses it for tradie discovery - Do not run awareness-only social campaigns without a direct response mechanism - Do not target keywords outside the service area — wasted spend and irrelevant traffic - Do not produce generic "tips" content without a price anchor or local angle

How It Works

  1. Receive job — BullMQ dequeues the job with the approved context file, business goals, connected channels, and plan type.

  2. RAG: supplementary brand materials — Server-side search() call with query "content examples copywriting samples product descriptions marketing materials brand story" against datasets tagged for strategy-writer (topK 4). Core brand voice is already structured into the Client Context File, so this query targets supplementary materials not yet captured there. Gated by useRagBrand.

  3. RAG: competitor and market context — Server-side search() call with query "competitor analysis market positioning industry trends" (topK 3). Gated by useRagCompetitor. Results from both queries are deduplicated by chunk text before injection — since both queries share the same agentRole dataset pool, the same chunk could otherwise appear twice.

  4. Plan-gating — Determine which channels and features are available based on planType. Free plan: SEO + GBP only. Pro: adds Google Ads, Facebook, Email. Agency/Enterprise: all channels. Filter currentChannels against plan entitlements to ensure strategy only recommends channels the tenant can actually use.

  5. LLM synthesis — Send all inputs to Claude Sonnet 4.6 with the Strategy Writer system prompt. Model returns the full strategy Markdown document.

  6. SMART goal extraction — Worker parses the Goals section of the Markdown to extract structured SmartGoal records. If the model did not write goals in the expected table format, a second lightweight extraction call is made.

  7. Validation — Document must contain all required sections (Executive Summary, Market Position, Goals, Recommended Channels, Competitive Advantage, What to Avoid). Word count must be between 600 and 2,500 words.

  8. Persist — Strategy Markdown is written to the strategyDocuments table keyed by tenantId. Versioned — previous strategy archived on refresh.

  9. Trigger downstream — Creates an approval record for the tenant admin. On approval, enqueues a deliverable-planner job to agent__deliverable-planner.


System Prompt

You are the Strategy Writer agent for Leadmetrics, a digital marketing agency AI platform. Your task is to write a comprehensive, actionable 6-month digital marketing strategy for the client described below. STRATEGY REQUIREMENTS: 1. Write a professional Markdown document (1500–3000 words). 2. Include exactly these sections (use ## headings): ## Executive Summary ## Situation Analysis ## Target Audience Personas ## Marketing Goals & KPIs ## Channel Strategy ## Content Strategy ## SEO Strategy ## Monthly Execution Roadmap ## Budget & Resource Allocation ## Success Metrics 3. USE MARKDOWN TABLES for all structured data — never use bullet lists for information that fits in a table: - "Marketing Goals & KPIs": one table with columns | Goal | Metric | Target | Timeline | Primary Channel | - "Monthly Execution Roadmap": one table with columns | Month | Theme | Key Activities | Deliverables | - "Budget & Resource Allocation": one table with columns | Category | Monthly Budget | 6-Month Total | Notes | - "Success Metrics": one table with columns | Metric | Baseline | 6-Month Target | How Tracked | - "Target Audience Personas": use a table with columns | Persona | Role/Profile | Goals | Pain Points | Best Channel | 4. Use bullet lists only for genuinely unstructured content (e.g. qualitative recommendations in Channel Strategy, Content Strategy, SEO Strategy). 5. Only recommend channels available on the plan tier provided. 6. Be specific to this client — use their actual products, audience, and competitive context. 7. Every recommendation must be justified by the client context below. Output ONLY the Markdown strategy document. No preamble, no explanation, no code fences.

Skills Injected

Skill filePurpose
client-context-file.mdAlways injected — the primary input; the strategy is written entirely from this document
channel-plan-matrix.mdMaps each plan tier to its available channels and features — prevents strategy from recommending unavailable capabilities

channel-plan-matrix.md — content

# Channel Plan Matrix — Strategy Writer Reference ## Plan Entitlements | Channel / Feature | Free | Pro | Agency | Enterprise | |---|---|---|---|---| | SEO (blog content, keyword research) | Yes | Yes | Yes | Yes | | Google Business Profile posts | Yes | Yes | Yes | Yes | | Google Ads (copy generation) | No | Yes | Yes | Yes | | Meta Ads (Facebook/Instagram copy) | No | Yes | Yes | Yes | | Social Media Calendar (organic) | No | Yes | Yes | Yes | | Social Post Writer | No | Yes | Yes | Yes | | Email Newsletter | No | Yes | Yes | Yes | | Landing Page Writer | No | Pro | Yes | Yes | | Review Response Writer | No | Yes | Yes | Yes | | Site Audit | No | No | Yes | Yes | | Backlink Research + Outreach | No | No | Yes | Yes | | Monthly Report | No | Yes | Yes | Yes | | White-label reporting | No | No | No | Yes | | Custom agent workflows | No | No | No | Yes | ## Channel Priority Guidelines **Local service businesses (trades, health, food):** Priority: GBP → SEO Blog → Google Ads → Facebook → Email **E-commerce:** Priority: SEO Blog → Google Ads → Meta Ads → Email → Social Organic **B2B SaaS / Professional Services:** Priority: SEO Blog → LinkedIn Organic → Email → Google Ads → Landing Pages **Hospitality / Events:** Priority: Social Organic → GBP → Meta Ads → Email → SEO Blog ## Notes for Strategy Writer - Never recommend a channel not in the tenant's plan entitlements - Never recommend a channel not connected (OAuth not completed) without noting the connection requirement - When a client has not yet connected a channel, recommend it with a note: "Requires connecting [channel] in Dashboard → Integrations"

RAG Usage

DatasetQueryWhen used
Datasets tagged for strategy-writer (brand query)"content examples copywriting samples product descriptions marketing materials brand story {tenantName}" (topK 4)Step 2 — supplementary brand materials not already in clientContext. Gated by useRagBrand.
Datasets tagged for strategy-writer (competitor query)"competitor analysis market positioning industry trends" (topK 3)Step 3 — competitor and market positioning context. Gated by useRagCompetitor.
All other datasetsNot queriedResearch already incorporated via Client Context File

Both queries share the same agentRole: "strategy-writer" dataset pool. Results are deduplicated by chunk text before injection into the prompt.


Tools Required

ToolMethodPurposeRequired?
search() (@leadmetrics/feature-search)server-side pre-fetchBrand supplementary materials (topK 4) — gated by useRagBrandNo (graceful fallback)
search() (@leadmetrics/feature-search)server-side pre-fetchCompetitor and market context (topK 3) — gated by useRagCompetitorNo (graceful fallback)

No external web tools are called. RAG is a server-side pre-fetch, not a Claude tool call. If the search service is unavailable, the worker proceeds without RAG and records — RAG unavailable in StrategyVersion.notes.


HITL Gates

Gate 1 — Strategy approval The full strategy document is surfaced to the tenant admin in Dashboard → Strategy. They can:

  • Read the strategy in a rendered Markdown view
  • Edit the document inline
  • Approve (“Use this strategy”)
  • Request a refresh with updated goals or channel preferences

Approval triggers the Deliverable Planner. Without approval, no deliverables are planned.

Gate 2 — Goals sanity check If any SMART goal has no measurable metric (e.g. “improve brand awareness” with no number), the approval UI flags it with: “This goal has no measurable target. You may want to edit it before approving.” The admin can edit goals directly in the UI before approving.


Guardrails

  • Strategy Markdown must contain all 10 required sections (headings matched by name): Executive Summary, Situation Analysis, Target Audience Personas, Marketing Goals & KPIs, Channel Strategy, Content Strategy, SEO Strategy, Monthly Execution Roadmap, Budget & Resource Allocation, Success Metrics.
  • “Marketing Goals & KPIs”, “Monthly Execution Roadmap”, “Budget & Resource Allocation”, “Success Metrics”, and “Target Audience Personas” must use Markdown tables (not bullet lists).
  • Goals table must contain between 4 and 7 rows; every row must have a numeric target and a timeline.
  • Only channels available on the tenant’s plan tier may be recommended.
  • Output word count must be between 1,500 and 3,000 words.

Tenant Settings Used

SettingHow it’s used
planFilters which channels the strategy is permitted to recommend
connectedChannelsFurther filters recommendations to channels with active OAuth connections
industryFrames channel priority logic (local service vs B2B vs e-commerce)
companyNameUsed in document heading
tenantIdKeys the versioned strategy document record

Cost Profile

Avg input tokens~9,000 (context file + goals + RAG docs + system prompt)
Avg output tokens~1,400
Est. cost / task~$0.70

Error Handling

ErrorResponse
Approved context file is empty or missingFail immediately; surface HITL error: “Strategy cannot be written — Client Context File has not been approved”
businessGoals array is emptyProceed with inferred goals based on context file; add note in strategy: “No business goals were specified — goals below are inferred from your industry and competitive position. Please review and adjust.”
Plan type not recognisedDefault to ‘free’ restrictions and log a warning
RAG returns no results for both queriesProceed without historical context; note “No uploaded business documents or content history found” in strategy preamble
Word count validation fails after retryAccept output; flag in HITL review UI with warning
Section validation failsSurface missing sections in HITL review UI as warnings; do not block approval
Refresh run — no meaningful changes vs existing strategyWrite strategy with changesSummary: “No material changes required — strategy reflects current context.”

© 2026 Leadmetrics — Internal use only