diff --git a/skills/instrument-error-tracking/SKILL.md b/skills/instrument-error-tracking/SKILL.md index f942b4d..0c05821 100644 --- a/skills/instrument-error-tracking/SKILL.md +++ b/skills/instrument-error-tracking/SKILL.md @@ -47,7 +47,10 @@ STEP 6: Upload source maps (frontend/mobile only). - Follow the platform-specific reference for upload configuration (build plugins, CI scripts, etc.). STEP 7: Set up environment variables. - - If an env-file-tools MCP server is connected, use check_env_keys to see which keys already exist, then use set_env_values to create or update the PostHog API key and host. + - Check if the project already has PostHog environment variables configured (e.g. in `.env`, `.env.local`, or framework-specific env files). If valid values already exist, skip this step. + - If the PostHog API key is missing, use the PostHog MCP server's `projects-get` tool to retrieve the project's `api_token`. If multiple projects are returned, ask the user which project to use. If the MCP server is not connected or not authenticated, ask the user for their PostHog project API key instead. + - For the PostHog host URL, use `https://us.i.posthog.com` for US Cloud or `https://eu.i.posthog.com` for EU Cloud. + - Write these values to the appropriate env file using the framework's naming convention. - Reference these environment variables in code instead of hardcoding them. STEP 8: Verify and clean up. diff --git a/skills/instrument-feature-flags/SKILL.md b/skills/instrument-feature-flags/SKILL.md index e47ac3d..2702b57 100644 --- a/skills/instrument-feature-flags/SKILL.md +++ b/skills/instrument-feature-flags/SKILL.md @@ -42,7 +42,10 @@ STEP 5: Instrument the feature. - You must read a file immediately before attempting to write it. STEP 6: Set up environment variables. - - If an env-file-tools MCP server is connected, use check_env_keys to see which keys already exist, then use set_env_values to create or update the PostHog API key and host. + - Check if the project already has PostHog environment variables configured (e.g. in `.env`, `.env.local`, or framework-specific env files). If valid values already exist, skip this step. + - If the PostHog API key is missing, use the PostHog MCP server's `projects-get` tool to retrieve the project's `api_token`. If multiple projects are returned, ask the user which project to use. If the MCP server is not connected or not authenticated, ask the user for their PostHog project API key instead. + - For the PostHog host URL, use `https://us.i.posthog.com` for US Cloud or `https://eu.i.posthog.com` for EU Cloud. + - Write these values to the appropriate env file using the framework's naming convention. - Reference these environment variables in code instead of hardcoding them. ## Reference files diff --git a/skills/instrument-integration/SKILL.md b/skills/instrument-integration/SKILL.md index 474e619..ce9c04c 100644 --- a/skills/instrument-integration/SKILL.md +++ b/skills/instrument-integration/SKILL.md @@ -40,7 +40,10 @@ STEP 5: Identify users. - If both frontend and backend exist, pass the client-side session and distinct ID using `X-POSTHOG-DISTINCT-ID` and `X-POSTHOG-SESSION-ID` headers to the server-side code. STEP 6: Set up environment variables. - - Store the PostHog API key and host in environment variables (e.g. `.env` or framework-specific env files). + - Check if the project already has PostHog environment variables configured (e.g. in `.env`, `.env.local`, or framework-specific env files). If valid values already exist, skip this step. + - If the PostHog API key is missing, use the PostHog MCP server's `projects-get` tool to retrieve the project's `api_token`. If multiple projects are returned, ask the user which project to use. If the MCP server is not connected or not authenticated, ask the user for their PostHog project API key instead. + - For the PostHog host URL, use `https://us.i.posthog.com` for US Cloud or `https://eu.i.posthog.com` for EU Cloud. + - Write these values to the appropriate env file (e.g. `.env.local` for Next.js, `.env` for others) using the framework's naming convention. - Reference these environment variables in code instead of hardcoding them. STEP 7: Verify and clean up. diff --git a/skills/instrument-llm-analytics/SKILL.md b/skills/instrument-llm-analytics/SKILL.md index 8e362fa..4b92755 100644 --- a/skills/instrument-llm-analytics/SKILL.md +++ b/skills/instrument-llm-analytics/SKILL.md @@ -47,7 +47,10 @@ STEP 5: Link to users. - Associate LLM generations with identified users via distinct IDs when possible. STEP 6: Set up environment variables. - - If an env-file-tools MCP server is connected, use check_env_keys then set_env_values to configure the PostHog API key and host. + - Check if the project already has PostHog environment variables configured (e.g. in `.env`, `.env.local`, or framework-specific env files). If valid values already exist, skip this step. + - If the PostHog API key is missing, use the PostHog MCP server's `projects-get` tool to retrieve the project's `api_token`. If multiple projects are returned, ask the user which project to use. If the MCP server is not connected or not authenticated, ask the user for their PostHog project API key instead. + - For the PostHog host URL, use `https://us.i.posthog.com` for US Cloud or `https://eu.i.posthog.com` for EU Cloud. + - Write these values to the appropriate env file using the framework's naming convention. - Reference these environment variables in code instead of hardcoding them. ## Reference files diff --git a/skills/instrument-logs/SKILL.md b/skills/instrument-logs/SKILL.md index 288a211..78e2570 100644 --- a/skills/instrument-logs/SKILL.md +++ b/skills/instrument-logs/SKILL.md @@ -48,7 +48,11 @@ STEP 6: Add structured properties. - Prefer structured log formats with key-value properties over plain text messages. STEP 7: Set up environment variables. - - If an env-file-tools MCP server is connected, use check_env_keys then set_env_values to configure the PostHog API key, host, and OpenTelemetry endpoint. + - Check if the project already has PostHog environment variables configured (e.g. in `.env`, `.env.local`, or framework-specific env files). If valid values already exist, skip this step. + - If the PostHog API key is missing, use the PostHog MCP server's `projects-get` tool to retrieve the project's `api_token`. If multiple projects are returned, ask the user which project to use. If the MCP server is not connected or not authenticated, ask the user for their PostHog project API key instead. + - For the PostHog host URL, use `https://us.i.posthog.com` for US Cloud or `https://eu.i.posthog.com` for EU Cloud. + - For the OpenTelemetry endpoint, use `https://us.i.posthog.com/v1` (US) or `https://eu.i.posthog.com/v1` (EU). + - Write these values to the appropriate env file using the framework's naming convention. - Reference these environment variables in code instead of hardcoding them. ## Reference files diff --git a/skills/instrument-product-analytics/SKILL.md b/skills/instrument-product-analytics/SKILL.md index 8045a6c..51219c7 100644 --- a/skills/instrument-product-analytics/SKILL.md +++ b/skills/instrument-product-analytics/SKILL.md @@ -55,7 +55,10 @@ STEP 8: Add error tracking. - Add PostHog exception capture error tracking to relevant files, particularly around critical user flows and API boundaries. STEP 9: Set up environment variables. - - If an env-file-tools MCP server is connected, use check_env_keys to see which keys already exist, then use set_env_values to create or update the PostHog API key and host. + - Check if the project already has PostHog environment variables configured (e.g. in `.env`, `.env.local`, or framework-specific env files). If valid values already exist, skip this step. + - If the PostHog API key is missing, use the PostHog MCP server's `projects-get` tool to retrieve the project's `api_token`. If multiple projects are returned, ask the user which project to use. If the MCP server is not connected or not authenticated, ask the user for their PostHog project API key instead. + - For the PostHog host URL, use `https://us.i.posthog.com` for US Cloud or `https://eu.i.posthog.com` for EU Cloud. + - Write these values to the appropriate env file using the framework's naming convention. - Reference these environment variables in code instead of hardcoding them. STEP 10: Verify and clean up.