configdirector-migrate-from-launchdarkly
Move a LaunchDarkly project's feature flags to ConfigDirector by following the migration guide, recreating its segments and flags as ConfigDirector segments and configs with the targeting rules of each environment, through the ConfigDirector MCP server or CLI, from flag data the user exports in their own terminal, then switching one application's SDK calls over and checking them with configdirector validate. Use when the user asks to move or migrate from LaunchDarkly, to recreate or import their LaunchDarkly flags, or to replace the LaunchDarkly SDK in an application.
Skill body
Migrate from LaunchDarkly
Work through the stages in order, each with the steps of its reference file. The result of stage 1 is the segments and flags of one LaunchDarkly project recreated in one ConfigDirector project, with the targeting rules of each environment; the result of stage 2 is one application reading them through a ConfigDirector SDK instead of the LaunchDarkly SDK. Run both, or the one the user asks for; a later run continues where the last one stopped, since stage 1 skips every segment and config key the project already has, and stage 2 starts from the LaunchDarkly reads still in the code.
- Stage 1, recreate the flags: references/recreate-flags.md.
- Stage 2, switch one application: references/switch-an-application.md.
Confirm with the user before every write to their ConfigDirector account and before editing any code. This skill changes nothing in LaunchDarkly, archives nothing there, and reads LaunchDarkly only through files the user exports, never through a LaunchDarkly token, SDK or MCP server. A segment or config key the ConfigDirector project already has is never changed.
Stage 1 needs an API token with these permissions, as the ConfigDirector dashboard names them under API tokens: Projects: Read, Environments: Read, Configs: Read, Configs: Create, Configs: Update targeting rules, Segments: Read, Segments: Create. Flags with tags also need Tags: Read. Stage 2 needs the same Projects: Read and Configs: Read for configdirector validate.
Fetch the migration guide
At the start of every run, fetch https://docs.configdirector.com/migration-guides/launchdarkly and keep it open. Its tables are the mapping this skill follows: how projects, environments, flags, variations, lifetimes, keys, SDK availability and tags map; how a fallthrough, the on and off switch, individual targets, rules, operators, rollouts, segments and prerequisites map, and what has no equivalent; how a context, its kind, key, name, custom attributes and anonymous flag map; which ConfigDirector SDK replaces which LaunchDarkly SDK; and what to check once an application has switched. Never map a flag, a rule or an SDK call from memory: take every mapping from the guide as it reads on that day, and every condition and operator from the targeting rules reference, which stage 1 reads before composing any rule.
Reach the account and check the permissions
Use the ConfigDirector MCP tools when the ConfigDirector MCP server is connected, and the configdirector CLI otherwise; never both in one run, except configdirector validate in stage 2, which exists only on the CLI. With the CLI, always pass --json and read the output, never the human text. Each step names the MCP tool first and the CLI command second.
List the projects: list_projects / configdirector projects list --json. When the current repository has configdirector.json, the project is the one whose slug is its project, and every CLI command, projects list included, runs from the directory that holds the file. Otherwise it is the only project listed, or the one the user picks when there are several: ask which project the flags go to. Then pass --project <slug> to every CLI command below.
Then read the token’s permissions, before proposing anything. On MCP, they are the ConfigDirector tools you can see by name, loaded or not, since the server offers only the tools the token allows; on the CLI, configdirector api-token get --json lists them in short form in permissions. The table gives each permission in the dashboard’s wording, its short form and the MCP tool that needs it:
| Permission | Short form | MCP tool |
|---|---|---|
Projects: Read |
projects:read |
list_projects |
Environments: Read |
environments:read |
list_environments |
Configs: Read |
configs:read |
list_configs |
Configs: Create |
configs:create |
create_config |
Configs: Update targeting rules |
config-targeting-rules:update |
update_targeting_rules |
Segments: Read |
segments:read |
list_segments |
Segments: Create |
segments:create |
create_segment |
Tags: Read |
tags:read |
find_tag_by_name |
When Projects: Read or Configs: Read is missing, stop and ask before proposing anything, and for stage 1 also when Environments: Read, Configs: Create, Configs: Update targeting rules or Segments: Read is missing. When Segments: Create is missing, tell the user that flags whose rules use a segment need it, and go on; once stage 1 finds such a flag, stop and ask before composing its segments. When Tags: Read is missing, tell the user that flags with tags need it, and go on; once a chosen flag has tags, stop and ask before showing its batch.
When a step fails, tell the user why. The CLI sign-ins case runs the command again; every other case means nothing can be created or changed, so stop and ask, with the case’s fix as the first choice:
- No route answers: no ConfigDirector tool is available, and
configdirectoris not installed, orprojects listexits 2 withNo API token foundorNo CLI sign-in is for the organization, or withThe Admin API refused the requestand a code other thanINSUFFICIENT_PERMISSIONS, such asAPI_TOKEN_EXPIRED. Send the user toconfigdirector-connectfor a token with the permissions above. - Exit 2 with
unknown command: the installed CLI is older than the commands this skill uses. Tell the user to install@configdirector/cliagain, which updates it, as the Install section of https://docs.configdirector.com/integrations/cli shows. - Exit 2 with
There are CLI sign-ins for: the CLI is signed in to several organizations, and nothing names this repository’s. Ask the user which organization, offering the names the message lists. When the directory holds aconfigdirector.json, it has noorganizationyet: runconfigdirector init --organization <name>from that directory, which adds it, and tell the user the file changed and belongs in their next commit. When it holds none, pass--organization <name>to every later CLI command. Then run the command again. - The token belongs to another organization than the one
configdirector.jsonnames: the projectslist_projectsorprojects listreturns carry anotherorganizationIdthan itsorganization, or a CLI command exits 2 withThe token fromandbelongs to the organization. Tell the user so, and where the token came from: the MCP server’s configuration, the source the CLI’s message names, or elseCONFIGDIRECTOR_TOKENorCONFIGDIRECTOR_ORGANIZATIONset where you run commands, which the CLI uses ahead of the repository’s organization. Send them toconfigdirector-connect. - A permission is missing: on MCP, a tool of the table that you cannot see, or a tool error naming the permission; on the CLI, one the table lists that
permissionslacks, or exit 2 withThe Admin API refused the requestand the codeINSUFFICIENT_PERMISSIONS. A refusal names the permission in its short form. Tell the user which one in the dashboard’s wording, from the table, and that they can add it to the token on the API tokens page. - Exit 2 with any other message, or any other tool error, such as a suspended service or an unreachable API: report the message, which says what to do.
Stop and ask means: stop at once, before any other work, including the rest of this skill’s stages and work the user asked for outside this skill. Tell the user what was not created or changed and why, with a missing permission in the dashboard’s wording, and ask how to go on:
- They fix it, as the case says, and you try again.
- They make the change in the dashboard, with the settings you show them, and you go on.
- Only when the user’s task has work left that does not need the change: you go on with that work without it, such as the remaining segments and flags, leaving out a flag whose rules use a segment not created, or stage 2, where the code reads a config not created with its in-code default value until it exists.
Wait for their answer. On choice 2 or 3 before the settings are settled, settle them with the user as stage 1 does, skipping any read that fails, and create nothing.
Read LaunchDarkly’s data from the user’s files
Never ask for, read or write a LaunchDarkly access token, and never call the LaunchDarkly API yourself. Stage 1 gives the user the requests to run in their own terminal, each writing a file in the operating system’s temporary directory, never in the repository; you read those files and delete them at the end of the run. If the user pastes a LaunchDarkly or ConfigDirector token into the conversation, tell them it is now in the transcript, ask them to revoke it and create another, and go on without it.
Stage 1: recreate the flags
Follow the six steps of references/recreate-flags.md: map the LaunchDarkly environments to the project’s; have the user export the flags, their statuses and the segments of each environment; choose the flags, proposing to leave out the ones that are launched or inactive everywhere and listing what has no equivalent; create the segments first, through configdirector-segments; create the configs in batches of up to ten, each batch shown next to LaunchDarkly’s settings and rules and confirmed once; then check one context per rule with an evaluation. Nothing reads a new config until stage 2 is deployed, so writing its rules into a live environment needs no separate yes.
Stage 2: switch one application
Follow the four steps of references/switch-an-application.md: find the LaunchDarkly SDK in the application’s dependency manifest and its replacement in the guide; show the plan, every read to replace, before editing; install and initialize the ConfigDirector SDK as configdirector-setup does and rewrite each read as the guide shows, following configdirector-use-configs-in-code and configdirector-test-with-flags; run configdirector validate and the project’s checks; and remove the LaunchDarkly package and its key once no read remains, on the user’s yes.
Hand over
At the end of each stage, hand over as its reference file says, in a few lines, and delete the exported LaunchDarkly files.
Skill frontmatter
Work with this as data
Every skill here is available over the APIs.io API and to AI agents over MCP.