オープンソース · MIT · TypeScript · v0.4.7

skelm — 本番投入できる agentic workflows

型付き TypeScript pipelines で、決定的な code、単発 inference、完全な agent loops を default-deny 権限と自分で所有する gateway の背後にまとめます。同じモジュール形状で、短い自動化、cron jobs、webhooks、durable approvals、persistent chat workflows を実行できます。

$ npm install -g skelm
$ skelm init my-bot && cd my-bot && npm install
$ skelm run workflows/hello.workflow.mts --input '{"name":"world"}'

scripts から durable agents まで、ひとつの authoring model。

workflow は型付き TypeScript モジュールです。決定的な code、model inference、agent loops を直接使い、schedules、webhooks、queues、durable state が必要になったら同じ workflow を gateway 経由で host します。

code()

決定的なロジック

fetches、transforms、branches、loops、parallel work、waits、nested pipeline calls のための純粋な TypeScript steps。通常の code と同じように型チェック、refactor、test、version 管理できます。

infer()

単発 inference

型付き input と structured output を持つ 1 回の model call。`infer()` は tool loop なしで LLM の判断を使うためのもので、OpenAI-compatible endpoints、Anthropic、Pi、Vercel AI、custom backends などに対応します。

agent()

Multi-turn agent loops

tools、MCP servers、skills、workspaces、default-deny permissions を持つ完全な agent steps。Backends には @skelm/agent、Opencode、Pi、Codex、Vercel AI、ACP agents、custom providers が含まれます。

gateway が所有する trust boundary

権限は後付けではなく API の一部です

すべての privileged action は code で宣言された permissions の下で gateway を通ります。宣言された permission を強制できない backend は、それを黙って bypass せず step start で失敗します。

  • Default-deny dimensions は tools、executables、MCP servers、skills、network egress、filesystem roots、delegation、agentmemory operations をカバーします。
  • gateway は HTTP + SSE で workflows を host し、scheduler、queue、file-watch、poll、webhook、event-source triggers を駆動し、execution surface を所有します。
  • Runs は human approval のために pause でき、durable state から resume でき、session-keyed persistent chat conversations を restart 後も保持できます。
  • Audit、secrets、workspace isolation、MCP lifecycle、agent supervision は同じ gateway trust boundary の内側に留まります。

実際の workflow を end to end で

現在の examples からの incident response: 並列の deterministic triage の後、tools、MCP、filesystem、network の明示的 permissions を持つ agent step を実行します。

import { agent, code, parallel, pipeline } from 'skelm'
import { z } from 'zod'

export default pipeline({
  id: 'incident-response',
  input: z.object({
    incidentId: z.string(),
    service: z.string(),
    description: z.string(),
  }),
  output: z.object({
    rootCause: z.string(),
    immediateActions: z.array(z.string()),
  }),
  triggers: [{ kind: 'webhook', path: '/webhooks/incident' }],
  steps: [
    parallel({
      id: 'triage',
      steps: [
        code({ id: 'search-issues', run: () => ({ issues: [] }) }),
        code({ id: 'open-channel', run: () => ({ channel: 'inc-001' }) }),
      ],
    }),
    agent({
      id: 'root-cause',
      backend: 'opencode',
      prompt: (ctx) => `Analyze this incident:\n${ctx.input.description}`,
      permissions: {
        allowedTools: ['gh.search_issues', 'slack.post_message'],
        allowedMcpServers: ['github'],
        allowedExecutables: [],
        fsRead: [],
        fsWrite: [],
        networkEgress: { allowHosts: ['api.github.com', 'slack.com'] },
      },
      output: z.object({
        rootCause: z.string(),
        immediateActions: z.array(z.string()),
      }),
      maxTurns: 4,
    }),
  ],
})

パッケージ

skelm は focused packages として配布されます。runtime と CLI には meta-package `skelm` を install し、必要に応じて backend、integration、memory、metrics、tracing packages を追加します。

skelm

Meta-package — これを install します。@skelm/core を再 export し、skelm CLI binary を含み、local execution に必要な CLI、scheduler、integration SDK に依存します。

@skelm/core

Runtime、types、builders、schemas、events、permissions、registries、backend interface、system prompt composition、pipeline execution primitives。

@skelm/cli

Command-line interface と programmatic primitives。非 exempt commands は local gateway に dispatch します。`init`、`validate`、`gateway *` は live gateway なしで実行できます。

@skelm/gateway

config、registries、permissions、audit、agent lifecycle、triggers、HTTP/SSE、dashboard API、execution trust boundary を所有する long-running orchestrator。

@skelm/scheduler

deduplication と overlap policies を備えた cron、interval、webhook schedules の trigger management。scheduled work のために gateway が使用します。

@skelm/integrations

GitHub、Slack、Jira、Telegram、Matrix、chat UI trigger sources など third-party services 向けの typed integration package。

@skelm/integration-sdk

custom skelm integrations と trigger sources を作る authoring SDK。gateway に plug in する connectors を構築できます。

@skelm/agent

First-party native agent backend。OpenAI-compatible chat endpoints に対して infer() と agent() を実行し、in-process TrustEnforcer permission checks を行います。

@skelm/agentmemory

cross-session recall のための typed REST client と gateway-wired AgentmemoryHandle。operations は default-deny で gateway enforcement 経由です。

@skelm/opencode

native permission mapping、granular enforcement、gateway-supervised lifecycle support を備えた Opencode.ai coding-agent backend。

@skelm/pi

native tool allowlist enforcement、infer() support、sandbox defaults、queue controls を備えた Pi coding-agent SDK backend。

@skelm/codex

@openai/codex-sdk 経由の OpenAI Codex backend。boundary permission mapping、MCP injection、skill loading、session lifecycle、streaming を備えます。

@skelm/vercel-ai

skelm policy の下で tool filtering と call-time permission checks により infer() と agent() を動かす Vercel AI SDK backend。

@skelm/metrics

skelm event streams 向け Prometheus-format metrics: run counters、step timings、permission denials、approvals、trigger fires。

@skelm/otel

exporters を自分で設定せずに run と step spans を emit する、skelm event streams 向け OpenTelemetry tracing。

workflow を ship する準備はできていますか?

CLI を install し、project を scaffold するか、`skelm builder` を使って natural-language spec から workflow を draft できます。