This file is for OpenCode. Follow these instructions when a user asks you to add this template to an existing project.
Install the intent-driven OpenSpec and OpenCode template files into the user's current project without overwriting project-specific work blindly.
This first-time install guide does not cover upgrade/version tracking. Handle upgrade instructions in a separate change.
Clone a fresh local copy of the template repository outside the target project:
git clone https://github.com/intent-driven-dev/intent-driven-template.gitIf the user already has a local clone, you may use it after checking its current branch and status.
Before copying files, inspect the target project:
- Check
README.md,AGENTS.md,opencode.json,openspec/,.opencode/, and.agents/if they exist. - Identify existing OpenSpec, OpenCode, agent, or skill configuration.
- Preserve user-specific instructions and project conventions.
- Do not delete or replace existing files without explaining the conflict and getting user approval.
Copy these template files and directories into the target project when they do not already exist:
openspec/.opencode/.agents/opencode.json
Merge these files when they already exist:
AGENTS.mdREADME.md, only if the user explicitly wants project documentation updated
- Clone or locate the source template repository.
- Inspect the target project for existing configuration and documentation.
- Copy missing template directories and files into the target project.
- Merge
AGENTS.mdby adding the OpenSpec git-discipline instruction without removing existing user instructions. - If
opencode.json,openspec/,.opencode/, or.agents/already exist, compare the template version with the target version and ask the user before replacing or restructuring anything. - Keep the target project's product code, package files, application docs, and existing tests unchanged unless the user explicitly asks for changes.
- Verify the resulting file tree and summarize exactly what changed.
After installation, run the safest available checks for the target project:
git status --shortIf OpenSpec is available, also run:
openspec schema validate intent-drivenIf OpenCode or OpenSpec commands are unavailable, report that clearly and leave the installed files in place for the user to verify later.