Skip to content

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

Open
ctawiah wants to merge 1 commit into
ctawiah/sync-attachment-reconciliationfrom
ctawiah/sync-attach-workflow
Open

ctawiah wants to merge 1 commit into
ctawiah/sync-attachment-reconciliationfrom
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, with optional --project and --variation for non-interactive runs. Bare flags open interactive search against LaunchDarkly (not a full local catalog) and pick among already-synced variations.

Attachment runs before the normal sync pipeline: it loads the latest tool or skill version, writes local attachment files, and updates the variation reference—reusing existing on-disk attachment content when another variation already uses the same key so shared edits are not overwritten. Failed variation updates roll back new attachment files; skills are rejected for completion-mode configs.

Attachment mode is isolated from --add, --detach, --dry-run, --link, and --watch (watch clears one-shot attachment on subsequent runs).

Reviewed by Cursor Bugbot for commit 78c89de. 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

@ld-ahartmann ld-ahartmann 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.

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 from cb03620 to b03c8e8 Compare October 7, 2026 15:41
@ctawiah
ctawiah force-pushed the ctawiah/sync-attach-workflow branch 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.

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

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 78c89de. Configure here.

Key: options.Attachment.Key,
Interactive: runner.isTerminal(options.Input, options.ErrorOutput),
Input: options.Input,
Output: options.Output,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

TTY check uses the wrong stream

Medium Severity

Interactive attach decides whether a terminal is available from stdin and stderr, then renders the project, variation, and attachment pickers on stdout. Redirecting stdout still looks interactive, so the picker runs on a non-TTY. The other sync selectors check the same stream they write to.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 78c89de. 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