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★ 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:
- Audit the code — read-only scan that produces a structured list of everything hardcoded (prompt, model, parameters, tools, app-scoped knobs).
- 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. - Move the tools — extract each tool's JSON schema, attach it to the config, and pass the implementations to the SDK as tool handlers.
- Verify metrics — confirm duration, tokens, and success/error reach the Monitoring tab, and add feedback or business metrics if the app needs them.
- Attach evaluators — either offline evals via the Playground + Datasets, or judges that score sampled traffic automatically.
⚠️ Three first-run failure modes to avoid.
- 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.- No fallback.
invoke()has no fallback argument. It raisesRuntimeError(a plainErrorin 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 anexcept RuntimeErrorbranch after checkingif (await inspect_config(key, context))["enabled"]: raise(so mid-run handler errors still propagate), or the app goes down with LaunchDarkly.- Fallthrough not flipped after
/configs-create. A freshly created config's fallthrough points at an auto-generated disabled variation, so everyinvoke()raises until/configs-targetingruns. 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 |
Установить migrate в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
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), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic