npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@fwdslsh/crosstrain

v0.1.0

Published

OpenCode plugin that loads Claude Code extension points (skills, agents, commands, hooks) into OpenCode

Downloads

16

Readme

Crosstrain

CLI tool and OpenCode plugin for converting Claude Code extensions to OpenCode format.

What It Does

Crosstrain bridges Claude Code's extension ecosystem to OpenCode:

| Claude Code | → | OpenCode | |-------------|---|----------| | Skills (.claude/skills/) | → | Plugin tools | | Agents (.claude/agents/) | → | Agents (.opencode/agent/) | | Commands (.claude/commands/) | → | Commands (.opencode/command/) | | Hooks (settings.json) | → | Event handlers | | MCP Servers (.mcp.json) | → | MCP config (opencode.json) |

Installation

Quick Install

# Install globally with bun
bun install -g @fwdslsh/crosstrain"

# Or run directly
bunx crosstrain --help

From Source

git clone https://github.com/fwdslsh/crosstrain.git
cd crosstrain
bun install
bun link  # Makes 'crosstrain' available globally

CLI Usage

crosstrain <command> [path] [options]

Commands

| Command | Description | |---------|-------------| | command <path> | Convert a Claude Code command (.md file) | | skill <path> | Convert a skill to OpenCode plugin tool | | agent <path> | Convert an agent to OpenCode format | | hook | Display Claude Code hooks configuration | | mcp [path] | Convert MCP servers to OpenCode config | | plugin <source> | Convert a full plugin (local or remote) | | list <source> | List plugins in a marketplace | | all | Convert all Claude Code assets in project | | init | Initialize a new skills plugin | | settings | Import Claude Code settings to opencode.json |

Options

| Option | Description | |--------|-------------| | -o, --output-dir <path> | Output directory (default: .opencode) | | -p, --prefix <prefix> | File prefix for generated files (default: claude_) | | -v, --verbose | Enable verbose output | | --dry-run | Preview changes without writing files | | --no-user | Skip user-level assets from ~/.claude |

Examples

# Convert all assets in current project
crosstrain all

# Preview changes without writing
crosstrain all --dry-run

# Convert a single command
crosstrain command .claude/commands/create-feature.md

# Convert a skill to a plugin tool
crosstrain skill .claude/skills/pdf-extractor

# Convert a plugin from GitHub
crosstrain plugin anthropics/claude-plugins/code-review

# Browse a marketplace
crosstrain list anthropics/claude-plugins

# Convert a specific version
crosstrain plugin org/repo/[email protected]

OpenCode Plugin

Crosstrain also works as an OpenCode plugin, exposing tools that let the AI agent assist with conversion.

Plugin Installation

# Clone to your plugin directory
git clone https://github.com/fwdslsh/crosstrain.git .opencode/plugin/crosstrain
cd .opencode/plugin/crosstrain
bun install

Plugin Tools

When installed as a plugin, the AI agent can use these tools:

  • crosstrain - Run any CLI command
  • crosstrain_convert_all - Convert all assets
  • crosstrain_convert_plugin - Convert a plugin
  • crosstrain_list_marketplace - Browse marketplaces
  • crosstrain_convert_command - Convert single command
  • crosstrain_convert_skill - Convert single skill
  • crosstrain_convert_agent - Convert single agent
  • crosstrain_convert_mcp - Convert MCP servers
  • crosstrain_show_hooks - Display hooks config
  • crosstrain_init - Initialize skills plugin
  • crosstrain_import_settings - Import Claude Code settings to opencode.json

Plugin Configuration

Optional settings in .opencode/plugin/crosstrain/settings.json:

{
  "enabled": true,
  "verbose": false
}

Asset Conversion Details

Skills → Plugin Tools

Claude Code skills become OpenCode plugin tools:

.claude/skills/commit-helper/SKILL.md → .opencode/plugin/crosstrain-skills/tools/skill_commit_helper.ts

Agents → Agents

.claude/agents/code-review.md → .opencode/agent/claude_code-review.md

Model mapping:

  • sonnetanthropic/claude-sonnet-4-20250514
  • opusanthropic/claude-opus-4-20250514
  • haikuanthropic/claude-haiku-4-20250514

Commands → Commands

.claude/commands/run-tests.md → .opencode/command/claude_run-tests.md

Hooks → Event Handlers

Event mapping:

  • PreToolUsetool.execute.before
  • PostToolUsetool.execute.after
  • SessionStartsession.created
  • SessionEndsession.idle

MCP Servers → OpenCode Config

.mcp.json → opencode.json (mcp section)

Settings → opencode.json

Claude Code settings are converted to OpenCode configuration:

# Import settings
crosstrain settings

# Preview first
crosstrain settings --dry-run

Permission mode mapping:

  • acceptEdits{ edit: "allow" }
  • bypassPermissions{ edit: "allow", bash: "allow" }
  • plan{ edit: "deny", bash: "deny" }

Not converted (no direct equivalent):

  • hooks - Use OpenCode plugins instead
  • env - Set environment variables before running OpenCode
  • companyAnnouncements - Not supported
  • sandbox - OpenCode uses different sandboxing

Remote Plugins

Convert plugins directly from GitHub:

# GitHub shorthand
crosstrain plugin org/repo/plugin-name

# With version tag
crosstrain plugin org/repo/[email protected]

# Full URL
crosstrain plugin https://github.com/org/repo

Browsing Marketplaces

List available plugins in a Claude Code marketplace:

crosstrain list anthropics/claude-plugins

Output shows plugin names, descriptions, and the command to convert each one.

Crosstrainer Configuration

Plugin authors can customize conversion by adding a crosstrainer.json or crosstrainer.js file to their plugin root.

JSON Configuration

For simple customization (model mappings, asset filtering):

{
  "name": "my-plugin",
  "prefix": "myplugin_",
  "models": {
    "sonnet": "anthropic/claude-sonnet-4-20250514"
  },
  "agents": {
    "exclude": ["deprecated-agent"]
  }
}

JavaScript Configuration

For full control with transform hooks:

export default {
  name: "my-plugin",

  transformAgent(agent, ctx) {
    // Modify agent before conversion
    agent.model = "opus"
    return agent
  },

  transformCommand(command, ctx) {
    // Return null to skip
    if (command.name.startsWith("internal-")) return null
    return command
  },

  onConversionComplete(ctx, results) {
    console.log(`Converted ${results.agents.length} agents`)
  }
}

Only one crosstrainer file per plugin. See CLI Reference for full documentation.

Development

bun install          # Install dependencies
bun test             # Run tests
bun run typecheck    # Type check
bun run build        # Build

Documentation

License

CC-BY-4.0