skill-tree 0.1.7 → 0.2.1

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.
Files changed (92) hide show
  1. package/README.md +102 -2
  2. package/dist/bowser-CQI7RKRA.mjs +2821 -0
  3. package/dist/chunk-2NL4MXNX.mjs +3156 -0
  4. package/dist/chunk-2STDJU5Y.mjs +1174 -0
  5. package/dist/chunk-3BCRI4CA.mjs +101 -0
  6. package/dist/chunk-3SRB47JW.mjs +8344 -0
  7. package/dist/chunk-43YOKLZP.mjs +6081 -0
  8. package/dist/chunk-4AGZU52D.mjs +7918 -0
  9. package/dist/chunk-4HXHCEFH.mjs +9157 -0
  10. package/dist/chunk-4OC5QFIF.mjs +11267 -0
  11. package/dist/chunk-4QGSDVGH.mjs +580 -0
  12. package/dist/chunk-4TFMKAVC.mjs +1225 -0
  13. package/dist/chunk-55SMGVTP.mjs +7126 -0
  14. package/dist/chunk-5C4MEQMR.mjs +125 -0
  15. package/dist/chunk-6FX4IK4Z.mjs +5368 -0
  16. package/dist/chunk-6UPDN5QM.mjs +163 -0
  17. package/dist/chunk-7EGDKOHV.mjs +9439 -0
  18. package/dist/chunk-7LMOQW5H.mjs +4893 -0
  19. package/dist/chunk-7QIQJVNP.mjs +14206 -0
  20. package/dist/chunk-7VB4ZRZO.mjs +7127 -0
  21. package/dist/chunk-A3SILZYX.mjs +8360 -0
  22. package/dist/chunk-BPVRW25O.mjs +6089 -0
  23. package/dist/chunk-BZ2JKJ54.mjs +1057 -0
  24. package/dist/chunk-CI4476KM.mjs +6607 -0
  25. package/dist/chunk-DCRKELD5.mjs +46 -0
  26. package/dist/chunk-DDXYQ74I.mjs +13969 -0
  27. package/dist/chunk-DQOFJXBX.mjs +6595 -0
  28. package/dist/chunk-E2CVK23F.mjs +8751 -0
  29. package/dist/chunk-F3YEUQAP.mjs +654 -0
  30. package/dist/chunk-FKJJ4RJG.mjs +13874 -0
  31. package/dist/chunk-II7DECZQ.mjs +9111 -0
  32. package/dist/chunk-INKVOZXK.mjs +15898 -0
  33. package/dist/chunk-J2JM7HAK.mjs +8787 -0
  34. package/dist/chunk-K6NRCSAZ.mjs +4355 -0
  35. package/dist/chunk-LACI6YL4.mjs +1379 -0
  36. package/dist/chunk-MBIGW6KU.mjs +644 -0
  37. package/dist/chunk-OYHYXKXO.mjs +7297 -0
  38. package/dist/chunk-P5GJJ4JB.mjs +9237 -0
  39. package/dist/chunk-PDPN7FW7.mjs +1045 -0
  40. package/dist/chunk-QNK3WYNA.mjs +8971 -0
  41. package/dist/chunk-QZ7TP4HQ.mjs +7 -0
  42. package/dist/chunk-RJYJGJO3.mjs +349 -0
  43. package/dist/chunk-T4PVQW5O.mjs +124 -0
  44. package/dist/chunk-TEUB6DZR.mjs +6453 -0
  45. package/dist/chunk-TWPEHDW4.mjs +1067 -0
  46. package/dist/chunk-VHFTX33A.mjs +6724 -0
  47. package/dist/chunk-Y54UK2J3.mjs +13071 -0
  48. package/dist/chunk-YDVZIFIU.mjs +2102 -0
  49. package/dist/chunk-ZQVS7MQK.mjs +6081 -0
  50. package/dist/chunk-ZYKRDDFO.mjs +163 -0
  51. package/dist/cli/index.js +1324 -386
  52. package/dist/cli/index.mjs +212 -9074
  53. package/dist/dist-es-2JG6ZWFR.mjs +69 -0
  54. package/dist/dist-es-2JGXQKUP.mjs +6077 -0
  55. package/dist/dist-es-644EP2LP.mjs +317 -0
  56. package/dist/dist-es-DSNCHWLJ.mjs +170 -0
  57. package/dist/dist-es-FIVW7BUZ.mjs +317 -0
  58. package/dist/dist-es-GXJAFBE5.mjs +22 -0
  59. package/dist/dist-es-HRBPKDMR.mjs +935 -0
  60. package/dist/dist-es-LHPJ63IO.mjs +4437 -0
  61. package/dist/dist-es-LT2AQAG7.mjs +4437 -0
  62. package/dist/dist-es-ORE4PQTL.mjs +87 -0
  63. package/dist/dist-es-TLCYJJ25.mjs +495 -0
  64. package/dist/dist-es-V4LHTSRG.mjs +69 -0
  65. package/dist/dist-es-XHTU3ZU2.mjs +935 -0
  66. package/dist/dist-es-Y2MPJ6IO.mjs +378 -0
  67. package/dist/dist-es-ZYHLY2E6.mjs +487 -0
  68. package/dist/event-streams-KIAAAC7Z.mjs +42 -0
  69. package/dist/index.d.mts +1143 -56
  70. package/dist/index.d.ts +1143 -56
  71. package/dist/index.js +38701 -499
  72. package/dist/index.mjs +129 -9612
  73. package/dist/loadSso-NPRY7QRT.mjs +579 -0
  74. package/dist/loadSso-OYKG6ZRE.mjs +579 -0
  75. package/dist/signin-LMFNL434.mjs +665 -0
  76. package/dist/signin-LUKXFXSI.mjs +743 -0
  77. package/dist/sqlite-MG45OOTV.mjs +6 -0
  78. package/dist/sqlite-OLU72GHB.mjs +6 -0
  79. package/dist/sqlite-RR2SJ3SR.mjs +7 -0
  80. package/dist/sqlite-XJRPMNAJ.mjs +6 -0
  81. package/dist/sso-oidc-NNH6SQIH.mjs +832 -0
  82. package/dist/sso-oidc-STZH2XK2.mjs +832 -0
  83. package/dist/sts-EF755UBF.mjs +6290 -0
  84. package/dist/sts-ZIS4G6FQ.mjs +6290 -0
  85. package/dist/sync-BSWMMDA6.mjs +14 -0
  86. package/dist/sync-WHIIDHML.mjs +14 -0
  87. package/dist/sync-XRWFQYBY.mjs +15 -0
  88. package/package.json +9 -2
  89. package/dist/cli/index.js.map +0 -1
  90. package/dist/cli/index.mjs.map +0 -1
  91. package/dist/index.js.map +0 -1
  92. package/dist/index.mjs.map +0 -1
package/README.md CHANGED
@@ -2,6 +2,33 @@
2
2
 
3
3
  A TypeScript library for managing agent skill versions and evolution. Store, version, serve, sync, and federate reusable skills for AI agents.
4
4
 
5
+ ## Metrics ownership (as of 0.2.0)
6
+
7
+ skill-tree does **not** track per-skill usage metrics. The `Skill` shape no
8
+ longer carries `metrics` — historical fields like `usageCount`, `successRate`,
9
+ `lastUsed`, `feedbackScores` lived on it but were never updated by any code
10
+ path in skill-tree, and the snapshots that consumers wrote at publish time
11
+ drifted from the live data.
12
+
13
+ Live usage tracking belongs to systems that observe agents running:
14
+ - **cognitive-core** (`playbook.evolution.successCount` / `failureCount`,
15
+ `playbook.confidence`) is the canonical home. `recordSuccess` and
16
+ `recordFailure` mutate it on every trajectory.
17
+
18
+ If you need ranked loadouts driven by live metrics, query that system
19
+ first, then pass the resulting skill IDs to skill-tree's loadout compile
20
+ via `include: [...]`. As of 0.2, `include` is a **presence guarantee** —
21
+ every ID listed is in the result regardless of other filters, in the
22
+ order specified. Combine with `maxSkills: include.length` for "exactly
23
+ these N skills" semantics.
24
+
25
+ skill-tree's `LoadoutCriteria` no longer supports `minSuccessRate` or
26
+ `priorityOrder: 'usage' | 'successRate' | 'recent'` — the only
27
+ recognized `priorityOrder` value is `'relevance'`, currently a no-op
28
+ pending semantic ranking.
29
+
30
+ See `CHANGELOG.md` for the full migration guide.
31
+
5
32
  ## Overview
6
33
 
7
34
  skill-tree helps you build and maintain a library of reusable skills for AI agents by:
@@ -45,7 +72,6 @@ await bank.saveSkill({
45
72
  createdAt: new Date(),
46
73
  updatedAt: new Date(),
47
74
  status: 'active',
48
- metrics: { usageCount: 0, successRate: 0, feedbackScores: [] },
49
75
  } as Skill);
50
76
 
51
77
  // Search for skills
@@ -74,7 +100,6 @@ interface Skill {
74
100
  instructions: string; // Free-form markdown body (the SKILL.md content)
75
101
  tags: string[]; // Categorization
76
102
  status: SkillStatus; // 'draft' | 'active' | 'deprecated' | 'experimental'
77
- metrics: SkillMetrics; // Usage tracking
78
103
  // ... namespace, taxonomy, lineage, serving metadata
79
104
  }
80
105
  ```
@@ -215,6 +240,81 @@ await bank.federation.share('my-skill', 'team');
215
240
  const updates = await bank.federation.checkUpstream();
216
241
  ```
217
242
 
243
+ ### Importing from SkillNet
244
+
245
+ Load skills from [SkillNet](https://github.com/zjunlp/SkillNet), a public index of
246
+ GitHub-hosted SKILL.md skills. Search is free and needs no API key; each result is
247
+ fetched directly from GitHub raw, parsed, and saved into the bank — fully versioned and
248
+ servable like any other skill.
249
+
250
+ ```typescript
251
+ import { createSkillNetClient } from 'skill-tree';
252
+
253
+ const client = createSkillNetClient({
254
+ // githubToken: process.env.GITHUB_TOKEN, // optional: private repos / rate limits
255
+ // githubMirror: 'https://ghfast.top/', // optional: faster in restricted networks
256
+ });
257
+
258
+ // Search the index (keyword or semantic/vector)
259
+ const results = await client.search('pdf', { mode: 'vector', threshold: 0.85, limit: 5 });
260
+
261
+ // Import all matching skills into a SkillBank
262
+ const summary = await client.importFromSearch('pdf', bank, { limit: 5 });
263
+ console.log(`Imported ${summary.imported}, failed ${summary.failed}`);
264
+
265
+ // Or import a single skill by its GitHub/SkillNet URL
266
+ await client.importSkill(
267
+ 'https://github.com/anthropics/skills/tree/main/skills/skill-creator',
268
+ bank,
269
+ );
270
+ ```
271
+
272
+ From the CLI:
273
+
274
+ ```bash
275
+ # Search (free, no API key)
276
+ skill-tree skillnet search "pdf" --mode vector --threshold 0.85
277
+
278
+ # Import matching skills into the local bank
279
+ skill-tree skillnet import "pdf" --limit 5
280
+
281
+ # Import a single skill by URL
282
+ skill-tree skillnet import --url https://github.com/owner/repo/tree/main/skills/foo
283
+ ```
284
+
285
+ ### Importing Local Skills
286
+
287
+ Bulk-import SKILL.md skills from the filesystem — a single file or a directory tree of
288
+ `<skill-id>/SKILL.md` folders (e.g. a downloaded skill pack, `.claude/skills/`, or any
289
+ `skills/` directory). No network involved.
290
+
291
+ ```typescript
292
+ import { importLocalSkillDir, importSkillMdFile, skillFromSkillMd } from 'skill-tree';
293
+
294
+ // Import every SKILL.md found under a directory (recursive; skips hidden dirs)
295
+ const result = await importLocalSkillDir('./downloaded-skills', bank);
296
+ console.log(`Imported ${result.imported}, failed ${result.failed}`);
297
+
298
+ // Import a single SKILL.md file (id derived from its folder name)
299
+ await importSkillMdFile('./skills/deploy-helper/SKILL.md', bank);
300
+
301
+ // Or just convert raw SKILL.md text to a Skill (source-agnostic, no I/O)
302
+ const { skill, warnings } = skillFromSkillMd(rawMarkdown, { id: 'my-skill' });
303
+ ```
304
+
305
+ From the CLI (the `import` command auto-detects directories and `.md` files):
306
+
307
+ ```bash
308
+ # Import a directory of skills
309
+ skill-tree import ./downloaded-skills
310
+
311
+ # Import a single SKILL.md
312
+ skill-tree import ./skills/deploy-helper/SKILL.md
313
+
314
+ # Force SKILL.md mode for an unusual path
315
+ skill-tree import ./some-path --skill-md
316
+ ```
317
+
218
318
  ### Events
219
319
 
220
320
  Subscribe to skill bank events: