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

@skelm/opencode

v0.4.3

Published

Opencode.ai backend for skelm with full permission enforcement

Readme

@skelm/opencode

Opencode.ai coding-agent backend for skelm — full granular permission enforcement, multi-agent support.

npm

Part of skelm.

Drives Opencode through its official SDK, mapping skelm's AgentPermissions model onto Opencode's permission primitives so a denied tool, exec, host, or filesystem write fails at step start instead of leaking past the trust boundary.

Install

npm install @skelm/opencode

You also need an Opencode runtime — the package speaks to a running Opencode server / SDK process; it does not vendor the agent.

Quick Start

Register the backend in skelm.config.ts:

// skelm.config.ts
import { defineConfig } from 'skelm'
import { createOpencodeBackendFromConfig } from '@skelm/opencode'

export default defineConfig({
  backends: { agent: 'opencode' },
  instances: [
    createOpencodeBackendFromConfig({
      id: 'opencode',
      agent: 'build',                     // 'build', 'plan', or a custom opencode agent id
      apiKey: { secret: 'OPENCODE_API_KEY' },
    }),
  ],
})

A workflow that applies a fix to a codebase:

// workflows/fix-bug.workflow.mts
import { agent, pipeline } from 'skelm'
import { z } from 'zod'

export default pipeline({
  id: 'fix-bug',
  input:  z.object({ description: z.string() }),
  output: z.object({ summary: z.string() }),
  steps: [
    agent({
      id: 'patch',
      backend: 'opencode',
      prompt: (ctx) => `Fix the following bug and return a JSON summary {summary}:\n${ctx.input.description}`,
      permissions: {
        allowedTools:       [],
        allowedExecutables: ['npm', 'pnpm', 'tsc'],
        allowedMcpServers:  [],
        allowedSkills:      [],
        fsRead:             ['./src'],
        fsWrite:            ['./src'],
        networkEgress:      { allowHosts: ['registry.npmjs.org'] },
      },
      output: z.object({ summary: z.string() }),
      maxTurns: 12,
    }),
  ],
})

createOpencodeBackendFromConfig lets @skelm/gateway supervise the Opencode server lifecycle. For a short-lived instance, use createOpencodeBackend and pass your own server URL.

What's exported

export { createOpencodeBackend } from './backend.js'
export { createOpencodeBackendFromConfig } from './factory.js'
export { OpencodeProvider, createOpencodeProvider } from './provider.js'
export { OpencodeClientWrapper } from './client.js'
export {
  mapSkelmPermissionsToOpencode,
  mapOpencodePermissionsToSkelm,
  validatePermissions,
  buildPermissionAuditEntry,
} from './permission-mapper.js'

export type {
  OpencodeBackendOptions, OpencodePermissionConfig, MappedPermissions,
  BackendAuthenticationError, BackendRateLimitError, BackendTimeoutError,
} from './types.js'

Permission mapping

Permissions declared on the skelm agent() step are translated into Opencode's permission types before each turn. A denial — wrong tool, wrong host, wrong filesystem path, wrong exec — surfaces as a permission-denied event on the bus and a non-zero exit code on the run.

See docs/backends/opencode.md for the full mapping table.

Stability

0.x — APIs may change between minor versions until v1.

License

MIT