Skip to main content
A winning variation lives in Kameleoon as experiment code, so your team has to rewrite it in your codebase before the change can ship. Doing that by hand means fetching the code, rebuilding it as native code, and wrapping it in a flag so you can release it to part of your traffic first. Your AI assistant runs these steps through the Kameleoon MCP server, starting with transpose_winning_experiment, which selects the variation and returns its code in one call. The assistant needs access to your repository to follow its conventions, and it doesn’t stop or delete the experiment. The result is a flag with a delivery rule, and the rule goes live in the target environment once you confirm the enable preview.

How the assistant converts a variation

transpose_winning_experiment retrieves the code of one variation in your experiment and returns instructions for re-implementing it behind a new feature flag. The tool picks the variation in one of two modes:
  • Winner only (default): The tool converts the winning variation. If the results show no clear winner, the tool returns a BLOCKED status instead of code, and the assistant reports that to you.
  • Manual selection: The tool converts the variation whose ID you give it, whether or not that variation won. In this mode, the tool doesn’t check for a winner.
Choose manual selection when the results show no clear winner but you still want to ship one variation, or when you want to ship a variation other than the winner. The assistant runs these four steps:
  1. Run transpose_winning_experiment to get the selected variation’s code and implementation instructions.
  2. Convert the code into native, production-ready code in the language and framework your codebase uses, so it fits the existing code.
  3. Create a feature flag in Kameleoon and gate the new implementation behind it.
  4. Enable the flag after you confirm the preview, then validate the feature in production.

Before you begin

  • Setup: Connect Kameleoon to your AI assistant. For a chat assistant such as Claude or ChatGPT, see Connect Kameleoon to Claude and ChatGPT. For a coding agent such as Claude Code, Codex, or Cursor, see Set up MCP clients.
  • Experiment: a finished experiment. Winner only mode needs a clear winner, and manual selection needs the ID of the variation to convert.
  • Codebase: access for your AI assistant to the repository it changes, so it can follow your existing conventions.

Automate the rollout

The transpose tool covers the winner check and the code retrieval in one call. Converting the code and rolling it out still benefit from an explicit system prompt, because the prompt sets the rules the assistant follows. The prompt below works with any language or framework, because the assistant converts the code to match the codebase it works in. It tells the assistant to call the tool, convert the code, gate it behind a new feature flag, and roll it out, all through the MCP tools.

Ship the winner with a prompt

Paste the prompt below into your AI assistant to have it convert a variation, gate it behind a feature flag, and roll it out. Enter the ID of your experiment in the Experiment ID field. To convert a variation you choose instead of the winner, select the Convert a variation you select manually checkbox. The checkbox shows the Fallback variation ID field, which is the tool’s fallbackVariationId parameter. Enter the ID of the variation to convert there. When the workflow finishes, the flag exists with a delivery rule that starts at the release time you set. The flag is enabled in the target environment only after you confirm the enable preview, and the assistant reports the final configuration from feature_flag_get. Tool parameters are in the Experiment tools and Feature flag tools references.