Skip to main content
Run this skill to migrate from Statsig to Confidence:
npx skills add spotify/confidence-ai-plugins --skill migrate-statsig
The installer works with Claude Code, Cursor, Codex, Gemini CLI, and other AI assistants, and asks which one to install to. You can also install the full Confidence plugin with your assistant’s own plugin manager. The kit moves your feature gates, dynamic configs, and experiments to Confidence, then rewrites your application code from the Statsig SDK to the Confidence SDK. See the migrations overview for how migration kits work.

Before You Begin

To run this migration kit, you need:
  • The Confidence plugin installed in your AI assistant
  • A Statsig Console API key (starts with console-) with read access to gates, dynamic configs, and experiments, stored in the STATSIG_API_KEY environment variable. You can create one under Project Settings > API Keys in the Statsig console.
  • The Confidence Flags MCP server, authenticated with your account
  • The Confidence Documentation MCP server, used during code transformation
  • Optional: a Confidence REST API token stored in the CONFIDENCE_TOKEN environment variable, required for partial experiment allocation, reusable segments, layer mutual exclusion, and holdouts

Run the Migration

Invoke the kit with the /confidence:migrate-statsig command in your AI assistant.
1

Plan the flag migration

Run /confidence:migrate-statsig plan flag. The kit scans your Statsig gates, dynamic configs, and experiments and writes a migration plan file.
2

Review the plan

The plan lists every flag with its targeting rules and rollout percentages, and marks anything that can’t migrate automatically. Plan files are resumable, so you can pause and continue later.
3

Execute the flag migration

Run /confidence:migrate-statsig execute <plan-file>. The kit recreates your gates, configs, and experiments in Confidence with matching rules and variant splits.
4

Plan and execute the code migration

Run /confidence:migrate-statsig plan code, review the plan, then execute it. The kit rewrites your Statsig SDK call sites to OpenFeature with the Confidence SDK, creating one pull request per flag.

What Gets Migrated

StatsigConfidence
Feature gateBoolean flag with enabled/disabled variants
Dynamic configStruct flag where each rule’s return value becomes a variant
ExperimentStruct flag where each group becomes a variant with its percentage split
SegmentSegment, or conditions copied into targeting rules
LayerMutual-exclusion group (requires the REST API token)
Rollout percentageRollout percentage on the targeting rule

Known Limitations

The kit flags these Statsig features for manual review because Confidence doesn’t support them:
  • Substring conditions (str_contains_any, str_contains_none) and general regular expression matching
  • Conditions that depend on another experiment’s assignment (experiment_group)
  • Custom JavaScript conditions
  • Custom event logging (logEvent)—Confidence doesn’t expose a matching API
  • Large ID list segments and analysis-only segments without the REST backend

Analyze Historical Experiments

The migration kit moves your flags and code, not your historical experiment results. To re-analyze experiments that ran on Statsig, import their assignment data into your data warehouse and follow the Analyze a Past Experiment quickstart.

Migrations Overview

How migration kits work and how to install the plugin

Use AI with Confidence

Set up the Confidence MCP servers for your AI assistant

Analyze a Past Experiment

Re-analyze experiments that ran on another platform

SDK Integration

Integrate Confidence SDKs into your application