chncaesar/opencode-db-clean ? reverse-engineered prompt
Reverse engineered prompt
Build me a small Python command line tool that helps OpenCode users clean up a bloated local SQLite database safely.
I want two commands, one that only analyzes the database and shows a simple health report, and another that can reclaim unused space without risking the data. The analysis should show the file size, how much is live data, how much is freelist space, and give a few useful details like table sizes and the biggest messages. The cleanup command should be careful, it should refuse to run if OpenCode still has the database open, make a backup first, check integrity before and after, run a vacuum style cleanup, and turn on incremental auto vacuum so the problem does not come back as easily.
Make it work from the terminal, use only standard Python if possible, and include clear output so a normal person can understand whether it is worth cleaning. Also let me point it at a custom database path and skip the confirmation prompt when I want to automate it.
Are you gonna build this?
make sure you review the code using coderabbit