Loading...
Loading...
Run /check-posthog, then fix the highest priority PostHog integration issues. Focuses on one issue at a time for safe, incremental fixes. Invoke for: PostHog not working, events not sending, analytics broken.
npx skill4agent add phrazzld/claude-config fix-posthog/check-posthog/check-posthoginitPostHog()codex exec --full-auto "Add PostHog initialization. \
Create lib/analytics/posthog.ts with initPostHog(). \
Create PostHogProvider component. \
Add to app/layout.tsx. \
Reference: ~/.claude/skills/posthog/references/sdk-patterns.md. \
Verify: pnpm typecheck" \
--output-last-message /tmp/codex-fix.md 2>/dev/nullNEXT_PUBLIC_POSTHOG_KEY# Get key from PostHog dashboard
# Add to .env.local
echo "NEXT_PUBLIC_POSTHOG_KEY=phc_xxx" >> .env.local
# Add to Vercel production
printf '%s' 'phc_xxx' | vercel env add NEXT_PUBLIC_POSTHOG_KEY productioncodex exec --full-auto "Add PostHog reverse proxy to next.config. \
Add rewrites for /ingest/* to us.i.posthog.com/*. \
Add rewrites for /ingest/static/* to us-assets.i.posthog.com/static/*. \
Update posthog.init to use api_host: '/ingest'. \
Reference: ~/.claude/skills/posthog/references/sdk-patterns.md section 4. \
Verify: pnpm build" \
--output-last-message /tmp/codex-fix.md 2>/dev/nullmask_all_textmaskAllInputscodex exec --full-auto "Add privacy settings to PostHog init. \
Add mask_all_text: true. \
Add session_recording.maskAllInputs: true. \
Add person_profiles: 'identified_only'. \
Reference: ~/.claude/skills/posthog/references/privacy-checklist.md. \
Verify: pnpm typecheck" \
--output-last-message /tmp/codex-fix.md 2>/dev/nullposthog.identify()codex exec --full-auto "Remove PII from posthog.identify calls. \
Only pass user ID, no email/name/phone properties. \
Search: grep -rE 'posthog.identify.*email|identify.*name' --include='*.ts' --include='*.tsx'. \
Verify: pnpm typecheck && grep -rE 'posthog.identify.*email' returns no results" \
--output-last-message /tmp/codex-fix.md 2>/dev/nullcodex exec --full-auto "Add typed event schema to PostHog analytics. \
Create StandardEvent type with: user_signed_up, user_activated, subscription_started, subscription_cancelled, feature_used. \
Add trackEvent function that enforces type. \
Reference: ~/.claude/skills/posthog/references/sdk-patterns.md section 1. \
Verify: pnpm typecheck" \
--output-last-message /tmp/codex-fix.md 2>/dev/null# Check events are flowing
mcp__posthog__query-run with TrendsQuery for last 1h
# Check for errors
mcp__posthog__list-errorsingestposthog/check-posthog/log-posthog-issues/posthog