Skip to content

feat: add SDK onboarding skill for AI-agent-driven LaunchDarkly integration#25

Draft
devin-ai-integration[bot] wants to merge 5 commits intomainfrom
devin/1774526759-onboarding-skill
Draft

feat: add SDK onboarding skill for AI-agent-driven LaunchDarkly integration#25
devin-ai-integration[bot] wants to merge 5 commits intomainfrom
devin/1774526759-onboarding-skill

Conversation

@devin-ai-integration
Copy link
Copy Markdown

@devin-ai-integration devin-ai-integration bot commented Mar 26, 2026

Summary

  • Adds a new onboarding/launchdarkly-sdk-onboarding skill 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 → Recover
  • Includes SKILL.md orchestrator with references for each step, plus a comprehensive sdk-recipes.md covering 23+ SDKs (12 server-side, 7 client-side, 4 mobile, 3 edge)
  • Updates README.md, skills.json (via generate_catalog.py), and adds marketplace.json

Updates since last revision

Round 1 — Review feedback across all files:

  • SKILL.md: Replaced static "Prerequisites" with dynamic "Account and Credentials" flow (login/signup via 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.
  • 1.0-detect.md: Expanded language detection table with C/C++, Haskell, Lua, Roku, Cloudflare Workers, Vercel Edge. Added React Native, JS browser, Flutter, Swift, Android entrypoints. Added SDK confirmation flow (confirm choice, handle ambiguity, ask user if undetectable).
  • 1.1-plan.md: Added edge SDKs, .NET client, C/C++, Haskell, Lua, Roku to SDK selection table. Added Node.js client SDK note. Plan now references detect step results instead of listing generic examples.
  • 1.3-run.md: Removed reliance on SDK log messages for success detection. Now uses ldcli sdk-active / API endpoint as the definitive check.
  • 1.4-validate.md: Fixed API endpoint path to /api/v2/projects/{projectKey}/environments/{environmentKey}/sdk-active. Promoted ldcli sdk-active as preferred (Option A). Added retry logic with a 3-attempt cap. Simplified dashboard fallback to flags page URL.
  • 1.5-first-flag.md: Replaced ldcli flags update with ldcli flags toggle-on. Added auth error handling section (prompt login/signup on 401/403).
  • marketplace.json: Moved MCP server from requirements to optional.
  • sdk-recipes.md: Added canonical ldcli sdk_instructions reference. Added Haskell, Lua, C++ (server & client), .NET client, Roku recipes. Added Edge SDKs section (Cloudflare, Vercel, Akamai).
  • New: 1.7-mcp-setup.md: Guide for installing LaunchDarkly MCP server (Cursor, Claude Desktop, VS Code configs).

Round 2 — Post-onboarding papertrail and editor rules:

  • New: 1.8-summary.md (Step 8): Template for a LAUNCHDARKLY.md document left in the user's repo with SDK details, dashboard links, useful ldcli commands, and next steps (rollouts, experiments, AI configs, guarded rollouts, observability).
  • New: 1.9-editor-rules.md (Step 9): Detect the user's editor and create rules files (.cursor/rules/launchdarkly.mdc, .claude/rules/launchdarkly.md, .github/copilot-instructions.md) with LaunchDarkly flag management best practices.
  • SKILL.md: Added Steps 8 and 9; renumbered Recover to Step 10.

Round 3 — MCP promotion in summary:

  • 1.8-summary.md: Added "AI Agent Integration (MCP Server)" section to the LAUNCHDARKLY.md template. 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

These items cannot be verified automatically and need a human with domain knowledge.

  • ldcli command accuracy — Verify ldcli sdk-active, ldcli flags toggle-on, and ldcli login match the current CLI flags/arguments (toggle source, sdk_active source).
  • API endpoint path1.4-validate.md and 1.3-run.md use /api/v2/projects/{projectKey}/environments/{environmentKey}/sdk-active. Confirm this is the correct path.
  • MCP tool names1.4-validate.md references get-environment, 1.5-first-flag.md references create-flag and toggle-flag. Verify these match the actual @launchdarkly/mcp-server tool names.
  • SDK code snippets — Inline init/evaluate examples cover 23+ SDKs. Spot-check snippets against current SDK docs, especially for .NET client, Rust, Flutter, and React Native.
  • Doc URL paths1.8-summary.md links to /home/guarded-rollouts, /home/ai-configs, /home/observability. Verify these resolve on launchdarkly.com/docs.
  • Editor rules format — Verify .cursor/rules/launchdarkly.mdc frontmatter and .claude/rules/ path match current Cursor and Claude Code conventions.
  • Relative cross-skill links1.5-first-flag.md links to ../../feature-flags/launchdarkly-flag-create/SKILL.md. Verify these resolve correctly in the repo.

Testing

  • Manual (describe below)
  • Ran python3 scripts/validate_skills.py — all 12 SKILL.md files validated successfully
  • Ran python3 scripts/generate_catalog.pyskills.json regenerated with new entry

Notes

  • There is a related draft PR on 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 the ldcli binary.
  • Follows the same pattern as PostHog's skills repo with a top-level SKILL.md orchestrating step-by-step reference files.

Link to Devin session: https://app.devin.ai/sessions/07a0cc633efc47c3b2e8dec7b61d2252

…ration

Co-Authored-By: Ari Salem <asalem@launchdarkly.com>
@devin-ai-integration
Copy link
Copy Markdown
Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

Comment on lines +15 to +19
## 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)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 |
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this just ask the user which SDK they want to install?

Comment on lines +143 to +148
```bash
ldcli flags update \
--access-token YOUR_ACCESS_TOKEN \
--project PROJECT_KEY \
--flag my-first-flag \
--data '{"environmentKey": "ENVIRONMENT_KEY", "instructions": [{"kind": "turnFlagOn"}]}'
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment on lines +17 to +19
"requirements": {
"mcp-servers": ["@launchdarkly/mcp-server"]
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this a requirement?

…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
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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...

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Implemented both of these in the latest commit (147f673):

Step 8: Onboarding Summary (references/1.8-summary.md)

  • Generates a LAUNCHDARKLY.md in 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 ldcli commands 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.mdc for Cursor
    • .claude/rules/launchdarkly.md for 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.
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you can't detect the editor, just assume it's claude and set it in a claude rules

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated in c719ee7 — if the editor can't be detected, it now defaults to creating .claude/rules/launchdarkly.md instead of asking.

- 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>
@ari-launchdarkly
Copy link
Copy Markdown

I need to verify whether the MCP is GA. If it is, we'll need to update the MCP reference

@devin-ai-integration
Copy link
Copy Markdown
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant