You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// The `instructions` string is injected into the agent's system prompt at
93
+
// connection time per the MCP spec. Use it to nudge skill loading rather
94
+
// than relying purely on each skill's semantic match.
95
+
constSERVER_INSTRUCTIONS=`Clamp Analytics MCP. Use these tools to read pageviews, custom events, funnels, cohorts, retention, revenue, errors, and user journeys for a single project.
96
+
97
+
Before INTERPRETING any analytics result from these tools, load the relevant analytics-skills skill(s). Skills enforce methodology — sample-size discipline, Simpson's paradox detection, causal-reasoning hygiene, mix-shift checks — that pure tool calls cannot.
98
+
99
+
Skill loading map:
100
+
- Any analytics interpretation question → load \`analytics-skills:analytics-diagnostic-method\` (the spine; load this first).
101
+
- "Why did traffic change / drop / spike?" → also load \`analytics-skills:traffic-change-diagnosis\`.
102
+
- "Is this metric good? Is bounce/CVR/churn normal?" → load \`analytics-skills:metric-context-and-benchmarks\`.
- A/B test reading, "did the variant win?" → load \`analytics-skills:experiment-result-reader\` (+ \`bayesian-experiment-reader\` for posterior P(better)/expected-loss; + \`sequential-monitoring\` for safe peeking).
105
+
- "Did X cause Y?" on observational data (no holdback) → load \`analytics-skills:causal-query-classifier\` first to rung-tag the question; then \`causal-dag-builder\` to make assumptions explicit; then \`causal-evidence-checklist\` (Bradford Hill) before recommending an action.
106
+
- Cohort comparison, funnel-by-cohort, "this segment converts X% higher" → load \`analytics-skills:causal-dag-builder\` to surface confounders before declaring causation.
- First time talking to a new project → run \`analytics-skills:analytics-profile-setup\` once so subsequent answers calibrate to the user's industry and business model.
109
+
110
+
If the user is interpreting a number AND no analytics-skills skill has been loaded, prefer to load the relevant skill and re-read with discipline rather than answer ad-hoc. The skill descriptions specify their triggers; match by question shape, not vendor.`;
// ── Methodology hints (prepended to diagnostic tool results) ──
199
+
// Each hint names the analytics-skills that the agent should load before
200
+
// interpreting the result. Vendor-neutral methodology lives in the skills;
201
+
// these strings are the per-tool routing nudges.
202
+
203
+
constM_TRAFFIC=
204
+
"Load `analytics-skills:analytics-diagnostic-method` before interpreting (sample-size discipline + Simpson's paradox). For 'why did X change' questions also load `analytics-skills:traffic-change-diagnosis`. For series spanning >14 days where the change date is contested, load `analytics-skills:anomaly-detection-time-series`.";
205
+
206
+
constM_FUNNEL=
207
+
"Load `analytics-skills:channel-and-funnel-quality` before reading these drop-offs (expected step-type ranges + mix-shift detection). Pair with `analytics-skills:analytics-diagnostic-method`. If you are about to recommend an action based on a cohort delta, load `analytics-skills:causal-dag-builder` to make confounders explicit.";
208
+
209
+
constM_COHORT=
210
+
"Load `analytics-skills:causal-dag-builder` before claiming one cohort 'caused' a difference — observational cohort splits have intent + selection confounds. Pair with `analytics-skills:analytics-diagnostic-method`. For Bradford-Hill grading before a ship/rollback decision, load `analytics-skills:causal-evidence-checklist`.";
211
+
212
+
constM_REVENUE=
213
+
"Load `analytics-skills:metric-context-and-benchmarks` for revenue interpretation (LTV/CAC, ARPU benchmarks by model). Pair with `analytics-skills:analytics-diagnostic-method` for mix-shift and sample-size discipline. Currencies are not auto-converted; the response returns one bucket per currency.";
214
+
215
+
constM_ERROR=
216
+
"Load `analytics-skills:analytics-diagnostic-method` before triaging (one cause, not five guesses). Errors deduplicated by fingerprint; correlate spike windows with deploy timestamps before recommending a rollback.";
217
+
218
+
constM_ENGAGEMENT=
219
+
"Load `analytics-skills:metric-context-and-benchmarks` for per-page-type expected ranges (a 'high' bounce on a docs page is healthy; on a pricing page it isn't). Pair with `analytics-skills:analytics-diagnostic-method`.";
0 commit comments