Repository navigation
feat(sync): attach tools and skills to variations - #841
Conversation
3008538 to
cb03620
Compare
ld-ahartmann
left a comment
There was a problem hiding this comment.
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
b03c8e8 to
78c89de
Compare
78c89de to
090b7ef
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
Reviewed by Cursor Bugbot for commit 090b7ef. Configure here.
| if project != "" || variation != "" { | ||
| return nil, fmt.Errorf("--project and --variation require --attach-skill or --attach-tool") | ||
| } | ||
| return nil, nil |
There was a problem hiding this comment.
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)
Reviewed by Cursor Bugbot for commit 090b7ef. Configure here.


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
--attach-tooland--attach-skilltoldcli sync prompt.--projectand--variationwhen the caller already knows the target.For example:
Review focus
Verification
go test ./cmd/sync ./internal/sync/prompt ./internal/sync/localgo test ./...git diff --checkRelated changes
Review the stack in this order:
Note
Overview
Adds
--attach-tooland--attach-skilltoldcli sync promptso 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--projectand--variationfor 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.attachToVariationreuses 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 promptrun.Reviewed by Cursor Bugbot for commit 090b7ef. Bugbot is set up for automated code reviews on this repo. Configure here.