.claude/skills/analyze-ctr/SKILL.md
Run Thompson Sampling CTR analysis on email treatments. Use when analyzing treatment performance or optimizing email campaigns.
npx skillsauth add praveenmaiya/holley-rec analyze-ctrInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Analyzes email treatment click-through rates using Bayesian Thompson Sampling.
python src/bandit_click_holley.py
This computes:
Key metrics to report:
| Metric | Meaning |
|--------|---------|
| posterior_mean | Bayesian CTR estimate |
| posterior_std | Uncertainty (higher = less data) |
| selection_pct | % of time bandit would pick this treatment |
For raw funnel data:
bq query --use_legacy_sql=false "
SELECT
treatment_id,
COUNT(DISTINCT CASE WHEN interaction_type = 'VIEWED' THEN user_id END) as views,
COUNT(DISTINCT CASE WHEN interaction_type = 'CLICKED' THEN user_id END) as clicks,
SAFE_DIVIDE(
COUNT(DISTINCT CASE WHEN interaction_type = 'CLICKED' THEN user_id END),
COUNT(DISTINCT CASE WHEN interaction_type = 'VIEWED' THEN user_id END)
) as ctr
FROM \`auxia-gcp.company_1950.treatment_interaction\`
WHERE DATE(TIMESTAMP_MICROS(interaction_timestamp_micros)) >= DATE_SUB(CURRENT_DATE(), INTERVAL 60 DAY)
GROUP BY treatment_id
ORDER BY ctr DESC
"
Reference files:
configs/personalized_treatments.csv (10 treatments)configs/static_treatments.csv (22 treatments)Report should include:
src/bandit_click_holley.py - Core analysis codesql/reporting/campaign_performance.sql - Funnel queriesdocs/analysis/model_ctr_comparison_2025_12_17.md - Analysis methodologytesting
Generate a team-facing weekly status update from STATUS_LOG.md and git history.
testing
Run QA validation checks on the recommendation pipeline output. Use after pipeline runs to verify data quality.
research
Compare Personalized vs Static treatment performance with unbiased methodology. Use for A/B analysis and treatment comparison.
testing
Show current pipeline and deployment status. Use for quick health check.