migrate-optimizely-execute-flags

A slash command that carries out a planned migration of feature flags to Optimizely Confidence, a feature-management service. It finds the migration plan, checks unsupported rule conditions, and requires all migrated flags to be resolved.

In plain words
What is it for?
Use it after planning an Optimizely flag migration to create the flags and import their supported targeting rules.
Why use it?
It prevents flags from being created from memory and catches rules that cannot be imported safely, while ensuring each flag has a usable default targeting rule.

Command

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/spotify/confidence-ai-plugins/migrate-optimizely-execute-flags
Clone the repo
git clone --depth 1 https://github.com/spotify/confidence-ai-plugins
Per session 50 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 984 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00050 $0.00984
Opus 5 $0.00025 $0.00492
Sonnet 5 $0.00010 $0.00197
Haiku 4.5 $0.00005 $0.00098

Measured 2d ago against content hash 443d8fe63a1d, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

migrate-optimizely-execute-flags scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

commands/migrate-optimizely-execute-flags.md · 90 lines

What it actually says

Treat this slash command as /migrate-optimizely execute flags.

Read skills/migrate-optimizely/SKILL.md (agent-only; do not narrate).

Starting Phase 1 — Flag execute.

Find .claude/plans/optimizely-flag-migration-*.md (newest if several). If none, run /migrate-optimizely-plan-flags first — do not create flags from memory. If Overall is not complete, ask resume the plan vs execute anyway.

Then follow Execute: How It Works → For flag plans (consent gate, then Flag Setup Sequence). Do not run access IAM writes or code transforms.

Catch-all guarantee: after rules for each flag, if it still has zero enabled targeting rules, automatically add/enable an everyone catch-all (default variant). Empty Confidence rules do not serve everyone. See Automatic everyone catch-all in SKILL.md.

Unsupported operators (must stay flagged): before create or rules import, re-check for exists / substring / regex. Those rules are BLOCKED in Confidence — list them, do not import them as-is, and do not clear BLOCKED without a recorded workaround. See UNSUPPORTED- OPERATOR GATE and Rules operator audit in SKILL.md.

Progress bars (mandatory — must be visible in chat): every long write loop must show a live / bar in the chat transcript (not only inside a collapsed shell panel). Required for flag create, production waterfall / targeting-rules import, catch-alls, and resolve verify. For bulk runs: write a script file + progress file, then every ~15–30s paste the latest bar line into a chat reply. Do not use a giant inline heredoc whose UI shows … N lines hidden, and do not treat silent waits as progress. See Execute progress bar in SKILL.md.

Targeting rules (mandatory next step after flag create): after flag shells exist, stop and suggest importing planned specific rules (_rulesets / confidenceRules) as the next step — do not jump to plan code or declare Phase 1 complete. Use this handoff in chat:

───── Flag create complete ─────────────────────────────
Next (required): import targeting rules
  [1] Start targeting-rules import  ← suggested
  [2] Pause

Then run the import with its own chat-visible bar:

Execute Flags · targeting rules ████… N/TOTAL flag-id · rule-name

Do not only create flags + everyone catch-alls while skipping planned rules. Do not fold rules into the create bar. Use the canonical emitter in Production waterfall / targeting-rules import (optimizely_execute_rules_progress.txt + chat paste every ~15–30s). Milestone-only ... created 50 rules or collapsed shell output alone is a bug.

Validate Phase 1 — resolve all (natural next step after rules): after targeting-rules import finishes, stop and suggest resolve-verifying every migrated flag for segment match. This is how Phase 1 is definitively validated — do not call Phase 1 complete or jump to plan code after rules alone. Use this handoff:

───── Targeting rules import complete ──────────────────
Next (required to validate Phase 1): resolve-verify ALL migrated flags
  Goal: every flag returns a segment match (expected variant)
  [1] Start resolve-verify all flags  ← suggested (validates Phase 1)
  [2] Pause

Then run Phase 1 resolve gate with a chat-visible bar (Execute Flags · resolve verify ████… N/TOTAL). Spot-checking 3–5 flags is not enough. NO_SEGMENT_MATCH / empty assignment = fail. Write .claude/plans/optimizely-flag-resolve-verify-<date>.json. Do not say Phase 1 validated while any migrated flag fails verify unless the operator explicitly skips it with a reason. Only then suggest plan code.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 90 lines · 50 tokens per session scan A 443d8fe63a1d

Subscribe to this mod's changes

migrate-optimizely-execute-flags is a command published in the GitHub repository spotify/confidence-ai-plugins (8 stars, last pushed today), licensed Apache-2.0. It adds 50 tokens to every session and 984 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.