AI Tools
Flagify ships with first-class integrations for the AI coding tools you already use. Manage feature flags, create targeting rules, and toggle environments without leaving your AI workflow.
Supported tools
| Tool | Integration type | What you get |
|---|---|---|
| Claude Code | Slash commands & skills | /flagify-toggle, /flagify-create, /flagify-list |
| Cursor | .cursorrules | Context-aware flag patterns, SDK autocomplete |
| GitHub Copilot | .github/copilot-instructions.md | Guided completions for flag checks |
| Windsurf | .windsurfrules | Flagify-aware coding patterns |
Quick setup
Every integration follows the same pattern: drop a config file in your repo, and the AI tool picks it up automatically.
# Install the Flagify CLI
npm install -g @flagify/cli
# Generate AI tool configs for your project
npx flagify ai-setup
This creates the appropriate config files based on the AI tools detected in your environment.
Claude Code
Slash commands
Add custom slash commands to your .claude/commands/ directory:
Create a flag:
<!-- .claude/commands/flagify-create.md -->
Create a new feature flag called "$FLAG_NAME" with type
"$FLAG_TYPE" (boolean, string, number, json).
Use the Flagify CLI:
flagify flags create $FLAG_NAME --type $FLAG_TYPE --description "$DESCRIPTION"
Toggle a flag:
<!-- .claude/commands/flagify-toggle.md -->
Toggle the flag "$FLAG_NAME" in the "$ENVIRONMENT" environment.
Use the Flagify CLI:
flagify flags toggle $FLAG_NAME --environment $ENVIRONMENT
List all flags:
<!-- .claude/commands/flagify-list.md -->
List all feature flags in the current project.
Use the Flagify CLI:
flagify flags list
CLAUDE.md context
Add Flagify context to your CLAUDE.md so the agent understands your flag setup:
<!-- CLAUDE.md -->
## Feature Flags
This project uses Flagify for feature flag management.
- SDK: `@flagify/node` (server) and `@flagify/react` (client)
- CLI: `flagify flags list`, `flagify flags create <key>`, `flagify flags toggle <key>`
- Environments: development, staging, production
- Flag evaluation is local (cached) with streaming sync
- Use `isEnabled()` for boolean flags, `getValue()` for typed values
- Flag names use kebab-case: `new-checkout-flow`
Cursor
.cursorrules
Create a .cursorrules file in your project root:
# Flagify Feature Flags
This project uses Flagify (@flagify/node, @flagify/react) for feature management.
## SDK Patterns
When creating flag checks:
- Import from '@flagify/node' for server code, '@flagify/react' for client
- Use isEnabled() for boolean flags
- Use getValue<T>() for typed values (string, number, JSON)
- In React, use useFlag(), useVariant(), useFlagValue() hooks
## Code Patterns
Server-side flag evaluation:
const isEnabled = flagify.isEnabled('flag-name');
React component with flag:
import { useFlag } from '@flagify/react';
const showFeature = useFlag('flag-name');
## Rules
- Never hardcode flag values — always evaluate dynamically
- Flag names use kebab-case: 'new-checkout-flow'
- Group related flags with a shared prefix: 'checkout-*'
- Always handle both flag states (enabled and disabled)
GitHub Copilot
copilot-instructions.md
Create .github/copilot-instructions.md:
# Flagify Feature Flags
This project uses the Flagify SDK for feature flag management.
## When writing code that involves feature flags:
1. Import from @flagify/node (server) or @flagify/react (client)
2. Use isEnabled(flagKey) for boolean flags
3. Use getValue<T>(flagKey) for typed values
4. In React: useFlag(), useVariant(), useFlagValue() hooks
5. Always handle both enabled and disabled states
6. Flag names are kebab-case: 'feature-name'
## Environments: development, staging, production
Prompt files
For more complex workflows, use .github/copilot/ prompt files:
<!-- .github/copilot/create-flag-check.md -->
Create a feature flag check for the given feature.
Use the Flagify SDK with proper error handling.
Include both the enabled and disabled code paths.
Use the existing flagify client from 'src/lib/flagify'.
Windsurf
.windsurfrules
Create a .windsurfrules file in your project root:
# Flagify Feature Flags
Project uses Flagify for feature management.
SDK: @flagify/node (server), @flagify/react (client)
## Patterns
- Boolean flags: flagify.isEnabled('flag-name')
- Typed values: flagify.getValue<string>('flag-name')
- React: const enabled = useFlag('flag-name')
## Conventions
- Flag names: kebab-case ('new-feature')
- Always handle both states
- To check current flags: flagify flags list
Best practices
Flag naming in AI contexts
Use descriptive, kebab-case names that help the AI understand intent:
// Good — AI understands the purpose
'new-checkout-flow'
'premium-dashboard-v2'
'enable-dark-mode'
// Avoid — ambiguous for AI
'flag1'
'test'
'temp'
Context files
Keep a FLAGIFY.md or include flag documentation in your README.md so AI tools understand your flag setup:
## Active flags
| Flag | Type | Purpose | Owner |
|------|------|---------|-------|
| `new-checkout-flow` | boolean | Checkout redesign rollout | @team-payments |
| `pricing-page-v2` | string | A/B test pricing layout | @team-growth |
Generating setup automatically
The Flagify CLI can scaffold all AI tool configs at once:
# Generate all configs
npx flagify ai-setup
# Generate for a specific tool
npx flagify ai-setup --tool claude
# Include a snapshot of current flags (AI tools always get a
# "run flagify flags list" instruction for live data too)
npx flagify ai-setup --include-flags