CtrlK
BlogDocsLog inGet started
Tessl Logo

punkdev/cc2oc

Add and ship OpenCode support for one Claude Code plugin at a time. Includes core migration to a reviewable `opencode-plugin/` adapter, maintainer-facing docs, and follow-up CI/versioning setup for package publishing or skill-copy drift checks.

92

1.25x
Quality

92%

Does it follow best practices?

Impact

97%

1.25x

Average score across 2 eval scenarios

SecuritybySnyk

Passed

No known issues

Overview
Quality
Evals
Security
Files

testing-and-parity.mdskills/migrate-plugin/references/

Testing And Parity Reference

Use this when designing tests or completion evidence.

Minimum Evidence

By completion, provide evidence for:

  • Package entrypoint imports successfully.
  • Plugin factory returns expected handlers/tools/commands.
  • Shared .agents/ assets are readable or package-local copies exist when needed.
  • Every source and package-local SKILL.md parses as YAML frontmatter and includes name and description.
  • Package-local skill copies, when used, are tested for content equality with the declared source of truth or explicitly documented as intentionally OpenCode-specific.
  • OpenCode command and agent wrappers have frontmatter when generated.
  • Migrated MCP config has valid mcp entries in opencode.jsonc / opencode.json when Claude MCP servers are present.
  • Every ported hook has an OpenCode event fixture test.
  • State writes avoid Claude config directories and use safe OpenCode/XDG paths.
  • Existing Claude tests still pass when they exist.
  • Any local .opencode/ harness is intentional and documented.

Hook Test Matrix

BehaviorTest example
Input parsingGiven an OpenCode event payload, extract the same intent as the Claude hook.
Blocking/mutationValidate the plugin blocks, throws, mutates, or allows exactly as intended.
StateState survives reload and rejects malformed files.
Path safetySymlinks, path traversal, and missing files fail safely.
FallbackMissing optional shared skill/script produces a documented fallback.
Non-regressionExisting Claude hook tests still pass unchanged.

Package Tests

Useful package tests:

  • Import opencode-plugin/src/plugin.ts or opencode-plugin/plugin.js.
  • Instantiate the exported plugin with a fake context.
  • Assert returned object contains only expected handlers/tools.
  • Exercise each handler with a minimal OpenCode-like input/output fixture.
  • Verify opencode-plugin/package.json main and exports point to existing files.
  • Parse every packaged SKILL.md frontmatter and assert required name and description fields exist.
  • If opencode-plugin/skills/ contains copies, assert they match the declared shared source or document why they intentionally differ.

MCP Config Tests

For migrated MCP servers:

  • Validate opencode.jsonc or opencode.json syntax for the chosen destination format.
  • Confirm each MCP entry has type.
  • Confirm local entries have command as an array.
  • Confirm remote entries have url.
  • Confirm Claude env keys were renamed to OpenCode environment.
  • Confirm command paths exist or are documented as external dependencies.
  • Confirm secrets were not inlined.
  • Confirm name conflicts with existing mcp entries were resolved intentionally.

Manual Smoke Tests

If OpenCode is available and the user wants local dogfooding, create a small .opencode/plugins/<plugin>.ts shim and run OpenCode in the repo. Make clear this is a development harness, not the package distribution path.

Discovery checks for migrated surfaces:

SurfaceCheck
SkillsRun opencode debug skill and confirm expected skills are listed.
CommandsOpen the / palette and confirm expected commands are listed.
AgentsOpen the @ picker and confirm expected agents are listed.
MCPRun opencode mcp list and confirm expected servers are listed.
MCP authRun opencode mcp auth <name> for OAuth remote servers when needed.
ConfigIf skills do not appear, inspect OpenCode config/tool permissions and confirm the skill tool is enabled.
WrappersConfirm generated command/agent wrappers include frontmatter.

Skills can be discoverable even when a UI view does not surface them. Prefer opencode debug skill for skill discovery evidence.

Experimental APIs

For experimental.* OpenCode APIs:

  • Record the OpenCode version tested.
  • Keep the feature optional where possible.
  • Add a caveat in docs and completion summary.
  • Do not claim exact Claude parity without a passing test or manual smoke result.

README.md

tile.json