agentleFS
RidhuanDEVRidhuanDEV/claude-skills/shadow-analytics/SKILL.md

shadow-analytics

Skill1 starsChanged 7 days agoMITView on GitHub

Use when designing product KPIs, tracking events, funnels, A/B tests, SRM, CUPED, or causal analysis. Not for SLOs (/shadow-observe).

The file

We split this skill into the rules it gives an agent

4 rules. About 0 are common, 1 is distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Use this skill whenever the Monarch designs KPI frameworks, tracking plans, identity graphs, privacy-compliant analytics pipelines, …

    line 8
  2. Very specific:

    Hard Randomization & SRM Gate: Always separate Assignment (ITT) from Exposure (triggered identically across Control and Treatment).

    line 14
  3. Very specific:

    Run offline checks (L0/L1) before claiming VERIFIED-LOCAL:

    line 20
  4. Distinctive:

    Do not load unrelated references unnecessarily.

    line 52

≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Shadow Analytics (/shadow-analytics) — Product Analytics & Experimentation Engineering

Use this skill whenever the Monarch designs KPI frameworks, tracking plans, identity graphs, privacy-compliant analytics pipelines, funnel/retention/behavioral analyses, A/B experiments, quasi-experimental causal studies, or executive ship decisions.

1. Core Engineering Principles & Non-Negotiables

  1. Metric & Contract Rigor: Anchor decisions on a value-driven North Star Metric, OEC, and blocking guardrails. Enforce Object_Action event naming, schema_version, zero raw PII, and occurrence-unique retry-stable event_id (UUIDv7) on repeatable events (deterministic entity keys apply strictly to once-per-entity domain transitions).
  2. Truthful Instrumentation & End-to-End Privacy: Use server-side events as the source of truth for revenue/billing, pair with consented first-party client telemetry, rotate anonymous_id (reset()) on logout/shared kiosks, and orchestrate multi-vendor DSAR deletion across BOTH the warehouse and third-party vendors (PostHog/GA4/Mixpanel/ESP) — deleting only analytics_identity_map is non-compliant.
  3. Hard Randomization & SRM Gate: Always separate Assignment (ITT) from Exposure (triggered identically across Control and Treatment). Compute Pearson chi-square SRM at alpha = 0.001; BLOCK shipping (BLOCKED_SRM) whenever srm_p < 0.001 regardless of positive lift (e.g. +12%, p = 0.02).
  4. Statistical & Causal Precision: Match estimator to metric structure (Z-test for user proportions, Welch's t-test for continuous, Delta Method / cluster bootstrap for ratio metrics, cluster-robust SE for clusters, mSPRT / Group Sequential for peeking, Holm-Bonferroni vs Benjamini-Hochberg FDR). CUPED covariates MUST be strictly pre-experiment (< assignment_ts). Use DiD / Synthetic Control / RDD / AIPW with falsification checks when RCTs are infeasible.
  5. Cross-Skill Boundaries: Delegate backend logging/Prometheus/OTel SRE to /shadow-observe, OLTP DB migrations/RLS to /shadow-db//shadow-data, UU PDP legal/DPIA governance to /shadow-privacy, and search visibility/CrUX SEO to /shadow-seo.

2. Deterministic Verification CLI & Scenario Benchmarks

Run offline checks (L0/L1) before claiming VERIFIED-LOCAL:

python "shadow-analytics/scripts/analytics_experiment_verifier.py" --self-test
python "shadow-analytics/scripts/analytics_experiment_verifier.py" --check-event path/to/event.json
python "shadow-analytics/scripts/analytics_experiment_verifier.py" --check-experiment path/to/experiment.json
python "shadow-analytics/scripts/analytics_experiment_verifier.py" --check-dsar-plan path/to/dsar_plan.json
python -m unittest discover -s "shadow-analytics/tests" -v

Graded specialist scenarios live in evaluations.md (13 scenarios including the SRM p = 0.0002 vs +12% lift, p = 0.02 ship-gate benchmark, ratio Delta Method, CUPED leakage, mSPRT peeking, marketplace switchbacks, DiD parallel trends, and multi-vendor DSAR).

Reference Guide

Load only the 1–2 modules matching the active subtask (never load all 15 at once):

Task / ScenarioTierLoad Reference
North Star Metric, OEC, metric trees, anti-Goodhart guardrails & metric governanceCOREreferences/01-product-metrics-and-kpi-design.md
Object_Action taxonomy, typed contracts, occurrence-unique retry-stable event_id, versioningCOREreferences/02-event-taxonomy-and-tracking-plans.md
anonymous_id -> identify -> reset(), cross-device stitching, sessions, shared-kiosk protectionCOREreferences/03-identity-resolution.md
UU PDP / GDPR consent gate, PII scrubbing, retention TTLs & multi-vendor DSAR orchestrationCOREreferences/04-privacy-and-consent-architecture.md
Hybrid client/server SDKs, first-party /ingest proxy, sendBeacon, PostHog/GA4/Mixpanel, botsCOREreferences/05-analytics-instrumentation.md
Raw/Silver/Gold warehouse modeling, clock-skew clamping, late-arriving mobile events, dedupADVANCEDreferences/06-analytics-data-architecture.md
Schema validation quarantine/DLQ, freshness/completeness SLAs, volume anomaly & CI contract gatesOPERATIONALreferences/07-data-quality-and-observability.md
Strict ordered vs unordered funnels, conversion windows, right-censoring & Simpson's paradoxCOREreferences/08-funnel-and-conversion-analytics.md
Activation, N-day vs bracket vs unbounded retention SQL, cohort masking & lifecycle Quick RatioCOREreferences/09-retention-and-cohort-analysis.md
L7/L28 power-user curves, journey/path SQL, behavioral cohorts & RFM applicability limitsADVANCEDreferences/10-behavioral-and-segmentation-analytics.md
Salted bucketing, Assignment vs Exposure (ITT/LATE), A/A tests, SRM taxonomy & exclusion layersCOREreferences/11-experiment-design-and-randomization.md
Power/MDE, Estimator Matrix, Welch's t, Delta Method, valid pre-experiment CUPED, FWER/FDRADVANCEDreferences/12-statistical-inference.md
Sequential testing (mSPRT / O'Brien-Fleming GST), cluster randomization & marketplace switchbacksSPECIALISTreferences/13-advanced-experimentation.md
Quasi-experiments: Difference-in-Differences (DiD), Synthetic Control, PSM/AIPW, RDD & falsificationSPECIALISTreferences/14-causal-inference.md
4-gate Ship/Iterate/Rollback Decision Records, CI reading, novelty decay, holdouts & flag cleanupOPERATIONALreferences/15-decision-science-and-reporting.md

Do not load unrelated references unnecessarily.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.