Skill: OpenCode Recover Project
Goal
Recover a project or feature by locating OpenCode session artifacts and reconstructing diffs into the working tree.
Use This Skill When
- •The user lost work and wants to restore it from OpenCode sessions or snapshots
- •You need to rebuild a branch or feature from conversation history
- •The request mentions "reconstitute", "recover", "snapshot", or "past sessions"
Do Not Use This Skill When
- •The change already exists in git history (use git tooling instead)
- •You only need to inspect or edit a single file (use search + manual edit)
- •The user explicitly does not want to use OpenCode session artifacts
Inputs
- •Project root path
- •Target feature or time window
- •OpenCode session IDs or search queries
- •Destination for recovered diffs or patches
Steps
- •Identify the target scope (feature name, timeframe, repo path).
- •Use session search to find relevant conversations:
pnpm -C packages/reconstituter opencode-sessions search "<query>". - •Filter to specific sessions with
--sessionand inspect message excerpts. - •Locate snapshot or diff artifacts referenced by those sessions.
- •Export or copy diff files into a staging directory.
- •Normalize diffs to patch format and map paths to the repo root.
- •Dry-run apply patches and resolve path mismatches.
- •Apply diffs and run the relevant tests.
Output
- •A list of sessions consulted and artifacts used
- •A set of recovered patches applied to the workspace
- •Notes on conflicts, missing artifacts, or follow-up steps