Skip to content

feat(sync): attach tools and skills to variations - #841

Merged
ctawiah merged 2 commits into
mainfrom
ctawiah/sync-attach-workflow
Oct 8, 2026
Merged

ctawiah merged 2 commits into
mainfrom
ctawiah/sync-attach-workflow

Conversation

@ctawiah

@ctawiah ctawiah commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Context

This layer gives users a direct way to attach an existing LaunchDarkly tool or skill to a variation that is already synchronized in their workspace. The same flow works interactively and through explicit command flags, so it can also be used in non-interactive environments.

What changes

  • Adds --attach-tool and --attach-skill to ldcli sync prompt.
  • Searches LaunchDarkly for matching tools and skills instead of loading the full catalog locally.
  • Lets users search for a project and choose a variation that is already synchronized in the workspace.
  • Supports --project and --variation when the caller already knows the target.
  • Always fetches the latest tool or skill version before attaching it.
  • Saves the attachment file and variation reference together so a failed variation update does not leave an unused file behind.
  • Prevents skills from being attached to completion-mode configs because LaunchDarkly only supports them on agent-mode configs.
  • Uses one shared attachment flow for tools and skills so another versioned attachment type can follow the same pattern later.

For example:

ldcli sync prompt --attach-tool search-docs
ldcli sync prompt --attach-skill support-guidance --project production --variation support/default

Review focus

  • Is the interactive flow clear about selecting a synchronized variation?
  • Do explicit flags provide everything needed for non-interactive use?
  • Does the command always resolve the latest attachment version before updating the variation?
  • Are failed or canceled attachments cleaned up without changing existing local files?
  • Is the shared workflow simple enough to extend to another attachment type later?

Verification

  • go test ./cmd/sync ./internal/sync/prompt ./internal/sync/local
  • go test ./...
  • git diff --check

Related changes

Review the stack in this order:

  1. Confirm destructive watch actions
  2. Guarantee prompt fingerprint convergence
  3. Add searchable attachment API foundations
  4. Reconcile variation attachments
  5. Attach tools and skills to variations
  6. Render attachment-aware review output
  7. Safely clean unreferenced attachments
  8. Persist sync manifests in LaunchDarkly

Note

Overview
Adds --attach-tool and --attach-skill to ldcli sync prompt so users can wire the latest LaunchDarkly tool or skill onto an already-synced variation, then run the usual sync pipeline to push changes.

The CLI accepts an explicit key or bare flags for interactive catalog search (SearchAttachments), plus --project and --variation for non-interactive targets. Attachment runs only when a local sync workspace exists, cannot be combined with --add, --detach, --watch, etc., and is cleared on watch retries. attachToVariation reuses existing on-disk attachment content when another variation already references the same tool/skill, rejects skills on completion-mode variations, and updates the local store atomically (failed variation writes roll back new attachment files).

After attach, the command still plans, reviews, and syncs like a normal sync prompt run.

Reviewed by Cursor Bugbot for commit 090b7ef. Bugbot is set up for automated code reviews on this repo. Configure here.

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Stale Bugbot comment from a previous run.

Comment thread cmd/sync/prompt.go Resolved

@ld-ahartmann ld-ahartmann left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

gave this whole stack some ai review and discussion - no negative feedback from my end! seems like everything in here is pretty isolated from the rest of the cli

@ctawiah
ctawiah force-pushed the ctawiah/sync-attach-workflow branch 2 times, most recently from b03c8e8 to 78c89de Compare October 7, 2026 15:44

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Stale Bugbot comment from a previous run.

Comment thread internal/sync/prompt/runner.go Resolved
Base automatically changed from ctawiah/sync-attachment-reconciliation to main October 8, 2026 00:02
@ctawiah
ctawiah force-pushed the ctawiah/sync-attach-workflow branch from 78c89de to 090b7ef Compare October 8, 2026 00:13
@ctawiah
ctawiah merged commit 94512ad into main Oct 8, 2026
10 checks passed
@ctawiah
ctawiah deleted the ctawiah/sync-attach-workflow branch October 8, 2026 00:18

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

Reviewed by Cursor Bugbot for commit 090b7ef. Configure here.

Comment thread cmd/sync/prompt.go
if project != "" || variation != "" {
return nil, fmt.Errorf("--project and --variation require --attach-skill or --attach-tool")
}
return nil, nil

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Project flag collides with config

High Severity

The new --project flag shares the name of the global default project stored in config and LD_PROJECT. Validate rebinds every command flag from Viper, so a configured project fills --project even when the user omitted it. A normal ldcli sync prompt then fails because --project is treated as an attach-only flag, and attach can also target the wrong project without an explicit flag.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 090b7ef. Configure here.

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.

2 participants