skillrun 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +24 -0
- package/LICENSE +21 -0
- package/README.md +226 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +258 -0
- package/dist/cli.js.map +1 -0
- package/dist/config.d.ts +14 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +9 -0
- package/dist/config.js.map +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +9 -0
- package/dist/index.js.map +1 -0
- package/dist/models.d.ts +68 -0
- package/dist/models.d.ts.map +1 -0
- package/dist/models.js +245 -0
- package/dist/models.js.map +1 -0
- package/dist/prompt.d.ts +3 -0
- package/dist/prompt.d.ts.map +1 -0
- package/dist/prompt.js +18 -0
- package/dist/prompt.js.map +1 -0
- package/dist/providers.d.ts +45 -0
- package/dist/providers.d.ts.map +1 -0
- package/dist/providers.js +235 -0
- package/dist/providers.js.map +1 -0
- package/dist/skills.d.ts +61 -0
- package/dist/skills.d.ts.map +1 -0
- package/dist/skills.js +253 -0
- package/dist/skills.js.map +1 -0
- package/package.json +84 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## 0.4.0
|
|
4
|
+
|
|
5
|
+
- Renamed package `skill-router` -> `skillrun` (bare name taken on npm); `skill-router` kept as a bin alias. — 2026-09-20
|
|
6
|
+
|
|
7
|
+
- skills.sh routing expanded from 8 to 10 curated skills with 3-tier Node.js
|
|
8
|
+
coverage: `nodejs-backend-patterns` (wshobson/agents),
|
|
9
|
+
`nodejs-best-practices` (sickn33/agentic-awesome-skills),
|
|
10
|
+
`nodejs-core` (mcollina/skills). Replaces `nodejs-expert`
|
|
11
|
+
(oimiragieo/agent-studio).
|
|
12
|
+
- New shared `buildSystemPrompt()` module (`skillrun/prompt`), used by the
|
|
13
|
+
CLI, live-check, and library consumers.
|
|
14
|
+
- New subpath exports: `./skills`, `./config`, `./prompt`.
|
|
15
|
+
- Test harness fixed: runner now covers skills + models + prompt
|
|
16
|
+
(21 tests, all green under `node --test`).
|
|
17
|
+
- New example: `examples/node-backend.mjs` (query → hints → prompt → model).
|
|
18
|
+
|
|
19
|
+
## 0.3.0
|
|
20
|
+
|
|
21
|
+
- Single-shot completion across Ollama, OpenAI-compatible, and Anthropic.
|
|
22
|
+
- Automatic local model selection with rationale (`models list/pick/resolve`).
|
|
23
|
+
- Query-based skills.sh decision, live discovery, and project setup
|
|
24
|
+
(`skills decide/find/list/setup/resolve`, `--auto-skills`).
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Kunj Shah
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
# skillrun
|
|
2
|
+
|
|
3
|
+
Single-shot completion against any coding model — local Ollama, any
|
|
4
|
+
OpenAI-compatible endpoint, or Anthropic. Configure a model, hint which services
|
|
5
|
+
it can call, send a prompt, get a response. No orchestration, no RAG, no routing
|
|
6
|
+
architecture — just talk to the model.
|
|
7
|
+
|
|
8
|
+
```bash
|
|
9
|
+
# zero-config on a local Ollama server — no API key, no signup
|
|
10
|
+
npx skillrun complete "Add a signup form and send a welcome email" \
|
|
11
|
+
--service "mail.send:send email --only to user-provided addresses"
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Install
|
|
15
|
+
|
|
16
|
+
Requires Node.js 20+.
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
npm install -g skillrun
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Use
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
# Pick the best local model for the work
|
|
26
|
+
skillrun models list # every model installed on Ollama
|
|
27
|
+
skillrun models pick --task coding # best model for code work, with rationale
|
|
28
|
+
skillrun models resolve # the model the library would use right now
|
|
29
|
+
|
|
30
|
+
# Single shot — prompt, services, response
|
|
31
|
+
skillrun complete "Add a signup form and send a welcome email" \
|
|
32
|
+
--service "mail.send:send email --only to addresses the user provides" \
|
|
33
|
+
--service "repo.read:read project files --read only"
|
|
34
|
+
|
|
35
|
+
# With a service file (one service per line: name:description --constraints)
|
|
36
|
+
skillrun complete "..." --service-file .claude/skills
|
|
37
|
+
|
|
38
|
+
# Hosted models
|
|
39
|
+
skillrun complete "..." --provider anthropic --model claude-sonnet-4-5
|
|
40
|
+
skillrun complete "..." --provider openai --base-url https://openrouter.ai/api/v1 \
|
|
41
|
+
--model deepseek/deepseek-chat
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
The `--service` flag (repeatable) or `--service-file` tells the model what services
|
|
45
|
+
it may call and what constraints apply. That's the whole surface — no DAG, no
|
|
46
|
+
registry lookup, no validation report. The model decides whether and how to use a
|
|
47
|
+
service.
|
|
48
|
+
|
|
49
|
+
## skills.sh setup (query-based skills)
|
|
50
|
+
|
|
51
|
+
The user shouldn't need to know skill names — the router decides them from the
|
|
52
|
+
natural-language query via the open agent-skills ecosystem
|
|
53
|
+
([skills.sh](https://skills.sh), `npx skills` CLI):
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
# Decide which skills.sh packages a query needs (offline, no network)
|
|
57
|
+
skillrun skills decide "Add Google login to my Next.js app, add tests"
|
|
58
|
+
|
|
59
|
+
# Print install commands instead of the table
|
|
60
|
+
skillrun skills decide "..." --install-cmd
|
|
61
|
+
|
|
62
|
+
# Live registry discovery (network)
|
|
63
|
+
skillrun skills find "react performance"
|
|
64
|
+
|
|
65
|
+
# Project-local installed skills
|
|
66
|
+
skillrun skills list
|
|
67
|
+
|
|
68
|
+
# Complete project setup plan (all 8 curated skills)
|
|
69
|
+
skillrun skills setup
|
|
70
|
+
|
|
71
|
+
# Merge curated + installed (+ live) skills into system-prompt hints
|
|
72
|
+
skillrun skills resolve "..." --live
|
|
73
|
+
|
|
74
|
+
# One-shot completion with automatic skill decision from the prompt
|
|
75
|
+
skillrun complete "Add Google login to my Next.js app, add tests" --auto-skills
|
|
76
|
+
skillrun complete "..." --auto-skills --skill-query "next.js auth tests" --live-skills
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
Full project install (idempotent — safe to re-run after an interrupted run):
|
|
80
|
+
|
|
81
|
+
```powershell
|
|
82
|
+
powershell -ExecutionPolicy Bypass -File scripts/setup-skills.ps1
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
Curated stack: `find-skills` (meta-discovery, always included),
|
|
86
|
+
`vercel-react-best-practices`, `vercel-composition-patterns`,
|
|
87
|
+
`web-design-guidelines`, `react-nextjs-development`,
|
|
88
|
+
`nodejs-backend-patterns` ([wshobson/agents](https://skills.sh/wshobson/agents/nodejs-backend-patterns) — 45.6K installs, Express/Fastify + auth + DB),
|
|
89
|
+
`nodejs-best-practices` ([sickn33](https://skills.sh/sickn33/agentic-awesome-skills/nodejs-best-practices) — 13.6K installs, architecture decisions),
|
|
90
|
+
`nodejs-core` ([mcollina/skills](https://skills.sh/mcollina/skills/nodejs-core) — Node TSC member, V8/libuv/addons),
|
|
91
|
+
`vitest-testing`, `skill-creator`. Library API: `decideSkillsForQuery`,
|
|
92
|
+
`resolveSkillsForQuery`, `findSkillsViaCli`, `listInstalledSkills`,
|
|
93
|
+
`loadInstalledSkillHints` (subpath `skillrun/skills` via `src/skills.ts`).
|
|
94
|
+
|
|
95
|
+
### Options
|
|
96
|
+
|
|
97
|
+
| Flag | Meaning |
|
|
98
|
+
|---|---|
|
|
99
|
+
| `<prompt>` | The prompt to send (positional, last arg) |
|
|
100
|
+
| `-s, --service <name:description --constraints>` | A service the model may call (repeatable) |
|
|
101
|
+
| `-f, --service-file <file>` | One service per line from a file |
|
|
102
|
+
| `-p, --provider <kind>` | `ollama` \| `openai` \| `anthropic` |
|
|
103
|
+
| `-m, --model <id>` | Model id (overrides auto-pick) |
|
|
104
|
+
| `-b, --base-url <url>` | Provider base URL |
|
|
105
|
+
| `-k, --api-key <key>` | Provider API key |
|
|
106
|
+
| `--temperature <n>` | Sampling temperature |
|
|
107
|
+
| `--max-tokens <n>` | Max output tokens |
|
|
108
|
+
| `--num-ctx <n>` | Context window for local servers |
|
|
109
|
+
| `--think` / `--no-think` | Enable or disable reasoning output |
|
|
110
|
+
|
|
111
|
+
## Model auto-pick
|
|
112
|
+
|
|
113
|
+
With Ollama and no `--model`, the library reads `/api/tags`, scores every
|
|
114
|
+
installed model for the task, and uses the best one:
|
|
115
|
+
|
|
116
|
+
```bash
|
|
117
|
+
$ skillrun complete "..."
|
|
118
|
+
qwen3.5-coder:latest (score 1.00)
|
|
119
|
+
purpose-built for code · qwen family is strong on code · 9.7B parameters · tool calling · reasoning · long context (task: coding)
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
Auto-pick works on `complete`, `models pick`, and `models resolve`. It reads the
|
|
123
|
+
live model list from Ollama, so the choice follows whatever you have installed.
|
|
124
|
+
|
|
125
|
+
| Env var | Default | Meaning |
|
|
126
|
+
|---|---|---|
|
|
127
|
+
| `SKILL_ROUTER_MODEL` | — | Pin a model; overrides auto-pick |
|
|
128
|
+
| `SKILL_ROUTER_BASE_URL` | per provider | Provider base URL |
|
|
129
|
+
| `SKILL_ROUTER_API_KEY` | — | Key for hosted providers |
|
|
130
|
+
| `SKILL_ROUTER_TEMPERATURE` | provider default | Sampling temperature |
|
|
131
|
+
| `SKILL_ROUTER_MAX_TOKENS` | 2048 (OpenAI/Anthropic) | Max output tokens per call |
|
|
132
|
+
| `SKILL_ROUTER_NUM_CTX` | model default | Context window (Ollama `num_ctx`) |
|
|
133
|
+
| `SKILL_ROUTER_THINK` | provider default | `1` enables reasoning output |
|
|
134
|
+
| `SKILL_ROUTER_TIMEOUT_MS` | 300000 | Per-request timeout (5 min) |
|
|
135
|
+
|
|
136
|
+
Providers and models:
|
|
137
|
+
|
|
138
|
+
| Provider | `--provider` | Default base URL | Auth |
|
|
139
|
+
|---|---|---|---|
|
|
140
|
+
| Ollama (local) | `ollama` | `http://localhost:11434` | none |
|
|
141
|
+
| OpenAI-compatible | `openai` | `https://api.openai.com/v1` | `OPENAI_API_KEY` |
|
|
142
|
+
| Anthropic | `anthropic` | `https://api.anthropic.com` | `ANTHROPIC_API_KEY` |
|
|
143
|
+
|
|
144
|
+
"OpenAI-compatible" covers OpenRouter, Groq, Together, LM Studio
|
|
145
|
+
(`http://localhost:1234/v1`), vLLM, and anything else that speaks
|
|
146
|
+
`/chat/completions`.
|
|
147
|
+
|
|
148
|
+
Local models are $0. Hosted models are priced per token using widely-available
|
|
149
|
+
list prices; the library reports cost, it never makes real payments.
|
|
150
|
+
|
|
151
|
+
## Claude Code / skills surface
|
|
152
|
+
|
|
153
|
+
The simplest delivery surface is the Claude Code convention: add a `skills:`
|
|
154
|
+
section to `.claude/CLAUDE.md` describing available services + constraints. The
|
|
155
|
+
model reads that section and calls services directly in its response.
|
|
156
|
+
|
|
157
|
+
Example `.claude/CLAUDE.md`:
|
|
158
|
+
|
|
159
|
+
```markdown
|
|
160
|
+
# Skills
|
|
161
|
+
|
|
162
|
+
skills:
|
|
163
|
+
- name: mail.send
|
|
164
|
+
description: Send an email to a given address with a subject and body
|
|
165
|
+
constraints: only to addresses the user explicitly provides
|
|
166
|
+
- name: repo.read
|
|
167
|
+
description: Read files from the current project
|
|
168
|
+
constraints: read only, never write
|
|
169
|
+
- name: http.post
|
|
170
|
+
description: Make an outbound HTTP POST to a URL the user provides
|
|
171
|
+
constraints: only to user-specified URLs; never to third parties without an explicit key
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
That file is the config the model should follow. The CLI mirrors the same
|
|
175
|
+
service-hint shape (`name:description --constraints`) so local runs and Claude
|
|
176
|
+
Code sessions describe the same services in the same terms.
|
|
177
|
+
|
|
178
|
+
## API
|
|
179
|
+
|
|
180
|
+
```ts
|
|
181
|
+
import { complete, resolveProvider, loadConfig, resolveModelForTask } from "skillrun";
|
|
182
|
+
|
|
183
|
+
// Zero-config: local Ollama, no key.
|
|
184
|
+
const config = loadConfig();
|
|
185
|
+
|
|
186
|
+
// Auto-pick the best installed local coding model.
|
|
187
|
+
const { model } = await resolveModelForTask({ task: "coding" });
|
|
188
|
+
config.provider.model = model.id;
|
|
189
|
+
config.provider.label = `Ollama · ${model.id} (local)`;
|
|
190
|
+
|
|
191
|
+
// Send a prompt with two service hints.
|
|
192
|
+
const response = await complete(
|
|
193
|
+
config.provider,
|
|
194
|
+
`Available services: mail.send — send an email (only to user-provided addresses).\nrepo.read — read project files (read only).`,
|
|
195
|
+
"Add a signup form and send a welcome email",
|
|
196
|
+
);
|
|
197
|
+
|
|
198
|
+
console.log(response.text);
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
Lower-level pieces: `listOllamaModels()`, `pickModel()`, `inferProfile()`,
|
|
202
|
+
`formatModelTable()`, `buildSystemPrompt()`. Subpaths: `skillrun/providers`
|
|
203
|
+
(completion + resolution), `skillrun/models` (listing + selection),
|
|
204
|
+
`skillrun/skills` (skills.sh decision + discovery), `skillrun/config`
|
|
205
|
+
(types), `skillrun/prompt` (system-prompt builder).
|
|
206
|
+
|
|
207
|
+
## Live check
|
|
208
|
+
|
|
209
|
+
```bash
|
|
210
|
+
node scripts/live-check.mjs --model qwen2.5:0.5b # tiny model, fast
|
|
211
|
+
node scripts/live-check.mjs # auto-picks the best local coding model
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
Sends a prompt to the resolved model with three hint services
|
|
215
|
+
(`mail.send`, `repo.read`, `http.post`) and checks whether the response mentions
|
|
216
|
+
at least one by name. Exit 0 if a service hint shows up in the output, 1 otherwise.
|
|
217
|
+
|
|
218
|
+
## Status
|
|
219
|
+
|
|
220
|
+
v0.4 — minimal single-shot surface: provider-agnostic completion (Ollama,
|
|
221
|
+
OpenAI-compatible, Anthropic), automatic local model selection with rationale,
|
|
222
|
+
skills.sh query routing (10 curated skills incl. 3-tier Node.js coverage:
|
|
223
|
+
backend-patterns / best-practices / core), and a shared system-prompt builder
|
|
224
|
+
used by the CLI, live-check, and library. `node --test test/runner.mjs` is
|
|
225
|
+
green (21 tests). Deferred: streaming, structured output, tool calling
|
|
226
|
+
integration, retry.
|
package/dist/cli.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":""}
|
package/dist/cli.js
ADDED
|
@@ -0,0 +1,258 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { Command } from "commander";
|
|
3
|
+
import { loadConfig } from "./config.js";
|
|
4
|
+
import { buildSystemPrompt } from "./prompt.js";
|
|
5
|
+
import { complete, resolveProvider, } from "./providers.js";
|
|
6
|
+
import { formatModelTable, listOllamaModels, pickModel, resolveModelForTask, } from "./models.js";
|
|
7
|
+
import { decideSkillsForQuery, findSkillsViaCli, installCommandFor, listInstalledSkills, resolveSkillsForQuery, } from "./skills.js";
|
|
8
|
+
import { readFileSync } from "node:fs";
|
|
9
|
+
function numberFlag(value) {
|
|
10
|
+
if (!value)
|
|
11
|
+
return undefined;
|
|
12
|
+
const n = Number(value);
|
|
13
|
+
return Number.isFinite(n) ? n : undefined;
|
|
14
|
+
}
|
|
15
|
+
function parseServices(raw, file) {
|
|
16
|
+
const set = new Map();
|
|
17
|
+
const add = (line) => {
|
|
18
|
+
const trimmed = line.trim();
|
|
19
|
+
if (!trimmed || trimmed.startsWith("#"))
|
|
20
|
+
return;
|
|
21
|
+
const [head, ...rest] = trimmed.split(":");
|
|
22
|
+
if (!head)
|
|
23
|
+
return;
|
|
24
|
+
const name = head.trim();
|
|
25
|
+
const body = rest.join(":").trim();
|
|
26
|
+
const [desc, ...c] = body.split("--").map((s) => s.trim()).filter(Boolean);
|
|
27
|
+
set.set(name, { name, description: desc || body, constraints: c.join("--").trim() || undefined });
|
|
28
|
+
};
|
|
29
|
+
for (const line of raw)
|
|
30
|
+
add(line);
|
|
31
|
+
if (file) {
|
|
32
|
+
try {
|
|
33
|
+
const text = readFileSync(file, "utf8");
|
|
34
|
+
for (const line of text.split(/\r?\n/))
|
|
35
|
+
add(line);
|
|
36
|
+
}
|
|
37
|
+
catch (err) {
|
|
38
|
+
console.error(`Could not read service file: ${err instanceof Error ? err.message : String(err)}`);
|
|
39
|
+
process.exitCode = 1;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
return [...set.values()];
|
|
43
|
+
}
|
|
44
|
+
const program = new Command();
|
|
45
|
+
program
|
|
46
|
+
.name("skillrun")
|
|
47
|
+
.description("Single-shot completion against any coding model — Ollama, OpenAI-compatible, or Anthropic")
|
|
48
|
+
.version("0.4.0");
|
|
49
|
+
program
|
|
50
|
+
.command("complete")
|
|
51
|
+
.aliases(["c", "run"])
|
|
52
|
+
.description("send a prompt to a model and print the response")
|
|
53
|
+
.argument("<prompt>", "prompt to send")
|
|
54
|
+
.option("-s, --service <name:description --constraints>", "a service the model may call", (v, acc) => {
|
|
55
|
+
acc.push(v);
|
|
56
|
+
return acc;
|
|
57
|
+
}, [])
|
|
58
|
+
.option("-f, --service-file <file>", "read newline-separated services from a file")
|
|
59
|
+
.option("-p, --provider <kind>", "ollama | openai | anthropic")
|
|
60
|
+
.option("-m, --model <id>", "model id")
|
|
61
|
+
.option("-b, --base-url <url>", "provider base URL")
|
|
62
|
+
.option("-k, --api-key <key>", "provider API key")
|
|
63
|
+
.option("--temperature <n>", "sampling temperature")
|
|
64
|
+
.option("--max-tokens <n>", "max output tokens")
|
|
65
|
+
.option("--num-ctx <n>", "context window for local servers")
|
|
66
|
+
.option("--think", "enable reasoning output where supported")
|
|
67
|
+
.option("--no-think", "disable reasoning output")
|
|
68
|
+
.option("--auto-skills", "decide skills.sh skills from the prompt query automatically")
|
|
69
|
+
.option("--skill-query <q>", "query used for skill decision (defaults to the prompt)")
|
|
70
|
+
.option("--live-skills", "also run live `npx skills find` discovery (network)")
|
|
71
|
+
.action(async (prompt, opts) => {
|
|
72
|
+
try {
|
|
73
|
+
const hints = parseServices(opts.service || [], opts.serviceFile);
|
|
74
|
+
if (opts.autoSkills) {
|
|
75
|
+
const resolved = await resolveSkillsForQuery(opts.skillQuery || prompt, {
|
|
76
|
+
live: Boolean(opts.liveSkills),
|
|
77
|
+
});
|
|
78
|
+
for (const h of resolved.hints) {
|
|
79
|
+
if (!hints.some((e) => e.name === h.name))
|
|
80
|
+
hints.push(h);
|
|
81
|
+
}
|
|
82
|
+
if (process.env.SKILL_ROUTER_VERBOSE === "1") {
|
|
83
|
+
console.error(`# auto-skills: ${resolved.curated.map((c) => c.skill).join(", ")} · installed=${resolved.installed.length} · live=${resolved.live.length}`);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
const provider = resolveProvider({
|
|
87
|
+
kind: opts.provider,
|
|
88
|
+
model: opts.model,
|
|
89
|
+
baseUrl: opts.baseUrl,
|
|
90
|
+
apiKey: opts.apiKey,
|
|
91
|
+
temperature: numberFlag(opts.temperature),
|
|
92
|
+
maxTokens: numberFlag(opts.maxTokens),
|
|
93
|
+
numCtx: numberFlag(opts.numCtx),
|
|
94
|
+
think: opts.think ? true : opts.noThink ? false : undefined,
|
|
95
|
+
}, { SKILL_ROUTER_MODEL: opts.model });
|
|
96
|
+
const config = loadConfig({ provider, services: hints });
|
|
97
|
+
const result = await complete(config.provider, buildSystemPrompt(config.services || []), prompt, {
|
|
98
|
+
maxTokens: config.provider.maxTokens,
|
|
99
|
+
temperature: config.provider.temperature,
|
|
100
|
+
json: false,
|
|
101
|
+
});
|
|
102
|
+
if (result.thinking) {
|
|
103
|
+
console.log(`[thinking]\n${result.thinking}\n[/thinking]\n`);
|
|
104
|
+
}
|
|
105
|
+
console.log(result.text);
|
|
106
|
+
const verbose = process.env.SKILL_ROUTER_VERBOSE === "1";
|
|
107
|
+
if (verbose) {
|
|
108
|
+
console.error(`# provider=${config.provider.label} · in=${result.inputTokens} · out=${result.outputTokens}`);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
catch (err) {
|
|
112
|
+
console.error(`Error: ${err instanceof Error ? err.message : String(err)}`);
|
|
113
|
+
process.exitCode = 1;
|
|
114
|
+
}
|
|
115
|
+
});
|
|
116
|
+
const models = program
|
|
117
|
+
.command("models")
|
|
118
|
+
.description("inspect and pick models the library can run on");
|
|
119
|
+
models
|
|
120
|
+
.command("list")
|
|
121
|
+
.description("list models installed on a local Ollama server")
|
|
122
|
+
.option("-b, --base-url <url>", "Ollama base URL", "http://localhost:11434")
|
|
123
|
+
.action(async (opts) => {
|
|
124
|
+
try {
|
|
125
|
+
const profiles = await listOllamaModels(opts.baseUrl);
|
|
126
|
+
if (profiles.length === 0) {
|
|
127
|
+
console.log("No models found. Try: ollama pull qwen2.5-coder:7b");
|
|
128
|
+
return;
|
|
129
|
+
}
|
|
130
|
+
console.log(`\n${formatModelTable(profiles)}\n`);
|
|
131
|
+
console.log(`${profiles.length} model(s) on ${opts.baseUrl}`);
|
|
132
|
+
}
|
|
133
|
+
catch (err) {
|
|
134
|
+
console.error(`Could not reach ${opts.baseUrl} — is Ollama running? (${err instanceof Error ? err.message : String(err)})`);
|
|
135
|
+
process.exitCode = 1;
|
|
136
|
+
}
|
|
137
|
+
});
|
|
138
|
+
models
|
|
139
|
+
.command("pick")
|
|
140
|
+
.description("pick the best installed model for a task")
|
|
141
|
+
.option("-t, --task <task>", "coding | general", "coding")
|
|
142
|
+
.option("-b, --base-url <url>", "Ollama base URL", "http://localhost:11434")
|
|
143
|
+
.option("--require-tools", "only consider models with tool calling")
|
|
144
|
+
.option("--min-context <tokens>", "minimum context window")
|
|
145
|
+
.action(async (opts) => {
|
|
146
|
+
try {
|
|
147
|
+
const profiles = await listOllamaModels(opts.baseUrl);
|
|
148
|
+
const picked = pickModel(profiles, {
|
|
149
|
+
task: opts.task,
|
|
150
|
+
...(opts.requireTools ? { requireTools: true } : {}),
|
|
151
|
+
...(opts.minContext ? { minContext: Number(opts.minContext) } : {}),
|
|
152
|
+
});
|
|
153
|
+
if (!picked) {
|
|
154
|
+
console.error("No installed model matches those constraints.");
|
|
155
|
+
process.exitCode = 1;
|
|
156
|
+
return;
|
|
157
|
+
}
|
|
158
|
+
console.log(`\n${picked.model.id} (score ${picked.score.toFixed(2)})`);
|
|
159
|
+
console.log(` ${picked.reason}\n`);
|
|
160
|
+
}
|
|
161
|
+
catch (err) {
|
|
162
|
+
console.error(`Could not reach the Ollama server — ${err instanceof Error ? err.message : String(err)}`);
|
|
163
|
+
process.exitCode = 1;
|
|
164
|
+
}
|
|
165
|
+
});
|
|
166
|
+
models
|
|
167
|
+
.command("resolve")
|
|
168
|
+
.description("show the model that would be used right now")
|
|
169
|
+
.option("-t, --task <task>", "coding | general", "coding")
|
|
170
|
+
.option("-b, --base-url <url>", "Ollama base URL", "http://localhost:11434")
|
|
171
|
+
.action(async (opts) => {
|
|
172
|
+
try {
|
|
173
|
+
const resolved = await resolveModelForTask({ baseUrl: opts.baseUrl, task: opts.task });
|
|
174
|
+
console.log(`\n${resolved.model.id} (source: ${resolved.source}, score ${resolved.score.toFixed(2)})`);
|
|
175
|
+
console.log(` ${resolved.reason}\n`);
|
|
176
|
+
}
|
|
177
|
+
catch (err) {
|
|
178
|
+
console.error(`Could not decide: ${err instanceof Error ? err.message : String(err)}`);
|
|
179
|
+
process.exitCode = 1;
|
|
180
|
+
}
|
|
181
|
+
});
|
|
182
|
+
const skills = program
|
|
183
|
+
.command("skills")
|
|
184
|
+
.description("skills.sh based skill decision, discovery, and project setup");
|
|
185
|
+
skills
|
|
186
|
+
.command("decide")
|
|
187
|
+
.description("decide which skills.sh packages a user query needs (offline)")
|
|
188
|
+
.argument("<query>", "natural-language user query")
|
|
189
|
+
.option("--install-cmd", "print npx install commands instead of the table")
|
|
190
|
+
.action(async (query, opts) => {
|
|
191
|
+
const decided = decideSkillsForQuery(query);
|
|
192
|
+
if (opts.installCmd) {
|
|
193
|
+
for (const r of decided)
|
|
194
|
+
console.log(installCommandFor(r));
|
|
195
|
+
return;
|
|
196
|
+
}
|
|
197
|
+
console.log(`\nQuery: ${query}\n`);
|
|
198
|
+
for (const r of decided) {
|
|
199
|
+
console.log(`${r.ref}\n ${r.reason}\n ${installCommandFor(r)}\n`);
|
|
200
|
+
}
|
|
201
|
+
console.log(`${decided.length} skill(s) decided offline.`);
|
|
202
|
+
});
|
|
203
|
+
skills
|
|
204
|
+
.command("find")
|
|
205
|
+
.description("live skills.sh discovery via `npx skills find`")
|
|
206
|
+
.argument("<query>", "search query")
|
|
207
|
+
.action(async (query) => {
|
|
208
|
+
const found = await findSkillsViaCli(query);
|
|
209
|
+
if (found.length === 0) {
|
|
210
|
+
console.log("No skills found (or skills CLI unavailable).");
|
|
211
|
+
return;
|
|
212
|
+
}
|
|
213
|
+
for (const s of found.slice(0, 20)) {
|
|
214
|
+
console.log(`${s.ref}${s.installs ? ` (${s.installs})` : ""}`);
|
|
215
|
+
if (s.url)
|
|
216
|
+
console.log(` ${s.url}`);
|
|
217
|
+
console.log(` npx skills add ${s.repo} --skill ${s.skill} -y`);
|
|
218
|
+
}
|
|
219
|
+
});
|
|
220
|
+
skills
|
|
221
|
+
.command("list")
|
|
222
|
+
.description("list project-local installed skills (`npx skills list --json`)")
|
|
223
|
+
.action(async () => {
|
|
224
|
+
const installed = await listInstalledSkills();
|
|
225
|
+
if (installed.length === 0) {
|
|
226
|
+
console.log("No project skills installed. Try: skill-router skills setup");
|
|
227
|
+
return;
|
|
228
|
+
}
|
|
229
|
+
for (const s of installed)
|
|
230
|
+
console.log(`${s.name} (${s.path})`);
|
|
231
|
+
console.log(`\n${installed.length} project skill(s).`);
|
|
232
|
+
});
|
|
233
|
+
skills
|
|
234
|
+
.command("setup")
|
|
235
|
+
.description("print the complete project skill setup (decided from an empty query)")
|
|
236
|
+
.action(async () => {
|
|
237
|
+
const decided = decideSkillsForQuery("");
|
|
238
|
+
console.log("\nComplete project skill setup (project-local, all agents):\n");
|
|
239
|
+
for (const r of decided)
|
|
240
|
+
console.log(installCommandFor(r));
|
|
241
|
+
console.log(`\n${decided.length} skill(s). Run the lines above, or:`);
|
|
242
|
+
console.log(` skill-router complete "..." --auto-skills`);
|
|
243
|
+
});
|
|
244
|
+
skills
|
|
245
|
+
.command("resolve")
|
|
246
|
+
.description("merge curated + installed (+ live) skills for a query into system-prompt hints")
|
|
247
|
+
.argument("<query>", "natural-language user query")
|
|
248
|
+
.option("--live", "include live skills.sh discovery")
|
|
249
|
+
.action(async (query, opts) => {
|
|
250
|
+
const resolved = await resolveSkillsForQuery(query, { live: Boolean(opts.live) });
|
|
251
|
+
console.log(`\nQuery: ${query}`);
|
|
252
|
+
console.log(`Curated: ${resolved.curated.map((c) => c.skill).join(", ") || "—"}`);
|
|
253
|
+
console.log(`Installed: ${resolved.installed.length} · Live: ${resolved.live.length}\n`);
|
|
254
|
+
for (const h of resolved.hints)
|
|
255
|
+
console.log(`- ${h.name}: ${h.description}`);
|
|
256
|
+
});
|
|
257
|
+
program.parse();
|
|
258
|
+
//# sourceMappingURL=cli.js.map
|
package/dist/cli.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EACL,QAAQ,EACR,eAAe,GAGhB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,gBAAgB,EAChB,gBAAgB,EAChB,SAAS,EACT,mBAAmB,GAEpB,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,oBAAoB,EACpB,gBAAgB,EAChB,iBAAiB,EACjB,mBAAmB,EACnB,qBAAqB,GACtB,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAGvC,SAAS,UAAU,CAAC,KAAyB;IAC3C,IAAI,CAAC,KAAK;QAAE,OAAO,SAAS,CAAC;IAC7B,MAAM,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;IACxB,OAAO,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;AAC5C,CAAC;AAED,SAAS,aAAa,CAAC,GAAa,EAAE,IAAwB;IAC5D,MAAM,GAAG,GAAG,IAAI,GAAG,EAAqB,CAAC;IACzC,MAAM,GAAG,GAAG,CAAC,IAAY,EAAE,EAAE;QAC3B,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,EAAE,CAA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M,qCAAqC,CAAC,CAAC;IACtE,OAAO,CAAC,GAAG,CAAC,6CAA6C,CAAC,CAAC;AAC7D,CAAC,CAAC,CAAC;AAEL,MAAM;KACH,OAAO,CAAC,SAAS,CAAC;KAClB,WAAW,CAAC,gFAAgF,CAAC;KAC7F,QAAQ,CAAC,SAAS,EAAE,6BAA6B,CAAC;KAClD,MAAM,CAAC,QAAQ,EAAE,kCAAkC,CAAC;KACpD,MAAM,CAAC,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE;IAC5B,MAAM,QAAQ,GAAG,MAAM,qBAAqB,CAAC,KAAK,EAAE,EAAE,IAAI,EAAE,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAClF,OAAO,CAAC,GAAG,CAAC,YAAY,KAAK,EAAE,CAAC,CAAC;IACjC,OAAO,CAAC,GAAG,CAAC,YAAY,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,GAAG,EAAE,CAAC,CAAC;IAClF,OAAO,CAAC,GAAG,CAAC,cAAc,QAAQ,CAAC,SAAS,CAAC,MAAM,YAAY,QAAQ,CAAC,IAAI,CAAC,MAAM,IAAI,CAAC,CAAC;IACzF,KAAK,MAAM,CAAC,IAAI,QAAQ,CAAC,KAAK;QAAE,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC;AAC/E,CAAC,CAAC,CAAC;AAEL,OAAO,CAAC,KAAK,EAAE,CAAC"}
|
package/dist/config.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type ProviderConfig } from "./providers.js";
|
|
2
|
+
export interface SkillHint {
|
|
3
|
+
name: string;
|
|
4
|
+
description: string;
|
|
5
|
+
constraints?: string;
|
|
6
|
+
}
|
|
7
|
+
export interface Config {
|
|
8
|
+
provider: ProviderConfig;
|
|
9
|
+
/** Services the model is allowed to call — surfaced in the system prompt. */
|
|
10
|
+
services?: SkillHint[];
|
|
11
|
+
}
|
|
12
|
+
/** Zero-config: local Ollama by default, no key, no registry. */
|
|
13
|
+
export declare function loadConfig(overrides?: Partial<Config>): Config;
|
|
14
|
+
//# sourceMappingURL=config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmB,KAAK,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAEtE,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,MAAM;IACrB,QAAQ,EAAE,cAAc,CAAC;IACzB,6EAA6E;IAC7E,QAAQ,CAAC,EAAE,SAAS,EAAE,CAAC;CACxB;AAED,iEAAiE;AACjE,wBAAgB,UAAU,CAAC,SAAS,GAAE,OAAO,CAAC,MAAM,CAAM,GAAG,MAAM,CAKlE"}
|
package/dist/config.js
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { resolveProvider } from "./providers.js";
|
|
2
|
+
/** Zero-config: local Ollama by default, no key, no registry. */
|
|
3
|
+
export function loadConfig(overrides = {}) {
|
|
4
|
+
return {
|
|
5
|
+
provider: resolveProvider(),
|
|
6
|
+
...overrides,
|
|
7
|
+
};
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAuB,MAAM,gBAAgB,CAAC;AActE,iEAAiE;AACjE,MAAM,UAAU,UAAU,CAAC,YAA6B,EAAE;IACxD,OAAO;QACL,QAAQ,EAAE,eAAe,EAAE;QAC3B,GAAG,SAAS;KACb,CAAC;AACJ,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { complete, resolveProvider, labelFor, providerName, ProviderError, DEFAULT_MODELS, DEFAULT_BASE_URLS, type Completion, type ProviderConfig, type ProviderKind, } from "./providers.js";
|
|
2
|
+
export { inferProfile, listOllamaModels, pickModel, resolveModelForTask, formatModelTable, type ModelCapabilities, type ModelProfile, type ModelTask, type PickOptions, type PickResult, type ResolvedModel, } from "./models.js";
|
|
3
|
+
export { loadConfig, type Config, type SkillHint } from "./config.js";
|
|
4
|
+
export { buildSystemPrompt } from "./prompt.js";
|
|
5
|
+
export { decideSkillsForQuery, installCommandFor, parseFindOutput, findSkillsViaCli, listInstalledSkills, loadInstalledSkillHints, curatedHints, resolveSkillsForQuery, type SkillRef, type DiscoveredSkill, type InstalledSkill, type ResolvedSkills, } from "./skills.js";
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,QAAQ,EACR,eAAe,EACf,QAAQ,EACR,YAAY,EACZ,aAAa,EACb,cAAc,EACd,iBAAiB,EACjB,KAAK,UAAU,EACf,KAAK,cAAc,EACnB,KAAK,YAAY,GAClB,MAAM,gBAAgB,CAAC;AAExB,OAAO,EACL,YAAY,EACZ,gBAAgB,EAChB,SAAS,EACT,mBAAmB,EACnB,gBAAgB,EAChB,KAAK,iBAAiB,EACtB,KAAK,YAAY,EACjB,KAAK,SAAS,EACd,KAAK,WAAW,EAChB,KAAK,UAAU,EACf,KAAK,aAAa,GACnB,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,UAAU,EAAE,KAAK,MAAM,EAAE,KAAK,SAAS,EAAE,MAAM,aAAa,CAAC;AAEtE,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAEhD,OAAO,EACL,oBAAoB,EACpB,iBAAiB,EACjB,eAAe,EACf,gBAAgB,EAChB,mBAAmB,EACnB,uBAAuB,EACvB,YAAY,EACZ,qBAAqB,EACrB,KAAK,QAAQ,EACb,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,KAAK,cAAc,GACpB,MAAM,aAAa,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// Minimal single-shot completion library.
|
|
2
|
+
// Configure a model, hint which services it can call, send a prompt, get a response.
|
|
3
|
+
// No orchestration, no RAG, no routing architecture — just talk to the model.
|
|
4
|
+
export { complete, resolveProvider, labelFor, providerName, ProviderError, DEFAULT_MODELS, DEFAULT_BASE_URLS, } from "./providers.js";
|
|
5
|
+
export { inferProfile, listOllamaModels, pickModel, resolveModelForTask, formatModelTable, } from "./models.js";
|
|
6
|
+
export { loadConfig } from "./config.js";
|
|
7
|
+
export { buildSystemPrompt } from "./prompt.js";
|
|
8
|
+
export { decideSkillsForQuery, installCommandFor, parseFindOutput, findSkillsViaCli, listInstalledSkills, loadInstalledSkillHints, curatedHints, resolveSkillsForQuery, } from "./skills.js";
|
|
9
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,0CAA0C;AAC1C,qFAAqF;AACrF,8EAA8E;AAC9E,OAAO,EACL,QAAQ,EACR,eAAe,EACf,QAAQ,EACR,YAAY,EACZ,aAAa,EACb,cAAc,EACd,iBAAiB,GAIlB,MAAM,gBAAgB,CAAC;AAExB,OAAO,EACL,YAAY,EACZ,gBAAgB,EAChB,SAAS,EACT,mBAAmB,EACnB,gBAAgB,GAOjB,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,UAAU,EAA+B,MAAM,aAAa,CAAC;AAEtE,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAEhD,OAAO,EACL,oBAAoB,EACpB,iBAAiB,EACjB,eAAe,EACf,gBAAgB,EAChB,mBAAmB,EACnB,uBAAuB,EACvB,YAAY,EACZ,qBAAqB,GAKtB,MAAM,aAAa,CAAC"}
|