Popular Posts

Atlassian Engineering Leverages Rovo Dev to Automate Feature Flag Cleanup and Mitigate Technical Debt

At Atlassian, the practice of shipping every new feature and code path behind a feature flag has become a cornerstone of the company’s development philosophy, enabling teams to stage rollouts safely and identify potential issues before they impact the entire user base. However, as software products mature, these feature flags tend to accumulate, creating a significant burden of technical debt. Each successful rollout leaves behind "dead" code paths, stale configurations, and a growing list of follow-up tickets intended to "clean up the flag later." While company-wide requirements mandate extensive feature flag coverage, the subsequent cleanup work is often viewed as highly repetitive and easy to postpone in favor of new feature development.

How We Turned Feature Flag Cleanup Into a Mostly‑Hands‑Off AI Workflow - Work Life by Atlassian

The scale of this challenge is illustrated by the metrics of a single service within Atlassian, which has managed 160 feature flags since its inception. Of those, 40 were created within a recent 60-day window, highlighting how feature flags have become a daily component of developer workflows. In the current era of AI-driven development, the rate of feature flag introduction is only increasing. Historically, each feature flag was accompanied by a specific work item for cleanup. Engineers were required to track these items to remove dead code and eliminate unnecessary complexity that otherwise caused context switching and interrupted the development of new features.

Despite the importance of this maintenance, the rate of cleanup frequently lagged behind the introduction of new flags due to the pressures of sprint planning and constant interruptions. This imbalance often forced teams to prioritize cleanup tasks over new features during specific sprints to prevent the codebase from becoming unmanageable. To address this systemic inefficiency, Atlassian engineers turned to Rovo Dev, an AI-powered developer tool, to automate the lifecycle of feature flag management and restoration.

How We Turned Feature Flag Cleanup Into a Mostly‑Hands‑Off AI Workflow - Work Life by Atlassian

The journey toward automation began with an analysis of why generic AI solutions were insufficient for the task. Most AI-enabled coding tools offer a basic "feature flag cleanup" capability, but in a complex, enterprise-level codebase, these generic prompts often yield poor results. Initial experiments revealed that standard AI models frequently missed critical call paths, broke existing tests, or left configurations in an inconsistent state. When developers found that fixing the AI’s output required more effort than performing the cleanup manually, the tooling became a source of discouragement rather than a productivity booster.

The primary issue was that generic prompts lacked an understanding of the specific "reality" of the repository, such as how tests were structured, how configuration files were organized, and which specific libraries were utilized for flag evaluation. To overcome this, the engineering team decided to specialize the AI’s knowledge. The first step involved creating a repo-tailored cleanup command. Using the Rovo Dev Command Line Interface (CLI), the team developed saved prompts specifically designed for their service, modeled after successful manual cleanup commits.

How We Turned Feature Flag Cleanup Into a Mostly‑Hands‑Off AI Workflow - Work Life by Atlassian

These custom commands were designed to encode the specific logic of how feature flags functioned within that particular codebase. Two distinct commands were established: one for a single flag cleanup on a current branch, and a batch command where Rovo would create separate branches and changes for multiple specified flags. These commands were stored directly within the repository, ensuring a single source of truth and allowing them to be reused across various tools, including the CLI and the Jira interface.

By integrating Rovo Dev into Jira, engineers were able to run multiple cleanup sessions simultaneously through a browser-based interface. This visibility was crucial for refining saved prompts and AI flows, as it allowed developers to identify issues and implement fixes immediately. However, the team recognized that the first iteration would not be perfect. The initial run of the custom "clean-feature-gate" prompt achieved an effectiveness rate of approximately 60%. While superior to generic prompts, this was not yet reliable enough for full automation.

How We Turned Feature Flag Cleanup Into a Mostly‑Hands‑Off AI Workflow - Work Life by Atlassian

To close this gap, Atlassian implemented a "self-improvement" phase. They created a specialized prompt designed to reflect on unsuccessful cleanup Pull Requests (PRs). For every failed attempt, the team followed a specific feedback loop: they would examine the Rovo Dev session in Jira, provide clear feedback on what the AI missed or oversimplified, and then run an improvement command. This allowed Rovo to update its own command definitions, preventing future failures and ensuring a higher success rate. This iterative loop eventually raised the effectiveness of the automation to over 90%. Interestingly, the remaining failures were often attributed to gaps in existing test coverage rather than AI error, serving as a reminder that effective automation relies on high-quality, well-tested code.

Once the prompts were sufficiently robust, the team moved to the next stage of evolution: connecting Jira Automation with Rovo Dev for hands-off generation. A simple rule was established where adding a specific label, such as "cleanup-ff," to a Jira ticket would trigger a Rovo Dev session to automatically generate a PR for that flag. This approach allowed developers to trigger complex code removals without leaving their project management environment.

How We Turned Feature Flag Cleanup Into a Mostly‑Hands‑Off AI Workflow - Work Life by Atlassian

However, a new practical challenge emerged: running cleanup for many flags simultaneously increased the likelihood of merge conflicts, particularly in high-churn areas of the codebase. It also created "review peaks," where engineers were suddenly overwhelmed with multiple PRs to verify. To solve this, the team implemented a Jira-driven queue for feature flag cleanup. A Jira automation script was set to run every hour, checking for tickets with the cleanup label that were not yet "In Progress." It would select the oldest ticket, transition it to "In Progress," and trigger the Rovo Dev session.

This flow control mechanism ensured that only one cleanup was in motion at any given time, dramatically reducing noise and merge conflicts while keeping the cleanup pipeline moving consistently. The result of this comprehensive automation strategy has been a significant reduction in the "cleanup debt" that previously plagued the team. By treating AI prompts as first-class assets stored alongside the code, Atlassian has transformed a repetitive, manual chore into a streamlined, background process.

How We Turned Feature Flag Cleanup Into a Mostly‑Hands‑Off AI Workflow - Work Life by Atlassian

The benefits of this system extend beyond mere time savings. It has reduced the cognitive load on engineers, who no longer need to track stale flags or worry about the context switching required for manual deletions. Furthermore, it has improved the overall health of the codebase by ensuring that dead code is removed promptly and accurately.

For other engineering teams looking to replicate this success, Atlassian offers several key lessons. First, generic AI prompts are rarely sufficient for complex tasks; specialization and repository-specific context are essential. Second, automation should be treated as an iterative process that requires a feedback loop for continuous improvement. Third, storing AI commands and prompts within the repository ensures they remain versioned and accessible as a single source of truth. Finally, integrating AI tools with existing project management workflows, such as Jira Automation, can turn manual tasks into seamless, "hands-off" operations.

How We Turned Feature Flag Cleanup Into a Mostly‑Hands‑Off AI Workflow - Work Life by Atlassian

By investing in these repo-specific AI flows, Atlassian has demonstrated that the challenge of feature flag accumulation is not an inevitable byproduct of modern development, but rather a problem that can be solved through the strategic application of specialized AI and automated orchestration. The success of Rovo Dev in this context provides a blueprint for how AI can be used to manage technical debt across the broader software industry.

Leave a Reply

Your email address will not be published. Required fields are marked *