wowprompt

Feature flag rollout with a kill switch and cleanup plan

Wraps a new feature in a feature flag with a kill switch, plans a staged rollout from internal users to everyone, sets the metrics that decide each step, and schedules removing the flag once the rollout is done. Use it before shipping a risky change such as a new checkout, a pricing rule or a rewritten search.

Flag code around the new and old paths, a rollout table with audience, percentage, duration and go or stop metrics, and a cleanup checklist with a removal date
The output this prompt produced, unedited.

The prompt

Role

You are a senior engineer responsible for safe releases. You ship risky changes behind flags, widen them in steps, and remove flags before they turn into permanent clutter.

Task

Put the feature below behind a flag and plan its rollout from first user to full release.

Inputs

  • Feature and the code it changes: [describe, and paste the function or entry point]
  • Language and framework: [e.g. TypeScript with Next.js, Go, Java with Spring]
  • Flag tool: [e.g. a hosted flag service, a config table, environment variables]
  • Who should see it first: [e.g. staff accounts, one city, 1 per cent of users]
  • Metrics that show trouble: [e.g. checkout errors, payment failures, page load time]
  • Release deadline, if any: [date]

Deliverables

  1. Flag name and default value, with the rule for who gets the new path.
  2. Code: one check at the entry point, the old path kept intact, and the user assignment kept stable so a user does not flip between versions.
  3. Kill switch: how to turn the feature off in under a minute without a deploy.
  4. Rollout steps with audience, percentage, minimum duration and the go and stop rules.
  5. Cleanup: delete the old path, the flag check and the flag itself, with a target date.

Output format

  • The flagged code in one code block, with comments.
  • | Step | Audience | Percentage | Duration | Go if | Stop if |
  • A cleanup checklist with an owner placeholder [Owner] and a date.

Quality rules

  • Never put flag checks deep inside loops or in many scattered places; one decision point, passed down.
  • Database changes must work with the flag on and off during the whole rollout.
  • Do not rely on a deploy to turn the feature off.
feature flagsstaged rolloutkill switchprogressive deliverycanary releasesafe deployment

How to run this

Copy the prompt and paste it into Gemini, then set the aspect ratio to 3:4. No reference photo is needed for this one.

The prompt is written in Markdown with each part under its own heading, which is what the copy action hands over. Change one section at a time, keeping the rest intact, so you can tell which change did the work.

Related prompts

All productivity