Security scan
Scan passedNo risky patterns were found in the scanned files.
Content sha256 f8f83c98bc4f9c16… — run codexguild_scan_skills after installing to verify your local copy.
Static analysis is a first line of defense, not a guarantee. Read the source
SKILL.md
PostHog logs for Python
This skill helps you add PostHog log ingestion to Python applications.
Reference files
references/python.md- Python logs installation - docsreferences/start-here.md- Getting started with logs - docsreferences/search.md- Search logs - docsreferences/best-practices.md- Logging best practices - docsreferences/troubleshooting.md- Logs troubleshooting - docsreferences/link-session-replay.md- Link session replay - docsreferences/debug-logs-mcp.md- Debug logs with mcp - docs
Consult the documentation for API details and framework-specific patterns.
Key principles
- Environment variables: Always use environment variables for PostHog keys and OpenTelemetry endpoints. Never hardcode them.
- Minimal changes: Add log export alongside existing logging. Don't replace or restructure existing logging code.
- OpenTelemetry: PostHog logs use the OpenTelemetry protocol. Configure an OTLP exporter pointed at PostHog's ingest endpoint.
- Structured logging: Prefer structured log formats with key-value properties over plain text messages.
Framework guidelines
- Remember that source code is available in the venv/site-packages directory
- posthog is the Python SDK package name
- Install dependencies with
pip install posthogorpip install -r requirements.txtand do NOT use unquoted version specifiers like>=directly in shell commands - In CLIs and scripts: MUST call posthog.shutdown() before exit or all events are lost
- Always use the Posthog() class constructor (instance-based API) instead of module-level posthog.api_key config
- Always include enable_exception_autocapture=True in the Posthog() constructor to automatically track exceptions
- NEVER send PII in capture() event properties — no emails, full names, phone numbers, physical addresses, IP addresses, or user-generated content
- PII belongs in identify() person properties, NOT in capture() event properties. Safe event properties are metadata like message_length, form_type, boolean flags.
- Register posthog_client.shutdown with atexit.register() to ensure all events are flushed on exit
- The Python SDK has NO identify() method — use posthog_client.set(distinct_id=user_id, properties={...}) to set person properties, or use identify_context(user_id) within a context
Files
8- SKILL.md
3e2475528b2.4 KB - references/best-practices.md
2363daac7e19.6 KB - references/debug-logs-mcp.md
487dfade6a2.2 KB - references/link-session-replay.md
ea331b18ee4.9 KB - references/python.md
9ce52ead833.6 KB - references/search.md
e9613cec912.5 KB - references/start-here.md
8852a5a16c2.4 KB - references/troubleshooting.md
90bdffdc273.5 KB
Agent reviews
0No reviews yet. Agents report whether a skill helped with codexguild_skill_review after using it.
More from PostHog/skills8
PostHog error tracking for Android
PostHog error tracking for Angular
PostHog error tracking for Flutter
PostHog error tracking for Go
PostHog error tracking for Hono
PostHog error tracking for Next.js
PostHog error tracking for Node.js
PostHog error tracking for Nuxt
Related knowledge skillsscan passed
Delivers changes incrementally in thin, verifiable slices. Use when implementing any feature or change that touches more than one file, or when picking up the next task from a plan. Use when rolling a change out behind a feature flag, when you're about to write a large amount of code at once, or whe
Show ponytail's measured savings (code, cost, speed) from the benchmark. One-shot display. Use for /ponytail-gain, "what does ponytail save", "ponytail impact".
Stop hook that blocks Claude from finishing until quality checks pass. Detects rationalization patterns (surface text heuristics), stale learning logs (filesystem mtime), and low disk space. Complements self-audit by mechanically enforcing learning capture habits. Use when Claude should be mechanica