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
BLOCKEDstatus 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.
- Run
transpose_winning_experimentto get the selected variation’s code and implementation instructions. - Convert the code into native, production-ready code in the language and framework your codebase uses, so it fits the existing code.
- Create a feature flag in Kameleoon and gate the new implementation behind it.
- 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’sfallbackVariationId 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.