# Automating feature-flag cleanup at Yazio: from a prompt to CI

DevFeed: [Automating feature-flag cleanup at Yazio: from a prompt to CI](<https://devfeed.tech/articles/automating-feature-flag-cleanup-at-yazio-from-a-prompt-to-ci-117999.md>)

Original publisher: [Read original article](<https://medium.com/yazio-engineering/automating-feature-flag-cleanup-at-yazio-from-a-prompt-to-ci-8692fe823570?source=rss----65bd178b00af---4>)

Author: Artem Zasypalov

Published: 2026-11-04T08:29:23Z

Content type: article

Language: en

Sources: [YAZIO](<https://devfeed.tech/sources/yazio-engineering-medium.md>)

Topics: [agentic workflows](<https://devfeed.tech/topics/agentic-workflows.md>), [CI/CD](<https://devfeed.tech/topics/cicd.md>), [Pull Request](<https://devfeed.tech/topics/pull-request.md>), [jira](<https://devfeed.tech/topics/jira.md>)

Tags: [a-b-testing](<https://devfeed.tech/tags/a-b-testing.md>), [ab-testing](<https://devfeed.tech/tags/ab-testing.md>), [agentic-workflow](<https://devfeed.tech/tags/agentic-workflow.md>), [agents](<https://devfeed.tech/tags/agents.md>), [ai](<https://devfeed.tech/tags/ai.md>), [ai-coding-agents](<https://devfeed.tech/tags/ai-coding-agents.md>), [automation](<https://devfeed.tech/tags/automation.md>), [autonomous](<https://devfeed.tech/tags/autonomous.md>), [ci](<https://devfeed.tech/tags/ci.md>), [cleanup](<https://devfeed.tech/tags/cleanup.md>), [feature](<https://devfeed.tech/tags/feature.md>), [flag](<https://devfeed.tech/tags/flag.md>), [prompt](<https://devfeed.tech/tags/prompt.md>), [software-engineering](<https://devfeed.tech/tags/software-engineering.md>), [workflow-automation](<https://devfeed.tech/tags/workflow-automation.md>)

## AI overview

Yazio automated feature flag removal from a manually prepared engineering task to a GitHub CI workflow that handles cleanup through opening a PR, with human oversight retained for merging. A Product Manager's removal decision starts the process; the agent removes flags and prepares changes, while a review agent gives a preliminary review. Reliability changes let the workflow process multiple flags sequentially with a fresh agent context and separate commit for each. It reads the Jira decision alongside Growthbook results and skips a flag when they conflict. Failures, skipped flags, gate errors, and successful PR links are reported in Jira. Over almost a year, the workflow created 237 tasks across mobile squads. Median time from cleanup initiation to PR creation fell from 32 days before the local prompt, to 17 days with the local prompt or skill, and 5 days with CI. A successful CI run takes about 15 minutes and removes a median 243 lines across 7 files. The article says the latest reliability improvements had been running only about ten days, so their backlog effect was not yet clear.

## Source excerpt

Photo by Franck V. on Unsplash Remember those days when we thought robots and AI were supposed to take care of tedious things nobody wanted to do? Like washing dishes, taking out the rubbish? My team and I have been working to give AI a less physical version of that job: cleaning up after A/B tests. With more things being automated, we are expected to accomplish more as automatable work is often considered at least half done. There is truth to it. But it also means our context switching becomes the norm. A truly useful automation should preserve the focus of engineers as long as possible, meaning it should be able to act trustworthily without approval for as long as possible within the workflow. At the same time, critical stages should still be approved by a human. The definition of the critical stage might change over the next years with further advancements in AI and autonomous software development. Right now at Yazio, we consider merging a PR a critical stage that should be done under a human's oversight. We started experimenting with automated workflows that include AI coding agents over a year ago. Feature flag cleanup was one of the first ones for us to automate. Over several iterations, this effort has grown from a small 64-line prompt into an autonomous workflow, with an engineer only at the critical stage. I'd like to share our journey. Where cleanup starts Our A/B testing lifecycle has 3 core stages: Preparation, Running, and Cleanup. The Cleanup stage begins when the Product Manager chooses one of the 3 options after the test is stopped: 📦 Keep the flag if it still serves a purpose, for example, a feature config. 🔄 Update the code default if we want to roll out a variation as the new baseline while keeping the flag for another iteration. 🗑 Remove the flag if we decide to roll out one variation permanently. The workflow we designed covers the third case. The old process required me or someone else to pick up the A/B ticket, create an engineering task to r