top | item 46838086

Show HN: Reverse-engineer OpenSpec specifications from existing codebases

3 points| hireclay | 1 month ago |github.com

2 comments

order

lexiathan|1 month ago

I thought about doing this sort of thing a while back by parsing code into an AST + using a debugger API. Using an LLM is an interesting approach, but I would be concerned whether (a) it is reliable and (b) whether it is deterministic and replicable.

hireclay|29 days ago

Hey! I'm glad to hear that you had a similar idea. It uses deterministic AST parsing and static analysis for the core spec generation. LLMs are only optionally invoked for natural language descriptions and documentation enhancement. The structural extraction (functions, parameters, types, dependencies) is fully deterministic and replicable since it's based on tree-sitter parsing, not probabilistic inference.