Skip to content

Add first-class OpenCode support alongside Claude Code#707

Open
mskadu wants to merge 19 commits into
santifer:mainfrom
mskadu:feat/opencode-support
Open

Add first-class OpenCode support alongside Claude Code#707
mskadu wants to merge 19 commits into
santifer:mainfrom
mskadu:feat/opencode-support

Conversation

@mskadu

@mskadu mskadu commented May 20, 2026

Copy link
Copy Markdown
Contributor

Closes #706

Summary

Adds native OpenCode support: command files, skill, batch runner integration, test coverage, and documentation. OpenCode users can now run /career-ops commands, use the skill system, and process batch jobs — the same experience as Claude Code and Gemini CLI.

All existing modes/*.md evaluation logic, tracker flow, templates, and scripts are reused. No new evaluation, CV, or tracker logic.

Changes

Area Files What changed
OpenCode commands .opencode/commands/*.md 15 slash-command files (one per mode)
OpenCode skill .opencode/skills/career-ops/SKILL.md Skill definition with OpenCode-compatible frontmatter
Project file OPENCODE.md OpenCode entry point (imports AGENTS.md)
Agent instructions AGENTS.md Updated batch runner table with opencode run command
Batch runner batch/batch-runner.sh Added opencode run as a supported CLI backend
Test suite test-all.mjs Added OpenCode-specific integrity checks
Docs README.md, docs/SETUP.md, docs/ARCHITECTURE.md OpenCode setup and architecture documentation
Doctor script doctor.mjs OpenCode check
Data contract DATA_CONTRACT.md .opencode/commands/, .opencode/agents/, .opencode/skills/career-ops listed
CI labeler .github/labeler.yml, .coderabbit.yaml OpenCode path rules
Package package.json OpenCode badge and metadata
Update system update-system.mjs OpenCode file bootstrapping
CUSTOMIZATION.md docs/CUSTOMIZATION.md Fixed OpenCode hooks reference (does not support hooks; points to commands/agents instead)

Testing

  • node test-all.mjs — 76 passed, 0 failed
  • npm run doctor — all 9 checks pass
  • Dashboard builds successfully

Context

This was verified against the official OpenCode documentation at https://opencode.ai/docs/ to ensure accuracy.

Summary by CodeRabbit

  • New Features

    • Add support for selecting multiple AI coding CLIs (OpenCode + Claude) and a CLI selection option for batch runs.
  • Documentation

    • Update docs, README, onboarding, and setup to reflect multi-CLI support and OpenCode integration.
  • Tests

    • Extend integrity checks and CI validations to include OpenCode artifacts, wrapper files, and skill symlink integrity.
  • Chores

    • Expand ignores, labeler rules, system lists, package metadata; streamline skill references and remove interview-prep content.

Review Change Stack

mskadu added 5 commits May 19, 2026 15:51
Makes career-ops fully usable with OpenCode by adding:

- OPENCODE.md -- OpenCode config wrapper (imports AGENTS.md, same pattern as CLAUDE.md and GEMINI.md)
- .opencode/skills/career-ops/SKILL.md -- symlink to canonical skill at .agents/skills/
- batch-runner.sh -- --cli flag and opencode command case (opencode run instead of claude -p)
- doctor.mjs -- mentions both claude and opencode in completion message
- package.json -- CLI-agnostic description, added opencode keyword
- update-system.mjs -- tracks OPENCODE.md and .opencode/skills/ as system-layer paths
- test-all.mjs -- validates OPENCODE.md and .opencode/skills/ exist in data contract
- DATA_CONTRACT.md -- documents OPENCODE.md and .opencode/skills/ in system layer
- .gitignore -- opencode local config/memory patterns
- .github/labeler.yml -- triggers agent-behavior label on .opencode/skills changes
- .coderabbit.yaml -- review instructions for OPENCODE.md
- AGENTS.md -- promotes OpenCode in headless mode table, OPENCODE.md in system layer list
- README.md -- adds OpenCode badge and CLI-agnostic phrasing
- docs/SETUP.md -- shows both claude and opencode as entry points
- SKILL.md -- removes Claude Code specific comment from skill frontmatter
Adds checks for:
- CLI wrapper files (CLAUDE.md, OPENCODE.md, GEMINI.md) all reference AGENTS.md
- .opencode and .claude skill symlinks resolve to canonical .agents/skills/
- batch-runner.sh documents opencode support and --cli flag
Updates README, architecture docs, and customization guide to refer to any AI coding CLI instead of singling out Claude Code.
- Add interview-prep/* to .gitignore with .gitkeep exception
- Remove interview-prep/story-bank.md from git tracking (user layer data)
- Fix docs/CUSTOMIZATION.md OpenCode hooks reference

Upstream sync: merge main from santifer/career-ops (5 new commits)
@coderabbitai

coderabbitai Bot commented May 20, 2026

Copy link
Copy Markdown

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

This PR adds OpenCode as a first-class AI coding CLI option alongside Claude Code. Changes span skill file structure, batch runner dispatch logic, system layer tracking, test infrastructure, and documentation, enabling users and automation to work with either CLI.

Changes

OpenCode Multi-CLI Support

Layer / File(s) Summary
OpenCode Skill and Configuration Foundation
.agents/skills/career-ops/SKILL.md, .opencode/skills/career-ops/SKILL.md, OPENCODE.md
Canonical skill definition removes Claude-specific comment; .opencode/skills/career-ops/SKILL.md created as symlink to canonical definition; OPENCODE.md established as OpenCode config that imports AGENTS.md.
Batch Runner Multi-CLI Support
batch/batch-runner.sh, docs/ARCHITECTURE.md
Batch runner gains --cli option (default claude) and dispatches to either claude -p or opencode run based on selection. Prerequisites check and help text updated for multi-CLI operation.
System Layer and Test Infrastructure
AGENTS.md, update-system.mjs, test-all.mjs
AGENTS.md marked system-updatable; batch CLI command table updated; update-system.mjs extends SYSTEM_PATHS to include OPENCODE.md and .opencode/skills/; test-all.mjs adds OpenCode file existence, symlink resolution, and batch runner CLI support checks.
Documentation and User-Facing Communication
README.md, docs/SETUP.md, docs/CUSTOMIZATION.md, doctor.mjs, DATA_CONTRACT.md, .coderabbit.yaml
README.md adds OpenCode badge and generalizes descriptions from Claude-specific to CLI-agnostic; setup docs list OpenCode as alternative prerequisite and start option; hook limitation documented; doctor.mjs success message includes OpenCode; DATA_CONTRACT.md and .coderabbit.yaml updated for OpenCode artifact classification and review guidance.
Environment Configuration and Metadata
.gitignore, .github/labeler.yml, package.json, interview-prep/story-bank.md
.gitignore extended for OpenCode local settings and memory; interview-prep content removed; .github/labeler.yml adds OPENCODE.md and .opencode/skills/** pattern; package.json description and keywords broadened to multi-CLI.

Sequence Diagram

sequenceDiagram
  participant User
  participant BatchRunner as batch-runner.sh
  participant Prereq as PrereqCheck
  participant Offers as OfferLoop
  participant Dispatcher as CLI_Dispatch
  participant Claude as "claude -p"
  participant OpenCode as "opencode run"

  User->>BatchRunner: run --cli opencode ...
  BatchRunner->>Prereq: command -v "$CLI"
  Prereq-->>BatchRunner: OK
  BatchRunner->>Offers: iterate offers
  Offers->>Dispatcher: build prompt
  Dispatcher->>OpenCode: opencode run "<prompt>"
  OpenCode-->>Dispatcher: result
  Dispatcher-->>Offers: return
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related issues

  • #737: PR adds first-class OpenCode support; this change implements the OpenCode artifacts and batch-runner support requested there.

Possibly related PRs

Suggested labels

⚠️ agent-behavior

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 75.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Add first-class OpenCode support alongside Claude Code' directly and accurately summarizes the main change: adding native OpenCode integration parity with Claude Code.
Linked Issues check ✅ Passed All coding objectives from issue #706 are met: OPENCODE.md added, 15 .opencode/commands/*.md files created, skill with frontmatter added, AGENTS.md and batch-runner.sh updated with opencode support, test-all.mjs extended with OpenCode checks, and documentation updated.
Out of Scope Changes check ✅ Passed All changes are directly aligned with #706 objectives. The removal of interview-prep/story-bank.md content is the only potential ancillary change, but it relates to cleanup of user-generated content per gitignore updates and does not conflict with the main scope.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 5

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/labeler.yml:
- Line 14: Add "OPENCODE.md" to the same core-architecture label mapping that
currently contains "CLAUDE.md" in .github/labeler.yml so changes to OPENCODE.md
trigger the core-architecture label; locate the block where "CLAUDE.md" is
listed (the mapping for the System Layer / core-architecture) and add
"OPENCODE.md" alongside "CLAUDE.md" to ensure consistent triage for system
instruction file updates.

In `@AGENTS.md`:
- Around line 272-273: Remove the duplicate OpenCode CLI table row by deleting
the redundant line that contains the "OpenCode" entry with the command `opencode
run "prompt"` so only a single row for OpenCode remains; locate the two
identical rows showing **OpenCode** and remove one to avoid repeating the same
`opencode run "prompt"` entry.

In `@batch/batch-runner.sh`:
- Around line 377-383: The OpenCode invocation only passes "$prompt" and drops
the rendered system prompt; update the opencode call to include the rendered
system prompt so OpenCode workers see the same batch-prompt.md content as Claude
workers. For example, ensure the CLI args built for opencode (the array used in
the opencode invocation and variable cli_args) include both the rendered system
prompt variable (e.g., "$SYSTEM_PROMPT" or the script variable that holds the
rendered batch-prompt.md) and "$prompt" (e.g., cli_args=(run "$SYSTEM_PROMPT"
"$prompt")), and apply the same fix to the other opencode/run block covering the
earlier 345-363 region.
- Around line 51-52: Update the help text for the "--model NAME" option in the
batch-runner script: change the description that currently says "only supported
by claude -p" to "both claude -p and opencode run" so the line reads "--model
NAME         Model name passed to the CLI's --model flag (both claude -p and
opencode run)"; locate the help string that defines the "--model" usage and
replace the wording accordingly to reflect both supported CLIs.

In `@test-all.mjs`:
- Around line 331-349: The current tests call run('readlink', ['-f', join(ROOT,
...)]) to canonicalize symlinks (assigning canonicalReal and resolved) and check
targets in the symlinks loop; replace those shell calls with Node's
fs.realpathSync (e.g., use fs.realpathSync(join(ROOT, canonicalSkill)) and
fs.realpathSync(join(ROOT, link))) for cross-platform resolution, add a
require/import for fs (or realpathSync) at the top, and wrap each realpathSync
call in a try/catch to map errors to the same null-handling logic used currently
(set canonicalReal or target to null on error) so the existing pass/fail checks
remain valid.
🪄 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: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 6244c72d-6955-4f1d-86c4-6a61b06aa1d3

📥 Commits

Reviewing files that changed from the base of the PR and between 82f0c2e and 87cc5ae.

📒 Files selected for processing (19)
  • .agents/skills/career-ops/SKILL.md
  • .coderabbit.yaml
  • .github/labeler.yml
  • .gitignore
  • .opencode/skills/career-ops/SKILL.md
  • AGENTS.md
  • DATA_CONTRACT.md
  • OPENCODE.md
  • README.md
  • batch/batch-runner.sh
  • docs/ARCHITECTURE.md
  • docs/CUSTOMIZATION.md
  • docs/SETUP.md
  • doctor.mjs
  • interview-prep/.gitkeep
  • interview-prep/story-bank.md
  • package.json
  • test-all.mjs
  • update-system.mjs
💤 Files with no reviewable changes (1)
  • interview-prep/story-bank.md

Comment thread .github/labeler.yml
Comment thread AGENTS.md Outdated
Comment thread batch/batch-runner.sh Outdated
Comment thread batch/batch-runner.sh Outdated
Comment thread test-all.mjs Outdated
- Add OPENCODE.md to core-architecture labeler mapping
- Remove duplicate OpenCode row in batch CLI table
- Fix --model help text: works with opencode too, not just claude
- Pass resolved system prompt to opencode run workers
- Replace readlink -f with fs.realpathSync for cross-platform compat

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
.github/labeler.yml (1)

1-7: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Add AGENTS.md to the core-architecture label mapping.

According to learnings, the System Layer includes AGENTS.md, CLAUDE.md, and OPENCODE.md as auto-updatable system instruction files. Currently, AGENTS.md is missing from the core-architecture label group, creating a triage inconsistency.

📋 Proposed fix
 "🔴 core-architecture":
   - changed-files:
       - any-glob-to-any-file:
+          - AGENTS.md
           - CLAUDE.md
           - OPENCODE.md
           - DATA_CONTRACT.md
           - modes/_shared.md

Based on learnings: System Layer includes AGENTS.md, CLAUDE.md, and OPENCODE.md as auto-updatable system instruction files.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/labeler.yml around lines 1 - 7, Update the "🔴 core-architecture"
label mapping to include AGENTS.md in the changed-files any-glob-to-any-file
list so the auto-triage treats AGENTS.md the same as CLAUDE.md and OPENCODE.md;
locate the mapping for the "🔴 core-architecture" label and add AGENTS.md to the
list alongside CLAUDE.md and OPENCODE.md under the any-glob-to-any-file entry.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In @.github/labeler.yml:
- Around line 1-7: Update the "🔴 core-architecture" label mapping to include
AGENTS.md in the changed-files any-glob-to-any-file list so the auto-triage
treats AGENTS.md the same as CLAUDE.md and OPENCODE.md; locate the mapping for
the "🔴 core-architecture" label and add AGENTS.md to the list alongside
CLAUDE.md and OPENCODE.md under the any-glob-to-any-file entry.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: caf335fa-1e97-4c69-b979-bf7c2ce1c9b2

📥 Commits

Reviewing files that changed from the base of the PR and between 87cc5ae and 305af29.

📒 Files selected for processing (4)
  • .github/labeler.yml
  • AGENTS.md
  • batch/batch-runner.sh
  • test-all.mjs

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@test-all.mjs`:
- Around line 449-462: Duplicate top-level declarations of agents and
requiredSections are causing a SyntaxError; remove or rename the second set in
the "13. AGENTS.md integrity" block so you don't redeclare the same consts.
Locate the duplicate const declarations named agents and requiredSections in
that block and either delete them and reuse the earlier variables, or rename
them (e.g., agents2/requiredSections2) if a distinct copy is actually needed;
ensure the for-loop uses the correct variable names after the change.
🪄 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: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: daafc0ec-48b2-4710-92e2-a85f75d327de

📥 Commits

Reviewing files that changed from the base of the PR and between 94abef7 and dbee1a6.

📒 Files selected for processing (7)
  • .agents/skills/career-ops/SKILL.md
  • .gitignore
  • AGENTS.md
  • README.md
  • package.json
  • test-all.mjs
  • update-system.mjs

Comment thread test-all.mjs Outdated
mskadu added 2 commits May 29, 2026 10:15
The AGENTS.md integrity test section was accidentally removed during
merge conflict resolution. Restored from upstream and renumbered
sections 10-14 to 11-15 to accommodate it.
@santifer

santifer commented Jun 9, 2026

Copy link
Copy Markdown
Owner

OpenCode is squarely on the roadmap (#272), @mskadu, and you did the issue-first thing (#706) — thank you. Blockers: (1) rebase — 6 files conflict after v1.9.0 + test-all.mjs is currently red on the branch; (2) heads-up that #757 was a competing 'OpenCode full parity' PR (now closed for PII) — yours is the cleaner base, so let's make this the canonical OpenCode PR. Rebase to green and ping me.

@mskadu

mskadu commented Jun 10, 2026

Copy link
Copy Markdown
Contributor Author

@santifer — rebased to green. Upstream main merged (35 commits, incl. v1.9.0 and rate-limit retry loop), test-all.mjs passes 175/175, and the batch runner now supports both OpenCode dispatch AND rate-limit retries. Ready for re-review.

@lligirlburg-wq

Copy link
Copy Markdown

Hello again

@santifer

Copy link
Copy Markdown
Owner

Thanks for the quick turnaround, @mskadu — rebase looks good and I've approved the test workflows to verify the 175/175. One thing the upstream merge resolution dropped: .claude-plugin/ is gone from SYSTEM_PATHS in update-system.mjs (main has it at ~line 92; your diff replaces it with a blank line). That would stop existing users receiving .claude-plugin/ on update. Restore that one line and this is ready.

@mskadu

mskadu commented Jun 11, 2026

Copy link
Copy Markdown
Contributor Author

Fixed — .claude-plugin/ restored in SYSTEM_PATHS. Ready for final review.

# Conflicts:
#	README.md
#	batch/batch-runner.sh
#	package.json
@mskadu

mskadu commented Jun 11, 2026

Copy link
Copy Markdown
Contributor Author

Rebased again (60+ upstream commits incl. v1.10.0, 3 conflict files resolved). Tests: 240 passed, 0 failed. Ready for review.

@santifer

Copy link
Copy Markdown
Owner

@mskadu — second rebase verified: clean merge against current main, 240 passed / 0 failed on my machine too, and the .claude-plugin/ line is intact this time. The OpenCode integration itself (OPENCODE.md, .opencode/skills/, canonical AGENTS.md wrappers, doctor, labeler, docs) is ready to merge. Two final asks, and I want to be upfront that the first one is on us, not you:

  1. Drop the batch-runner.sh changes from this PR (the --cli flag + OpenCode dispatch). While your PR was open, we made a design decision for multi-CLI batch execution (feat(batch): add safe agent selection #834): a single extensible agent table inside run_worker() owns CLI dispatch, with the --cli flag as UX on top (feat(batch): add --cli flag for multi-CLI batch evaluation (opencode, gemini, qwen) #738). Your dispatch logic is good — but merging it now would land a third competing pattern in the same file and force yet another refactor. The goalposts moved under you; sorry about that. The deal: as soon as feat(batch): add safe agent selection #834's table lands, an opencode entry in that table is yours if you want it — it's exactly the knowledge in this diff, as a small follow-up that merges fast.

  2. Split the interview-prep/story-bank.md deletion into its own PR. The direction looks right to me (stop tracking a user-layer scaffold — same confusion class as v1.8.1 update tripped by safety check on interview-prep/story-bank.md (user-layer file) #732), but it's unrelated to OpenCode and deserves its own rationale + review. As its own focused PR it can merge in minutes.

What remains after those two = the pure OpenCode integration, and it goes straight in. Three rounds of fast turnarounds on a moving main — genuinely appreciated. 🙏

@mskadu

mskadu commented Jun 11, 2026

Copy link
Copy Markdown
Contributor Author

Hola! Both asks addressed: batch-runner.sh changes dropped (hope this helps - and since I had the time), story-bank.md split into #944, tests green at 243/0. Ready for re-review.

@mskadu

mskadu commented Jun 12, 2026

Copy link
Copy Markdown
Contributor Author
  • Rebased onto latest main with 6 new upstream commits merged. Resolved merge conflicts in doctor.mjs and test-all.mjs.

  • Tests: 251/251 passed, 0 failed.

Ready for re-review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add first-class OpenCode support alongside Claude Code

3 participants