skill-autoroute 0.6.0 → 0.7.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/README.md +15 -1
- package/bin/cli.js +2 -2
- package/package.json +1 -1
- package/src/flow.js +18 -0
package/README.md
CHANGED
|
@@ -272,6 +272,7 @@ npx skill-autoroute install --model triggers=haiku
|
|
|
272
272
|
| `install` | The full setup flow |
|
|
273
273
|
| `regenerate` | Update triggers for new or changed skills, or for all skills after an update that changes how triggers are written. Keeps your choices. |
|
|
274
274
|
| `scan` | Scan and find duplicates only. Writes nothing. |
|
|
275
|
+
| `list` | Show skills, on/off state, tools, priority, paths and trigger rules. Supports `--tools` and `--project`. Writes nothing. |
|
|
275
276
|
| `set <skill> on|off` | Turn one skill's hints on or off |
|
|
276
277
|
| `words [<skill> [add|remove <word>...]]` | Your own trigger words for a skill. Without a skill, lists all of them. |
|
|
277
278
|
| `status` | Tools, hook state, skill counts, changed skills |
|
|
@@ -285,6 +286,19 @@ npx skill-autoroute install --model triggers=haiku
|
|
|
285
286
|
|
|
286
287
|
When your skills change, the hint line tells you so. Run `regenerate`.
|
|
287
288
|
|
|
289
|
+
Inspect the saved routing configuration:
|
|
290
|
+
|
|
291
|
+
```bash
|
|
292
|
+
npx skill-autoroute list
|
|
293
|
+
npx skill-autoroute list --tools codex
|
|
294
|
+
npx skill-autoroute list --project
|
|
295
|
+
```
|
|
296
|
+
|
|
297
|
+
`list` reads the user table by default; `--project` reads only the current project's table.
|
|
298
|
+
It includes disabled skills (marked `off`). Patterns within a rule must all match (AND);
|
|
299
|
+
any rule can trigger the skill (OR). Custom words are another way to match.
|
|
300
|
+
Enabled means eligible for routing on matching prompts, not that the agent has invoked the skill.
|
|
301
|
+
|
|
288
302
|
---
|
|
289
303
|
|
|
290
304
|
## User or project install
|
|
@@ -345,4 +359,4 @@ The tests use fake `claude` and `codex` programs and a fake `HOME`. They make no
|
|
|
345
359
|
|
|
346
360
|
## License
|
|
347
361
|
|
|
348
|
-
[MIT](LICENSE)
|
|
362
|
+
[MIT](LICENSE)
|
package/bin/cli.js
CHANGED
|
@@ -6,12 +6,12 @@ import * as flow from '../src/flow.js';
|
|
|
6
6
|
import { STEP_DEFAULTS } from '../src/models.js';
|
|
7
7
|
|
|
8
8
|
const USAGE = `usage: skill-autoroute <command> [flags]
|
|
9
|
-
commands: install | regenerate | scan | set <skill> on|off | words [<skill> [add|remove <word>...]] | status | tokens | bench | uninstall
|
|
9
|
+
commands: install | regenerate | scan | list | set <skill> on|off | words [<skill> [add|remove <word>...]] | status | tokens | bench | uninstall
|
|
10
10
|
flags: --yes --dry-run --project --tools claude,codex --ai claude|codex|none --model step=model (repeatable) --log`;
|
|
11
11
|
|
|
12
12
|
const COMMANDS = {
|
|
13
13
|
install: flow.install, regenerate: flow.regenerate, scan: flow.scan, set: flow.setSkill, words: flow.setWords,
|
|
14
|
-
status: flow.status, tokens: flow.tokens, bench: flow.bench, uninstall: flow.uninstall,
|
|
14
|
+
list: flow.list, status: flow.status, tokens: flow.tokens, bench: flow.bench, uninstall: flow.uninstall,
|
|
15
15
|
};
|
|
16
16
|
|
|
17
17
|
function options() {
|
package/package.json
CHANGED
package/src/flow.js
CHANGED
|
@@ -410,6 +410,24 @@ export function setSkill(o, ui, name, state) {
|
|
|
410
410
|
if (state === 'on' && hits.some((s) => !s.patterns?.length)) ui.log(`${show(name)} has no trigger rules yet, so it gets no hints. Run: npx skill-autoroute regenerate`);
|
|
411
411
|
}
|
|
412
412
|
|
|
413
|
+
export function list(o, ui) {
|
|
414
|
+
const path = routesPath(scopeOf(o));
|
|
415
|
+
const table = readTable(path);
|
|
416
|
+
if (!table) return ui.log(`no table at ${show(path)}; run install first`);
|
|
417
|
+
const skills = table.skills.filter((s) => s && (!o.tools?.length || o.tools.some((t) => (s.tools ?? [s.tool]).includes(t))));
|
|
418
|
+
if (!skills.length) return ui.log('No skills in this scope for the selected tools.');
|
|
419
|
+
ui.log('Routing configuration (on = enabled for matching prompts; not proof of invocation).\nRules are case-insensitive: AND within a rule, OR between rules. Own words also trigger a match.');
|
|
420
|
+
for (const s of skills) {
|
|
421
|
+
ui.log(`${show(s.name)} ${s.enabled ? 'on' : 'off'} ${(s.tools ?? [s.tool]).map(show).join(', ')} priority ${show(s.priority ?? 50)}`);
|
|
422
|
+
if (s.path) ui.log(` Path: ${show(s.path)}`);
|
|
423
|
+
if (s.projects?.length) ui.log(` Projects: ${s.projects.map(show).join(', ')}`);
|
|
424
|
+
ui.log(s.patterns?.length
|
|
425
|
+
? ` Rules: ${s.patterns.map((rule) => `(${rule.map(show).join(' AND ')})`).join(' OR ')}`
|
|
426
|
+
: ' No trigger rules.');
|
|
427
|
+
if (s.words?.length) ui.log(` Own words: ${s.words.map(show).join(', ')}`);
|
|
428
|
+
}
|
|
429
|
+
}
|
|
430
|
+
|
|
413
431
|
export function status(o, ui) {
|
|
414
432
|
const scope = scopeOf(o);
|
|
415
433
|
for (const t of findTools()) ui.log(`${t.name}: CLI ${t.cli ? 'found' : 'not found'}, config ${t.configDir ? 'found' : 'not found'}, ${ADAPTERS[t.name].hasHook(scope) ? 'hook installed' : 'no hook'}`);
|