Edison-A-N/opencode-worktree-memory-sync ? reverse-engineered prompt
Reverse engineered prompt
Build me an OpenCode plugin that keeps my .opencode/memory files synced into new git worktrees.
When I open a session in a worktree created from my main repo, it should detect that it’s a worktree, find the main repository, and copy over the memory files from the main project. It should only do this when the worktree memory folder is still empty or just has the default scaffold files, because I never want it to overwrite anything I’ve already edited.
If I’m just in a normal repo folder, it should quietly do nothing. I want this to run automatically on session start, so I do not have to think about it. Please make it easy to install through opencode.json and keep it simple and reliable. If you need to check current OpenCode or git worktree behavior, look up the latest docs online first.
Are you gonna build this?
make sure you review the code using coderabbit