sdk-install

作者: launchdarkly

在入職引導過程中,按順序執行嵌套技能(偵測、規劃、應用)來安裝並初始化正確的 LaunchDarkly SDK。父級入職步驟 6 為第一步…

npx skills add https://github.com/launchdarkly/agent-skills --skill sdk-install

LaunchDarkly SDK Install (onboarding)

Installs and initializes the right LaunchDarkly SDK for the user’s project by following three nested skills in order. Do not skip ahead to feature flags here—the parent LaunchDarkly onboarding continues with Step 6: First feature flag using Create first feature flag.

Prerequisites

  • Project context from parent Step 1: Explore the Project (reuse it; only re-run deep detection if something is unclear)
  • SDK key / client-side ID / mobile key: Needed when you reach Apply code changes (env wiring). Do not ask the user for these during detect or plan solely because you opened this skill—follow parent onboarding: account status is inferred via MCP OAuth (Step 4) or surfaced at D7 in apply; key material is collected at apply (see parent Prerequisites).

Key types (summary)

SDK TypeVariable (logical)Source in LaunchDarkly
Server-sideLAUNCHDARKLY_SDK_KEYEnvironments → SDK key
Client-sideClient-side ID (bundler-prefixed env names)Environments → Client-side ID
MobileLAUNCHDARKLY_MOBILE_KEYEnvironments → Mobile key

Never hardcode keys. Full env rules, consent, and bundler tables: Apply code changes Step 2.

Workflow — run these nested skills in order

Execute all three unless the detect decision tree short-circuits (e.g. skip to apply only). Each nested skill may contain decision points — some blocking (marked D<N> -- BLOCKING, where you must call your structured question tool and wait for the user's response before continuing) and some non-blocking (where you present information and continue unless the user objects). Do NOT batch tool calls across blocking boundaries.

OrderNested skillRole
1Detect repository stackLanguage, package manager, monorepo target, entrypoint, existing LD usage
2Generate integration planSDK choice, files to change, env plan -- presented to user (non-blocking; see plan SKILL.md D6)
3Apply code changesInstall package(s), .env / secrets with consent, init code, compile check (both tracks when dual-SDK plan)

Shared references for all steps: SDK recipes, SDK snippets.

After Step 3 completes

Continue with the parent skill:

Do not add standalone “sample flag” evaluation in this skill unless the user explicitly needs a throwaway check; the parent flow creates the first flag in order.

Guidelines

  • Match existing codebase conventions for imports, config, and style.
  • Prefer TypeScript in TypeScript projects.
  • If the project uses a shared config layer, initialize LaunchDarkly there.
  • Add .env.example entries when the project uses dotenv.
  • Dependency scope: Add only LaunchDarkly SDK package(s) from the recipe unless the user explicitly approves upgrading or adding other packages (Apply — Permission before changing other dependencies).

Edge cases

  • Multiple environments (e.g. Next.js server + client) or user asked for frontend + backend: Use a dual-SDK plan and apply both packages and both inits—never summarize the second SDK as done without lockfile + entrypoint evidence.
  • Monorepo: Integrate the package the user chose in parent onboarding; stay within that subtree.
  • SDK already installed and initialized: Parent may skip this handoff—see parent Edge Cases and detect decision tree.
  • Unsupported or uncommon stack: Use SDK recipes and the full SDK catalog.

References

來自 launchdarkly 的更多技能

aiconfig-agent-graphs
launchdarkly
建立並管理代理圖表——由帶有交接邏輯的邊連接的AI Configs有向圖。適用於建構多代理工作流程,其中配置…
official
aiconfig-ai-metrics
launchdarkly
為現有程式碼庫加入 LaunchDarkly AI Config 追蹤功能。逐步走過四層階梯(受管執行器 → 提供者套件 → 自訂提取器 +…)
official
aiconfig-create
launchdarkly
在 LaunchDarkly 中建立和設定 AI Config。協助你選擇 agent 或 completion 模式、建立設定、新增包含模型和提示的變體…
official
aiconfig-custom-metrics
launchdarkly
為 AI Configs 建立、追蹤、擷取、更新及刪除自訂業務指標。涵蓋完整生命週期:透過 API 定義指標類型,透過 SDK 發送事件,…
official
aiconfig-migrate
launchdarkly
將具有硬編碼 LLM 提示的應用程式遷移至完整的 LaunchDarkly AI Configs 實作,分為五個階段:審查程式碼、封裝呼叫、移動…
official
aiconfig-online-evals
launchdarkly
為 AI Config 變體附加評判員,以進行自動化的 LLM-as-a-judge 評估。建立自訂評判員、設定抽樣率,並監控品質分數。
official
aiconfig-projects
launchdarkly
在程式碼庫中設定 LaunchDarkly 專案的指南。協助您評估技術堆疊、選擇合適的方法,並整合專案管理,以便…
official
aiconfig-snippets
launchdarkly
建立並管理提示片段 — 可在 AI Config 變體提示中重複使用的文字區塊。保留常用指令、角色設定及防護措施…
official