$npx -y skills add retentioneering/retentioneering-tools --skill retentioneering-product-analyticsAnalyze event logs, clickstreams, user paths, product funnels, retention, behavioral segments, transition graphs, step matrices, sequence patterns, and customer journeys using Retentioneering. Use when the user provides CSV, Parquet, pandas, or database event data containing user
| 1 | # Retentioneering product analytics |
| 2 | |
| 3 | ## Objective |
| 4 | |
| 5 | Turn event-level behavioral data into a reproducible answer to a **product question** — |
| 6 | why users convert, churn, loop, or abandon — using user trajectories, transitions, |
| 7 | funnels, and behavioral segments. |
| 8 | |
| 9 | Do not merely generate visualizations. Connect each output to the question, separate |
| 10 | observation from interpretation, and never present path correlations as causal effects. |
| 11 | |
| 12 | ## Bundled references (read on demand, not upfront) |
| 13 | |
| 14 | | File | Read it when | |
| 15 | |---|---| |
| 16 | | `references/api-map.md` | before writing any Retentioneering call — verified signatures, argument conventions, return shapes for 5.x | |
| 17 | | `references/analysis-recipes.md` | after the question is clear — 10 field-tested patterns (R1–R10) with skeletons and pitfalls | |
| 18 | | `references/gotchas-and-validation.md` | before executing (API gotchas G1–G10) and before presenting (integrity checklist B1–B10) | |
| 19 | | `scripts/inspect_event_log.py` | step 2 — automated data profiling and schema suggestion | |
| 20 | |
| 21 | ## Required event-log semantics |
| 22 | |
| 23 | Minimum: a path identifier (user or session), an event name, a timestamp (or a reliable |
| 24 | order column — see gotcha G2 for order-only data). Useful extras: session id, segment |
| 25 | attributes (device, source, plan), event properties, conversion labels. |
| 26 | |
| 27 | ## Workflow |
| 28 | |
| 29 | ### 1. Environment |
| 30 | |
| 31 | 1. Confirm the package: `python -c "import retentioneering; print(retentioneering.__version__)"`. |
| 32 | Expect 5.x; this skill's API map is version-verified for 5.0 — on a different major |
| 33 | version, trust installed docstrings over the map. |
| 34 | 2. Locate the event data (CSV / Parquet / frames in existing code). Never modify inputs. |
| 35 | 3. Do not invent methods: anything not in `references/api-map.md` must be verified |
| 36 | against the installed package before use. |
| 37 | |
| 38 | ### 2. Inspect the data BEFORE choosing methods |
| 39 | |
| 40 | Run `scripts/inspect_event_log.py <path> [--sep ...]` (or replicate its checks inline for |
| 41 | in-memory frames). It profiles columns, infers the user/event/timestamp mapping, checks |
| 42 | timestamp parseability, duplicates, per-path ordering, path-length distribution, and |
| 43 | emits `artifacts/data-profile.json` plus a ready-to-paste `Eventstream(...)` schema. |
| 44 | |
| 45 | Report to the user before proceeding: inferred mapping, row/user/event-type counts, |
| 46 | covered period, and any red flags (nulls in key columns, timestamp ties, suspected bots |
| 47 | or ultra-long paths, order-only timestamps). Confirm the mapping if inference is |
| 48 | ambiguous. |
| 49 | |
| 50 | ### 3. Frame the product question, then pick the SMALLEST recipe |
| 51 | |
| 52 | Map the question to a recipe in `references/analysis-recipes.md`: |
| 53 | navigation structure/loops → transition graph (R1/R6) · before/after an anchor → |
| 54 | step matrix (R3) · ordered conversion flow → funnel (R1/R2) · what winners do |
| 55 | differently → diff on a funnel-stage segment (R2) · heterogeneous users → clustering |
| 56 | without target leakage (R5) · between two funnel levels → truncate micro-journey (R4) · |
| 57 | intervention timing → time-to-outcome (R7) · cross-segment scan → segment overview (R8) · |
| 58 | value of a fix → Markov what-if (R9, advanced). |
| 59 | |
| 60 | Combine recipes only when each addition resolves a distinct uncertainty. |
| 61 | |
| 62 | ### 4. Execute reproducibly |
| 63 | |
| 64 | 1. Prefer a rerunnable script (or a notebook executed top-to-bottom) over ad-hoc cells. |
| 65 | 2. Write artifacts to a dedicated output directory (`artifacts/` by default). |
| 66 | 3. Log every filtering rule and its row/path impact; never silently drop data |
| 67 | (integrity item B2). |
| 68 | 4. Use `sample_paths(frac=, random_state=)` for stable subsamples; stochastic steps get |
| 69 | explicit seeds. |
| 70 | 5. Record lineage: save `processed.recipe()` and the package version into |
| 71 | `artifacts/run-metadata.json` — any artifact must be regenerable from raw data vi |