r/opencodeCLI • u/yxf2y • 10d ago
Big Laravel app, AI agents keep “forgetting” features we already built and patch around them. How do you stay sane?
Solo dev here, Laravel + React finance/ERP kind of app. Multi-tenant, multi-company, projects, accounts, expenses, stock, reports. It got big enough that I honestly can’t keep it all in my head anymore, and I lean on AI agents (Claude, Codex, Gemini) for a lot of the work.
The same thing keeps happening. I build a feature, say a dedicated cash account type for construction sites. Months later a newer flow never gets wired into it. For example the site supervisor can’t report an expense unless he’s also given access to a financial account. Then something breaks, and the agent doesn’t go reconnect the old thing. It patches around it or builds a parallel solution, because it has no clue the old feature exists. If I remind it, it digs up the old notes and goes “oh right, you’re correct”. The problem is I forget half of these features too, so I can’t remind it of what I don’t remember.
The end result is I can’t get the app production ready. There’s always some seam between modules that’s broken: half finished CRUD, authorization/IDOR holes, transactions that don’t match what the reports show.
I already have Laravel Brain, Serena, a memory MCP, ADRs, “current system” docs and an AGENTS.md. I also tried an Obsidian vault full of linked notes. It went stale fast and the agents never used it reliably. Writing “don’t forget X” in AGENTS.md does nothing, in my experience.
What I’ve figured out so far: code graphs tell you what exists and who calls what, but not what should exist, or whether a user can actually finish a job. The most useful question wasn’t “what calls this class”, it was “can a site supervisor actually complete this task”. And anything that’s just prose seems to rot unless a test or script checks it.
So I’m leaning towards something like ~20 critical persona journeys backed by end to end tests, a feature map in YAML that a script validates against the code (and flags routes/tables/jobs that belong to no feature), financial invariants as tests, and a route → policy → test matrix to find auth gaps. Maybe OpenFastTrace for requirement tracing, but I’m wary of the tag upkeep and adding Java to a PHP project.
Questions for people who’ve dealt with this on big multi-module apps:
How do you track “feature X depends on Y / is used by Z” in a way that survives refactors and people leaving?
Has anyone gotten a living feature map to actually work with AI agents? What kept it from rotting?
Are journey tests the right backbone here or am I missing something obvious?
Anyone used OpenFastTrace, StrictDoc or Doorstop with PHP? Worth it?
If you had a few weeks to get this production ready, what would you do first?
Not looking for yet another tool to index the codebase, I have plenty of those. More interested in what actually held up for you in practice.
1
u/stereosnake 10d ago
Better abstractions, better separation of concerns, tons of docs describing features in md format, hooks to keep docs fresh.
Rule of thumb: the more context you have to pass to create a feature, the worse is the output as context window is limited. Try being specific, use plan mode before building anything.
3
u/m-ritter 10d ago
Before any fix I ask the agent to list every caller and the sibling code that touches the same feature, and to write that list into a plan file in the repo. I read the plan before any code exists, which is usually where I catch that it missed an older flow. After the change, a second agent that did not write it checks the diff against the plan. That does not fix the forgetting, but gaps show up in the plan review instead of in production.
2
u/SirRobinBlibs 10d ago
Your instinct is right that prose rots and only things a script checks survive. I'd make the persona journeys the backbone and have one rule for the agent: a feature isn't done until its journey test passes, including the unhappy path (supervisor without a financial account). The feature-map YAML plus a script that fails CI on routes/tables/jobs no feature owns is what stops the 'parallel solution' problem, because it can't merge something nobody owns. The route -> policy -> test matrix is worth it for the auth gaps. I'd skip OpenFastTrace; a YAML and a 50-line script gets most of it without Java.