Skip to content

devkade/dynamic-skills

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Dynamic Skill Manager (DSM)

Dynamic Skill Manager is a CLI tool for integrating skills from multiple sources (MCP, Vercel Skills, and Native) into the Claude Code ecosystem. DSM provides a unified interface for discovering, installing, and managing AI-assisted development tools across different skill ecosystems.

Overview

DSM bridges the gap between different skill ecosystems, enabling seamless integration of:

  • MCP (Model Context Protocol) skills - Tools, resources, and prompts from MCP servers
  • Vercel Skills - AI assistant capabilities from the Vercel ecosystem
  • Native (OMC) skills - Oh-My-Claude native skill integrations

Key Features

  • Unified Skill Interface: A single UnifiedSkill type abstracts differences between skill sources
  • Adapter Pattern: Extensible architecture for adding new skill sources
  • Execution Context Detection: Automatic detection of global, local, npx, and Node.js API modes
  • Skill Scoring & Analysis: Intent-based task analysis with keyword scoring
  • Scope-based Installation: Install skills globally, per-project, or per-session
  • Comprehensive Error Handling: 20+ error types with categories and severity levels

Installation

Global Installation

Install DSM globally for system-wide availability:

npm install -g dsm

Local Installation

Install DSM within a project:

npm install dsm

NPX Usage

Run DSM without installation using npx:

npx dsm <command>

Requirements

  • Node.js >= 18.0.0
  • npm >= 10.0.0

Usage

Command Reference

Status

Show DSM status, execution context, and installed skills count:

dsm status
# or
dsm st

Output:

DSM Status
  Execution Context: local
  Storage Path: /project/.dsm
  Ephemeral Mode: No

Installed Skills: 3/3
  - mcp: 2
  - vercel: 1

List

List installed skills with optional filtering:

# List all installed skills
dsm list
# or
dsm ls

# Filter by source
dsm list --source mcp
dsm list --source vercel

# Filter by status
dsm list --status installed
dsm list --status enabled

# JSON output
dsm list --json

Add / Install

Install a skill with optional scope:

# Install with default (session) scope
dsm add mcp/github

# Install with specific scope
dsm add vercel/retry --scope project
dsm add mcp/postgres --scope global

# Force reinstall
dsm add mcp/github --force

# Alternate command
dsm install mcp/github

Scopes:

  • global - Available across all projects (stored in ~/.dsm/)
  • project - Available in the current project (stored in ./.dsm/)
  • session - Available only for the current session

Remove / Uninstall

Remove an installed skill:

dsm remove mcp/github
# or
dsm rm mcp/github
# or
dsm uninstall mcp/github

Search

Search for available skills:

# General search
dsm search react
dsm search database

# Filter by source
dsm search api --source mcp

# JSON output
dsm search testing --json

MCP Server Management

Manage MCP server connections:

# List configured MCP servers
dsm mcp list

# Connect to an MCP server
dsm mcp connect my-server http://localhost:3000

# Disconnect from an MCP server
dsm mcp disconnect my-server

Analyze

Analyze a task and suggest relevant skills:

dsm analyze "build a REST API for user management"
dsm analyse "create a React component for data visualization"

Bundle

Manage skill bundles:

# List saved bundles
dsm bundle list

# Show bundle details
dsm bundle show fullstack

# Remove a bundle
dsm bundle remove fullstack

Init

Initialize DSM configuration:

dsm init

This creates:

  • Configuration file: dsm.config.json
  • Storage directory: .dsm/

Version

Show DSM version:

dsm version
# or
dsm v

Global Options

Option Description
--json Output as JSON
--compact Compact output (no ANSI colors)
--verbose Verbose output

Architecture

Project Structure

src/
├── core/
│   ├── types.ts          # Type definitions (UnifiedSkill, Task, etc.)
│   ├── errors.ts         # DSMError class with 20+ error subclasses
│   └── execution-context.ts  # Execution context detection
├── adapters/
│   ├── base-adapter.ts   # BaseAdapter abstract class
│   ├── mcp-adapter.ts    # MCP server adapter (JSON-RPC over HTTP/stdio)
│   ├── vercel-adapter.ts # Vercel Skills adapter (SKILL.md parsing)
│   └── omc-adapter.ts    # OMC native skills adapter (.claude/skills parsing)
├── registry/
│   ├── skill-registry.ts # Skill registry with adapter management
│   └── bundle-storage.ts # Skill bundle persistence (bundles.json)
├── analyzer/
│   └── task-analyzer.ts  # Task analysis and skill scoring
├── cli/
│   └── index.ts          # Commander.js CLI with all commands
└── index.ts              # Main entry point

Adapter Pattern

All skill sources adopt the SkillAdapter interface:

interface SkillAdapter {
  readonly source: SkillSource;
  discover(): Promise<UnifiedSkill[]>;
  install(skillId: string, options?: InstallOptions): Promise<UnifiedSkill>;
  uninstall(skillId: string): Promise<void>;
  isAvailable(skillId: string): Promise<boolean>;
}

Supported Adapters:

Adapter Source Purpose
MCPAdapter mcp Connect to MCP servers via JSON-RPC
VercelAdapter vercel Parse SKILL.md from Vercel Skills repo
BaseAdapter omc Base class for custom skill implementations

Unified Skill Model

The UnifiedSkill interface standardizes skills across all sources:

interface UnifiedSkill {
  id: string;              // "source/id" format
  name: string;            // Human-readable name
  description: string;     // Skill description
  source: SkillSource;     // 'mcp' | 'vercel' | 'omc'
  version: string;         // Semantic version
  capabilities: Capability[];
  triggers: Trigger[];
  adapter: string;
  config: Record<string, unknown>;
  status: SkillStatus;
  scope: SkillScope;
  metadata: SkillMetadata;
}

Capability Types

Type Description
tool Executable tool/function
resource Accessible data resource
prompt Prompt template
native Native OMC capability

Intent Classification

The TaskAnalyzer classifies tasks into 9 intent types:

Intent Description
code-generation Creating new code/components/APIs
refactoring Restructuring or optimizing code
testing Writing or running tests
debugging Fixing issues or investigating problems
documentation Writing docs or explaining code
analysis Performance analysis, code review
deployment Publishing or deploying to production
research Looking up information or best practices
unknown Unable to classify

Configuration

Configuration File

DSM uses dsm.config.json for configuration:

{
  "outputFormat": "table",
  "defaultScope": "session",
  "autoEnable": true,
  "telemetryEnabled": false,
  "mcpServers": {
    "my-server": {
      "endpoint": "http://localhost:3000",
      "enabled": true
    }
  }
}

Configuration Options

Option Type Default Description
outputFormat string table table, json, or compact
defaultScope string session global, project, or session
autoEnable boolean true Auto-enable skills after installation
telemetryEnabled boolean false Enable telemetry
mcpServers object {} MCP server configurations

DSM_HOME

You can set a custom DSM home directory:

export DSM_HOME=/custom/path/to/dsm

Execution Contexts

DSM automatically detects the execution context:

Context Indicator Storage Location Ephemeral
npx Running via npx Project-local .dsm/ Yes
global DSM_HOME in npm/global path ~/.dsm/ No
local Default Project-local .dsm/ No
node-api DSM_API_MODE=true Project-local .dsm/ No

Programmatic Usage

You can use DSM as a Node.js library:

import { SkillRegistry, MCPAdapter, VercelAdapter } from 'dynamic-skills';

// Create registry
const registry = new SkillRegistry();

// Register adapters
registry.registerAdapter('mcp', new MCPAdapter());
registry.registerAdapter('vercel', new VercelAdapter());

// Initialize
await registry.initialize();

// Search skills
const results = await registry.search({
  query: 'api',
  filters: { sources: ['mcp'] }
});

// Install a skill
const result = await registry.install('mcp/github', {
  scope: 'project'
});

// List installed skills
const skills = registry.getAll();

Task Analysis

import { TaskAnalyzer } from 'dynamic-skills';

const analyzer = new TaskAnalyzer(registry);
const task = {
  id: 'task-1',
  input: 'Build a REST API for user management',
  context: { projectType: 'nodejs' }
};

const analysis = await analyzer.analyze(task);

console.log('Intent:', analysis.intent.intentType);
console.log('Confidence:', analysis.confidence);
console.log('Suggested skills:', analysis.suggestedSkills);

Error Handling

DSM provides comprehensive error handling with 20+ error types:

Category Errors
Validation ValidationError, InvalidSkillIdError, InvalidSchemaError
Installation InstallationError, SkillNotFoundError, DuplicateSkillError
Execution ExecutionError, SkillExecutionTimeoutError, SkillInvocationError
Storage StorageError, StorageReadError, StorageWriteError
Network NetworkError, RegistryConnectionError, RegistryTimeoutError
Protocol MCPProtocolError, MCPConnectionError, VercelSkillsError
Configuration ConfigurationError, MissingConfigError, InvalidConfigError
Security SecurityError, SkillValidationError, DangerousCapabilityError
Compatibility CompatibilityError, VersionMismatchError, UnsupportedPlatformError

Error Format

{
  code: string;           // Error code (e.g., 'SKILL_NOT_FOUND')
  message: string;        // Human-readable message
  severity: ErrorSeverity; // 'critical' | 'high' | 'medium' | 'low'
  category: ErrorCategory; // Error category
  timestamp: Date;        // When the error occurred
  context?: ErrorContext; // Additional context
  cause?: string;         // Root cause message
}

Development

Build Commands

# Compile TypeScript
npm run build

# Watch mode
npm run build:watch

# Run CLI directly with ts-node
npm run dev

# Lint code
npm run lint

# Format code
npm run format

# Run tests
npm run test

# Run tests in watch mode
npm run test:watch

# Generate coverage report
npm run test:coverage

# Clean build artifacts
npm run clean

Dependencies

Peer Dependencies:

  • @anthropic-ai/sdk >= 0.26.0

Production Dependencies:

  • chalk - Terminal styling
  • cli-table3 - Table formatting
  • commander - CLI framework
  • conf - Configuration management
  • figlet - ASCII art headers
  • inquirer - Interactive prompts
  • js-yaml - YAML parsing
  • ora - Loading spinners
  • zod - Runtime validation

Contributing

Contributions are welcome! Please follow these guidelines:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Make your changes with appropriate tests
  4. Run npm run lint and npm run test to verify
  5. Commit your changes (git commit -m 'Add amazing feature')
  6. Push to the branch (git push origin feature/amazing-feature)
  7. Open a Pull Request

Adding a New Adapter

To add support for a new skill source:

  1. Create a new adapter extending BaseAdapter
  2. Implement the SkillAdapter interface
  3. Register the adapter in the CLI
  4. Add tests for the new adapter
// src/adapters/my-adapter.ts
import { BaseAdapter } from './base-adapter.js';

export class MyAdapter extends BaseAdapter implements SkillAdapter {
  readonly type = 'my-source' as const;
  readonly name = 'My Adapter';
  readonly source = 'omc' as const;

  async discover(): Promise<UnifiedSkill[]> {
    // Discovery logic
  }

  async install(skillId: string, options?: InstallOptions): Promise<UnifiedSkill> {
    // Installation logic
  }

  async uninstall(skillId: string): Promise<void> {
    // Uninstallation logic
  }

  async isAvailable(skillId: string): Promise<boolean> {
    // Availability check
  }
}

License

MIT License - see LICENSE file for details.

Links

About

Dynamic Skill Manager - CLI for integrating skills from MCP, Vercel Skills, and Native OMC sources

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors