What to build
A config reader/writer that understands every config pattern OpenCode allows — opencode.json and opencode.jsonc at the scope base and the repo root, plus global config.json (read-only) — and that can ensure a package's plugin array entry with surgical semantics:
- Text-splice insertion, leaving every other byte of the file untouched
- Zero writes when a semantically matching entry already exists (name-aware,
@version/@latest-tolerant)
- When no config exists anywhere, create a repo-root
opencode.jsonc by default (scope-base equivalent for global scope)
- Warn and abort without modification when a candidate config file is unparseable
This is the capability later tickets port into the CLI and the generated-package templates. Grounded in ADR-0008 (content-based deployment plans) and the Zero-write no-op invariant in CONTEXT.md.
Acceptance criteria
Blocked by
None (can start immediately).
What to build
A config reader/writer that understands every config pattern OpenCode allows —
opencode.jsonandopencode.jsoncat the scope base and the repo root, plus globalconfig.json(read-only) — and that can ensure a package'spluginarray entry with surgical semantics:@version/@latest-tolerant)opencode.jsoncby default (scope-base equivalent for global scope)This is the capability later tickets port into the CLI and the generated-package templates. Grounded in ADR-0008 (content-based deployment plans) and the Zero-write no-op invariant in CONTEXT.md.
Acceptance criteria
name@version,name@latest.jsonand lenient.jsonc(comments, trailing commas) both parse;$schemaURLs containing//and escaped quotes surviveBlocked by
None (can start immediately).