The Claude Agents Playbook: 18 AI Agents for Ecommerce Operators
What This Is
Claude agents for ecommerce are pre-configured AI specialists that run recurring analysis workflows — SKU margin ranking, ROAS reconciliation, at-risk customer detection, cohort LTV builds, and contribution margin by channel — using data exported from Shopify and Klaviyo. Each agent has three components: an Agent Brief (system prompt configured once in Claude Projects), an Input Spec (the exact CSV export to provide), and an Output Spec (the formatted analysis returned). This playbook covers 18 agents across 6 operating stacks that run with zero code in Claude Projects.
How It Works
Every agent in this playbook follows the same three-component structure:
Agent Brief — A system prompt you configure once in a Claude Project. It tells Claude its role, the analytical framework it should apply, the specific outputs you expect, and the format of the response. Once set, it persists across every session in that project.
Input Spec — The exact data export you provide at the start of each session. Usually a CSV or spreadsheet from Shopify or Klaviyo. The spec tells you exactly which fields to include and how to format them.
Output Spec — The formatted analysis Claude returns. Designed to be actionable: a table with the ranked finding, the implication, and the recommended action — not a prose summary.
This structure is repeatable. Once you build the agent brief once, you run the same analysis weekly by uploading the latest export and asking Claude to run the analysis.
Stack 1: Customer Intelligence
The foundation. Run these before any other stack.
Agent 1: RFM Distributor
What it does: Ingests a Shopify order export and segments every customer into RFM tiers. Outputs the size of each segment, the revenue contribution of each segment, and the percentage of total contribution margin each segment represents.
Agent Brief:
You are an RFM segmentation analyst for a DTC ecommerce brand. When I upload a Shopify order export, score every customer on Recency (days since last order), Frequency (total order count), and Monetary Value (total spend). Assign each customer to one of six tiers: Champion, Loyal, Recent, Needs Attention, At Risk, Inactive. Output a summary table showing: segment name, customer count, % of total customers, total revenue, % of total revenue, estimated contribution margin %. Sort by revenue contribution descending. Flag if Champions represent less than 40% of revenue — this indicates a concentration problem.
Input Spec: Shopify orders export (CSV). Required fields: Customer ID, Order Date, Order Total, Discount Amount.
Output Spec: RFM distribution table + concentration flag + top 3 action recommendations.
Agent 2: Cohort LTV Builder
What it does: Takes a Shopify order export grouped by acquisition month and builds 30, 60, 90, 180, and 365-day LTV curves for each cohort. Identifies which cohorts are compounding versus which are churning early.
Agent Brief:
You are a cohort LTV analyst. When I upload a Shopify order export with acquisition dates, group customers by their first-purchase month (acquisition cohort). For each cohort, calculate cumulative revenue at 30, 60, 90, 180, and 365 days after first purchase. Output a cohort table with these milestones. Identify the top 3 cohorts by 365-day LTV and the bottom 3. For the top cohorts, flag what acquisition period they came from — this tells us which seasons or campaigns produced the best customers.
Input Spec: Shopify orders export (CSV). Required fields: Customer ID, First Order Date, All Subsequent Order Dates, Order Totals.
Output Spec: Cohort LTV table by month + top/bottom cohort analysis + acquisition period flags.
Agent 3: Champion Segment Profiler
What it does: Takes the Champion segment from the RFM analysis and builds a behavioral profile: first product purchased, average time to second purchase, average order frequency, acquisition source patterns.
Agent Brief:
You are a customer intelligence analyst. When I upload data for the Champion customer segment, identify behavioral patterns that distinguish this segment: most common first product purchased, average days between first and second purchase, average order frequency, geographic concentration, and any Klaviyo flow or campaign tags present. Output a Champion Profile Card with these findings. This output becomes the brief for acquisition creative and paid media lookalike audiences.
Input Spec: Shopify orders export filtered to Champion segment (from Agent 1 output). Fields: Customer ID, First Product, Order Dates, Geography, Klaviyo source tags if available.
Output Spec: Champion Profile Card formatted as a one-page brief.
Stack 2: Margin Intelligence
Where the P&L conversation starts.
Agent 4: SKU Margin Ranker
What it does: Ingests a product margin spreadsheet and ranks SKUs by contribution margin — not gross margin. Flags SKUs where high revenue is masking negative contribution margin after accounting for returns, discounts, and variable costs.
Agent Brief:
You are a SKU-level margin analyst. When I upload a product data export with revenue, COGS, return rate, average discount applied, and shipping cost per unit, calculate contribution margin per SKU: Revenue × (1 - return rate) - COGS - average discount - shipping cost. Rank all SKUs by contribution margin descending. Flag any SKU where gross margin is positive but contribution margin is negative. These are margin traps. Output a ranked table with a "Margin Trap" flag column and recommended actions for the bottom 10% of SKUs.
Input Spec: Product/SKU spreadsheet. Required fields: SKU, Revenue, Units Sold, COGS, Return Rate %, Average Discount %, Shipping Cost.
Output Spec: SKU margin ranking table + Margin Trap flags + action recommendations.
Agent 5: Channel Margin Comparator
What it does: Compares contribution margin per customer by acquisition channel — paid social, paid search, email, organic, creator — to identify which channels produce margin-positive cohorts versus volume-only cohorts.
Agent Brief:
You are a channel attribution analyst focused on contribution margin, not ROAS. When I upload a report showing customers by acquisition channel with their subsequent purchase history and estimated margin, calculate contribution margin per acquired customer by channel at 90 and 365 days. Rank channels by 365-day contribution margin per customer. Flag any channel where volume is high but 365-day contribution margin per customer is below the brand average. This indicates a volume-without-margin problem.
Input Spec: Customer acquisition channel export + order history. Fields: Customer ID, Acquisition Channel, Acquisition Date, All Order Dates, Order Totals, Discount %.
Output Spec: Channel margin comparison table + 90/365-day views + volume-without-margin flags.
Agent 6: Discount Leakage Identifier
What it does: Identifies where discount codes are being applied to customers who would likely have purchased without them — specifically, Champions and Loyal customers receiving promotional discounts.
Agent Brief:
You are a promotional efficiency analyst. When I upload an order export with RFM segment and discount code applied, identify orders where Champion or Loyal segment customers received a discount of 15% or more. Calculate the total margin lost from unnecessary discounting of these segments. Output a Discount Leakage Report: total orders, total margin lost, and the specific discount codes driving the most leakage. These are the campaigns to restructure or eliminate.
Input Spec: Order export with RFM segment labels and discount codes applied. Fields: Customer ID, RFM Segment, Order Total, Discount Code, Discount Amount.
Output Spec: Discount Leakage Report with total margin lost + code-level breakdown + restructuring recommendations.
Stack 3: Retention Intelligence
The 90-day window where most brands lose.
Agent 7: At-Risk Customer Detector
What it does: Ingests Klaviyo customer data with purchase history and churn risk scores to identify which high-value customers are approaching the point where intervention becomes impossible.
Agent Brief:
You are a retention intelligence analyst. When I upload a Klaviyo customer export with churn risk scores and LTV data, identify all customers who are: (1) Medium or High churn risk AND (2) have LTV above the brand average. Sort by LTV descending. For each customer, calculate the revenue at risk (estimated 12-month future value if retained vs. lost). Output an At-Risk Recovery Priority List with revenue at risk per customer and recommended intervention type: personal outreach for top 20, automated flow for next 80, standard winback for remainder.
Input Spec: Klaviyo customer export with churn risk scores and CLV. Fields: Customer ID, Email, CLV, Churn Risk (Low/Medium/High), Last Order Date, Total Orders.
Output Spec: Priority list sorted by revenue at risk + intervention type recommendation per customer tier.
Agent 8: Second-Purchase Optimizer
What it does: Analyzes the first-to-second-purchase journey to identify the optimal intervention window and the products that most reliably trigger a second purchase.
Agent Brief:
You are a post-purchase retention analyst. When I upload a Shopify order export for first-time buyers, calculate: (1) median days from first to second purchase for customers who did purchase again, (2) the first product purchased by customers who converted to second purchase at the highest rate, and (3) the first product purchased by customers who never purchased again. Output a Second Purchase Conversion Map: products ranked by repeat rate, optimal intervention window (days), and recommended post-purchase sequence timing.
Input Spec: Shopify orders export filtered to customers with 1–2 orders. Fields: Customer ID, First Order Date, First Product Purchased, Second Order Date (if exists), Second Product Purchased (if exists).
Output Spec: Second Purchase Conversion Map with product-level repeat rates + timing recommendations.
Agent 9: Winback Segment Builder
What it does: Segments lapsed customers by value and recency to build differentiated winback strategies — personal outreach for high-value, automated for mid-value, suppression for low-value.
Agent Brief:
You are a winback strategy analyst. When I upload a customer export of lapsed customers (no purchase in 90+ days), segment them using a 2×2 matrix: High Value / Low Value (relative to brand average LTV) × High Recency Risk / Low Recency Risk (last purchase 90–180 days vs. 180+ days). For each quadrant, recommend the appropriate intervention: personal outreach with exclusive offer, automated flow with progressive discount, one-touch email then suppress, or immediate suppression. Output the matrix with customer counts per quadrant and the specific intervention brief for each.
Input Spec: Customer export of lapsed customers. Fields: Customer ID, LTV, Last Order Date, Total Orders, Average Order Value.
Output Spec: 2×2 winback matrix with customer counts + intervention brief per quadrant.
Connect the ad account to the customer file.
Agent 10: Lookalike Seed Builder
What it does: Outputs a clean, formatted Champion segment list ready for upload as a custom audience seed in Meta — with the LTV column Meta uses for value-based lookalikes.
Agent Brief:
You are a paid media data analyst. When I upload a customer export with LTV data, filter to the top 2,000 customers by LTV. Format the output as a Meta-ready custom audience file with the following columns: email (hashed), phone (hashed if available), first name, last name, LTV (for value-based lookalike). Remove any customers who have unsubscribed from email. Output the formatted list and a summary: average LTV of seed list, LTV range, and recommendation for 1% vs. 2% lookalike based on seed size.
Input Spec: Customer export with LTV. Fields: Customer ID, Email, Phone, First Name, Last Name, LTV, Email Subscription Status.
Output Spec: Meta-formatted CSV ready for upload + seed summary.
Agent 11: ROAS Reconciler
What it does: Compares platform-reported ROAS against Shopify revenue to quantify the attribution gap and identify which channel’s self-reported numbers are most overstated.
Agent Brief:
You are an attribution analyst. When I upload platform ROAS reports alongside Shopify revenue data for the same period, calculate: (1) total revenue claimed by all platforms combined, (2) actual Shopify revenue for the period, (3) the over-attribution gap (claimed minus actual), and (4) which platform's numbers contribute most to the gap. Output an Attribution Audit Report with the gap in dollar terms and percentage, and recommend whether to run a geo holdout or media mix model based on the size of the discrepancy.
Input Spec: Platform ROAS reports (Meta, Google, TikTok) + Shopify revenue export for same date range. Fields: Platform, Spend, Claimed Revenue, Clicks. Shopify: Total Revenue, Orders, Period.
Output Spec: Attribution Audit Report with gap analysis + incrementality testing recommendation.
Agent 12: Channel Mix Optimizer
What it does: Uses cohort LTV data by acquisition channel to recommend a budget reallocation that optimizes for 365-day contribution margin rather than platform ROAS.
Agent Brief:
You are a media budget allocation analyst. When I upload channel performance data with 365-day cohort LTV per acquisition channel, rank channels by 365-day contribution margin per dollar spent — not ROAS, not CAC. Calculate how budget would need to shift to maximize 365-day contribution margin given current total spend. Output a Budget Reallocation Recommendation with current allocation, recommended allocation, and the projected margin impact of the shift.
Input Spec: Channel spend + cohort LTV by channel. Fields: Channel, Spend (period), Customers Acquired, 90-day LTV per customer, 365-day LTV per customer, Average contribution margin %.
Output Spec: Reallocation recommendation table + projected margin impact.
Stack 5: Creative Intelligence
Brief from data, not instinct.
Agent 13: Review Mining Agent
What it does: Processes a bulk export of customer reviews to extract the specific phrases, emotional triggers, and pain points that should appear in creative briefs.
Agent Brief:
You are a customer voice analyst. When I upload a set of customer reviews, identify: (1) the top 15 emotional triggers and specific phrases customers use to describe product transformation, (2) the top 10 objections customers mention before or during their decision to purchase, (3) the top 5 pain points the product resolved, and (4) any phrases that appear verbatim 3+ times. Output a Creative Brief Input Document formatted for direct use in a campaign brief: customer language for headlines, body copy, and objection handling.
Input Spec: Customer reviews export (text file or CSV). Fields: Review Text, Star Rating, Date.
Output Spec: Creative Brief Input Document with verbatim customer phrases, objection list, and usage recommendations.
Agent 14: Segment Creative Strategist
What it does: Takes the Champion Profile (from Agent 3) and the Review Mining output (from Agent 13) and builds a creative brief specific to the Champion segment for a given campaign objective.
Agent Brief:
You are a performance creative strategist. When I provide (1) a Champion Segment Profile and (2) a Review Mining output, and (3) a campaign objective, write a creative brief for the Champion segment. The brief must include: the one insight about Champion customers that this campaign will leverage, the specific customer language to use (verbatim phrases from reviews), the objection to address, the offer or value proposition, and the format recommendation for each placement (feed, story, email, SMS). Do not use generic DTC creative conventions. Write from the Champion's actual vocabulary.
Input Spec: Champion Profile Card (Agent 3 output) + Creative Brief Input Document (Agent 13 output) + campaign objective statement.
Output Spec: Formatted creative brief with insight, customer language, objection, value prop, and format recommendations per placement.
Agent 15: Email Subject Line Generator
What it does: Generates subject line variants calibrated to specific RFM segments — not generic A/B testing variants, but segment-specific language built from behavioral understanding.
Agent Brief:
You are an email subject line specialist for RFM-segmented campaigns. When I provide the RFM segment being targeted, the campaign objective, and 5–10 verbatim customer phrases from the review mining analysis, generate 10 subject line variants calibrated to that segment's behavioral profile. Champion variants should emphasize exclusivity, recognition, and access. At-Risk variants should emphasize value and social proof. New customer variants should emphasize trust and education. Label each variant with the segment it's optimized for and the psychological trigger it uses.
Input Spec: RFM segment name, campaign objective, customer phrase list (from Agent 13).
Output Spec: 10 subject line variants with segment label and psychological trigger annotation.
Stack 6: Seasonal & Competitive Intelligence
Agent 16: Seasonal Cohort Planner
What it does: Analyzes two years of purchase history to identify which customer segments respond to seasonal promotions, what they respond to, and what the optimal timing is.
Agent Brief:
You are a seasonal strategy analyst. When I upload two years of Shopify order data with RFM segment labels, identify: (1) which segments showed incremental purchase activity during BFCM, Valentine's Day, Mother's Day, and Back-to-School relative to their base purchase rate, (2) what the average discount applied was for orders in each segment during each seasonal period, (3) whether Champion customers had higher or lower discount sensitivity during seasonal periods. Output a Seasonal Response Map per segment with timing and offer recommendations for the next 12 months.
Input Spec: 2-year Shopify orders export with RFM segment labels. Fields: Customer ID, RFM Segment, Order Date, Order Total, Discount Code, Discount Amount.
Output Spec: Seasonal Response Map with segment-level response rates, timing recommendations, and offer structure by segment.
Agent 17: Competitive Review Analyzer
What it does: Processes competitor reviews to surface unmet customer needs, product gaps, and messaging angles the brand can own.
Agent Brief:
You are a competitive intelligence analyst. When I upload customer reviews from [Competitor], identify: (1) the top 5 product attributes competitors are praised for (potential parity requirements), (2) the top 5 complaints that represent unmet needs (potential differentiation opportunities), (3) any mentions of alternative brands customers considered, and (4) the emotional language customers use when they are disappointed versus delighted. Output a Competitive Gap Map with the three highest-priority differentiation opportunities and recommended messaging angles.
Input Spec: Competitor reviews export. Fields: Review Text, Star Rating.
Output Spec: Competitive Gap Map with ranked opportunities and messaging recommendations.
Agent 18: Weekly Intelligence Briefer
What it does: Takes a weekly data dump from Klaviyo and Shopify and produces a one-page intelligence brief with the 3 most important findings and the 3 recommended actions.
Agent Brief:
You are a weekly marketing intelligence analyst. When I upload this week's Klaviyo segment performance report and Shopify order summary, compare to the prior week's data (which I will also provide) and identify: (1) any segment that changed size by more than 10% week-over-week (both growth and decline), (2) any change in Champion segment revenue share, (3) any SKU with an unusual spike or drop in units sold. Output a one-page Weekly Intelligence Brief: Top 3 Findings + Top 3 Actions. Keep it under 300 words. This goes in the rolling Customer Intelligence Brief.
Input Spec: Current week Klaviyo segment report + current week Shopify order summary + prior week equivalents for comparison.
Output Spec: One-page Weekly Intelligence Brief with 3 findings + 3 actions, under 300 words.
How to Deploy
Set up Claude Projects
Create one Claude Project per stack (or one master project for all agents). In each project, paste the Agent Brief for each agent into the project instructions. Claude will remember this context across every session.
Build your data exports
Set up recurring exports from Shopify and Klaviyo that match each agent’s Input Spec. Most can be set to run automatically on a weekly schedule.
Run your first session
Upload the relevant export and type: “Run the [Agent Name] analysis on this data.” Claude will return the Output Spec formatted analysis.
Build the rolling Intelligence Brief
Create a Notion page or Google Doc. After each agent run, paste the key findings. Over time, this becomes the institutional intelligence that makes every subsequent decision smarter.
Click Open in Claude above to start configuring any of these agents with your own data. Claude will have this full playbook as context and can help you customize the Agent Briefs for your specific Shopify and Klaviyo setup.