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

@skill-kit/compose

v1.0.0

Published

Workflow composer and orchestrator for Skill Kit

Readme

@skill-kit/compose

Workflow composer and orchestrator for Skill Kit. Define, execute, and visualize complex workflows that combine multiple Skills.

Installation

npm install @skill-kit/compose
# or
pnpm add @skill-kit/compose

Quick Start

Define a Workflow (YAML)

# workflow.yaml
name: data-pipeline
description: Process and transform data
version: 1.0.0

inputs:
  source:
    type: string
    description: Data source URL

steps:
  - id: fetch
    skill: http-fetcher
    inputs:
      url: ${inputs.source}

  - id: validate
    skill: data-validator
    inputs:
      data: ${fetch.response}

  - id: transform
    skill: data-transformer
    inputs:
      data: ${validate.data}
    when: ${validate.isValid}

outputs:
  result:
    value: ${transform.output}

Execute with CLI

# Run a workflow
skill-compose run workflow.yaml --input source=https://api.example.com/data

# Validate workflow syntax
skill-compose validate workflow.yaml

# Visualize workflow
skill-compose visualize workflow.yaml --format mermaid

Use Programmatically

import { parseWorkflowFile, executeWorkflow } from '@skill-kit/compose';

const { workflow } = await parseWorkflowFile('./workflow.yaml');

const result = await executeWorkflow(workflow, {
  inputs: { source: 'https://api.example.com/data' },
  skillExecutor: async (skillName, inputs) => {
    // Implement your skill execution logic
    return { output: `Executed ${skillName}` };
  },
});

console.log('Status:', result.status);
console.log('Outputs:', result.outputs);

Features

Control Flow

Parallel Execution

steps:
  - id: parallel-tasks
    parallel:
      - id: task1
        skill: fast-task
      - id: task2
        skill: slow-task
    maxConcurrency: 2
    failureStrategy: wait-all # or fail-fast

Conditional Branching

steps:
  - id: check
    condition:
      if: ${inputs.enabled} and ${validate.isValid}
      then:
        id: process
        skill: processor
      else:
        id: skip
        skill: logger

Loops (foreach)

steps:
  - id: process-items
    foreach:
      items: ${inputs.items}
      as: item
      index: idx
      step:
        id: process
        skill: item-processor
        inputs:
          data: ${item}
          position: ${idx}
      maxConcurrency: 5

Variable Interpolation

inputs:
  name: Alice
  config:
    timeout: 5000

steps:
  - id: greet
    skill: greeter
    inputs:
      message: Hello ${inputs.name}!
      timeout: ${inputs.config.timeout}
      fallback: ${missing:-default-value}
      envVar: ${env.API_KEY}

Error Handling

steps:
  - id: flaky-step
    skill: unreliable-service
    onError:
      action: retry
      retry:
        maxRetries: 3
        initialDelay: 1000
        maxDelay: 30000
        exponential: true

  - id: optional-step
    skill: optional-service
    onError:
      action: continue
      fallback: { status: 'skipped' }

Workflow-level Error Strategy

name: robust-workflow
onError:
  action: fail # fail | continue | retry

steps:
  # ...

Visualization

ASCII Output

skill-compose visualize workflow.yaml --format simple
[data-pipeline]

├─ fetch: http-fetcher
├─ validate: data-validator
├─ transform: data-transformer

Mermaid Output

skill-compose visualize workflow.yaml --format mermaid
flowchart TB
    fetch["http-fetcher"]
    validate["data-validator"]
    transform["data-transformer"]
    fetch --> validate
    validate --> transform

API Reference

Parser

// Parse YAML string
const result = parseWorkflowString(yamlContent, { validate: true });

// Parse from file
const workflowFile = await parseWorkflowFile('./workflow.yaml');

// Validate workflow object
const validation = validateWorkflow(workflowObject);

Executor

// Create executor
const executor = createExecutor(workflow, {
  inputs: { ... },
  skillExecutor: async (name, inputs, context) => { ... },
  timeout: 30000,
  maxConcurrency: 10,
  onStepStart: (step, context) => { ... },
  onStepComplete: (step, result, context) => { ... },
});

// Execute
const result = await executor.execute();

// Cancel
executor.cancel();

Visualization

// ASCII
const ascii = toAscii(workflow);
const simple = toSimpleAscii(workflow);

// Mermaid
const mermaid = toMermaid(workflow, { direction: 'LR' });

Types

interface Workflow {
  name: string;
  description?: string;
  version?: string;
  inputs?: Record<string, InputDefinition>;
  outputs?: Record<string, OutputDefinition>;
  steps: WorkflowStep[];
  onError?: ErrorStrategy;
}

type WorkflowStep =
  | SkillStep
  | ParallelStep
  | ConditionStep
  | ForeachStep
  | WhileStep
  | SubWorkflowStep;

interface ExecutionResult {
  status: 'completed' | 'failed' | 'cancelled';
  outputs: Record<string, unknown>;
  steps: StepResult[];
  duration: number;
  error?: Error;
}

License

MIT