omniskill

package module
v0.12.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 9, 2026 License: MIT Imports: 0 Imported by: 0

README

OmniSkill

Go CI Go Lint Go SAST Docs Docs License

Unified skill infrastructure for AI agents in Go.

Overview

OmniSkill provides a common interface for defining, registering, and invoking AI agent capabilities across multiple execution environments:

  • skill/ - Core Skill and Tool interfaces, CommandTool for CLI wrapping
  • role/ - Role interfaces for agent personas with behaviors, policies, and delegation
  • roles/ - Reference role implementations (CodeReviewer, MeetingPM)
  • loader/ - Skill loaders for SKILL.md markdown and Go formats
  • installer/ - Dependency management for skill requirements, with version pinning
  • clawhub/ - ClawHub marketplace integration for skill discovery
  • pack/ - Skill pack interface, validation, publishing, and scaffolding
  • registry/ - Skill registration and capability-based discovery
  • migration/ - Adapters and validation for migrating bespoke tool layers to omniskill
  • mcp/server/ - MCP server runtime with tools, prompts, resources, rate limiting
  • mcp/client/ - MCP client for connecting to remote servers
  • mcp/bridge/ - Mount remote MCP servers as local skills
  • mcp/oauth2/ - OAuth 2.1 Authorization Server for authenticated MCP, or a pure resource server validating externally-issued tokens
  • voicetools/ - Voice call control tools (transfer, hold, consult, conference)

Skills can be invoked via:

  • Library mode - Direct in-process calls without protocol overhead
  • MCP Server - Expose via Model Context Protocol (stdio, HTTP, SSE)
  • MCP Client - Consume remote MCP servers as local skills

Installation

go get github.com/plexusone/omniskill

Quick Start

Define a Skill
package main

import (
    "context"
    "github.com/plexusone/omniskill/skill"
)

func main() {
    // Create a tool
    addTool := skill.NewTool("add", "Add two numbers",
        map[string]skill.Parameter{
            "a": {Type: "number", Required: true},
            "b": {Type: "number", Required: true},
        },
        func(ctx context.Context, params map[string]any) (any, error) {
            a := params["a"].(float64)
            b := params["b"].(float64)
            return map[string]any{"sum": a + b}, nil
        },
    )

    // Create a skill
    mathSkill := &skill.BaseSkill{
        SkillName:        "math",
        SkillDescription: "Mathematical operations",
        SkillTools:       []skill.Tool{addTool},
    }
}
Library Mode

Call tools directly without MCP overhead:

import (
    runtime "github.com/plexusone/omniskill/mcp/server"
    "github.com/modelcontextprotocol/go-sdk/mcp"
)

rt := runtime.New(&mcp.Implementation{
    Name:    "calculator",
    Version: "1.0.0",
}, nil)

rt.RegisterSkill(mathSkill)

// Direct invocation - no JSON-RPC, no transport
result, err := rt.CallTool(ctx, "add", map[string]any{"a": 1.0, "b": 2.0})
MCP Server Mode

Expose skills via MCP for Claude Desktop or other clients:

// stdio (for Claude Desktop)
rt.ServeStdio(ctx)

// HTTP with SSE
rt.ServeHTTP(ctx, &runtime.HTTPServerOptions{Addr: ":8080"})

// With OAuth2 authentication (for ChatGPT.com)
rt.ServeHTTP(ctx, &runtime.HTTPServerOptions{
    Addr: ":8080",
    OAuth2: &runtime.OAuth2Options{
        Users: map[string]string{"admin": "password"},
    },
})

// As a pure resource server validating externally-issued tokens
// (e.g. an enterprise IdP), instead of running a local authorization server
rt.ServeHTTP(ctx, &runtime.HTTPServerOptions{
    Addr: ":8080",
    ExternalAuth: &runtime.ExternalAuthOptions{
        Verifier:             myJWTVerifier, // implements oauth2.TokenVerifier
        AuthorizationServers: []string{"https://idp.example.com"},
    },
})
MCP Client Mode

Connect to remote MCP servers and use them as skills:

import (
    "os/exec"
    "github.com/plexusone/omniskill/mcp/client"
)

c := client.New("my-app", "1.0.0", nil)

// Connect to MCP server
cmd := exec.Command("npx", "-y", "@modelcontextprotocol/server-filesystem", "/tmp")
session, err := c.ConnectCommand(ctx, cmd)
defer session.Close()

// Wrap as skill
fsSkill := session.AsSkill(client.WithSkillName("filesystem"))

// Use like any local skill
for _, tool := range fsSkill.Tools() {
    fmt.Println(tool.Name())
}
Registry

Central skill registration and discovery:

import "github.com/plexusone/omniskill/registry"

reg := registry.New()
reg.Register(mathSkill)
reg.Register(fsSkill)

// Discover all tools
for _, tool := range reg.ListTools() {
    fmt.Printf("%s: %s\n", tool.Name(), tool.Description())
}

// Initialize all skills
reg.Init(ctx)
defer reg.Close()
Auto-Registration

Skills registered with the runtime can auto-register with a registry:

reg := registry.New()
rt := runtime.New(impl, &runtime.Options{
    Registry: reg,  // Enable auto-registration
})

rt.RegisterSkill(mathSkill)  // Also registers with reg

Package Structure

github.com/plexusone/omniskill
├── skill/       # Core Skill and Tool interfaces, CommandTool
├── role/        # Role interfaces and specification types
│   ├── role.go        # Role interface, BaseRole, optional interfaces
│   ├── spec.go        # RoleSpec, Responsibility, SkillRequirements
│   ├── behavior.go    # Behavior, BehaviorContext, BehaviorTrigger
│   ├── policy.go      # Policy, PolicyRule, PolicyEnforcement
│   ├── metric.go      # MetricDefinition, MetricType, MetricTarget
│   ├── delegation.go  # DelegationConfig, DelegationRule
│   └── workflow.go    # Workflow interface, WorkflowResult, Artifact
├── roles/       # Reference role implementations (CodeReviewer, MeetingPM)
├── loader/      # Skill loaders for SKILL.md and Go formats
├── installer/   # Dependency management for skills, with version pinning
├── clawhub/     # ClawHub marketplace integration
│   ├── hub.go       # API client
│   ├── manifest.go  # CLAWHUB.json parsing
│   ├── resolver.go  # Dependency resolution
│   └── security.go  # Security scanning
├── pack/        # Skill pack interface: validation, publishing, scaffolding
├── registry/    # Skill registration and capability-based discovery
├── migration/   # Adapters and validation for migrating bespoke tool layers
├── voicetools/  # Voice call control tools
│   ├── context.go     # CallContext, Call, Transport interfaces
│   ├── registry.go    # NewVoiceSkill() registration
│   ├── transfer.go    # transfer_call tool
│   ├── hold.go        # hold_call, unhold_call tools
│   ├── consult.go     # consult_agent tool
│   └── conference.go  # add_to_conference tool
├── mcp/
│   ├── server/  # MCP server runtime (rate limiting, tool auth, logging)
│   ├── client/  # MCP client for remote servers
│   ├── bridge/  # Mount remote MCP servers as local skills
│   └── oauth2/  # OAuth 2.1 authorization server (RFC 7009 revocation, external resource-server mode)
└── doc.go

Roles

The role/ package defines interfaces for high-level agent personas that compose skills and define behavior. Roles separate organizational responsibilities from runtime implementations.

Role Interface
import "github.com/plexusone/omniskill/role"

type MyRole struct {
    role.BaseRole
}

func (r *MyRole) Spec() *role.RoleSpec {
    return &role.RoleSpec{
        ID:          "my-role",
        Name:        "My Role",
        Description: "Does something useful",
        Skills: role.SkillRequirements{
            Required: []role.SkillRef{
                {Name: "skill-a", Purpose: "For doing A"},
            },
        },
        Behaviors: []role.Behavior{
            // Context-aware behaviors
        },
        Metrics: []role.MetricDefinition{
            role.NewCounterMetric("tasks-completed", "Tasks Completed", ""),
        },
    }
}
Optional Interfaces

Roles can implement additional interfaces for enhanced capabilities:

Interface Purpose
SkillRequirer Roles with optional skills
BehaviorProvider Context-aware behaviors (meeting, chat, autonomous)
MetricsProvider KPIs and success metrics
DelegationProvider Sub-agent orchestration
PolicyProvider Governance rules

Roles also implement Version() string (via role.BaseRole or directly), matching the skill.Skill interface's versioning convention.

The roles/ package ships reference implementations built on role.BaseRole - CodeReviewer (configurable strictness) and MeetingPM - usable directly or as templates for custom roles.

See Role Interface Reference for complete documentation.

Voice Tools

The voicetools package provides AI agent tools for controlling voice calls:

import (
    "github.com/plexusone/omniskill/voicetools"
)

// Create call context with transport and agent registry
callCtx := voicetools.NewCallContext(call, transport, agentRegistry)

// Create voice skill with all call control tools
voiceSkill := voicetools.NewVoiceSkill(callCtx)

// Register with MCP server
rt.RegisterSkill(voiceSkill)
Available Tools
Tool Description
transfer_call Transfer call to another number or agent queue
hold_call Place caller on hold with optional music
unhold_call Resume call from hold
consult_agent Query specialist AI without transferring
add_to_conference Add participants to conference call

GitHub

The GitHub skill was extracted to a separate repository in v0.10.0 to keep omniskill's dependency footprint light:

go get github.com/plexusone/omniskill-github@latest
import "github.com/plexusone/omniskill-github/skill"

ghSkill := skill.NewGitHubSkill(os.Getenv("GITHUB_TOKEN"))

if err := ghSkill.Init(ctx); err != nil {
    log.Fatal(err)
}
defer ghSkill.Close()

rt.RegisterSkill(ghSkill)

See omniskill-github for tool reference and documentation.

Documentation

Feature Comparison

Feature Library Mode MCP Server MCP Client
Direct tool calls - -
JSON-RPC overhead None Yes Yes
Claude Desktop - -
Remote servers - -
Skill interface

Design Philosophy

  1. Define Once, Use Everywhere - Skills work in library mode, as MCP servers, or wrapping MCP clients
  2. Protocol at the Edge - MCP is for external communication; internal calls bypass JSON-RPC
  3. Type Safety - Generic handlers with automatic JSON schema inference
  4. Composable - Skills can wrap other skills or remote MCP sessions

License

MIT License - see LICENSE file for details.

Documentation

Overview

Package omniskill provides a unified skill/tool infrastructure for AI applications.

OmniSkill is organized into focused subpackages:

  • mcp/server: MCP server runtime with tools, prompts, resources, and multiple transport options (stdio, HTTP, SSE)
  • mcp/client: MCP client for connecting to external MCP servers
  • mcp/oauth2: OAuth 2.1 Authorization Server with PKCE support for MCP authentication

Quick Start

For building MCP servers, import the server package:

import "github.com/plexusone/omniskill/mcp/server"

rt := server.New(&mcp.Implementation{
    Name:    "my-server",
    Version: "1.0.0",
}, nil)

// Add tools, prompts, resources
server.AddTool(rt, tool, handler)

// Library mode: call directly
result, err := rt.CallTool(ctx, "add", map[string]any{"a": 1, "b": 2})

// Server mode: serve via HTTP
rt.ServeHTTP(ctx, &server.HTTPServerOptions{
    Addr: ":8080",
})

For connecting to MCP servers as a client:

import "github.com/plexusone/omniskill/mcp/client"

c := client.New("my-app", "1.0.0", nil)
session, err := c.ConnectCommand(ctx, exec.Command("npx", "-y", "@modelcontextprotocol/server-github"), nil)
tools, err := session.ListTools(ctx)

For OAuth 2.1 authentication with PKCE (required by ChatGPT.com and other MCP clients):

import "github.com/plexusone/omniskill/mcp/oauth2"

srv, err := oauth2.New(&oauth2.Config{
    Issuer: "https://example.com",
    Users:  map[string]string{"admin": "password"},
})

See the individual package documentation for detailed usage.

Design Philosophy

OmniSkill enables defining skills once and exposing them across multiple formats: MCP protocol, compiled Go skills, OpenAPI, and more.

MCP (Model Context Protocol) is treated as the primary interoperability protocol, while providing zero-overhead library-mode for Go consumers.

Directories

Path Synopsis
Package clawhub provides ClawHub skills marketplace integration.
Package clawhub provides ClawHub skills marketplace integration.
Package installer provides installation management for skill dependencies.
Package installer provides installation management for skill dependencies.
Package loader provides skill loaders for different formats.
Package loader provides skill loaders for different formats.
mcp
bridge
Package bridge provides MCP-to-omniskill bridging.
Package bridge provides MCP-to-omniskill bridging.
client
Package client provides an MCP client wrapper for connecting to MCP servers.
Package client provides an MCP client wrapper for connecting to MCP servers.
oauth2
Package oauth2 provides a standalone OAuth 2.1 Authorization Server with PKCE support, designed for MCP server authentication.
Package oauth2 provides a standalone OAuth 2.1 Authorization Server with PKCE support, designed for MCP server authentication.
transport
Package transport provides MCP transport configurations and utilities.
Package transport provides MCP transport configurations and utilities.
Package migration provides utilities for migrating bespoke tool layers to omniskill.
Package migration provides utilities for migrating bespoke tool layers to omniskill.
Package pack provides interfaces for markdown skill packs.
Package pack provides interfaces for markdown skill packs.
Package registry provides skill registration and discovery.
Package registry provides skill registration and discovery.
Package role defines the core interfaces for agent roles.
Package role defines the core interfaces for agent roles.
Package roles provides reference role implementations.
Package roles provides reference role implementations.
Package skill defines the core interfaces for skills and tools.
Package skill defines the core interfaces for skills and tools.
Package voicetools provides voice call control tools for AI agents.
Package voicetools provides voice call control tools for AI agents.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL