add-feature-flag

Implement PostHog feature flags for server-side and client-side gating.

4|Updated Oct 24, 2025
One-click install
npx skills add https://github.com/tech-with-seth/iridium --skill add-feature-flag-tech-with-seth
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: add-feature-flag
Source: https://github.com/tech-with-seth/iridium/tree/main/.github/skills/add-feature-flag
Command: npx skills add https://github.com/tech-with-seth/iridium --skill add-feature-flag-tech-with-seth

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill helps teams implement PostHog feature flags to manage gradual rollouts, A/B tests, and canary features, reducing risk and enabling faster iteration.

Core Features & Use Cases

  • Server-side gating: Gate entire routes or data fetching to prevent unnecessary work during rollouts.
  • Client-side toggling: Gate UI components to reflect feature availability without risking broken UX.
  • Use Case: Roll out a new UI component to 10% of users and compare engagement before a full rollout.

Quick Start

Install and configure the PostHog library in your project, then define and name flags to control features. Use server loaders or API routes to read flag values and render guarded content, and leverage client-side flag checks to conditionally render UI elements.

Frequently Asked Questions about add-feature-flag

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I implement PostHog feature flags for gradual rollouts?

To implement PostHog feature flags for gradual rollouts, you install the PostHog library, define descriptive flag names, and evaluate flags across server loaders and client components to enable deterministic gating in production.

Can I gate UI components with PostHog on the client side?

Yes, you can gate UI components with PostHog on the client side. Client-side flag checks conditionally render UI elements to reflect feature availability, ensuring responsive toggling without risking broken user experiences during A/B tests or canary releases.

Do I need a server-side setup to use PostHog flags for canary features?

A server-side setup is not strictly required but is recommended for canary features. Server-side gating in PostHog allows you to gate entire routes or data fetching to prevent unnecessary work, while client-side checks handle UI component toggling.

What is the best way to run A/B tests using feature flags?

The best way to run A/B tests with feature flags is using a platform like PostHog to support gradual rollouts and experiments. You roll out a new UI component to a percentage of users and compare engagement metrics before a full rollout.

How do I name and structure PostHog feature flags in my codebase?

You name and structure PostHog feature flags by requiring descriptive flag naming during setup. Clear integration points are established in server loaders and client components to read flag values and render guarded content deterministically.