Adds feature flag support using LaunchDarkly or JSON-based configuration to toggle features in UI components and Server Actions. This skill should be used when implementing feature flags, feature toggles, progressive rollouts, A/B testing, or gating functionality behind configuration. Use for feature flags, feature toggles, LaunchDarkly integration, progressive rollout, canary releases, or conditional features.
View on GitHubhopeoverture/worldbuilding-app-skills
feature-flag-manager
plugins/feature-flag-manager/skills/feature-flag-manager/SKILL.md
January 21, 2026
Select agents to install to:
npx add-skill https://github.com/hopeoverture/worldbuilding-app-skills/blob/main/plugins/feature-flag-manager/skills/feature-flag-manager/SKILL.md -a claude-code --skill feature-flag-managerInstallation paths:
.claude/skills/feature-flag-manager/# Feature Flag Manager
Implement comprehensive feature flag management for controlled feature rollouts and A/B testing in worldbuilding applications.
## Overview
To add feature flag capabilities:
1. Choose between LaunchDarkly (cloud service) or JSON-based (local) implementation
2. Set up feature flag provider with configuration
3. Create feature flag components and hooks
4. Gate UI components and Server Actions behind flags
5. Implement user targeting and progressive rollouts
## Implementation Options
### LaunchDarkly Integration
To integrate LaunchDarkly:
1. Install LaunchDarkly SDK: `npm install launchdarkly-react-client-sdk`
2. Configure provider in app root with client-side ID
3. Create hooks for flag evaluation
4. Wrap components with feature flag checks
5. Configure flags in LaunchDarkly dashboard
Use `scripts/setup_launchdarkly.py` to scaffold LaunchDarkly configuration.
### JSON-Based Feature Flags
To implement local JSON-based flags:
1. Create `config/feature-flags.json` with flag definitions
2. Build feature flag provider context
3. Create hooks to read flags from context
4. Implement environment-specific overrides
5. Support runtime flag updates
Use `scripts/setup_json_flags.py` to generate JSON flag structure.
Consult `references/feature-flag-patterns.md` for implementation patterns and best practices.
## Feature Flag Provider Setup
### LaunchDarkly Provider
To set up LaunchDarkly in Next.js:
```typescript
// app/providers.tsx
import { LDProvider } from 'launchdarkly-react-client-sdk';
export function Providers({ children }: { children: React.ReactNode }) {
return (
<LDProvider
clientSideID={process.env.NEXT_PUBLIC_LD_CLIENT_ID}
user={{
key: 'user-id',
email: 'user@example.com',
}}
>
{children}
</LDProvider>
);
}
```
### JSON Provider
To create custom JSON provider:
```typescript
// lib/feature-flags/provider.tsx
import { createContext, useContext } from 'react';
import flags