From 8 years down to 6 months: How we built AI to split the monday.com monolith
- The Moonshot Challenge: monday.com faced the daunting task of breaking apart a massive decade-old JavaScript client monolith (containing thousands of Redux-based components, actions, selectors, and reducers). The manual effort was originally estimated to take 8 person-years, but the team set an ambitious goal to achieve it in 6 months using AI during an internal "AI Month" initiative.
- Why Custom AI Was Needed: Standard tools like Cursor or Claude's CLI were insufficient for the scale and complexity of the project. Relying solely on raw AI often led to hallucinations or loss of context on massive tasks. The team required a system that could execute complex refactoring workflows in parallel, completely independently, and without constant human prompting.
- The Solution (Morphex): The team built a custom, hybrid migration system named Morphex. It combines AI capabilities with a deterministic NodeJS orchestrator, static analysis, and traditional codemods. The tool operates under a strict "Research -> Plan -> Review" execution pattern.
- Algorithmic Codebase Mapping: Morphex repeatedly scans and parses the client codebase into a monday.com board. Every file is treated as an item and receives an algorithmic score based on:
- Complexity: Number and severity of dependencies.
- Impact: How many other files rely on it.
- Challenges: Existing legacy issues or technical debt.
- Core: Relevance to the target migration scope. The system follows an iterative cycle, picking and extracting the highest-scoring files first, which sequentially simplifies the remaining un-extracted files.
- Deterministic Orchestration and Validation Loops: To prevent AI hallucinations, the migration steps are kept small and deterministic. Before any code is committed, Morphex enforces strict automated validation loops (running linters, executing test suites, and performing automated code reviews). If a step fails, Morphex retries the task while feeding the error context back into the next AI prompt.
- Human-AI Collaboration (The Tooling):
- Human Todos: Morphex inserts deliberate "Human Todos" to trigger linting errors and block PR merges if it applies subjective judgment or detects a high-risk area requiring manual review.
- Feature Flagging: The system automatically wraps all newly migrated code (rewritten from JavaScript to TypeScript and transitioned to Zustand) behind feature flags for safe, gradual rollouts.
- Side-by-Side Testing: Morphex auto-generates a comprehensive test suite to run the new implementation side-by-side against the legacy code to verify functional parity.
- Key Results: Once fully operational, Morphex achieved a pace where it could successfully extract 1% of the massive client-side codebase in a single day—a velocity completely unattainable through manual development.