spec-kit icon indicating copy to clipboard operation
spec-kit copied to clipboard

Roundtripping - Reverse a repo back into artifacts for SDD

Open JohnnyOpcode opened this issue 1 year ago • 5 comments

SDD is definitely cool .. but it would be cooler if we could add it to an existing repo (that has lots of code already) and reverse engineer the PRD and all the other valuable artifacts ..

Working backwards and reverse engineering existing codebases to setup a successful SDD to move forward may provide a viable means to remove technical debt and security attack surfaces. SDD is great for greenfield projects, but lifting & shifting legacy codebases into this modern software development era via closed loop roundtripping needs to be given some serious consideration ..

JohnnyOpcode avatar Sep 20 '25 17:09 JohnnyOpcode

this can be done for a small repo, can be hard for large repos. For large repos, we should come up with a way to consider one fature or something like that.

this should help explore codebaes and convert it to a better knowledge structure: https://github.com/The-Pocket/PocketFlow-Tutorial-Codebase-Knowledge

amithegde avatar Sep 22 '25 06:09 amithegde

It would be great to have a feature like /capture that does this in the context of a brownfield repository. I imagine that it would require some framing to help the process understand what narrower thing in the repository is being captured. I also imagine that for repos of a sufficient size, you would have to do some hinting to help it along.

So for instance:

/capture Capture the user profile feature, which is primarily contained in 
app/api/user_profile.py, as well as in pages/user/profile/, app/models/user_profile.py, 
and which has some existing tests in tests/user_profile.py

It's also possible that this could be added to /specify by just adding additional prompting to attempt to infer the spec from the codebase if told to.

I think this is a great use case though. Similar to this, having some way to audit a brownfield repository to ensure that it meets the tenets of the project constitution would be great. That seems feasible if you have tenets like "all files need to have proper method documentation, and all first-level subdirectories need to have a README.md describing their function", but maybe a disaster if you have a python project and your constitution says "all projects MUST be in Rust". If I'm trying to do this, I would just /specify to ensure that a specific directory or set of files in my repo satisfies the constitution

beager avatar Oct 23 '25 03:10 beager

[Extension Proposal] Brownfield Bootstrap: SDD Workflow for Existing (Brownfield) Projects #1436

wcpaxx avatar Jan 06 '26 03:01 wcpaxx

This issue has been automatically marked as stale because it has not had any activity for 150 days. It will be closed in 30 days if no further activity occurs.

github-actions[bot] avatar Jun 07 '26 01:06 github-actions[bot]

This issue has been automatically closed due to inactivity (180 days total). If you believe this issue is still relevant, please reopen it or create a new issue.

github-actions[bot] avatar Jul 08 '26 00:07 github-actions[bot]