feature-flags-ruby

PostHog Feature Flags für Ruby-Anwendungen

npx skills add https://github.com/posthog/skills --skill feature-flags-ruby

PostHog feature flags for Ruby

This skill helps you add PostHog feature flags to Ruby applications.

Reference files

  • references/ruby.md - Ruby feature flags installation - docs
  • references/adding-feature-flag-code.md - Adding feature flag code - docs
  • references/best-practices.md - Feature flag best practices - docs

Consult the documentation for API details and framework-specific patterns.

Key principles

  • Environment variables: Always use environment variables for PostHog keys. Never hardcode them.
  • Minimal changes: Add feature flag code alongside existing logic. Don't replace or restructure existing code.
  • Boolean flags first: Default to boolean flag checks unless the user specifically asks for multivariate flags.
  • Server-side when possible: Prefer server-side flag evaluation to avoid UI flicker.

PostHog MCP tools

Check if a PostHog MCP server is connected. If available, look for tools related to feature flag management (creating, listing, updating, deleting flags). Use these tools to manage flags directly in PostHog rather than requiring the user to do it manually in the dashboard.

Framework guidelines

  • posthog-ruby is the Ruby SDK gem name (add gem 'posthog-ruby' to Gemfile) but require it with require 'posthog' (NOT require 'posthog-ruby')
  • Use PostHog::Client.new(api_key: key, host: host) for instance-based initialization in scripts and CLIs
  • In CLIs and scripts: MUST call client.shutdown before exit or all events are lost
  • Use begin/rescue/ensure with shutdown in the ensure block for proper cleanup
  • capture and identify take a single hash argument: client.capture(distinct_id: 'user_123', event: 'my_event', properties: { key: 'value' })
  • capture_exception takes POSITIONAL args (not keyword): client.capture_exception(exception, distinct_id, additional_properties) — do NOT use distinct_id: keyword syntax

Mehr Skills von posthog

error-tracking-hono
posthog
PostHog Fehlerverfolgung für Hono
tuning-incremental-sync-config
posthog
Die Konfiguration einer Synchronisation befindet sich auf dem ExternalDataSchema und kann jederzeit über external-data-schemas-partial-update geändert werden. Die meisten Änderungen sind nicht destruktiv (wirken sich auf die nächste Synchronisation aus), aber einige (Wechsel des sync_type, Änderung von Primärschlüsseln) erfordern eine sorgfältige Handhabung, um eine Beschädigung der synchronisierten Daten zu vermeiden.
playwright-test
posthog
Schreibe einen Playwright-Test, stelle sicher, dass er läuft und nicht flaky ist.
error-tracking-ruby
posthog
PostHog Fehlerverfolgung für Ruby
authoring-log-alerts
posthog
Erstelle nützliche, rauscharme Log-Benachrichtigungen für Dienste in einem PostHog-Projekt. Verwende dies, wenn der Benutzer darum bittet, Benachrichtigungen für seine Logs einzurichten, oder wenn du Benachrichtigungen vorschlagen sollst, die er hinzufügen sollte,…
making-scenes-tab-aware
posthog
Guides converting PostHog frontend scenes to be tab aware for internal scene tabs. Use when adding or refactoring a `SceneExport` scene, fixing state leaking…
posthog-survey-creator
posthog
Erstellen und konfigurieren Sie Umfragen in PostHog durch geführte Konversation. Verwenden Sie diese Fähigkeit, wenn ein Benutzer eine Umfrage erstellen, Benutzerfeedback sammeln, durchführen…
authoring-scouts
posthog
Wie man PostHog Signals Scouts erstellt, bearbeitet und anpasst – die geplanten Agenten, die ein Projekt scannen und Berichte in den Signals-Posteingang schreiben. Verwenden Sie, wenn ein Benutzer…