Analytics your AI agent can actually use. Track, analyze, run A/B experiments, and optimize across all your projects via CLI. Includes a growth playbook so your agent knows HOW to grow, not just what to track.
npx skills add https://github.com/davepoon/buildwithclaude --skill agent-analytics
You are adding analytics tracking using Agent Analytics — the analytics platform your AI agent can actually use. Built for developers who ship lots of projects and want their AI agent to track, analyze, experiment, and optimize across all of them.
Website: agentanalytics.sh
GitHub: Agent-Analytics/agent-analytics
Docs: docs.agentanalytics.sh
You are NOT Mixpanel. Don't track everything. Track only what answers: "Is this project alive and growing?"
For a typical site, that's 3-5 custom events max on top of automatic page views.
Get an API key: Sign up at agentanalytics.sh and generate a key from the dashboard. Alternatively, self-host the open-source version from GitHub.
If the project doesn't have tracking yet:
# 1. Login (one time — uses your API key)
npx @agent-analytics/cli login --token aak_YOUR_API_KEY
# 2. Create the project (returns a project write token)
npx @agent-analytics/cli create my-site --domain https://mysite.com
# 3. Add the snippet using the returned token
# 4. Deploy, click around, verify:
npx @agent-analytics/cli events my-site
The create command returns a project write token — use it as data-token in the snippet. This is separate from your API key (which is for reading/querying).
The create command returns a tracking snippet with your project token — add it before </body>. It auto-tracks page_view events with path, referrer, browser, OS, device, screen size, and UTM params. You do NOT need to add custom page_view events.
If tracking is already set up, check what events and property keys are already in use so you match the naming:
npx @agent-analytics/cli properties-received PROJECT_NAME
Use onclick handlers on the elements that matter:
<a href="..." onclick="window.aa?.track('EVENT_NAME', {id: 'ELEMENT_ID'})">
Pick the ones that apply. Most sites need 2-4:
| Event | When to fire | Properties |
|-------|-------------|------------|
| cta_click | User clicks a call-to-action button | id (which button) |
| signup | User creates an account | method (github/google/email) |
| login | User returns and logs in | method |
| feature_used | User engages with a core feature | feature (which one) |
| checkout | User starts a payment flow | plan (free/pro/etc) |
| error | Something went wrong visibly | message, page |
snake_case: hero_get_started not heroGetStartedid property identifies WHICH element: short, descriptivesection_action: hero_signup, pricing_pro, nav_dashboardExperiments let you test which variant of a page element converts better. The full lifecycle is API-driven — no dashboard UI needed.
npx @agent-analytics/cli experiments create my-site \
--name signup_cta --variants control,new_cta --goal signup
Declarative (recommended): Use data-aa-experiment and data-aa-variant-{key} HTML attributes. Original content is the control. The tracker swaps text for assigned variants automatically.
<h1 data-aa-experiment="signup_cta" data-aa-variant-new_cta="Start Free Trial">Sign Up</h1>
Programmatic (complex cases): Use window.aa?.experiment(name, variants) — deterministic, same user always gets same variant.
npx @agent-analytics/cli experiments get exp_abc123
Returns Bayesian probability_best, lift, and a recommendation. The system needs ~100 exposures per variant before results are significant.
After adding tracking, verify it works:
# Click around, then check:
npx @agent-analytics/cli events PROJECT_NAME
# Events appear within seconds.
All commands use npx @agent-analytics/cli:
# Setup
login --token aak_YOUR_KEY # Save API key (one time)
projects # List all projects
create my-site --domain https://... # Create project
# Real-time
live # Live TUI dashboard across ALL projects
live my-site # Live view for one project
# Analytics
stats my-site --days 7 # Overview: events, users, daily trends
insights my-site --period 7d # Period-over-period comparison
breakdown my-site --property path --event page_view --limit 10 # Top pages/referrers/UTM
pages my-site --type entry # Landing page performance & bounce rates
sessions-dist my-site # Session engagement histogram
heatmap my-site # Peak hours & busiest days
events my-site --days 30 # Raw event log
sessions my-site # Individual session records
properties my-site # Discover event names & property keys
funnel my-site --steps "page_view,signup,purchase" # Funnel drop-off
retention my-site --period week --cohorts 8 # Cohort retention
# A/B experiments
experiments list my-site
experiments create my-site --name signup_cta --variants control,new_cta --goal signup
experiments get exp_abc123
experiments complete exp_abc123 --winner new_cta
| User asks | Call | Why |
|-----------|------|-----|
| "How's my site doing?" | insights + breakdown + pages (parallel) | Full weekly picture |
| "Is anyone visiting right now?" | live | Real-time visitors across all projects |
| "What are my top pages?" | breakdown --property path --event page_view | Ranked page list |
| "Where's my traffic coming from?" | breakdown --property referrer --event page_view | Referrer sources |
| "Are people actually engaging?" | sessions-dist | Bounce vs engaged split |
| "When should I deploy?" | heatmap | Find low-traffic windows |
| "Where do users drop off?" | funnel --steps "page_view,signup,purchase" | Step-by-step conversion |
| "Are users coming back?" | retention --period week --cohorts 8 | Cohort retention |
| "Which CTA converts better?" | experiments create + experiments get | A/B test lifecycle |
For any "how is X doing" question, always call insights first — it's the single most useful endpoint.
Track custom events via window.aa?.track():
window.aa?.track('cta_click', {id: 'hero_get_started'});
window.aa?.track('signup', {method: 'github'});
window.aa?.track('feature_used', {feature: 'create_project'});
window.aa?.track('checkout', {plan: 'pro'});
live for a real-time TUI)Comprehensive spreadsheet creation, editing, and analysis with support for formulas, formatting, data analysis, and visualization. When Claude needs to work with spreadsheets (.xlsx, .xlsm, .csv, .tsv, etc) for: (1) Creating new spreadsheets with formulas and formatting, (2) Reading or analyzing data, (3) Modify existing spreadsheets while preserving formulas, (4) Data analysis and visualization in spreadsheets, or (5) Recalculating formulas
Use this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing .xlsx, .xlsm, .csv, or .tsv file (e.g., adding columns, computing formulas, formatting, charting, cleaning messy data); create a new spreadsheet from scratch or from other data sources; or convert between tabular file formats. Trigger especially when the user references a spreadsheet file by name or path — even casually (like \"the xlsx in my downloads\") — and wants something done to it or produced from it. Also trigger for cleaning or restructuring messy tabular data files (malformed rows, misplaced headers, junk data) into proper spreadsheets. The deliverable must be a spreadsheet file. Do NOT trigger when the primary deliverable is a Word document, HTML report, standalone Python script, database pipeline, or Google Sheets API integration, even if tabular data is involved.
Picks random winners from lists, spreadsheets, or Google Sheets for giveaways, raffles, and contests. Ensures fair, unbiased selection with transparency.
Query openFDA API for drugs, devices, adverse events, recalls, regulatory submissions (510k, PMA), substance identification (UNII), for FDA regulatory data analysis and safety research.
MATLAB and GNU Octave numerical computing for matrix operations, data analysis, visualization, and scientific computing. Use when writing MATLAB/Octave scripts for linear algebra, signal processing, image processing, differential equations, optimization, statistics, or creating scientific visualizations. Also use when the user needs help with MATLAB syntax, functions, or wants to convert between MATLAB and Python code. Scripts can be executed with MATLAB or the open-source GNU Octave interpreter.
UMAP dimensionality reduction. Fast nonlinear manifold learning for 2D/3D visualization, clustering preprocessing (HDBSCAN), supervised/parametric UMAP, for high-dimensional data.
Creating interactive data visualisations using d3.js. This skill should be used when creating custom charts, graphs, network diagrams, geographic visualisations, or any complex SVG-based data visualisation that requires fine-grained control over visual elements, transitions, or interactions. Use this for bespoke visualisations beyond standard charting libraries, whether in React, Vue, Svelte, vanilla JavaScript, or any other environment.
Access AlphaFold 200M+ AI-predicted protein structures. Retrieve structures by UniProt ID, download PDB/mmCIF files, analyze confidence metrics (pLDDT, PAE), for drug discovery and structural biology.
Take davepoon/agent-analytics from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.
The instructions reference npx.
Without those the skill loads but fails at the first command.