Inspiration Every developer has experienced the anxiety of making a seemingly small code change, only to discover it broke something unexpected in production.This fear often leads to overly cautious development, slow refactoring, and accumulating technical debt. I wanted to solve this problem by giving developers a tool that could predict the impact of their changes before they even write a line of code.

What it does SmartRefactorer is an AI agent that uses GitLab Orbit's structured knowledge graph to analyze the "blast radius" of any code change. When a developer asks about modifying a file, module, or function, SmartRefactorer:

  1. Identifies the target- Clarifies exactly what needs to change
  2. Queries GitLab Orbit - Finds all dependencies, importing files, recent merge requests, and contributors
  3. Analyzes the Blast Radius- Determines which files have the highest risk of breaking
  4. Provides a structured report - Delivers risk level, impacted files, suggested tests, recommended reviewers, and precautionary steps The agent transforms developer intuition into data-driven confidence, making large-scale refactoring safer and more predictable. How we built it

Technologies Used:

  • GitLab Orbit - The core knowledge graph that provides structured, queryable access to the codebase
  • GitLab Duo Agent Platform - The framework for creating and hosting custom AI agents
  • GitLab Duo Agentic Chat - The interface where developers interact with SmartRefactorer
  • Termux (Android) - The development environment used to build and test the agent Development Process:
  • Set up the development environment on an Android device using Termux
  • Installed the GitLab CLI (glab) to access GitLab Orbit via the terminal
  • Authenticated with GitLab and tested Orbit connectivity
  • Created a custom agent in the GitLab AI Catalog with a carefully crafted system prompt
  • Designed the system prompt to guide the agent through a structured analysis workflow
  • Published the agent as Public in the AI Catalog
  • Tested the agent with real queries on the eco-scan project Key Design Decisions: The system prompt was the most critical component. I structured it to:
  • Define the agent's role as an expert software architect
  • Provide clear, step-by-step instructions for analysis
  • Emphasize the use of GitLab Orbit for real data
  • Deliver actionable, structured reports (not just generic advice) Challenges we ran into Technical Challenges:
  • Installing glab on Termux - The package wasn't initially available in the default repositories. I had to use the glab-cli package and ensure proper authentication.
  • Orbit Accessibility - Testing Orbit queries required the right permissions and scopes. I had to generate a personal access token with api and read_api scopes.
  • Agent Response Formatting - Getting the agent to produce structured, consistent output required iterative refinement of the system prompt.
  • Large Project Analysis - When analyzing large codebases like gitlab-org/gitlab, Orbit queries could take significant time to return results. Resource Constraints:
  • Building and testing entirely on an Android device using Termux
  • Limited screen space for development and testing
  • Managing multiple browser tabs for GitLab, Devpost, and documentation Accomplishments that we're proud of ✅ Created a fully functional AI agent*that meaningfully uses GitLab Orbit ✅ Published the agent as Public in the GitLab AI Catalog ✅ Demonstrated real-world impact by analyzing an actual project (eco-scan) ✅ Built the entire project on an Android phone - proving that hackathons are accessible to everyone ✅ Designed a professional system prompt that delivers structured, actionable reports ✅ Successfully integrated with GitLab Orbit - showing the power of knowledge graphs for software development ✅ Created a solution that solves a genuine developer pain point What we learned Technical Takeaways:
  • GitLab Orbit is incredibly powerful for understanding codebase relationships
  • The knowledge graph approach (nodes and edges) makes complex queries intuitive
  • AI agents are only as good as their system prompts - clear instructions yield better results
  • Building on mobile devices is viable with the right tools (Termux + GitLab CLI) Soft Skills:
  • The importance of storytelling in hackathon submissions
  • How to demonstrate value through structured responses
  • The value of focusing on a specific, well-defined problem GitLab Platform Insights:
  • The AI Catalog makes agent discovery and publishing seamless
  • Duo Agentic Chat provides a natural interface for developers to interact with agents
  • Orbit's schema covers all the essential entities for software development analytics What's next for SmartRefactorer Feature Enhancements:
  • Visualization Dashboard- Create a web interface showing dependency graphs and blast radius reports visually
  • CI/CD Integration - Automatically run SmartRefactorer on every merge request to flag high-risk changes
  • Custom Reports - Support for generating specific reports like "Security Impact" or "Test Coverage Impact"
  • Visualization - Integrate with the GitLab UI to highlight impacted files directly in merge requests
  • Team Insights - Provide metrics on code ownership and expertise to suggest reviewers Expansion Plans:
  • Multi-Project Analysis - Extend to analyze cross-project dependencies in GitLab groups
  • Historical Analysis - Learn from past changes to improve risk predictions
  • IDE Integration- Build plugins for VS Code and other IDEs
  • Team Insights - Provide metrics on code ownership and expertise to suggest reviewers Community Goals:
  • Open Source- Share the agent template so other developers can create similar tools
  • Contributor Friendly - Add documentation to help others contribute
  • Hackathon Submissions - Use SmartRefactorer to help other hackathon participants understand their codebases

Built With

Share this project:

Updates