Inspiration
The spark for Necroma came from a realization I had while building projects over the last two months. I noticed a pattern: I would spend hours designing the entire application architecture and implementation plan, put it all into a single reference file, and then use that file to guide an AI coding agent (like Cursor).
I observed that when my initial plan was crystal clear and the instructions were precise, the agent could build entire "vertical slices" of the app without me needing to intervene. It wasn't magic; it was just good context.
This got me thinking: "What is stopping us from automating this entire loop?"
Usually, the hard part of software development is figuring out the requirements—decisions evolve as the project evolves. But there is one specific scenario where all the requirements are known upfront: Legacy Migration. When you migrate an old app, you already know the screens, the behavior, and the business logic. You have the perfect "implementation plan" just waiting to be extracted.
That was the "Aha!" moment. If we can extract that plan automatically, we can build a marathon coding agent that rebuilds the software slice-by-slice, tests it, and self-heals until it matches the original behavior. We aren't just writing code; we are reincarnating it.
What it does
Necroma is an autonomous "Legacy Code Necromancer." It takes a legacy application (codebase + video recordings of user behavior) and transmutes it into a modern, test-backed web application.
Instead of just translating code line-by-line (which often just ports the bugs), Necroma:
- Watches the legacy app to understand actual user behavior.
- Plans a migration strategy based on "Vertical Slices" (e.g., "Login Flow," "Checkout Process").
- Builds the new app autonomously using Gemini, verifying each slice with browser-based tests.
- Heals itself when tests fail. If a selector is wrong or a logic error occurs, it reads the error, updates its plan, and fixes the code without human help.
It effectively turns the vague task of "rewrite this old app" into a deterministic, autonomous process.
How we built it
We built Necroma by connecting a "Left Brain" (Structure) and a "Right Brain" (Behavior):
- The "Right Brain" (Gemini 3 Pro): We use Gemini's multimodal capabilities to analyze video recordings of the legacy app. This gives us the "Behavioral Contract"—what the user actually sees and does.
- The "Left Brain" (Code Analysis): We parse the old codebase to understand the data structures and business logic.
- The Orchestrator: We use a vertical slicing implementation model. The agent picks one slice, generates the code (Next.js/React), and immediately spins up a browser to test it.
- The "Glass Brain" UI: We realized we needed to see what the agent was thinking. We built a dashboard that visualizes the agent's thought process, the active slice it's building, and the real-time test results.
Challenges we ran into
- The "Context Window" Trap: Early on, we tried to feed too much code to the LLM. We learned that even with massive context windows, precision drops. We had to implement a "Vertical Slice" architecture to feed the agent only what it needed for the current feature.
- Gemini 429 Errors: We hit rate limits (429 Too Many Requests) frequently with the Gemini 3 preview. We had to build robust backoff and retry logic into our agent loop.
- Hallucinated UI: Sometimes the agent would build a UI that looked great but didn't function like the original. We had to tighten our "Behavioral Contract" to ensure it wasn't just hallucinating a pretty interface but actually replicating the interaction steps.
- Output Cutoffs: Occasionally, the model would stop generating code mid-file. We had to implement a "continue" mechanism to stitch incomplete files together.
Accomplishments that we're proud of
- Autonomous Self-Healing: The most magical moment was watching the agent encounter a UI bug (a button wasn't clickable), read the browser console error, modify the CSS, and re-run the test—all while I was grabbing a coffee.
- The "Glass Brain": We managed to visualize the AI's reasoning. Seeing the "Thought Signatures" stream in real-time makes the autonomous process feel tangible and trustworthy.
- Identifying "Abnormal" Behavior: Our agent doesn't just copy code; it finds bugs in the old app. By analyzing the video, it flagged inconsistent UI states and unfinished screens in the legacy application that the client didn't even know about.
What we learned
We learned that code is repetitive, but intent is unique. While building this, we realized that AI agents often try to reinvent the wheel. They rewrite the same "Login with Auth" or "Tenant Management" code over and over. We discovered that if we build a library of "battle-tested primitives" (hardened code blocks for common features), the agent becomes exponentially faster. It stops guessing how to write a login form and starts focusing on the unique business logic that matters.
Business Insight: We also validated the massive market need. Maintaining legacy software costs organizations globally over $3.5 trillion annually (some estimates put technical debt remediation as high as $2.4 trillion in the US alone). The cost of not migrating is bleeding companies dry, but the risk of migration failure is huge. Necroma bridges that gap by making migration incremental, testable, and less risky.
What's next for necroma
- Automated Data Migration: Majority of the Legacy code produces or work on large amounts of data. While transmuting code is one part of the problem performing a reliable data migration with schema changes and optimisations is the true bottle neck.
- Browser-Based Test-Driven Development (TDD): We want to flip the model. Generate the test first based on the video, then let the agent write code until the test passes.
- Microservices Support: Expanding beyond monolithic Next.js apps to generate multi-service architectures.
- "Primitives" Library: Building a vast repository of pre-built, hardened "Legos" that the agent can snap together instead of writing raw code from scratch.
- Orchestrator Mode: Scaling the agent to manage dependencies across multiple files and services more effectively.
Log in or sign up for Devpost to join the conversation.