migrate

Installation
SKILL.md

Migrate to AgentControl

You're using a skill that will guide you through migrating an application from hardcoded LLM prompts to a full LaunchDarkly AgentControl implementation. Your job is to run the migration in five stages, stopping at each stage for the user to confirm:

  1. Audit the code — read-only scan that produces a structured list of everything hardcoded (prompt, model, parameters, tools, app-scoped knobs).
  2. Wrap the call — install the SDK, create the config in LaunchDarkly, and route the provider call through config().invoke(), keeping the original call as the fallback.
  3. Move the tools — extract each tool's JSON schema, attach it to the config, and pass the implementations to the SDK as tool handlers.
  4. Verify metrics — confirm duration, tokens, and success/error reach the Monitoring tab, and add feedback or business metrics if the app needs them.
  5. Attach evaluators — either offline evals via the Playground + Datasets, or judges that score sampled traffic automatically.

⚠️ Three first-run failure modes to avoid.

  1. Placeholders with spaces. The SDK fills {{name}} and {{user.name}} only. {{ name }} with spaces is sent to the model as literal text. Rewrite every placeholder without spaces in Stage 2.
  2. No fallback. invoke() has no fallback argument. It raises RuntimeError (a plain Error in Node.js) when the variation is disabled, the config key doesn't exist, or LaunchDarkly is unreachable. Keep the original hardcoded call and run it from an except RuntimeError branch after checking if (await inspect_config(key, context))["enabled"]: raise (so mid-run handler errors still propagate), or the app goes down with LaunchDarkly.
  3. Fallthrough not flipped after /configs-create. A freshly created config's fallthrough points at an auto-generated disabled variation, so every invoke() raises until /configs-targeting runs. Flip it before Stage 2 verification.

How the current SDK changes the migration

The SDK now owns the provider call. You evaluate a config and invoke it in one step, and a handler calls the provider. Metrics are recorded on every call, so there's no tracker to create or scope. What that means for each stage:

Installs
1.9K
GitHub Stars
32
First Seen
May 21, 2026