jeffusion/opencode-sweeper ? reverse-engineered prompt
Reverse engineered prompt
Build me an opencode plugin called opencode sweeper that automatically cleans up expired sessions and their subagents on a schedule, and also adds a /sweep command for manual cleanup.
I want it to read the opencode config, let me set things like expiry time, sweep interval, dry run mode, protected session IDs, and a grace period for recently active sessions. Main sessions and subagents should be handled separately, so I can keep longer lived main sessions but remove subagents sooner if I want. When I run /sweep, it should never delete the current session, and it should return a clear summary of what was scanned, deleted, skipped, or failed. If dry run is on, show what would happen without deleting anything.
Please make it work with current opencode 1.17.x behavior, and if you need to check the latest docs online, go ahead. Include a simple background timer for automatic sweeping, plus tests for the cleanup rules and config validation.
Are you gonna build this?
make sure you review the code using coderabbit