feat: add SDK onboarding skill for AI-agent-driven LaunchDarkly integration#25
feat: add SDK onboarding skill for AI-agent-driven LaunchDarkly integration#25devin-ai-integration[bot] wants to merge 5 commits intomainfrom
Conversation
…ration Co-Authored-By: Ari Salem <asalem@launchdarkly.com>
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
| ## Prerequisites | ||
|
|
||
| - A LaunchDarkly account with an API access token (or SDK key) | ||
| - A project and environment configured in LaunchDarkly | ||
| - Access to the user's codebase (read and write) |
There was a problem hiding this comment.
I don't think these are prerequisites, they're add-ons to the functionality that need to be prompted so that we can get permission to read the SDK key and set it. If the user has an account, we should be able to make a request using the existing get -project endpoint, which will contain the environment and the SDK Key. If they don't have an account, then we can prompt them to login or sign-up using the LDCLI.
| | SDK already installed | Skip to Step 4 (Run) or Step 5 (Validate) | | ||
| | Multiple languages in repo | Ask the user which target to integrate first (frontend vs backend vs mobile) | | ||
| | Monorepo | Identify the specific package/service to integrate and work within that subtree | | ||
| | No package manager detected | Provide manual install instructions from the SDK recipe | |
There was a problem hiding this comment.
Should this just ask the user which SDK they want to install?
skills/onboarding/launchdarkly-sdk-onboarding/references/1.4-validate.md
Show resolved
Hide resolved
| ```bash | ||
| ldcli flags update \ | ||
| --access-token YOUR_ACCESS_TOKEN \ | ||
| --project PROJECT_KEY \ | ||
| --flag my-first-flag \ | ||
| --data '{"environmentKey": "ENVIRONMENT_KEY", "instructions": [{"kind": "turnFlagOn"}]}' |
There was a problem hiding this comment.
There's a toggle command we can use:
https://github.com/launchdarkly/ldcli/blob/main/cmd/flags/toggle.go
skills/onboarding/launchdarkly-sdk-onboarding/references/1.5-first-flag.md
Show resolved
Hide resolved
| "requirements": { | ||
| "mcp-servers": ["@launchdarkly/mcp-server"] | ||
| } |
…on, and toggle commands - SKILL.md: Replace static prerequisites with dynamic account setup flow, add Step 7 (MCP Server Installation), renumber Recover to Step 8, fix 'No package manager' edge case to ask user which SDK they want - 1.0-detect.md: Add C/C++, Haskell, Lua, Roku, .NET client, edge SDK detection; add React Native, JS browser, Flutter, Swift, Android entrypoints; add SDK confirmation flow; ask user if language undetectable - 1.1-plan.md: Add edge SDKs, .NET client, C/C++, Haskell, Lua, Roku to SDK selection table; add Node.js client SDK note; reference detect step results for files to modify - 1.3-run.md: Remove reliance on log messages for success; use sdk-active endpoint for definitive validation; reframe indicators as startup errors - 1.4-validate.md: Fix API endpoint path to correct format; promote ldcli sdk-active as preferred option; add retry logic with 3-attempt limit; simplify dashboard option to flags page URL - 1.5-first-flag.md: Use ldcli flags toggle-on instead of flags update; add auth error handling section (prompt login/signup on 401/403) - marketplace.json: Move MCP server from requirements to optional - sdk-recipes.md: Add canonical ldcli sdk_instructions reference; add Haskell, Lua, C++ server, .NET client, C++ client, Roku recipes; add Edge SDKs section (Cloudflare, Vercel, Akamai) - New: 1.7-mcp-setup.md for MCP server installation guidance Co-Authored-By: Ari Salem <asalem@launchdarkly.com>
| - [Validate SDK Connection](references/1.4-validate.md) — How to verify LaunchDarkly sees the SDK | ||
| - [Create First Feature Flag](references/1.5-first-flag.md) — How to create, evaluate, and toggle a flag | ||
| - [Recovery Procedures](references/1.6-recover.md) — How to diagnose failures and resume | ||
| - [SDK Recipes](references/sdk-recipes.md) — Detection patterns, install commands, and init snippets for all SDKs |
There was a problem hiding this comment.
Once we've successfully completed all these tasks, i'd like to create a papertrail that the user could reference on how LD was setup, with links to the documentation if necessary. So we give them the playbook on how to setup LD, where they can find their flags, and maybe even some additional next steps they can take (like creating an experiment, guarding a rollout, adding an AI config, adding observability). We should also leave behind some skills for the user that they can use to help manage their feature flags. We can start off with some basic feature-flag related skills. if the user is using claude, we should put it under claude rules, if they're using cursor, they should be put under cursorrules, etc...
There was a problem hiding this comment.
Implemented both of these in the latest commit (147f673):
Step 8: Onboarding Summary (references/1.8-summary.md)
- Generates a
LAUNCHDARKLY.mdin the user's repo with:- SDK details (name, package, init file, key env var)
- Dashboard links (flags, project settings, environments, API tokens)
- Next steps: percentage rollouts, targeting rules, experimentation, AI configs, guarded rollouts, observability
- Useful
ldclicommands table
- Asks user permission before committing
Step 9: Editor Rules (references/1.9-editor-rules.md)
- Detects the user's editor (Cursor, Claude Code, GitHub Copilot)
- Creates the appropriate rules file:
.cursor/rules/launchdarkly.mdcfor Cursor.claude/rules/launchdarkly.mdfor Claude Code.github/copilot-instructions.md(append) for Copilot
- Rules cover: when to use flags, evaluation best practices, SDK key safety, flag hygiene, available MCP tools, and doc links
- Asks user permission before committing
- New Step 8: Leave behind LAUNCHDARKLY.md with setup details, dashboard links, next steps (rollouts, experiments, AI configs, observability), and useful ldcli commands - New Step 9: Detect user's editor and create rules file (.cursorrules, .claude/rules, .github/copilot-instructions.md) with LaunchDarkly flag management best practices and skills - Renumber Recover to Step 10 - Add references for 1.8-summary.md and 1.9-editor-rules.md Co-Authored-By: Ari Salem <asalem@launchdarkly.com>
Adds 'AI Agent Integration (MCP Server)' section to the LAUNCHDARKLY.md template encouraging users to install the MCP server, with examples of what agents can do: create/toggle flags, set up targeting, clean up stale flags, run experiments, manage AI configs. Includes install snippet. Co-Authored-By: Ari Salem <asalem@launchdarkly.com>
| | `.vscode/` (without Cursor indicators) | VS Code | | ||
| | `.idea/` | JetBrains IDE | | ||
|
|
||
| If you can't detect the editor, ask the user which editor they're using. |
There was a problem hiding this comment.
If you can't detect the editor, just assume it's claude and set it in a claude rules
There was a problem hiding this comment.
Updated in c719ee7 — if the editor can't be detected, it now defaults to creating .claude/rules/launchdarkly.md instead of asking.
skills/onboarding/launchdarkly-sdk-onboarding/references/1.9-editor-rules.md
Show resolved
Hide resolved
- Default to Claude Code rules if editor can't be detected (instead of asking) - Add 'Agent Skills for Feature Flags' section referencing the four existing skills: flag-create, flag-targeting, flag-cleanup, flag-discovery Co-Authored-By: Ari Salem <asalem@launchdarkly.com>
|
I need to verify whether the MCP is GA. If it is, we'll need to update the MCP reference |
|
Sounds good — let me know once you've confirmed the MCP GA status and I'll update the references (package name, install instructions, docs links) if anything needs to change. |
Summary
onboarding/launchdarkly-sdk-onboardingskill that guides AI agents through a 10-step workflow for integrating a LaunchDarkly SDK into a project: Detect → Plan → Apply → Run → Validate → First Flag → MCP Setup → Summary → Editor Rules → RecoverSKILL.mdorchestrator with references for each step, plus a comprehensivesdk-recipes.mdcovering 23+ SDKs (12 server-side, 7 client-side, 4 mobile, 3 edge)README.md,skills.json(viagenerate_catalog.py), and addsmarketplace.jsonUpdates since last revision
Round 1 — Review feedback across all files:
ldcli, auto-retrieve SDK keys). Added Step 7 (MCP Server Installation offer). Fixed "no package manager" edge case to ask the user which SDK they want.ldcli sdk-active/ API endpoint as the definitive check./api/v2/projects/{projectKey}/environments/{environmentKey}/sdk-active. Promotedldcli sdk-activeas preferred (Option A). Added retry logic with a 3-attempt cap. Simplified dashboard fallback to flags page URL.ldcli flags updatewithldcli flags toggle-on. Added auth error handling section (prompt login/signup on 401/403).requirementstooptional.ldcli sdk_instructionsreference. Added Haskell, Lua, C++ (server & client), .NET client, Roku recipes. Added Edge SDKs section (Cloudflare, Vercel, Akamai).Round 2 — Post-onboarding papertrail and editor rules:
LAUNCHDARKLY.mddocument left in the user's repo with SDK details, dashboard links, usefulldclicommands, and next steps (rollouts, experiments, AI configs, guarded rollouts, observability)..cursor/rules/launchdarkly.mdc,.claude/rules/launchdarkly.md,.github/copilot-instructions.md) with LaunchDarkly flag management best practices.Round 3 — MCP promotion in summary:
LAUNCHDARKLY.mdtemplate. Encourages MCP installation and describes agent-driven capabilities (create/manage flags, toggle on/off, targeting rules, clean up stale flags, run experiments, manage AI configs). Includes a ready-to-paste MCP config snippet.Human review checklist
ldclicommand accuracy — Verifyldcli sdk-active,ldcli flags toggle-on, andldcli loginmatch the current CLI flags/arguments (toggle source, sdk_active source).1.4-validate.mdand1.3-run.mduse/api/v2/projects/{projectKey}/environments/{environmentKey}/sdk-active. Confirm this is the correct path.1.4-validate.mdreferencesget-environment,1.5-first-flag.mdreferencescreate-flagandtoggle-flag. Verify these match the actual@launchdarkly/mcp-servertool names.1.8-summary.mdlinks to/home/guarded-rollouts,/home/ai-configs,/home/observability. Verify these resolve onlaunchdarkly.com/docs..cursor/rules/launchdarkly.mdcfrontmatter and.claude/rules/path match current Cursor and Claude Code conventions.1.5-first-flag.mdlinks to../../feature-flags/launchdarkly-flag-create/SKILL.md. Verify these resolve correctly in the repo.Testing
python3 scripts/validate_skills.py— all 12 SKILL.md files validated successfullypython3 scripts/generate_catalog.py—skills.jsonregenerated with new entryNotes
launchdarkly/ldcli(#674) that implemented this as Go structs. This PR supersedes that approach by making the onboarding content portable markdown that can be consumed by the MCP server, CLI, or any agent directly — without requiring theldclibinary.SKILL.mdorchestrating step-by-step reference files.Link to Devin session: https://app.devin.ai/sessions/07a0cc633efc47c3b2e8dec7b61d2252