@duanz/pi-skill-search 1.0.0 → 1.0.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.
- package/README.en.md +61 -0
- package/README.md +61 -0
- package/package.json +8 -4
package/README.en.md
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
# skill-search
|
|
2
|
+
|
|
3
|
+
<p align="center"><strong>English</strong> | <a href="./README.md">中文</a></p>
|
|
4
|
+
|
|
5
|
+
<p align="center"><img src="https://raw.githubusercontent.com/DuanZGit/D-Hub/master/docs/covers/skill-search.png" alt="skill-search cover" width="880"></p>
|
|
6
|
+
|
|
7
|
+
<p align="center"><strong>Skill catalogs do not need to sit in the system prompt — one lookup tool is enough</strong><br><sub>On-demand retrieval · paths only · no auto-injection</sub></p>
|
|
8
|
+
|
|
9
|
+
<p align="center">
|
|
10
|
+
<a href="https://www.npmjs.com/package/@duanz/pi-skill-search"><img src="https://img.shields.io/npm/v/@duanz%2Fpi-skill-search.svg?style=flat-square" alt="npm"></a>
|
|
11
|
+
<a href="https://github.com/DuanZGit/D-Hub/blob/master/LICENSE"><img src="https://img.shields.io/npm/l/@duanz%2Fpi-skill-search.svg?style=flat-square" alt="license"></a>
|
|
12
|
+
<a href="https://github.com/DuanZGit/D-Hub"><img src="https://img.shields.io/badge/GitHub-DuanZGit%2FD--Hub-181717?style=flat-square&logo=github" alt="GitHub"></a>
|
|
13
|
+
<img src="https://img.shields.io/badge/pi-extension-34d399?style=flat-square" alt="pi extension">
|
|
14
|
+
</p>
|
|
15
|
+
|
|
16
|
+
<p align="center">
|
|
17
|
+
<code>pi install npm:@duanz/pi-skill-search</code>
|
|
18
|
+
</p>
|
|
19
|
+
|
|
20
|
+
## Why
|
|
21
|
+
|
|
22
|
+
pi keeps the skill catalog in the system prompt. On this machine 82 skills take about 21,164 characters (≈6,500 tokens) **every turn**, whether or not any of them is used.
|
|
23
|
+
|
|
24
|
+
Both off-the-shelf answers fall short:
|
|
25
|
+
|
|
26
|
+
1. Marking low-frequency skills `disable-model-invocation` saves tokens but makes them **invisible** to the model unless the user remembers `/skill:name`
|
|
27
|
+
2. Injecting the full index each turn spends the savings right back
|
|
28
|
+
|
|
29
|
+
This extension fills the gap: the catalog does not need to be resident, only the **lookup entry** does. One tool schema is about 120 tokens per turn.
|
|
30
|
+
|
|
31
|
+
## Usage
|
|
32
|
+
|
|
33
|
+
The model calls `skill_search`:
|
|
34
|
+
|
|
35
|
+
| Parameter | Meaning |
|
|
36
|
+
| --- | --- |
|
|
37
|
+
| `query` | Task description or keywords; omit to list every skill name |
|
|
38
|
+
| `limit` | Results to return, default 8 |
|
|
39
|
+
|
|
40
|
+
Returns `name` / `description` / absolute SKILL.md path. The model reads the body with `read` before deciding, so `path` is mandatory.
|
|
41
|
+
|
|
42
|
+
## Three design constraints
|
|
43
|
+
|
|
44
|
+
1. **Paths, not bodies.** SkillRouter measured on 80K candidates: exposing only name + description drops routing accuracy by 37–44 points. Retrieval must be body-aware.
|
|
45
|
+
2. **No auto-injection.** Stuffing a hint into `before_agent_start` spends the savings again; a tool in the list is enough.
|
|
46
|
+
3. **No frontmatter edits.** The extension lives in the extensions directory, so `uipro update` / `npx impeccable update` never clobber it.
|
|
47
|
+
|
|
48
|
+
## Configuration
|
|
49
|
+
|
|
50
|
+
| Variable | Default | Description |
|
|
51
|
+
| --- | --- | --- |
|
|
52
|
+
| `PI_AGENT_DIR` | `~/.pi/agent` | Skill root |
|
|
53
|
+
| `DESC_MAX` | `200` | Description truncation length |
|
|
54
|
+
|
|
55
|
+
## Relation to ask-me
|
|
56
|
+
|
|
57
|
+
`ask-me` is the human entry point (`/skill:ask-me`); `skill_search` is the model's. With this extension installed, the `ask-me` scan script becomes a fallback for environments without it (Minis, DSH).
|
|
58
|
+
|
|
59
|
+
## License
|
|
60
|
+
|
|
61
|
+
MIT © DuanZ
|
package/README.md
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
# skill-search
|
|
2
|
+
|
|
3
|
+
<p align="center"><a href="./README.en.md">English</a> | <strong>中文</strong></p>
|
|
4
|
+
|
|
5
|
+
<p align="center"><img src="https://raw.githubusercontent.com/DuanZGit/D-Hub/master/docs/covers/skill-search.png" alt="skill-search cover" width="880"></p>
|
|
6
|
+
|
|
7
|
+
<p align="center"><strong>技能目录不必常驻系统提示,留一个查询入口就够</strong><br><sub>按需检索 · 只返回路径 · 不自动注入</sub></p>
|
|
8
|
+
|
|
9
|
+
<p align="center">
|
|
10
|
+
<a href="https://www.npmjs.com/package/@duanz/pi-skill-search"><img src="https://img.shields.io/npm/v/@duanz%2Fpi-skill-search.svg?style=flat-square" alt="npm"></a>
|
|
11
|
+
<a href="https://github.com/DuanZGit/D-Hub/blob/master/LICENSE"><img src="https://img.shields.io/npm/l/@duanz%2Fpi-skill-search.svg?style=flat-square" alt="license"></a>
|
|
12
|
+
<a href="https://github.com/DuanZGit/D-Hub"><img src="https://img.shields.io/badge/GitHub-DuanZGit%2FD--Hub-181717?style=flat-square&logo=github" alt="GitHub"></a>
|
|
13
|
+
<img src="https://img.shields.io/badge/pi-extension-34d399?style=flat-square" alt="pi extension">
|
|
14
|
+
</p>
|
|
15
|
+
|
|
16
|
+
<p align="center">
|
|
17
|
+
<code>pi install npm:@duanz/pi-skill-search</code>
|
|
18
|
+
</p>
|
|
19
|
+
|
|
20
|
+
## 它解决什么
|
|
21
|
+
|
|
22
|
+
pi 的技能目录常驻系统提示。本机 82 个技能全部摊开约 21,164 字符(≈6,500 tokens),**每一轮都在烧**,不管这次用不用得上。
|
|
23
|
+
|
|
24
|
+
两个现成解法都不合适:
|
|
25
|
+
|
|
26
|
+
1. 把低频技能设成 `disable-model-invocation` —— 省了 token,但模型**完全看不见**它们,除非用户记得打 `/skill:名字`
|
|
27
|
+
2. 把技能索引全量注入每轮上下文 —— 省下的 token 原样花回去
|
|
28
|
+
|
|
29
|
+
本扩展补的是这条缝:技能目录不必常驻,**只要查询入口常驻**。一个工具 schema 约 120 tokens/轮。
|
|
30
|
+
|
|
31
|
+
## 用法
|
|
32
|
+
|
|
33
|
+
模型调用 `skill_search`:
|
|
34
|
+
|
|
35
|
+
| 参数 | 说明 |
|
|
36
|
+
| --- | --- |
|
|
37
|
+
| `query` | 任务描述或关键词;省略则列出全部技能名 |
|
|
38
|
+
| `limit` | 返回条数,默认 8 |
|
|
39
|
+
|
|
40
|
+
返回 `name` / `description` / SKILL.md 绝对路径。模型拿到路径后用 `read` 读正文再决定,所以路径是必返回字段。
|
|
41
|
+
|
|
42
|
+
## 三条设计约束
|
|
43
|
+
|
|
44
|
+
1. **只给路径,不给正文**。论文 SkillRouter 在 80K 候选上实测:只暴露 name + description 会让路由准确率掉 37–44 个百分点,必须 body-aware。
|
|
45
|
+
2. **不自动注入**。在 `before_agent_start` 塞提示等于把省下的 token 花回去;工具躺在工具列表里就够。
|
|
46
|
+
3. **不碰 frontmatter**。扩展只占 extensions 目录,`uipro update` / `npx impeccable update` 不会覆盖它。
|
|
47
|
+
|
|
48
|
+
## 配置
|
|
49
|
+
|
|
50
|
+
| 变量 | 默认 | 说明 |
|
|
51
|
+
| --- | --- | --- |
|
|
52
|
+
| `PI_AGENT_DIR` | `~/.pi/agent` | 技能根目录 |
|
|
53
|
+
| `DESC_MAX` | `200` | 描述截断长度 |
|
|
54
|
+
|
|
55
|
+
## 与 ask-me 技能的关系
|
|
56
|
+
|
|
57
|
+
`ask-me` 是给人的入口(显式 `/skill:ask-me`),`skill_search` 是给模型的入口。装了本扩展后,`ask-me` 的扫描脚本可以退居备用(Minis / DSH 等没有本扩展的环境仍用它)。
|
|
58
|
+
|
|
59
|
+
## License
|
|
60
|
+
|
|
61
|
+
MIT © DuanZ
|
package/package.json
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@duanz/pi-skill-search",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "按需检索本机全部技能,返回该用哪个和 SKILL.md 路径",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"pi-package",
|
|
8
|
-
"pi-extension"
|
|
8
|
+
"pi-extension",
|
|
9
|
+
"pi-web"
|
|
9
10
|
],
|
|
10
11
|
"license": "MIT",
|
|
11
12
|
"author": "DuanZ",
|
|
@@ -16,12 +17,15 @@
|
|
|
16
17
|
"directory": "extensions/skill-search"
|
|
17
18
|
},
|
|
18
19
|
"files": [
|
|
19
|
-
"index.ts"
|
|
20
|
+
"index.ts",
|
|
21
|
+
"README.md",
|
|
22
|
+
"README.en.md"
|
|
20
23
|
],
|
|
21
24
|
"pi": {
|
|
22
25
|
"extensions": [
|
|
23
26
|
"./index.ts"
|
|
24
|
-
]
|
|
27
|
+
],
|
|
28
|
+
"image": "https://raw.githubusercontent.com/DuanZGit/D-Hub/master/docs/covers/skill-search.png"
|
|
25
29
|
},
|
|
26
30
|
"engines": {
|
|
27
31
|
"node": ">=20"
|