Skip to content

feat(experiment-setup): require approval before creating, starting, or changing the flag - #224

Open
cromeroLD wants to merge 6 commits into
mainfrom
carmen/experiment-setup-confirm-design-before-start
Open

cromeroLD wants to merge 6 commits into
mainfrom
carmen/experiment-setup-confirm-design-before-start

Conversation

@cromeroLD

@cromeroLD cromeroLD commented Oct 23, 2026 •

Copy link
Copy Markdown

Summary

Updates launchdarkly-experiment-setup so the agent never creates, starts, or
changes anything without the user's approval. Previously the skill went straight
from creating an experiment to starting it, and didn't ask the user for the design.

  • Requires the flag and variations, hypothesis, control, randomization unit, and
    primary metric from the user; asks for any that are missing in one message, and
    never fills them in itself.
  • For a new custom-event metric, checks with list-metric-events that the event is
    reaching LaunchDarkly before creating it.
  • Shows the full design, including metric settings and LaunchDarkly defaults, and
    waits for an explicit yes before create-metric or create-experiment.
  • Starts an iteration (including via save-and-start-experiment-iteration) only after
    the user explicitly says to start.
  • If the flag is off when the user says to start, leaves it unchanged, explains that
    turning it on serves its variations to users, and asks who should turn it on.
  • Bumps the skill to 0.3.0 and updates skills.json and the CHANGELOG.

Testing

Automated: scripts/validate_skills.py, python3 -m unittest discover -s tests,
and scripts/generate_catalog.py --check all pass, run locally with Python 3.12
(the system Python 3.9 can't run these scripts).

Live, against a demo project (test environment) with a local Node.js app, a
string flag, and a custom event:

  • Full design, new metric: showed the full design with defaults and stopped; "yes"
    created the metric and experiment without starting; stopped correctly with the
    control as winner.
  • Flag off at start (found in testing, fixed in this PR): originally the agent turned
    the flag on by itself when told to start. After the fix, it changes nothing, explains
    the impact, asks who should turn it on, re-checks the flag version once it's on, and
    confirms before starting.
  • No start without a go: "yes, create it" left the experiment not started in every run.
  • Incomplete design: asked for the missing control, randomization unit, and primary
    metric in one message, offered examples without choosing, and created nothing.
  • Missing event: for a metric on an event that never arrived, reported it wasn't
    reaching LaunchDarkly and created nothing.
  • Existing metric: reused it by name and key, with no event check.
  • Mid-experiment change: a 70/30 split request explained it would start a new
    iteration, asked which variation gets 70%, and waited for an explicit start.
  • End to end: simulated traffic (500 users) appeared in experiment results.

Retested after review fixes: a complete design still goes straight to approval with no extra questions; a blank measure blocks creation until it’s filled in and the full design is re-approved; the event check waits until the user names the metric kind and event key; incomplete-design and missing-event tests behave as before.

Notes

  • docs/skills.md and docs/versioning.md are referenced in CONTRIBUTING but
    missing, so this follows the conventions of launchdarkly-metric-create.
  • The published LaunchDarkly plugin (1.0.2) includes flag, AI Configs, and metric
    skills, but no experiment skills. Should experiment skills be added to the plugin?
  • Possible follow-ups, not in this PR: stopping an experiment isn’t gated by confirmation; key and metric lookups don’t account for archived experiments or metrics, so a proposed key can collide with an archived one (the skill asks how to proceed when it does).

Note

Overview
Tightens launchdarkly-experiment-setup (0.3.0) so the agent cannot create metrics/experiments, start iterations, or change flags without explicit user consent and a complete design.

The skill now requires user input for flag/variations, hypothesis, control, randomization unit, and primary metric (never inferred). For new metrics, it defers list-metric-events until the user confirms a custom event and names the event key (not the metric name); creation is blocked if the event is not flowing. Design review must show defaults and metric measurement; generic approvals like "yes" or "create it" do not fill a blank measurement type—only a named measure, then a second approval, unlocks create-metric / create-experiment. Starting (start-experiment-iteration, save-and-start-experiment-iteration) waits for an explicit go; if the flag is off, the agent explains impact and asks who should enable it instead of toggling the flag itself.

skills.json and CHANGELOG are updated for 0.3.0.

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

Carmen Romero and others added 3 commits October 23, 2026 11:36
Require the flag, hypothesis, control, randomization unit, and primary metric from the user, and wait for an explicit yes before creating a metric or experiment or starting an iteration.

Co-authored-by: Cursor <cursoragent@cursor.com>
Starting an experiment must not silently turn the flag on and begin serving variations.

Co-authored-by: Cursor <cursoragent@cursor.com>

@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 2 potential issues.

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 02afad3. Configure here.

Comment thread skills/experiments/launchdarkly-experiment-setup/SKILL.md Outdated
Comment thread skills/experiments/launchdarkly-experiment-setup/SKILL.md Outdated
@github-actions

github-actions Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

Skill eval results

Skill Before After Δ
agentcontrol/configs-create 100/100 (4/4) 100/100 (4/4) no change
agentcontrol/configs-update 80/100 (4/5) 80/100 (4/5) no change
agentcontrol/configs-variations 80/100 (4/5) 80/100 (4/5) no change
agentcontrol/tools 75/100 (3/4) 75/100 (3/4) no change
feature-flags/flag-and-release-change - 100/100 (4/4) new
feature-flags/flag-release - 80/100 (4/5) new
feature-flags/launchdarkly-flag-command - 100/100 (3/3) new
feature-flags/launchdarkly-flag-create 100/100 (3/3) 100/100 (4/4) no change
feature-flags/launchdarkly-flag-drift - 100/100 (4/4) new
feature-flags/should-flag-change - 100/100 (17/17) new
onboarding - 75/100 (3/4) new

Only suites whose source actually changed since their last recorded score were re-run. Soft-failing while we stabilise the baseline.

Carmen Romero and others added 3 commits October 23, 2026 16:16
A blank measure stays blank until the user names it, and that reply only restates the completed design for a separate approval.

Co-authored-by: Cursor <cursoragent@cursor.com>
…s known

A missing metric name is not an event key. Wait until the user says the metric is custom and names the key before calling list-metric-events.

Co-authored-by: Cursor <cursoragent@cursor.com>
Fold the measure and event-key fixes into the existing 0.3.0 changelog entry instead of bumping the version.

Co-authored-by: Cursor <cursoragent@cursor.com>
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