>- Add PostHog LLM analytics to trace AI model usage. Use after implementing LLM features or reviewing PRs to ensure all generations are captured with token counts, latency, and costs. Also handles initial PostHog SDK setup if not yet installed.
npx skills add https://github.com/PostHog/skills --skill omnibus-instrument-llm-analytics
Use this skill to add PostHog LLM analytics that trace AI model usage in new or changed code. Use it after implementing LLM features or reviewing PRs to ensure all generations are captured with token counts, latency, and costs. If PostHog is not yet installed, this skill also covers initial SDK setup. Supports any provider or framework.
Supported providers: OpenAI, Azure OpenAI, Anthropic, Google, Cohere, Mistral, Perplexity, DeepSeek, Groq, Together AI, Fireworks AI, xAI, Cerebras, Hugging Face, Ollama, OpenRouter.
Supported frameworks: LangChain, LlamaIndex, CrewAI, AutoGen, DSPy, LangGraph, Pydantic AI, Vercel AI, LiteLLM, Instructor, Semantic Kernel, Mirascope, Mastra, SmolAgents, OpenAI Agents.
Proxy/gateway: Portkey, Helicone.
Follow these steps IN ORDER:
STEP 1: Analyze the codebase and detect the LLM stack.
STEP 2: Research instrumentation. (Skip if PostHog LLM tracing is already set up.)
2.1. Find the reference file below that matches the detected provider or framework — it is the source of truth for callback setup, middleware configuration, and event capture. Read it now.
2.2. If no reference matches, use manual-capture.md as a fallback — it covers the generic event capture approach that works with any provider.
STEP 3: Install the PostHog SDK. (Skip if PostHog is already set up.)
STEP 4: Add LLM tracing.
STEP 5: Link to users.
STEP 6: Set up environment variables.
references/openai.md - Openai llm analytics installation - docsreferences/azure-openai.md - Azure openai llm analytics installation - docsreferences/anthropic.md - Anthropic llm analytics installation - docsreferences/google.md - Google llm analytics installation - docsreferences/cohere.md - Cohere llm analytics installation - docsreferences/mistral.md - Mistral llm analytics installation - docsreferences/perplexity.md - Perplexity llm analytics installation - docsreferences/deepseek.md - Deepseek llm analytics installation - docsreferences/groq.md - Groq llm analytics installation - docsreferences/together-ai.md - Together ai llm analytics installation - docsreferences/fireworks-ai.md - Fireworks ai llm analytics installation - docsreferences/xai.md - Xai llm analytics installation - docsreferences/cerebras.md - Cerebras llm analytics installation - docsreferences/hugging-face.md - Hugging face llm analytics installation - docsreferences/ollama.md - Ollama llm analytics installation - docsreferences/openrouter.md - Openrouter llm analytics installation - docsreferences/langchain.md - Langchain llm analytics installation - docsreferences/llamaindex.md - Llamaindex llm analytics installation - docsreferences/crewai.md - Crewai llm analytics installation - docsreferences/autogen.md - Autogen llm analytics installation - docsreferences/dspy.md - Dspy llm analytics installation - docsreferences/langgraph.md - Langgraph llm analytics installation - docsreferences/pydantic-ai.md - Pydantic ai llm analytics installation - docsreferences/vercel-ai.md - Vercel ai SDK llm analytics installation - docsreferences/litellm.md - Litellm llm analytics installation - docsreferences/instructor.md - Instructor llm analytics installation - docsreferences/semantic-kernel.md - Semantic kernel llm analytics installation - docsreferences/mirascope.md - Mirascope llm analytics installation - docsreferences/mastra.md - Mastra llm analytics installation - docsreferences/smolagents.md - Smolagents llm analytics installation - docsreferences/openai-agents.md - Openai agents SDK llm analytics installation - docsreferences/portkey.md - Portkey llm analytics installation - docsreferences/helicone.md - Helicone llm analytics installation - docsreferences/manual-capture.md - Manual capture llm analytics installation - docsreferences/basics.md - Llm analytics basics - docsreferences/traces.md - Traces - docsreferences/calculating-costs.md - Calculating llm costs - docsEach provider reference contains installation instructions, SDK setup, and code examples specific to that provider or framework. Find the reference that matches the user's stack.
If the user's provider isn't listed, use manual-capture.md as a fallback — it covers the generic event capture approach that works with any provider.
Work with Data Commons, a platform providing programmatic access to public statistical data from global sources. Use this skill when working with demographic data, economic indicators, health statistics, environmental data, or any public datasets available through Data Commons. Applicable for querying population statistics, GDP figures, unemployment rates, disease prevalence, geographic entity resolution, and exploring relationships between statistical entities.
Neuropixels neural recording analysis. Load SpikeGLX/OpenEphys data, preprocess, motion correction, Kilosort4 spike sorting, quality metrics, Allen/IBL curation, AI-assisted visual analysis, for Neuropixels 1.0/2.0 extracellular electrophysiology. Use when working with neural recordings, spike sorting, extracellular electrophysiology, or when the user mentions Neuropixels, SpikeGLX, Open Ephys, Kilosort, quality metrics, or unit curation.
Fast in-memory DataFrame library for datasets that fit in RAM. Use when pandas is too slow but data still fits in memory. Lazy evaluation, parallel execution, Apache Arrow backend. Best for 1-100GB datasets, ETL pipelines, faster pandas replacement. For larger-than-RAM data use dask or vaex.
World-class data science skill for statistical modeling, experimentation, causal inference, and advanced analytics. Expertise in Python (NumPy, Pandas, Scikit-learn), R, SQL, statistical methods, A/B testing, time series, and business intelligence. Includes experiment design, feature engineering, model evaluation, and stakeholder communication. Use when designing experiments, building predictive models, performing causal analysis, or driving data-driven decisions.
Python interface to OpenMS for mass spectrometry data analysis. Use for LC-MS/MS proteomics and metabolomics workflows including file handling (mzML, mzXML, mzTab, FASTA, pepXML, protXML, mzIdentML), signal processing, feature detection, peptide identification, and quantitative analysis. Apply when working with mass spectrometry data, analyzing proteomics experiments, or processing metabolomics datasets.
Parallel/distributed computing. Scale pandas/NumPy beyond memory, parallel DataFrames/Arrays, multi-file processing, task graphs, for larger-than-RAM datasets and parallel workflows.
Visualize training metrics, debug models with histograms, compare experiments, visualize model graphs, and profile performance with TensorBoard - Google's ML visualization toolkit
Work with Data Commons, a platform providing programmatic access to public statistical data from global sources. Use this skill when working with demographic data, economic indicators, health statistics, environmental data, or any public datasets available through Data Commons. Applicable for querying population statistics, GDP figures, unemployment rates, disease prevalence, geographic entity resolution, and exploring relationships between statistical entities.
Take posthog/omnibus-instrument-llm-analytics from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.