feature-flag-manager

Create boolean PostHog feature flags and gate Next.js website routes behind them.

Updated May 11, 2026
One-click install
npx skills add https://github.com/mmnavarr/harness --skill feature-flag-manager-mmnavarr
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: feature-flag-manager
Source: https://github.com/mmnavarr/harness/tree/main/skills/feature-flag-manager
Command: npx skills add https://github.com/mmnavarr/harness --skill feature-flag-manager-mmnavarr

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Shipping unfinished features safely requires hiding code behind remotely controlled switches, but manually wiring PostHog flags, rollout percentages, and server-side gating is error-prone and easy to misconfigure. ## Core Features & Use Cases - Flag Creation: Create boolean PostHog feature flags via the PostHog MCP or REST API with safe defaults (active but 0% rollout) so code ships hidden. - Code Gating: Apply flags in a Next.js App Router website using a server-side layout gate with isBooleanFlagEnabled(), avoiding the boolean-vs-variant misread pitfall. - Rollout & Rollback: Raise or lower rollout_percentage in PostHog to release or retract a feature without touching code. - Use Case: You are building a new /launches page. Use this Skill to create the launches flag at 0% rollout, gate the route segment with a layout.tsx, and preview it locally with EXPERIMENT_launches=true before rolling out to users. ## Quick Start Create a PostHog boolean feature flag named launches and gate the /launches route in the website app behind it.

Frequently Asked Questions about feature-flag-manager

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

FAQPage Schema
How do I create a PostHog feature flag with zero percent rollout?▼

Create the flag with active set to true and a single filter group with rollout_percentage of 0, so the code can ship hidden. Use the PostHog MCP feature-flag domain or POST to /api/projects/33209/feature_flags/ with the key, name, and filters payload.

How do I gate a Next.js route behind a PostHog feature flag?▼

Add a layout.tsx at the route segment that calls getBootstrapData() and checks isBooleanFlagEnabled(featureFlags, 'your_key'), calling notFound() when disabled. One layout gates the page and all nested routes.

Should I use a boolean flag or an experiment variant flag in PostHog?▼

Use a boolean flag for simple on/off feature gating with this skill. Use the experiment-manager skill for A/B tests with control/test variants, which require experiment APIs, Prismic, and exposure setup.

Why does my boolean flag return control instead of true?▼

The shouldShowForExperiment() helper maps any value outside its variant table back to control, misreading boolean true. Use isBooleanFlagEnabled() from lib/experiments/server.ts, which accepts both true and the string 'true'.

How do I test a feature flag locally without changing PostHog?▼

Set an EXPERIMENT_<flag_key>=true environment variable when starting the dev server, for example EXPERIMENT_launches=true. USE_MOCKING defaults to true outside production, so the override arrives as the string 'true' and is ignored in production.

What are the limitations of this feature flag workflow?▼

Only the Next.js website app is covered; webapp and admin gating patterns using the tRPC/session stack are not yet documented. Client-side gating via usePostHog().getFeatureFlag() is also not yet covered.