frontpage.
newsnewestaskshowjobs

Open Source @Github

fp.

Ask HN: What are you working on? (September 2026)

259•david927•1d ago•796 comments

Ask HN: Are 80s high school hobby programmers overwhelmingly pro-AI?

9•amichail•6h ago•24 comments

Ask HN: What would make you trust an AI's assessment of your understanding?

2•Aditya_0315•3h ago•0 comments

Ask HN: What would make self-hosting easy enough for average consumers?

4•dani4299•3h ago•4 comments

Ask HN: How are you managing aging relatives passwords?

3•rylando•3h ago•10 comments

Ask HN: Developers – Do you let agents write production code?

2•smurf9852•4h ago•3 comments

Has anyone made a legacy codebase more legible to AI coding agents?

2•iacobandrei•4h ago•2 comments

A repo gained 3,278 stars while GitHub showed Andrej Karpathy as a contributor

4•newshackee•4h ago•1 comments

Tell HN: Screenshots on macOS don't have to be date named files with spaces

4•cs1996•5h ago•3 comments

Chinese cargo ship makes inaugural journey, reshaping global trade

8•thelastgallon•6h ago•2 comments

Ask HN: Would a startup for young creatives who reject AI be feasible?

10•mondobe•20h ago•20 comments

System 3 Thinking

3•rexossbear•17h ago•0 comments

Ask HN: Is there an emerging pattern for NEGATIVESKILLS.md files?

4•mehmetoguzderin•21h ago•2 comments

Ask HN: Should we start airgapping our personal devices?

7•emerongi•1d ago•6 comments

Ask HN: What default model do you use and why?

60•stikit•2d ago•102 comments

Ask HN: You have unlimited resources, what software would you build?

4•smalltorch•6h ago•4 comments

Ask HN: What are some privacy/security tools you wish exist, but don't yet?

5•ToriTech•18h ago•7 comments

AI Boom / Bust – Boom Boom Pow

5•wwolfson97•19h ago•2 comments

Ask HN: How is AI actively a threat to humanity if it's only online?

5•CM30•19h ago•12 comments

Ask HN: How much correlation should a privacy system preserve?

2•Securelytixdev•8h ago•0 comments

Ask HN: Multi-agent workflows in production; Where people using 1000s of agents?

2•ramstar3000•20h ago•5 comments

DietPi released a new version v10.7

3•stephanstsdietp•1d ago•0 comments

Ask HN: Career paths to consider if I am better at supporting than creating?

28•_override•1d ago•28 comments

Ask HN: What would it look like if AI agents "took over the internet"?

4•scripper1•1d ago•12 comments

Ask HN: Did Google kill its enterprise workhorse model?

26•waldrews•2d ago•18 comments

Tell HN: OpenAI keeps re-enabling the 'allow training' setting

482•jacquesm•4d ago•188 comments

Ask HN: Why haven't people vibe coded popular 80s word processors as TUI apps?

5•amichail•1d ago•4 comments

Ask HN: Can we please limit the AI news flood?

855•cromka•3d ago•394 comments

Ask HN: Do You Like Skiing?

3•roschdal•8h ago•5 comments

Reddit Now Blocking Firefox for Android with uBlock Origin?

25•chucksmash•2d ago•6 comments
Open in hackernews

Has anyone made a legacy codebase more legible to AI coding agents?

2•iacobandrei•4h ago
Quick Summary: Did you ever optimize a legacy/vibe-coded codebase to improve AI driven development results and avoid fixing a bug for 2 more to appear? i want to hear what your experience was.

First, some context. ~7 months ago i was the first Engineering hire at a ( now ) 2 years old startup. The codebase started as a Lovable MVP built by our low level CTO, one month ago we hired a second dev and we are further expanding our engineering team and preparing the terrain for me to move to Staff. Now as you probably expected, the codebase is a mess since we simply built on top of the first MVP, of course with zero documentation, the main problems i identified in our codebase: - Duplicated business logic → no single source of truth / poor separation of concerns. - Zombie tables and columns → accumulated schema/structural debt, most of them look right, they are not - We manually track downstream effects since everything is scattered and duplicated in the most confusing way → implicit dependencies, implicit architecture and high change coupling. Changing a thing here also needs changing there and there ( this is mainly fixable by a codebase graph indexer )

Now quickly, so you dont get bored, ive identified as the sweet spot solution between speed and reliability to properly document the whole codebase and store that efficiently as a 'knowledge database' for our AI agents, so they are at least aware of the known gaps, constraints, decisions, business logic, where else to change something and the causes and effects of changes.

The closest and most interesting article that treats this exact issue is this one from Meta, which i want to start my approach from.

Now what im asking here is for some similar experiences, other startup engineers that had to go through a similar approach, what was their approach, experience, outcome and any tips on what should i avoid or be aware of.

Any help will be much appreciated

Comments

iacobandrei•4h ago
BTW this is the article from Meta https://engineering.fb.com/2026/04/06/developer-tools/how-me...
PaulHoule•3h ago
I think it is the same with cleaning up a code base for human programmers.

For instance I picked up a typescript code base that was a real mess and if I tired to change anything I would get all these crazy error messages that made no sense to either me or the AI.

It took about two days going back and forth with the AI for me to understand that was going wrong and put the typescript into a good condition where, when it type checked, it typed check for the right reasons. As the code got better I was able to make changes easily and so was the agent. I haven't put a lot of effort into things like AGENTS.md files, I just write a lot of

  // documentation in comments
that would make sense to anyone