open-index/open-npm huggingface dataset:
npm package: @skill-tools/core
Description: Core parser, types, and utilities for Agent Skills (SKILL.md)
Author: Piyush Vyas
Latest version: 0.2.2

# @skill-tools/core

Core parser, types, and utilities for [Agent Skills](https://agentskills.io) (SKILL.md).

This is the foundation package that all other `@skill-tools` packages depend on.

## Install

```bash
npm install @skill-tools/core
```

## Usage

```typescript
import { parseSkill, resolveSkillFiles, countTokens } from '@skill-tools/core';

// Discover all SKILL.md files in a directory
const locations = await resolveSkillFiles('./skills/');

// Parse a single SKILL.md file
const result = await parseSkill(locations[0].skillFile);
if (result.ok) {
  console.log(result.skill.metadata.name);
  console.log(result.skill.metadata.description);
  console.log(result.skill.sections);
}

// Parse raw content without file I/O
import { parseSkillContent } from '@skill-tools/core';
const parsed = parseSkillContent(markdownString, 'path/SKILL.md', 'path/');

// Count tokens (cl100k_base encoding)
const tokens = countTokens('Hello, world!');
```

## API

| Export | Description |
|--------|-------------|
| `parseSkill(path)` | Parse a SKILL.md file from disk |
| `parseSkillContent(content, filePath, dirPath)` | Parse SKILL.md from a string |
| `resolveSkillFiles(dir)` | Find all SKILL.md files in a directory tree |
| `countTokens(text)` | Count tokens using tiktoken (cl100k_base) |

## Types

All types are exported: `Skill`, `SkillMetadata`, `SkillSection`, `SkillFileReference`, `Diagnostic`, `ParseResult`, `QualityScore`, `DimensionScore`, `ScoreSuggestion`.

## License

Apache-2.0
npm package: @skill-tools/router
Description: BM25 skill selection middleware for Agent Skills — fast full-text routing for large skill catalogs
Author: Piyush Vyas
Latest version: 0.2.2

# @skill-tools/router

Skill selection middleware for [Agent Skills](https://agentskills.io). Uses **BM25** (Okapi BM25) to rank and route natural-language queries to the right skills from large catalogs. Zero external dependencies — no API keys or model downloads.

## Install

```bash
npm install @skill-tools/router
```

## Quick Start

```typescript
import { SkillRouter } from '@skill-tools/router';

const router = new SkillRouter();

await router.indexSkills([
  { name: 'deploy-vercel', description: 'Deploy apps to Vercel production...' },
  { name: 'run-tests', description: 'Execute unit and integration tests...' },
  { name: 'lint-code', description: 'Run ESLint or Biome to check code style...' },
]);

const results = await router.select('deploy my app to production');
// [{ skill: 'deploy-vercel', score: 1.0, metadata: { ... } }]
```

## Features

- **BM25 full-text search** — fast inverted-index scoring, no API keys needed
- **Pluggable embedding providers** — bring your own OpenAI, Cohere, or custom embeddings
- **Pluggable vector stores** — in-memory store included, add your own for persistence
- **Conflict detection** — find overlapping skills in your catalog
- **Snapshot persistence** — save/load indexes for instant startup
- **Boost & exclude** — fine-tune results per query

## API

| Export | Description |
|--------|-------------|
| `SkillRouter` | Main router — `indexSkills()`, `select()`, `detectConflicts()`, `save()`/`load()` |
| `BM25Index` | Standalone BM25 engine (used internally, also exported for direct use) |
| `LocalEmbeddingProvider` | TF-IDF embedding provider (legacy, for custom vector store workflows) |
| `MemoryVectorStore` | In-memory cosine-similarity vector store |

## BM25 Parameters

```typescript
const router = new SkillRouter({
  bm25: { k1: 1.2, b: 0.75 }, // defaults — tune for your catalog
});
```

| Param | Default | Effect |
|-------|---------|--------|
| `k1` | 1.2 | Term frequency saturation — higher = more weight on repeated terms |
| `b` | 0.75 | Length normalization — 0 = ignore doc length, 1 = fully normalize |

## License

Apache-2.0