Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

migrate

БесплатноБез исполняемых скриптовНе проверен

Migrate an application with hardcoded LLM prompts to a full LaunchDarkly AgentControl implementation on the current AI SDKs in five stages: audit the code…

launchdarklyот launchdarkly★ 32 звезды на GitHub

Об этом скилле

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:

Concern Current SDK
Provider call A handler package (OpenAI, Anthropic, LangChain) or a custom handler that wraps your existing call
Fallback Your own code, run when invoke() raises RuntimeError and inspect_config() reports enabled=False
Template variables Third argument to invoke(); {{name}} placeholders, no spaces
Tools tool_handlers={"tool-key": fn} on config(); the handler runs the tool loop
Metrics Automatic: duration, tokens, success/error, tool calls
Judges Attached judges run inside invoke(); skip_judges=True + run_judge() for background work
Multi-agent graph(), or resolve_graph() + a native runner such as to_lang_graph

If the app already uses the legacy LaunchDarkly AI SDK (ldai, @launchdarkly/server-sdk-ai, completion_config(), create_tracker()) and its configs already exist in LaunchDarkly, use the legacy-sdk-migrate skill instead — it upgrades between the LaunchDarkly AI SDKs without creating new configs.

Coverage — which shapes are well-trodden vs require extrapolation

The skill is optimized for Python and Node.js / TypeScript. The current AI SDKs exist for Python and Node.js only.

Shape Python Node.js Reference
One-shot completion (direct OpenAI / Anthropic call) ✅ Worked example ✅ Worked example before-after-examples.md
Bedrock / Gemini / custom HTTP direct call ✅ Custom handler ✅ Custom handler built-in-metrics per-provider references
LangChain single-call ✅ Handler package ✅ Handler package agent-mode-frameworks.md § LangChain
LangGraph prebuilt agent (Python create_agent, Node createReactAgent) ✅ Worked example ✅ Worked example before-after-examples.md, agent-mode-frameworks.md § LangGraph prebuilt
LangGraph custom StateGraph ✅ Custom agent handler ⚠️ Translate from Python agent-mode-frameworks.md § Custom StateGraph
CrewAI ✅ Custom agent handler — (not a Node framework) agent-mode-frameworks.md § CrewAI
Strands ✅ Custom agent handler ⚠️ BedrockModel + OpenAIModel only agent-mode-frameworks.md § Strands
Custom ReAct loop ✅ Replace with SDK tool loop ✅ Same agent-mode-frameworks.md § Custom ReAct loop
Streaming (SSE / WebSocket) ✅ stream() ✅ stream() built-in-metrics streaming reference
Multi-agent graph (super
Полный SKILL.md на GitHub

Установить migrate в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

README.mdreferences/agent-graph-reference.mdreferences/agent-mode-frameworks.mdreferences/before-after-examples.mdreferences/fallback-defaults-pattern.mdreferences/phase-1-analysis-checklist.mdreferences/sdk-ai-tracker-patterns.md

FAQ

Что делает скилл migrate?

Migrate an application with hardcoded LLM prompts to a full LaunchDarkly AgentControl implementation on the current AI SDKs in five stages: audit the code, wrap the call, move the tools, verify metrics, 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. If the app already uses a legacy LaunchDarkly AI SDK (`launchdarkly-server-sdk-ai` / `ldai`, `@launchdarkly/server-sdk-ai`), use `legacy-sdk-migrate` instead.

Как установить скилл migrate?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл migrate запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить migrate с