{"slug": "ask-hn-how-would-you-harden-ai-changes-to-a-1m-line-legacy-saas-before-review", "title": "Ask HN: How would you harden AI changes to a 1M-line legacy SaaS before review?", "summary": "A non-engineer running an experiment on a 1M-line, 15-year-old legacy SaaS codebase on Azure used AI agents to build a 13k-line functional prototype plus tests in two weeks, aiming for customer testing in September. The developer seeks advice on hardening the AI-generated code before an engineer review in August to maximize the chance it can be copied into production with minimal rework.", "body_md": "I’m not a software engineer, but I’ve been running an experiment to see whether agentic development could produce a useful prototype on top of an existing SaaS codebase.\n\nThe codebase is 1M+ lines, 15 years old, hosted on Azure, and primarily written in C# and React.\n\nThe prototype needs to be available for customer testing in September. No developers were available to work on it full-time, although I could occasionally get help with specific technical issues. An engineer will evaluate the implementation in August and decide how much confidence we can have in the AI-generated code so that we can decide how to “convert” the code to production-grade.\n\nMy question is what I can do before August, primarily using AI tools and manual testing, to make the code as robust and reviewable as possible. I want to increase the likelihood that the AI-generated code would be so good that the path to production-grade would be closer to “copy-paste” than building everything again from scratch.\n\nEnvironment The prototype is being developed in a separate branch, deployed to a separate internal environment, and connected to its own database and schema.\n\nPlanning process We interviewed customers in June and turned the resuls into an MVP spec.\n\nThe process was approximately: 1. Write a PRD. 2. Use an LLM to convert the PRD into an architecture document, which was reviewed by an architect. 3. Create product designs consisting of screen images and md files containing interaction details ans edge cases with Claude Design. 4. Use an agent to break the work into epics using the PRD and architecture document as guardrails.\n\nThe epics were the most granular planning artifacts that received review by me and the architect.\n\nDevelopment process The development flow was intended to run with little intervention: 1. A planner agent converted epics into md story files and Jira stories 2. A coding agent implemented the stories including tests and opened PRs 3. A reviewer agent reviewed the PRs, requested changes, and merged them into the prototype branch\n\nThe coding agent polled PRs for review comments and could escalate issues back to the planner.\n\nAgents also had a “stop and ask” list for decisions they were not allowed to make autonomously. I (and a few times an engineer) were involved by resolving those escalations and by manually testing the accumulated changes end to end each day.\n\nMost implementation and initial review were done with Claude-based agents. For riskier PRs, I also used Codex as a reviewer. The second-model review found substantially more relevant issues in the Claude-generated code, but token quotas limited the use.\n\nI had separate refactoring and harden runs for the code as well.\n\nResults The planning and setting up the environment and agentic flow took about two weeks and then the agents built the whole MVP in about two weeks. Size-wise it was 13k lines of functional code + the same amount for tests.\n\nWhat I would like advice on Assuming that I cannot get substantial developer involvement before the review, how can I increase the likelihood that the code is as close to production-grade as possible?\n\nHere are some of the questions I have been thinking about: 1. What checks or development loops would give the largest improvement in confidence before an engineer reviews the code? 2. How would you use independent agents or models to reduce the risk that the coder and reviewer make the same incorrect assumptions? 3. Should tests be generated by a separate agent from the one that wrote the implementation? 4. What documentation or evidence would make the eventual engineering review faster and more reliable? 5. If you had only a few weeks to improve this prototype before handing it to an engineer, what would you prioritize?\n\nComments URL: [https://news.ycombinator.com/item?id=49045271](https://news.ycombinator.com/item?id=49045271)\n\nPoints: 1\n\n# Comments: 0", "url": "https://wpnews.pro/news/ask-hn-how-would-you-harden-ai-changes-to-a-1m-line-legacy-saas-before-review", "canonical_source": "https://news.ycombinator.com/item?id=49045271", "published_at": "2026-07-25 07:19:48+00:00", "updated_at": "2026-07-25 07:52:55.667826+00:00", "lang": "en", "topics": ["ai-agents", "developer-tools", "ai-tools"], "entities": ["Azure", "Claude", "Codex"], "alternates": {"html": "https://wpnews.pro/news/ask-hn-how-would-you-harden-ai-changes-to-a-1m-line-legacy-saas-before-review", "markdown": "https://wpnews.pro/news/ask-hn-how-would-you-harden-ai-changes-to-a-1m-line-legacy-saas-before-review.md", "text": "https://wpnews.pro/news/ask-hn-how-would-you-harden-ai-changes-to-a-1m-line-legacy-saas-before-review.txt", "jsonld": "https://wpnews.pro/news/ask-hn-how-would-you-harden-ai-changes-to-a-1m-line-legacy-saas-before-review.jsonld"}}