Terminal
Terminal/Skill
Prepares a Mixpanel org or project for its AI assistants by setting business context and event and property descriptions, with a readiness check.
By Mixpanel
Works with
npx skills add mixpanel/ai-plugins --skill prepare-ai-readinessEngine required — resolve an engine per
ENGINE.md: one named in the conversation or loaded instructions is mandatory (not set up → offer/mixpanel:installfor it); otherwise use the Mixpanel MCP server, or offer/mixpanel:installif it's unavailable.
This skill gets a customer's Mixpanel setup ready for AI assistants (the in-product agent and MCP clients). "Ready" means two layers are in place:
manage-lexicon skill, run inline, rather than reimplementing it.How the agent consumes each layer evolves with the product — verify current agent behavior against Mixpanel docs.
The skill is import-first: if the customer already has their business knowledge written down somewhere (Notion, a Google Doc, a tracking-plan sheet, a PRD, a pasted block), it pulls that in and maps it onto the template, then interviews only to fill what's missing. It runs as a single interactive session and writes only after explicit preview and confirmation.
Loaded on demand from commands/.
| Command | File | Match if message contains any of |
|---|---|---|
status | commands/status.md | how ready, ai-ready, score, audit, what's missing, check our setup |
import-context | commands/import-context.md | import, we already have, pull from, from notion/doc/drive, paste |
setup-context | commands/setup-context.md | set up context, configure context, interview, create context |
enrich-data | commands/enrich-data.md | event descriptions, property descriptions, tags, clean up events, lexicon |
target | commands/target.md | switch level, org vs project, change target, where should this live |
If a message matches more than one, show the Command menu. The natural full-onboarding path is: status → import-context (or setup-context) → enrich-data → status.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Mixpanel AI Readiness — [Org Name]
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Business context layer
1. Status — Score readiness across BOTH layers
2. Import context — Pull context you already have (connector or file)
3. Setup context — Interview to build context from scratch
4. Target — Org level, project level, or both
Data layer (Lexicon)
5. Enrich data — Event/property descriptions + tags (via manage-lexicon)
6. Exit
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
| Key | Shape | Description |
|---|---|---|
org_id, org_name | string | Active organization. |
target_level | "org"|"project"|"both" | Where context is written. |
project_id, project_name | string | Active project, when in scope. |
caller_role | map | Resolved role at org and project — the permission gate. |
existing_context | map | { org, project } current context, read before any write. |
imported_source | map | Raw text pulled from a connector/file, plus its origin, pre-mapping. |
schema_facts | map | Derived top events/properties, integrations, timezone. Timestamped. |
interview_answers | map | Section-keyed answers, for gaps not covered by import. |
draft_context | map | { org, project } composed markdown pending preview/confirm. |
lexicon_score | map | Coverage summary returned from manage-lexicon (for the unified status). |
existing_context for the target before composing. The diff is computed against it.existing_context, and getting explicit confirmation.EXPORT (saves the draft to a local file instead of writing to Mixpanel — see Write flow below).backups/{level}-{id}-backup-{ISO-timestamp}.md (an empty file with a note if context was empty) and report the path — so a prior version can be restored manually if a write turns out to be wrong. If no local file-write capability is available (or it's denied), don't write or fail silently: print the full existing document inline so the user can save it themselves, and get explicit confirmation to proceed without a file backup.schema_facts support. Uncertainty → Open Questions, never hedged prose.enrich-data hands off to manage-lexicon and captures lexicon_score so status can report both layers.ai-readiness-runs/[ISO-timestamp]-[command].json with org/target/project, command, sections or entities written, counts.exit always valid.The shared tail of setup-context and import-context, and the canonical definition of the composition rules, confirmation prompt, and write sequence. Each command sources draft_context its own way (from interview answers, or from mapped source), but composes it by the same rules: fill references/context-template.md with the durable tldr; first; schema facts from schema_facts only in the fenced, timestamped Schema Snapshot; anything unsupported in Open Questions (per the "Ground everything" rule); respect the 50,000-char cap per context level (see Critical constraints below), trimming the Schema Snapshot first. From the composed draft, both do exactly this:
existing_context (added/changed/removed/unchanged). For both, show both levels together. Prompt:
Write this to [org / project: NAME / both] business context?
CONFIRM — commit this exact document (replaces current context at that level)
EXPORT — save draft to a local .md file, don't write to Mixpanel
edit — tell me what to change
exit — discard
Only literal CONFIRM commits; for both, one CONFIRM applies both levels (writes run per level; report each). edit scopes to the level named. Anything else cancels.EXPORT and name the required role.Properties of the underlying APIs, not preferences — every constraint below can change as Mixpanel's product evolves; verify current behavior, limits, and role requirements against Mixpanel docs before relying on the specifics.
CONFIRM) before every write. Never write a partial document.manage-lexicon can be unavailable. Enrichment runs through it, per the "Delegate Lexicon, surface its result" behaviour rule. If the skill is unavailable, say so and let the user proceed with the business-context layer only — do not silently reimplement enrichment.Identify the org. Determine target_level (infer from the request, else ask: org / project / both). Resolve project_id if project is in scope. If no Mixpanel engine is available, stop and ask the user whether to run /mixpanel:install now.
Resolve caller_role for each target. Surface any level the user can't edit up front; adjust target or offer EXPORT.
Populate existing_context for each target — mandatory before composing, per the "Read before write, always" rule.
BEFORE the command menu, if the existing context for the target level is empty or minimal (< 500 chars):
Always ask first:
Your [org/project] context is currently [empty/minimal].
Do you have existing business context written down somewhere?
• Notion, Google Drive, Confluence, or other connected source
• A file or text block you can paste
• Or I can interview you from scratch
Where should I look? (or type 'interview' to skip import)
Only proceed to setup-context or the menu if the user explicitly declines to import — types "interview" / "skip" / "scratch" — or explicitly invoked setup-context by name (asking to interview from scratch is itself a decline). This ensures most customers start with import-context (the preferred path per the "Import before interview" behaviour rule) without asking twice when the user already said which path they want.
Choose command (explicit → implicit → menu), load commands/[command].md, execute reusing session state, print ✅ Done., write the audit entry if the command wrote anything (per the "Audit trail" rule — read-only commands like status skip it), return to selection. Honour follow-on offers (Status → Import/Setup/Enrich; Import → Setup for gaps → Enrich).
references/context-template.md — fixed org and project section templates, following a what/where/who/how/why framework at project level (org level uses a subset, plus default-project routing); that file carries the note on alignment with Mixpanel's native context generation.references/interview-questions.md — question bank per section, including the authority question.references/import-mapping.md — how to map an arbitrary source doc onto the template, what to keep, what to drop.