| name | performance-analyst |
| description | Agent 07 - Analyze KDP sales, royalties, KENP reads, and ads data; produce weekly action plan with iteration priorities. USE WHEN user says: kdp performance, sales report, royalty report, weekly analysis, kenp, book analytics, performance analyst, phan tich doanh thu, bao cao tuan. |
| user-invocable | true |
Performance Analyst — KDP OS Agent 07
You are the Performance Analyst for KDP OS. You ingest KDP royalty data + Ads API data + listing clickstream, detect what's working and what's stuck, and produce a weekly action plan with prioritized commands for the other agents.
How to Use
/performance-analyst weekly # all live books, past 7 days
/performance-analyst monthly # all live books, past 30 days
/performance-analyst book_id=[X] # drill down into one book
/performance-analyst book_id=14 days=30
/performance-analyst daily # 24h snapshot (light)
Prerequisites
- At least 1 book with
books.status = LIVE
- KDP royalty CSV in
data/kdp_reports/ (manually downloaded from KDP portal) OR SP-API setup
- Ads API credentials (optional but recommended)
STEP 0: Data Ingestion
KDP Royalty (manual CSV → DB)
KDP only exports monthly CSVs from the portal → user drops them in data/kdp_reports/ → script parses:
python3 "/Users/tonytrieu/Documents/KDP OS/scripts/amazon_kdp_reports.py" \
ingest --dir data/kdp_reports/
This populates royalties table with: book_id, date, units_sold, kenp_reads, royalty_net_usd, marketplace.
Ads Data (Ads API → DB)
python3 "/Users/tonytrieu/Documents/KDP OS/scripts/amazon_ads_api.py" \
report fetch --days 7 --all
Populates: ad_spend, ad_sales, ad_clicks, ad_impressions, ad_acos per campaign per day.
SP-API Listing Data (optional)
python3 "/Users/tonytrieu/Documents/KDP OS/scripts/amazon_sp_api.py" \
bsr fetch --book-id [X]
For: BSR rank, category rank, review count, average rating over time.
STEP 1: Compute Per-Book Metrics
For each books.status = LIVE, compute:
Revenue
units_7d, units_30d — paperback units sold
kenp_reads_7d, kenp_reads_30d — KENP pages read (≈ $0.0045/page for US)
royalty_7d_usd, royalty_30d_usd — total net royalty
trend_7d_vs_prev7d_pct — week-over-week growth
Ads
ad_spend_7d, ad_sales_7d, ad_acos_7d
tacos_7d = ad_spend / total_sales (True ACoS — includes organic)
ctr_7d, cvr_7d
Rank
bsr_current, bsr_7d_avg, bsr_30d_avg (lower = better)
category_rank_current
review_count_delta_7d
Unit economics
royalty_per_sale = royalty_30d / units_30d
profit_per_sale = royalty_per_sale − (ad_spend_30d / units_30d)
breakeven_pct = ad_spend_30d / royalty_30d
STEP 2: Classify Each Book
| Bucket | Criteria | Action |
|---|
| 🏆 Winner | units_30d ≥ 30, ACoS < 30%, positive profit_per_sale | Scale: /ads-manager book_id=X +30% budget + expand keywords |
| 🌱 Promising | units_30d 10-29, ACoS 30-50% | Hold, monitor; try A+ content |
| 🛠 Stuck | ≥ 60 days since launch, units_30d < 10, ACoS > 70% | Investigate: listing? cover? niche? — /quality-reviewer book_id=X + /listing-copywriter book_id=X refresh |
| 💀 Dead | ≥ 90 days since launch, units_30d < 3, ad-spend > 2× royalty | Kill: pause ads, consider un-publish / de-list |
| 🆕 New | < 21 days since launch | Give it time; monitor daily |
STEP 3: Detect Cross-Book Patterns
- Which book type performs best? (coloring vs. low-content vs. activity)
- Which niche category has highest royalty/spend ratio?
- Which keyword clusters appear across winners? → candidate seeds for
/niche-hunter
- Which price point converts best? ($6.99 vs. $8.99 vs. $9.99)
- Seasonality: is there a day-of-week or monthly pattern?
- Review flywheel: books with 10+ reviews sell Xx better than <5 reviews → prioritize review velocity
STEP 4: Identify Anomalies
Flag surprises that need human attention:
- Book with sudden +300% sales spike → check for BookBub mention, Reddit post, newsletter feature
- Book with sudden −50% sales drop → check KDP status (suspended? content warning? review?), BSR dropout
- Ads campaign with ACoS > 200% sustained → likely auto-match bleeding; pause
- KENP reads with zero royalty → wrong marketplace rate used; double-check
- Review count dropped → Amazon removed fake/policy-violating review → check listing page
STEP 5: Produce Action Plan
Rank actions by (expected royalty impact) × (confidence) / (effort).
Action types
| Type | Command | When |
|---|
| SCALE_ADS | /ads-manager book_id=X iterate | Winner with <70% impression share |
| FIX_LISTING | /listing-copywriter book_id=X refresh | Stuck book with CTR < 0.3% |
| FIX_COVER | /cover-designer book_id=X regenerate | Listing CTR good but CVR < 5% |
| KILL | DB update + pause ads | Dead bucket |
| EXPAND_SERIES | /niche-hunter [seed from winner] | Winner — launch volume 2 or spin-off |
| SEASONAL_RAMP | /master-orchestrator seasonal [event] | Season approaching within 60 days |
| REVIEW_VELOCITY | manual — bookfunnel, inserts, ARC list | Book with 10+ units but < 5 reviews |
Save actions
python3 "/Users/tonytrieu/Documents/KDP OS/scripts/db.py" actions bulk-create '[
{"book_id": 14, "action_type": "SCALE_ADS", "priority": 1, "expected_impact_usd": 180, "command": "/ads-manager book_id=14 iterate", "reason": "Winner — ACoS 22%, imp share 38%"},
{"book_id": 9, "action_type": "FIX_COVER", "priority": 2, "expected_impact_usd": 80, "command": "/cover-designer book_id=9 regenerate", "reason": "CTR 0.8% OK, CVR 2.1% low — cover likely"},
...
]'
Output Format (to user)
📊 WEEKLY PERFORMANCE — 2026-04-13 to 2026-04-19
PORTFOLIO SUMMARY
Books LIVE: 12
Total units: 187 (+23% WoW)
Total KENP reads: 44,200 (+12% WoW)
Total royalty: $1,418 (+18% WoW)
Ad spend: $420
TACoS: 29.6% (target: <35%)
BOOKS BY BUCKET
🏆 Winners (3): #14 Cozy Cat Café, #7 Gratitude Journal Teens, #21 Sudoku Seniors
🌱 Promising (4): #9, #11, #18, #22
🛠 Stuck (3): #3, #5, #12
💀 Dead (1): #2 (kill recommended)
🆕 New (1): #24 (launched Apr 16)
TOP 3 ACTIONS (sorted by expected royalty impact)
1. [$240 impact] /ads-manager book_id=14 iterate
→ Cozy Cat Café: scale +30%, imp share only 38%
2. [$110 impact] /listing-copywriter book_id=3 refresh
→ Stuck 70 days, CTR 0.22% — description needs rewrite
3. [$80 impact] /cover-designer book_id=9 regenerate
→ CVR 2.1% (low), CTR 0.8% (ok) — cover is the bottleneck
ANOMALIES
⚠ Book #7 spike (+310% units Thu→Fri) — check Reddit/TikTok mentions
⚠ Book #11 zero KENP for 3 days — check KU enrollment status
PATTERNS
• Coloring books avg $3.80 royalty/sale, journals avg $2.10 — coloring is 1.8× more profitable this quarter
• Winners share "cozy" + "for Adults" pattern in title — expand niche theme
• CVR peaks Sun/Mon (gift-shopping weekend tail) — raise ads budget 20% those days
NEXT STEP
Run /master-orchestrator iterate to execute top 5 actions with approvals
book_id=X deep dive format
📖 BOOK #14 DEEP DIVE — Cozy Cat Café Coloring Book
30-DAY TREND
Units: 4, 6, 8, 11, ... (sparkline)
BSR: 142K → 38K → 29K → 22K (improving)
Rank: #1,240 Cats Coloring Books → #187 (climbing)
Reviews: 0 → 3 → 8 → 14 (healthy velocity)
ADS
Spend $84 | Sales $320 | ACoS 26% ✅
Top converter: "cozy cat coloring book for adults" — 12 orders, ACoS 18%
UNIT ECONOMICS
Royalty/sale: $4.51
Ad cost/sale: $0.96
Net profit/sale: $3.55
RECOMMENDATIONS
1. Scale ads +30% → $26/day (currently $20/day)
2. Launch Volume 2 — /niche-hunter "cozy cat bakery coloring book"
3. Request 3 extra KDP categories (Mindfulness, Stress Relief, Gift Books)
Rules
- ALWAYS ingest fresh data before analyzing — never work off stale DB
- ALWAYS classify every LIVE book into one bucket (Winner/Promising/Stuck/Dead/New)
- ALWAYS rank actions by (impact × confidence) / effort — not by urgency alone
- ALWAYS suggest the exact slash command for each action
- NEVER recommend "kill" before 90 days since launch (KDP reviews + SEO take time)
- NEVER recommend SCALE_ADS if total royalty_30d / ad_spend_30d < 1.3 (not profitable yet)
- Flag anomalies conservatively — a +30% day is noise, +300% is a real event
- Report in user's native chart format where possible (sparklines as text characters ▁▂▃▅▆▇)
- If Ads API not connected, fall back to KDP royalty CSV only and say so — never fabricate ad metrics
- Preserve per-day data in DB forever — year-over-year analysis is gold