How to effectively utilise AI to enhance large-scale refactoring

This post details a practical, end-to-end approach for using AI (primarily Rovo Dev, but can be migrated to other AI agents) to identify and remove new Navigation (Nav4) feature gates (FG) and mocks across the monorepo of Atlassian Frontend. It shares the experience using AI to enhance cleanup and lessons learned. The objective is to provide a repeatable, safe, and scalable workflow to use AI for large-scale codebase refactoring, specifically removing all Nav4 FGs and mocks with quality and speed. The approach involves making AI a good coder by establishing a durable AI context using a `memory` file to guide Rovo Dev in code generation, edit interpretation, and workflow assistance during each session. A discovery prompt is used to enumerate all Nav4 FG and mock patterns. A package-level cleanup method is defined using AI to perform targeted, high-quality transformations that can be reused across multiple packages, then used to drive code changes. Multiple threads are conducted to make code changes with DevBox. Key takeaways include that AI can think, not just be a script generator, codified context acts as a force multiplier, batching with tight feedback loops keeps large changes safe, discovery prompts turn ambiguity into a concrete plan, and quality comes from guardrails, not blind trust. The post also outlines next steps for creating an automated E2E workflow leveraging AI to modify code.
More from the AI-Native Software Development Capabilities in Jira trail
- A simpler way to run AI agents in Bitbucket Pipelines
- We’re bringing governed agent loops to the AI-Native SDLC
- How we made vulnerability fixes review-ready with Agentic Pipelines
- Agentic automation in practice: putting standard engineering work on autopilot
- Opening the door to agent autonomy: The architecture behind Rovo’s agent harness