chore(release): ship opencode wrapper flow#19
Conversation
Adds a standalone obsxa-opencode package that re-exports the existing plugin entrypoint so users can install a stable package name while OpenCode subpath plugin specifier support is still pending.
Routes pnpm release through a single script that bumps the root package first, mirrors that version into the wrapper package, and then runs changelogen for both targets before final release commit and tag.
Extends the tag-triggered npm release workflow to publish the new wrapper package after the main package and records the release-flow change in the unreleased changelog notes.
Adds an explicit existence check before syncing wrapper metadata and removes fixed obsxa version pinning in the wrapper dependency to reduce manual drift risk between wrapper and root package maintenance.
📝 WalkthroughWalkthroughIntroduces an Changes
Sequence DiagramsequenceDiagram
participant User as User/CI
participant ReleaseScript as Release Script
participant RootPkg as Root package.json
participant OpencodeSync as Opencode Sync
participant OpencodePkg as Opencode package.json
participant Changelogen as Changelogen
participant GHWorkflow as GitHub Workflow
User->>ReleaseScript: pnpm release
ReleaseScript->>RootPkg: Read version
RootPkg-->>ReleaseScript: v0.0.2
ReleaseScript->>OpencodeSync: Validate opencode/package.json exists
OpencodeSync-->>ReleaseScript: Exists ✓
ReleaseScript->>OpencodePkg: Update version & obsxa dep to v0.0.2
OpencodePkg-->>ReleaseScript: Written
ReleaseScript->>Changelogen: --bump (root)
Changelogen-->>ReleaseScript: Root bumped
ReleaseScript->>Changelogen: --dir ./opencode -r v0.0.2 (opencode bump)
Changelogen-->>ReleaseScript: Opencode bumped
ReleaseScript->>Changelogen: --release -r v0.0.2 --push
Changelogen-->>ReleaseScript: Released & pushed
ReleaseScript-->>GHWorkflow: Trigger publish
GHWorkflow->>GHWorkflow: Publish root package
GHWorkflow->>GHWorkflow: Publish opencode package
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes The release script requires verification of version syncing logic, file I/O operations, and changelogen command sequencing to ensure both packages stay synchronized. Wrapper package files are straightforward re-exports and configuration. Key concern: confirm version sync doesn't break if opencode/package.json is missing or malformed. Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
✨ Simplify code
📝 Coding Plan for PR comments
Comment |
Review Summary by QodoAdd obsxa-opencode wrapper package with unified release automation
WalkthroughsDescription• Add standalone obsxa-opencode wrapper package for stable plugin installation • Implement unified release script syncing root and wrapper package versions • Extend CI/CD to publish wrapper package alongside main package • Add safeguards for wrapper metadata sync with existence checks Diagramflowchart LR
A["Root Package"] -->|"sync version"| B["Wrapper Package<br/>obsxa-opencode"]
C["Release Script"] -->|"bump & sync"| A
C -->|"bump wrapper"| B
D["CI/CD Release Job"] -->|"publish"| A
D -->|"publish"| B
File Changes1. opencode/package.json
|
Code Review by Qodo
1.
|
Sequence DiagramThis PR introduces a single release script that bumps the root package first, synchronizes the wrapper package version, and updates both changelogs with the same release version. It also extends the tag based release workflow to publish both the main package and the new wrapper package. sequenceDiagram
participant Maintainer
participant ReleaseScript
participant RootPackage
participant WrapperPackage
participant ReleaseWorkflow
participant NpmRegistry
Maintainer->>ReleaseScript: Run release command
ReleaseScript->>RootPackage: Bump root version and changelog
RootPackage-->>ReleaseScript: Return new version
ReleaseScript->>WrapperPackage: Verify wrapper package and sync version
ReleaseScript->>WrapperPackage: Bump wrapper changelog with same version
ReleaseScript->>ReleaseWorkflow: Create tag and push release
ReleaseWorkflow->>NpmRegistry: Publish main package
ReleaseWorkflow->>NpmRegistry: Publish wrapper package
Generated by CodeAnt AI |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ace554cf6d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (1)
package.json (1)
48-48: Keep the normal release gates here.This path can tag and push a release even when the new wrapper entrypoint breaks exports or declarations, because it skips
pnpm lintandpnpm typecheck.Possible fix
- "release": "pnpm test:run && pnpm build && node ./scripts/release-with-opencode.mjs" + "release": "pnpm lint && pnpm typecheck && pnpm test:run && pnpm build && node ./scripts/release-with-opencode.mjs"Based on learnings: Default verification sequence after non-trivial edits:
pnpm lint→pnpm typecheck→pnpm test:run→pnpm build🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@package.json` at line 48, The "release" npm script currently runs "pnpm test:run && pnpm build && node ./scripts/release-with-opencode.mjs" which skips linting and typechecking; update the "release" script entry named "release" to run the full verification sequence: "pnpm lint" then "pnpm typecheck" then "pnpm test:run" then "pnpm build" before invoking "./scripts/release-with-opencode.mjs" so releases are gated by lint and type checks.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@opencode/package.json`:
- Around line 10-17: Add TypeScript declaration file for the published wrapper
package so consumers get types: create a new file opencode/index.d.mts that
re-exports the type declarations from the main package (exporting
createObsxaPlugin and default) by referencing the existing types built at
dist/opencode.d.mts / the upstream module "obsxa/opencode"; this ensures the
symbol createObsxaPlugin (and default export) are available to TypeScript users
importing from obsxa-opencode.
In `@scripts/release-with-opencode.mjs`:
- Around line 31-37: The release script currently updates
opencodePackageJson.version but leaves the wrapper's "obsxa" dependency as "*"
which causes installs to pick up the wrong major; modify the code that handles
opencodePackageJson (the opencodePackageJson, opencodePackageJsonPath and
version variables) to also set opencodePackageJson.dependencies.obsxa = version
(or the appropriate released semver string) before calling writeFileSync so the
published opencode package pins "obsxa" to the release version.
---
Nitpick comments:
In `@package.json`:
- Line 48: The "release" npm script currently runs "pnpm test:run && pnpm build
&& node ./scripts/release-with-opencode.mjs" which skips linting and
typechecking; update the "release" script entry named "release" to run the full
verification sequence: "pnpm lint" then "pnpm typecheck" then "pnpm test:run"
then "pnpm build" before invoking "./scripts/release-with-opencode.mjs" so
releases are gated by lint and type checks.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 335b734c-cde4-44e9-8cc2-212c7b75dede
📒 Files selected for processing (7)
.github/workflows/release.ymlCHANGELOG.mdopencode/CHANGELOG.mdopencode/index.mjsopencode/package.jsonpackage.jsonscripts/release-with-opencode.mjs
📜 Review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: cubic · AI code reviewer
🧰 Additional context used
📓 Path-based instructions (2)
**/*.md
📄 CodeRabbit inference engine (CLAUDE.md)
Use
@mentionsyntax in documentation to reference agents (e.g.,@AGENTS.md)
Files:
opencode/CHANGELOG.mdCHANGELOG.md
**/*.{ts,tsx,js,mjs}
📄 CodeRabbit inference engine (AGENTS.md)
Use ESM-only TypeScript with
"type": "module"in package.json; do not introduce CommonJS
Files:
scripts/release-with-opencode.mjsopencode/index.mjs
🧠 Learnings (5)
📓 Common learnings
Learnt from: oritwoen
Repo: oritwoen/obsxa PR: 9
File: package.json:58-58
Timestamp: 2026-03-11T19:03:02.039Z
Learning: In `package.json` of `oritwoen/obsxa`, `opencode-ai/plugin` is intentionally pinned to `"latest"` in devDependencies to track plugin API movement. Do not flag this as a non-reproducible build issue.
📚 Learning: 2026-03-11T19:03:02.039Z
Learnt from: oritwoen
Repo: oritwoen/obsxa PR: 9
File: package.json:58-58
Timestamp: 2026-03-11T19:03:02.039Z
Learning: In `package.json` of `oritwoen/obsxa`, `opencode-ai/plugin` is intentionally pinned to `"latest"` in devDependencies to track plugin API movement. Do not flag this as a non-reproducible build issue.
Applied to files:
opencode/index.mjspackage.jsonCHANGELOG.mdopencode/package.json
📚 Learning: 2026-03-12T11:16:05.994Z
Learnt from: CR
Repo: oritwoen/obsxa PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-03-12T11:16:05.994Z
Learning: Default verification sequence after non-trivial edits: `pnpm lint` → `pnpm typecheck` → `pnpm test:run` → `pnpm build`
Applied to files:
package.json
📚 Learning: 2026-03-12T11:16:05.994Z
Learnt from: CR
Repo: oritwoen/obsxa PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-03-12T11:16:05.994Z
Learning: Applies to {drizzle/**/*.ts,src/**/schema.ts} : Schema changes must go through Drizzle migrations using `pnpm generate`, not ad-hoc SQL edits in runtime code
Applied to files:
package.json
📚 Learning: 2026-03-12T11:16:05.994Z
Learnt from: CR
Repo: oritwoen/obsxa PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-03-12T11:16:05.994Z
Learning: Do not run destructive git operations, commit, push, or modify generated artifacts (`dist/`, `drizzle/meta/`) unless explicitly requested
Applied to files:
package.json
Keeps obsxa-opencode bound to the exact root package version and updates release sync logic so dependency and wrapper version move together on every release.
Adds declaration entrypoints to obsxa-opencode so TypeScript consumers get createObsxaPlugin types from the wrapper package, matching the runtime re-export.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@scripts/release-with-opencode.mjs`:
- Around line 47-48: The script calls runChangelogen(["--bump", "--dir",
"./opencode", "-r", version]) which writes opencode/CHANGELOG.md but then only
runs runChangelogen(["--release", "-r", version, "--push"]) scoped to root, so
the opencode changelog isn't committed/tagged; fix by running a release scoped
to ./opencode as well (e.g., invoke runChangelogen(["--release", "--dir",
"./opencode", "-r", version]) before the final --push) or otherwise make the
release step monorepo-aware so that runChangelogen handles both root and
./opencode commits/tags.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 5a66e677-86d1-46e4-bd6f-273210c22a84
📒 Files selected for processing (2)
opencode/package.jsonscripts/release-with-opencode.mjs
🚧 Files skipped from review as they are similar to previous changes (1)
- opencode/package.json
📜 Review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: cubic · AI code reviewer
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{ts,tsx,js,mjs}
📄 CodeRabbit inference engine (AGENTS.md)
Use ESM-only TypeScript with
"type": "module"in package.json; do not introduce CommonJS
Files:
scripts/release-with-opencode.mjs
🧠 Learnings (2)
📓 Common learnings
Learnt from: oritwoen
Repo: oritwoen/obsxa PR: 9
File: package.json:58-58
Timestamp: 2026-03-11T19:03:02.039Z
Learning: In `package.json` of `oritwoen/obsxa`, `opencode-ai/plugin` is intentionally pinned to `"latest"` in devDependencies to track plugin API movement. Do not flag this as a non-reproducible build issue.
📚 Learning: 2026-03-11T19:03:02.039Z
Learnt from: oritwoen
Repo: oritwoen/obsxa PR: 9
File: package.json:58-58
Timestamp: 2026-03-11T19:03:02.039Z
Learning: In `package.json` of `oritwoen/obsxa`, `opencode-ai/plugin` is intentionally pinned to `"latest"` in devDependencies to track plugin API movement. Do not flag this as a non-reproducible build issue.
Applied to files:
scripts/release-with-opencode.mjs
Drops opencode changelog bumping and removes opencode/CHANGELOG.md so release tagging stays single-source in root and avoids conflicting multi-release tag behavior.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@scripts/release-with-opencode.mjs`:
- Around line 10-14: The call in runChangelogen uses execFileSync("changelogen",
...) which fails on Windows because .cmd files aren't executed directly; update
runChangelogen (the execFileSync call) to be cross-platform by either adding {
shell: true } to the options, or invoking cmd.exe explicitly via
execFileSync("cmd.exe", ["/c", "changelogen", ...args], {...}), or replace
execFileSync with a cross-platform spawn (e.g., cross-spawn) to ensure
changelogen runs correctly on Windows.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 8a28c389-95e3-4cf9-8ff6-13deb23e61e6
📒 Files selected for processing (2)
CHANGELOG.mdscripts/release-with-opencode.mjs
📜 Review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: cubic · AI code reviewer
🧰 Additional context used
📓 Path-based instructions (2)
**/*.{ts,tsx,js,mjs}
📄 CodeRabbit inference engine (AGENTS.md)
Use ESM-only TypeScript with
"type": "module"in package.json; do not introduce CommonJS
Files:
scripts/release-with-opencode.mjs
**/*.md
📄 CodeRabbit inference engine (CLAUDE.md)
Use
@mentionsyntax in documentation to reference agents (e.g.,@AGENTS.md)
Files:
CHANGELOG.md
🧠 Learnings (3)
📓 Common learnings
Learnt from: oritwoen
Repo: oritwoen/obsxa PR: 19
File: scripts/release-with-opencode.mjs:0-0
Timestamp: 2026-03-12T13:12:57.305Z
Learning: In `oritwoen/obsxa`, the release flow uses a single root changelog and release tag for both the root package and the `obsxa-opencode` wrapper (`opencode/`). `opencode/CHANGELOG.md` was intentionally removed and changelogen is NOT run with `--dir ./opencode`. Do not flag the absence of a separate opencode release step as a bug.
Learnt from: oritwoen
Repo: oritwoen/obsxa PR: 9
File: package.json:58-58
Timestamp: 2026-03-11T19:03:02.039Z
Learning: In `package.json` of `oritwoen/obsxa`, `opencode-ai/plugin` is intentionally pinned to `"latest"` in devDependencies to track plugin API movement. Do not flag this as a non-reproducible build issue.
📚 Learning: 2026-03-12T13:12:57.305Z
Learnt from: oritwoen
Repo: oritwoen/obsxa PR: 19
File: scripts/release-with-opencode.mjs:0-0
Timestamp: 2026-03-12T13:12:57.305Z
Learning: In `oritwoen/obsxa`, the release flow uses a single root changelog and release tag for both the root package and the `obsxa-opencode` wrapper (`opencode/`). `opencode/CHANGELOG.md` was intentionally removed and changelogen is NOT run with `--dir ./opencode`. Do not flag the absence of a separate opencode release step as a bug.
Applied to files:
scripts/release-with-opencode.mjsCHANGELOG.md
📚 Learning: 2026-03-11T19:03:02.039Z
Learnt from: oritwoen
Repo: oritwoen/obsxa PR: 9
File: package.json:58-58
Timestamp: 2026-03-11T19:03:02.039Z
Learning: In `package.json` of `oritwoen/obsxa`, `opencode-ai/plugin` is intentionally pinned to `"latest"` in devDependencies to track plugin API movement. Do not flag this as a non-reproducible build issue.
Applied to files:
scripts/release-with-opencode.mjsCHANGELOG.md
🔇 Additional comments (2)
CHANGELOG.md (1)
5-10: LGTM - changelog entries accurately reflect the release automation changes.The three bullets clearly document the wrapper package release flow, format matches existing conventions, and line 9 correctly reflects the single root changelog approach per the retrieved learning.
scripts/release-with-opencode.mjs (1)
31-35: This fixes the wrapper/root drift at install time.Setting both
opencodePackageJson.versionanddependencies.obsxato the same release version meansobsxa-opencode@x.y.zno longer installs against whateverobsxa@*happens to resolve to later.
OpenCode plugin subpath specifiers are still not universally installable, so this adds a publishable obsxa-opencode wrapper package and wires release automation to bump root first, sync wrapper version, bump wrapper changelog, and then finalize release. The tag-based release workflow now publishes both root and wrapper packages.
Closes
Closes #18