mixpanel-headless-setup
This skill installs mixpanel_headless, pandas, numpy, matplotlib, seaborn, networkx, anytree, scipy (and pyarrow on Python 3.11+), then verifies Mixpanel credentials. It should be invoked when setting up a new environment for Mixpanel data analysis, when dependencies are missing, or when configuring service account or OAuth credentials for the first time.
- License 许可
- MIT
- 最近更新
- 2026-07-19
- Stars
- ★ 1
- Forks
- 1
01 前言 Front Matter
- name
- mixpanel-headless-setup
- description
- This skill installs mixpanel_headless, pandas, numpy, matplotlib, seaborn, networkx, anytree, scipy (and pyarrow on Python 3.11+), then verifies Mixpanel credentials. It should be invoked when setting up a new environment for Mixpanel data analysis, when dependencies are missing, or when configuring service account or OAuth credentials for the first time.
- allowed-tools
- Bash
- disable-model-invocation
- false
02 资源文件 1
- 脚本scripts/setup.sh6.0 KB
03 SKILL.md 正文
mixpanel-headless — Setup
Install dependencies and verify credentials for CodeMode analytics.
Run Setup
Before running bundled scripts, set SKILL_DIR to the absolute path of this
skills/setup directory.
bash $SKILL_DIR/scripts/setup.sh
This will:
- Verify Python 3.10+ is available
- Install
mixpanel_headless,pandas,numpy,matplotlib,seaborn,networkx>=3.0,anytree>=2.8.0,scipy, andpyarrow>=17.0on Python 3.11+ (tries uv, pip in order) - Verify all packages import successfully (including pyarrow on 3.11+, networkx, anytree, and scipy)
- Check for configured Mixpanel credentials (single schema — Account → Project → Workspace)
Check Credentials
After installation, check the active session:
python3 $SKILL_DIR/../mixpanelyst/scripts/auth_manager.py session
Parse the JSON state field:
ok— credentials configured. Showaccount.name→ projectproject.idand proceed to verification.needs_account— no account configured. Readnextfor onboarding suggestions and follow "If Credentials Are Missing" below.needs_project— account configured but no project pinned. Suggestmp project listthenmp project use <id>.error— showerror.message. Iferror.actionableis true, the message names a concrete next command.
If Credentials Are Missing
If no credentials are configured, guide the user to one of these methods:
Recommended: mp login
The frictionless one-shot path. Tell the user to run:
mp login
mp login runs the right auth flow for the environment, derives the
account name from /me, and pins a default project. For laptops with a
usable browser, this opens the PKCE flow; for environments with
MP_USERNAME + MP_SECRET set, it skips the browser and uses the
service-account path; for MP_OAUTH_TOKEN set, it uses the static
bearer.
Region behavior:
service_accountandoauth_tokenpaths probeus → eu → inwhen--regionis omitted.oauth_browser(the bare-mp logindefault) defaults tous. EU and India browser users must pass--region euor--region in.
Useful flags: --name NAME, --region us|eu|in, --project ID,
--service-account, --token-env VAR, --no-browser, --secret-stdin.
Alternative: Guided Setup (explicit account add)
Use the mixpanel-auth skill's account-add workflow for a
step-by-step walkthrough. The workflow never prompts for secrets in
conversation — it instructs the user to run mp account add ...
themselves so the secret is read with hidden input. Use this path when
the user wants explicit control over the account name, region, and type
at registration time.
Alternative: Service-Account Environment Variables (temporary)
For quick testing, set all four variables in the shell — the resolver picks them up directly without account registration:
export MP_USERNAME="service-account-username"
export MP_SECRET="service-account-secret"
export MP_PROJECT_ID="12345"
export MP_REGION="us" # or "eu", "in"
Alternative: Raw OAuth Bearer Token (best for agents / CI)
If the user has an OAuth 2.0 access token from another source, they can use it directly without the PKCE browser flow:
export MP_OAUTH_TOKEN="<bearer-token>"
export MP_PROJECT_ID="12345"
export MP_REGION="us" # or "eu", "in"
This is the recommended mode for non-interactive contexts. The full
service-account env-var set (MP_USERNAME + MP_SECRET + MP_PROJECT_ID
MP_REGION) takes precedence when both sets are complete.
Remote Environment
If running inside a remote or sandboxed agent environment, credentials work differently:
- OAuth login and interactive account setup are NOT available (no browser, no host terminal access)
- Credentials must be configured on the host machine before starting the remote session
If No Credentials Found in the Remote Session
Tell the user:
No Mixpanel credentials found in this remote session.
On your host machine (outside the remote session), run:
mp account export-bridge --to ~/.claude/mixpanel/auth.jsonThis writes a v2 bridge file embedding your account record (and any oauth_browser tokens) so the remote session can read your credentials at startup.
Then start a new remote session — credentials will be available automatically.
Do NOT suggest the account-login or account-add interactive workflows — these won't work inside remote sessions without browser or terminal access.
If Bridge File Found But Token Expired
The library will auto-refresh the OAuth token via the on-disk refresh token (no browser needed). If refresh fails:
Your OAuth session has expired and could not be refreshed. On your host machine, run:
mp login --name personal # re-authenticate (or `mp account login personal`) mp account export-bridge --to ~/.claude/mixpanel/auth.jsonThen start a new remote session.
Verify Everything Works
python3 $SKILL_DIR/../mixpanelyst/scripts/auth_manager.py account test
The subcommand never raises — read result.ok to determine outcome.
result.ok: true→ setup is complete; the user can ask analytics questions.result.ok: false→ suggest themixpanel-authaccount-test workflow for detailed diagnostics.
Post-Setup: Explore Your Data
Once authenticated, these slash commands help orient the user:
mixpanel-authproject-list workflow — discover all accessible projects via/memixpanel-authsession workflow — see active account / project / workspacemixpanel-authproject-use workflow — switch to a different projectmixpanel-authtarget-add workflow — save a named cursor position
The user can also construct a Workspace targeting a specific account / project / workspace directly:
import mixpanel_headless as mp
ws = mp.Workspace() # default session
ws = mp.Workspace(account="team") # named account
ws = mp.Workspace(project="67890") # explicit project (active account)
ws = mp.Workspace(account="team", project="67890") # both axes
ws.use(project="98765").events() # in-session switch (no re-auth)
The mixpanelyst skill auto-triggers on analytics questions. For the analytical frameworks that guide investigations, see analytical-frameworks.md. For the complete Python API, see python-api.md.
04 同仓库更多 Skills
Zotero
Use Zotero Desktop from Codex to enable/probe the local API, search a local Zotero library, list items/collections/tags, export BibTeX, insert citation keys into LaTeX or Markdown drafts, read indexed full text when requested, and import BibTeX/RIS records into Zotero through the connector server. Use when the user mentions Zotero, citations, references.bib, BibTeX export, local Zotero API, localhost:23119, or adding citations from a Zotero library.
zoom-apps-sdk
Use when using Apps SDK.
youtube
Obtain accurate, timestamped YouTube video transcripts (preferring manual captions over auto-generated) as the primary deliverable, then derive summaries, key claims, or notes from that transcript. Use when the user provides a YouTube URL (or video ID) and wants the transcript, a faithful summary, key claims with attribution, timestamped notes, or "what does this video actually say". The skill is transcript-first: never substitute metadata, title, description, or search snippets for the spoken content. Triggers: "youtube transcript", "get the transcript of this video", "summarize this youtube video", "what did they say in https://youtube.com/...", "key claims from this talk".
yeet
Publish local changes to GitHub by confirming scope, committing intentionally, pushing the branch, and opening a draft PR through the GitHub app from this plugin, with `gh` used only as a fallback where connector coverage is insufficient.
x-post-creator
Create X-ready post threads and co-located story packages from the active conversation or referenced project material. Use when the user says turn this into an X-post, /x-post, make this into an X thread, or wants plain-language social posts with supporting images saved to docs/x-posts/[story-name]/.
x-api
Search, read, and write X posts through the local X API MCP server (the same backend used by the Codex x-api skill). Use for searching X/x.com, reading threads and replies, creating lists, staging/publishing posts for @alltheputs, finding high-visibility reply targets for research outreach, ingesting public context, or any request that mentions /x-api or "search X".