I have tried this but don't you find it ends up writing a very poor spec doc? For example, it will specify the component must use .NET only because it is currently written in .NET. In fact, it doesn't need to be .NET, and if it performed some investigations, it would discover that Rust would be better. So much of code is not intentional design choice. It just ended up that way for a thousand different reasons. In fact, all code contains inefficiencies, and when an LLM documents those inefficiencies as "specifications," I end up with worse code.
I can mitigate this somewhat by asking it to refactor while it's going, but there are still countless taste decisions which it infers. That could be the framework, mono/micro-architecture, integrations, rate limits, API complexity, auth, etc.
Maybe I'm just working a lot with badly written code, but I hear this complaint a lot.
i would let the spec be completely agnostic of the tech stack.
and just ask to turn this into a description to hand to a product manager and their team, as i have to revise the software and it needs to be a cleanroom implementation. so the spec needs to cover minimum all the current capabilities.
The problem remains taste, context, and institutional knowledge. If the API rate limits 100 queries/min, is the model going to call that a specification? So often the only reason the rate limit exists is because seven years ago the environment used didn't have enough CPU. It has long since migrated to a new cluster and it can now handle 10,000 queries/min. And if the model doesn't consider this a functional spec, what if that's actually kind of important for the architecture?
It sounds like we work on VERY different kinds of projects. I'm closer to infrastructure and these details make big differences.
You go existing codebase —> feature spec —> new codebase with a very adversarial agent in the middle driving a live version of the product and validating every statement in the spec by checking its behavior.
It takes some scaffolding, but I’ve had good results.
I can mitigate this somewhat by asking it to refactor while it's going, but there are still countless taste decisions which it infers. That could be the framework, mono/micro-architecture, integrations, rate limits, API complexity, auth, etc.
Maybe I'm just working a lot with badly written code, but I hear this complaint a lot.