launchdarkly/ai-toolingApache-2.08 files

Migrate

Migrate an application with hardcoded LLM prompts to a full LaunchDarkly AgentControl implementation in five stages: audit the code, wrap the call, move the tools, add tracking, attach evaluators. Use when the user wants to externalize model/prompt configuration, move from direct provider calls (OpenAI, Anthropic, Bedrock, Gemini, Strands) to a managed config, or stage a full hardcoded-to-LaunchDarkly migration.

Specification
Skill ID
launchdarkly/ai-tooling/migrate
Publisher
launchdarkly
Repository
ai-tooling
Installs
0
Files
8
License
Apache-2.0
Requires
Requires the remotely hosted LaunchDarkly MCP server
Synced
Sep 23, 2026
How to use it

Open any RiverX project, open the Skills panel in the chat, and search for this identifier. The files are fetched from the source repository at install time.

launchdarkly/ai-tooling/migrateInstalls these files
  • README.md
  • SKILL.md
  • references/agent-graph-reference.md
  • references/agent-mode-frameworks.md
  • references/before-after-examples.md
  • references/fallback-defaults-pattern.md
  • references/phase-1-analysis-checklist.md
  • references/sdk-ai-tracker-patterns.md

What this skill tells the agent

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 with a fallback that mirrors the hardcoded values, and rewrite the call site to fetch the config fresh on every request.
  3. Move the tools — extract each tool's JSON schema, attach it to the config, and swap every call site that references the old tool list.
  4. Add tracking — wire the per-request tracker (duration, tokens, success/error) around the provider call.
  5. Attach evaluators — either offline evals via the Playground + Datasets, or online judges that score sampled traffic automatically.
⚠️ Three first-run failure modes to avoid. 1. Tracker in the wrong scope. For an agent with a loop, mint create_tracker() once per user turn in a setup_run entry node — not inside call_model. Per-iteration factory calls produce N runIds and trip the at-most-once guards. See agent-mode-frameworks.md § Custom `StateGraph`. 2. `load_chat_model` wrapper reuse. Templates like langchain-ai/react-agent ship a load_chat_model(f"{provider}/{name}") helper that wraps init_chat_model(...) and silently drops every variation parameter. Delete it (don't just avoid using it) and replace call sites with create_langchain_model(ai_config). 3. Fallthrough not flipped after `/configs-create`. A freshly-created config's fallthrough points at an auto-generated disabled variation, so the SDK returns enabled=False until /configs-targeting runs. Flip it before Stage 2 verification.

Coverage — which shapes are well-trodden vs require extrapolation

The skill is optimized for Python and Node.js / TypeScript; other languages are install-only. Within Python and Node the coverage tiers are:

ShapePythonNode.jsReference
One-shot completion (direct OpenAI / Anthropic / Bedrock / Gemini call)✅ Worked example✅ Worked examplebefore-after-examples.md, per-provider docs in built-in-metrics/references/
Chat loop via managed runner (ManagedModel)✅ Tier 1 pattern✅ Tier 1 patternbuilt-in-metrics SKILL.md
LangChain single-call✅ Worked example✅ Worked examplelangchain-tracking.md
LangGraph prebuilt agent (Python langchain.agents.create_agent, Node createReactAgent)✅ Worked example✅ Worked exampleagent-mode-frameworks.md § LangGraph
LangGraph custom StateGraph with run-scoped tracker (setup_run + call_model + finalize)✅ Deep worked example⚠️ Mentioned — translate from Pythonagent-mode-frameworks.md § Custom `StateGraph`
CrewAI Agent✅ Worked example— (not a Node framework)agent-mode-frameworks.md § CrewAI
Strands Agent✅ Worked example⚠️ BedrockModel + OpenAIModel only (no Anthropic)agent-mode-frameworks.md § Strands
Custom ReAct loop (hand-rolled, any framework or none)✅ Worked example⚠️ Apply framework-agnostic invariants; translate from Pythonagent-mode-frameworks.md § Custom ReAct loop
Vercel AI SDK (generateText / streamText)— (not a Python framework)⚠️ Provider package exists; no worked example in skillbuilt-in-metrics provider-package matrix
Streaming (SSE / WebSocket)⚠️ Delegated to built-in-metrics streaming doc⚠️ Same — use trackStreamMetricsOf + manual TTFTstreaming-tracking.md
Multi-agent graph (supervisor + workers)⚠️ Out of main scope; see reference⚠️ Out of main scope; see referenceagent-graph-reference.md
Non-LangGraph agent frameworks (Pydantic AI, DSPy, AutoGen, Haystack, LlamaIndex agents, Semantic Kernel)⚠️ Apply the three invariants; no framework-specific example⚠️ Sameagent-mode-frameworks.md § Framework-agnostic invariants
Go, Ruby, .NETℹ️ Install commands onlyℹ️ Install commands onlyphase-1-analysis-checklist.md § SDK routing table

Reading the key: ✅ = follow the skill verbatim; ⚠️ = the architecture applies but you'll translate idioms or cross-reference another skill; ℹ️ = skill doesn't go past the install step.

If the target app is in the ⚠️ column, start by reading agent-mode-frameworks.md § Framework-agnostic invariants — those three rules (one agent_config per turn, one tracker per turn, at-most-once methods fire once at turn end) apply regardless of framework, and every code snippet in this skill is an instantiation of them. Translate the Python example's shape onto the target framework's primitives.

Prerequisites

This skill requires the remotely hosted LaunchDarkly MCP server to be configured in your environment, and an application that already calls an LLM provider with hardcoded model, prompt, and parameter values.

Required environment:

  • LD_SDK_KEY — server-side SDK key (starts with sdk-) from the target LaunchDarkly project

MCP tools used directly by this skill: none — every LaunchDarkly write happens in a focused sibling skill.

Check the SDK CHANGELOG before applying any pattern. The API surface described throughout this skill targets the SDK behavior at the time of the skill's last update; SDK releases can rename, remove, or split methods after that. Before you start, fetch the latest CHANGELOG for the SDK(s) you'll target and skim for anything that contradicts the pattern you're about to apply:

  • Python: https://github.com/launchdarkly/python-server-sdk-ai/blob/main/packages/sdk/server-ai/CHANGELOG.md (and per-provider CHANGELOGs under packages/ai-providers/server-ai-{openai,langchain}/CHANGELOG.md)
  • Node: https://github.com/launchdarkly/js-core/blob/main/packages/sdk/server-ai/CHANGELOG.md (and per-provider CHANGELOGs under packages/ai-providers/server-ai-{openai,langchain,vercel}/CHANGELOG.md)

If a CHANGELOG entry post-dates this skill and changes an API you're about to use, the CHANGELOG wins — and the skill should be updated.

Hand-off model. This skill does not auto-invoke other skills. At each stage that needs a LaunchDarkly write, this skill prepares the inputs (config key, mode, model, prompt, tool schemas, judge keys) and then tells the user to run the next slash-command themselves. After the user finishes that sibling skill, return to the next step here. Treat the "Delegate" lines below as next-step instructions, not auto-handoffs.

Sibling skills the user runs at each stage:

  • projects — pre-Stage 2, only if no project exists yet
  • configs-create — Stage 2 (creates the config and first variation)
  • tools — Stage 3 (creates tool definitions and attaches them)
  • configs-targeting — between Stage 2 and Stage 4 (promotes the new variation to fallthrough so the SDK actually serves it)
  • online-evals — Stage 5 (attaches judges, creates custom judges)

Core Principles

  1. Inspect before you mutate. Every stage begins with a read-only audit. Do not touch code until Step 1 is confirmed by the user.

Use this skill in a project

Open any RiverX project, search the Skills panel for launchdarkly/ai-tooling/migrate, and install it in one click.

Use this skill