Skip to content

feat: add onboard command for AI-agent SDK integration workflow#674

Draft
devin-ai-integration[bot] wants to merge 1 commit intomainfrom
devin/1774481043-onboard-command
Draft

feat: add onboard command for AI-agent SDK integration workflow#674
devin-ai-integration[bot] wants to merge 1 commit intomainfrom
devin/1774481043-onboard-command

Conversation

@devin-ai-integration
Copy link
Contributor

Requirements

  • I have added test coverage for new or changed functionality
  • I have followed the repository's pull request submission guidelines
  • I have validated my changes against all supported platform versions

Related issues

AI-Assisted Onboarding — MCP-driven "Onboard me" wizard via agent-skills.

Describe the solution you've provided

Adds a new ldcli onboard command that generates a structured onboarding plan for AI agents (Cursor, Copilot, Claude) to follow when integrating the LaunchDarkly SDK into a user's project.

The command outputs a deterministic workflow of 7 agent-skill steps:

  1. Detect — Inspect repo to identify language/framework/package manager and existing SDK presence
  2. Plan — Choose the correct SDK and generate a minimal integration plan using SDK recipes
  3. Apply — Install dependencies and add SDK initialization code
  4. Run — Start the application and confirm SDK initialization
  5. Validate — Check LaunchDarkly-side sdk-active signal
  6. First Flag — Create and toggle a feature flag end-to-end
  7. Recover — Ranked recovery options if any step fails

Output modes:

  • --json / --output json: Full structured plan with step instructions, SDK recipes (17 SDKs), and recovery options
  • Plaintext (default): Human-readable summary with a hint to use --json

New files:

  • cmd/onboard.go — Cobra command entry point with --project and --environment flags
  • internal/onboarding/onboarding.go — Core types (OnboardingPlan, Step, RecoveryOption) and serialization
  • internal/onboarding/steps.go — Detailed agent-skill instructions for each step
  • internal/onboarding/sdk_recipes.go — SDK detection mappings (file patterns → SDK) with install/import/init snippets
  • Tests for both the command layer and internal package

Modified files:

  • cmd/root.go — Register the onboard command
  • cmd/templates.go — Add onboard to the CLI usage template

🔍 Key areas for reviewer attention:

  1. Static plan vs. stateful orchestrator: This implementation generates a static JSON plan that an AI agent interprets and executes. There is no runtime state machine or checkpointing in the CLI itself — the agent is expected to manage workflow state. Confirm this is the right approach for the agent-skills model.
  2. Tools field values (readFile, writeFile, runCommand, etc.) are conceptual tool names for the AI agent — they are not tied to actual MCP tool definitions. Verify these match the expected contract.
  3. SDK recipes are hardcoded — install commands, import snippets, and init snippets could drift from actual SDK versions. The existing internal/sdks/sdk_instructions/*.md files are not consumed by this new code. Worth considering whether they should be.
  4. fmt.Sprintf in buildValidateStep and buildFirstFlagStep — these use multiple positional %s args for project/environment/baseURI repeated across the template. Verify argument ordering is correct.
  5. Viper flag bindinginitOnboardFlags binds ProjectFlag and EnvironmentFlag globally, which other commands also bind. This is a known pattern in the codebase but could cause test flakiness if test ordering changes.

Describe alternatives you've considered

  • Reuse the existing quickstart TUI (internal/quickstart): Rejected because the quickstart flow is interactive (bubbletea) and designed for human terminal use, not AI agent consumption.
  • Execute steps at CLI runtime: Could have built a stateful orchestrator that runs the steps directly, but the agent-skills model expects the CLI to provide instructions that the agent executes in its own environment (IDE, MCP session).

Additional context

All existing tests pass (make test). The command follows established patterns from cmd/quickstart.go and cmd/sdk_active/sdk_active.go.

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

Co-Authored-By: Ari Salem <asalem@launchdarkly.com>
@devin-ai-integration
Copy link
Contributor 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

@devin-ai-integration
Copy link
Contributor Author

/label devin-pr

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.

0 participants