Yorby Logging
Packages PostHog's official logging best-practices guide into a skill so Claude implements consistent, high-quality logging without the developer needing deep logging expertise.
Before & after
Same prompt, same agent — the only difference is the skill.
You'll want to log important events in your payment flow. Standard practice is to log when things start, finish, and if errors occur. You might log to console or a file, and later stream to a logging service. There are different approaches to how detailed you want to be. It's worth thinking about what's useful to search for later when debugging.
POSTHOG STRUCTURED LOGGING FOR PAYMENTS
LOGGING PATTERN (PostHog event naming convention):
1. PAYMENT INITIATED
Event name: payment_method_selected
Properties:
• payment_method: string (card, bank_transfer, wallet)
• amount_cents: number
• currency: string (ISO 4217)
• user_id: string (hashed if PII)
• session_id: string (correlation ID across flow)
• timestamp: ISO 8601
• metadata: {billing_address_same_as_shipping: boolean}
2. PAYMENT PROCESSING
Event name: payment_processing_started
Properties:
• processor_id: string (Stripe ID)
• processor_response_code: string
• authorization_method: string (3DS, tokenized, etc)
• risk_score: number (0-100, if available)
• timestamp: ISO 8601
3. PAYMENT COMPLETED
Event name: payment_completed
Properties:
• transaction_id: string
• amount_cents: number
• fee_cents: number
• net_cents: number (amount - fee)
• status: string (captured, processing, requires_action)
• time_to_completion_ms: number
• timestamp: ISO 8601
4. PAYMENT FAILED
Event name: payment_failed
Properties:
• failure_reason: string (insufficient_funds, expired_card, rate_limit, etc)
• error_code: string (from processor)
• user_facing_message: string (customer-safe error text)
• retry_eligible: boolean
• retry_count: number
• timestamp: ISO 8601
IMMEDIATE SEARCHES:
• Debug: Trace single transaction via session_id
• Report: Revenue by processor in date range
• Alert: Failed payments >50 per hour
• Cohort: Users with 3+ payment failures
NOTE: Do not log full card numbers, expiry, or CVV. Do not log bank account numbers.About this skill
name: yorby-logging description: Use when Packages PostHog's official logging best-practices guide into a skill so Claude implements consistent, high-quality logging without the developer needing deep logging expertise.
Yorby Logging
Built by copying PostHog's official logging best-practices guide directly into a skill definition. The creator, who describes himself as more of a product engineer than a logging expert, uses this so that any time the app needs new logs, Claude references the codified guide instead of inventing ad hoc logging patterns. A pattern he also notes mirrors Supabase's own official Postgres best-practices skill set.
What you get
- Consistent logging implementation across the codebase, sourced from an official PostHog best-practices guide, no need for the developer to be a logging expert, reusable across every new feature.
Customize your output
- Swap in the best-practices guide from your own observability provider (Sentry, Datadog, etc.) instead of PostHog.
Example output
New feature added — Claude automatically applied PostHog-recommended structured logging with proper event naming and context, matching the rest of the codebase.
Best for
Product-focused developers who want expert-level logging practices without personally researching or being opinionated about logging architecture.
SKILL.md preview
---
name: yorby-logging
description: Use this skill when an application needs consistent, high-quality logging added and the developer doesn't want to invent ad hoc patterns each time.
version: 1.0.0
category: Development / Observability
author: AgentVolt
license: proprietary
tags:
- development
- observability
- standard
---
# Yorby Logging
Applies a codified set of logging best practices so every new log statement follows the same structure, severity convention, and redaction rules instead of being invented fresh each time.
## When to use
… (sign up to view the full skill)