@kmiyh/pi-skills-menu 1.2.0 → 1.2.2
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 +103 -79
- package/package.json +1 -1
- package/src/images/skill-create-description.jpg +0 -0
- package/src/images/skill-create-generate.jpg +0 -0
- package/src/images/skill-create-name.jpg +0 -0
- package/src/images/skill-create-visibility.jpg +0 -0
- package/src/images/skill-delete.jpg +0 -0
- package/src/images/skill-disable.jpg +0 -0
- package/src/images/skill-edit.jpg +0 -0
- package/src/images/skill-preview.jpg +0 -0
- package/src/images/skill-rename.jpg +0 -0
- package/src/images/skills-menu.jpg +0 -0
- package/src/index.ts +52 -1
- package/src/images/skill-create-generating.jpg +0 -0
package/README.md
CHANGED
|
@@ -1,14 +1,25 @@
|
|
|
1
1
|
# @kmiyh/pi-skills-menu
|
|
2
2
|
|
|
3
|
-
`@kmiyh/pi-skills-menu` is a Pi
|
|
3
|
+
`@kmiyh/pi-skills-menu` is a Pi extension that moves skill browsing and selection into a dedicated `/skills` menu.
|
|
4
|
+
|
|
5
|
+
Instead of filling Pi's main menu with many `/skill:<name>` entries, it gives you one focused place to search, preview, insert, create, edit, rename, delete, and enable or disable skills.
|
|
6
|
+
|
|
7
|
+
## Why use it
|
|
8
|
+
|
|
9
|
+
- keeps the main menu cleaner when many skills are installed
|
|
10
|
+
- puts project, global, and package-provided skills in one searchable list
|
|
11
|
+
- makes skill selection faster in interactive sessions
|
|
12
|
+
- lets you manage your own skills without leaving the TUI
|
|
13
|
+
|
|
14
|
+
## Installation
|
|
4
15
|
|
|
5
16
|
```bash
|
|
6
|
-
/skills
|
|
17
|
+
pi install npm:@kmiyh/pi-skills-menu
|
|
7
18
|
```
|
|
8
19
|
|
|
9
|
-
|
|
20
|
+
## What changes after installation
|
|
10
21
|
|
|
11
|
-
When the extension is installed, it automatically writes
|
|
22
|
+
When the extension is installed, it automatically writes this to `settings.json`:
|
|
12
23
|
|
|
13
24
|
```json
|
|
14
25
|
{
|
|
@@ -16,135 +27,150 @@ When the extension is installed, it automatically writes the following to `setti
|
|
|
16
27
|
}
|
|
17
28
|
```
|
|
18
29
|
|
|
19
|
-
|
|
30
|
+
That disables the default `/skill:<name>` command registration in the main menu and replaces it with a single `/skills` entry.
|
|
20
31
|
|
|
21
|
-
|
|
32
|
+
The extension also hides Pi's standard startup `[Skills]` block, so installed skills are shown only through the dedicated `/skills` UI instead of the default startup listing.
|
|
22
33
|
|
|
23
|
-
|
|
34
|
+
When you insert a skill from the menu, the extension adds a marker like this to the editor:
|
|
24
35
|
|
|
25
|
-
```
|
|
26
|
-
|
|
36
|
+
```text
|
|
37
|
+
[skill] my-skill
|
|
27
38
|
```
|
|
28
39
|
|
|
29
|
-
|
|
40
|
+
Before the message is sent, Pi expands that marker into the actual skill content.
|
|
30
41
|
|
|
31
|
-
|
|
42
|
+
## What the `/skills` menu shows
|
|
43
|
+
|
|
44
|
+
The menu includes all available installed skills:
|
|
32
45
|
|
|
33
|
-
- global skills
|
|
34
46
|
- project skills
|
|
35
|
-
- skills
|
|
47
|
+
- global skills
|
|
48
|
+
- skills provided by installed packages/libraries
|
|
36
49
|
|
|
37
|
-
The list is
|
|
50
|
+
The list is grouped into:
|
|
38
51
|
|
|
39
|
-
- **Your Skills** —
|
|
40
|
-
- **Library Skills** — skills coming from
|
|
52
|
+
- **Your Skills** — your own project and global skills
|
|
53
|
+
- **Library Skills** — skills coming from installed packages
|
|
41
54
|
|
|
42
55
|

|
|
43
56
|
|
|
44
|
-
## What
|
|
57
|
+
## What you can do in `/skills`
|
|
45
58
|
|
|
46
|
-
|
|
59
|
+
| Action | Shortcut | Notes |
|
|
60
|
+
| --- | --- | --- |
|
|
61
|
+
| Filter skills by name | type | Search works directly in the list |
|
|
62
|
+
| Open preview | `Tab` | Shows full metadata and content |
|
|
63
|
+
| Insert selected skill | `Enter` | Works only for enabled skills |
|
|
64
|
+
| Enable or disable a skill | `Ctrl+X` | Works for your skills and library skills |
|
|
65
|
+
| Create a new skill | `Enter` on **Create new skill** | Opens the creation flow |
|
|
66
|
+
| Delete your own skill | `Backspace` | Available only for project/global skills you own |
|
|
47
67
|
|
|
48
|
-
|
|
68
|
+
### Preview a skill
|
|
49
69
|
|
|
50
|
-
|
|
70
|
+
Press `Tab` on a selected skill to open preview mode.
|
|
51
71
|
|
|
52
|
-
|
|
72
|
+
The preview shows:
|
|
53
73
|
|
|
54
|
-
-
|
|
74
|
+
- the skill name and scope
|
|
75
|
+
- its source path or package
|
|
76
|
+
- whether it is enabled or disabled
|
|
77
|
+
- the full frontmatter
|
|
78
|
+
- the full skill content with scrolling support
|
|
55
79
|
|
|
56
80
|

|
|
57
81
|
|
|
58
82
|
### Insert a skill into the editor
|
|
59
83
|
|
|
60
|
-
Press
|
|
61
|
-
|
|
62
|
-
- `Enter` — select an enabled skill and insert it into the editor
|
|
84
|
+
Press `Enter` on an enabled skill to insert it into the editor.
|
|
63
85
|
|
|
64
|
-
|
|
86
|
+
This is useful when you want to explicitly attach one or more skills to the message you are writing, without manually copying skill content.
|
|
65
87
|
|
|
66
88
|
### Enable or disable a skill
|
|
67
89
|
|
|
68
|
-
Press
|
|
90
|
+
Press `Ctrl+X` to toggle the selected skill.
|
|
69
91
|
|
|
70
|
-
|
|
92
|
+
Disabled skills stay visible in the list and are marked with `[disabled]`, so you can still find them and re-enable them later.
|
|
71
93
|
|
|
72
|
-
This also works for skills that come from installed
|
|
94
|
+
This also works for skills that come from installed packages.
|
|
73
95
|
|
|
74
|
-
|
|
96
|
+

|
|
75
97
|
|
|
76
|
-
|
|
98
|
+
## Creating a new skill
|
|
77
99
|
|
|
78
|
-
|
|
100
|
+
The first row in the menu is **Create new skill**.
|
|
79
101
|
|
|
80
|
-
|
|
102
|
+
Creation is split into three short steps:
|
|
81
103
|
|
|
82
|
-
|
|
104
|
+
1. **Name** — the skill folder/name slug
|
|
105
|
+
2. **Description** — one clear sentence describing what the skill does and when Pi should use it
|
|
106
|
+
3. **Visibility** — whether the skill should be saved globally or only for the current project
|
|
83
107
|
|
|
84
|
-
1.
|
|
108
|
+
### 1. Name
|
|
85
109
|
|
|
86
110
|

|
|
87
111
|
|
|
88
|
-
2.
|
|
112
|
+
### 2. Description
|
|
89
113
|
|
|
90
114
|

|
|
91
115
|
|
|
92
|
-
3.
|
|
93
|
-
- **Global** — save the skill in your user-level Pi skills directory
|
|
94
|
-
- **Project** — save the skill in the current project's `.pi/skills` directory
|
|
116
|
+
### 3. Visibility
|
|
95
117
|
|
|
96
|
-
|
|
118
|
+

|
|
119
|
+
|
|
120
|
+
After that, the extension generates `SKILL.md` for you.
|
|
97
121
|
|
|
98
122
|
Generation uses:
|
|
99
123
|
|
|
100
|
-
- the
|
|
101
|
-
- the
|
|
124
|
+
- the model currently selected in the TUI
|
|
125
|
+
- the current thinking level selected in the TUI
|
|
126
|
+
|
|
127
|
+
So the draft follows the model configuration already active in your Pi session.
|
|
102
128
|
|
|
103
|
-
|
|
129
|
+

|
|
104
130
|
|
|
105
|
-
|
|
131
|
+
## Editing, renaming, and deleting your own skills
|
|
106
132
|
|
|
107
|
-
|
|
133
|
+
Your own project and global skills can be managed directly from preview mode.
|
|
108
134
|
|
|
109
|
-
|
|
135
|
+
Library skills can be previewed, inserted, and enabled/disabled, but they cannot be edited, renamed, or deleted from this menu.
|
|
110
136
|
|
|
111
|
-
|
|
112
|
-
- scrolling support for reading the content
|
|
137
|
+
### Edit skill content
|
|
113
138
|
|
|
114
|
-
|
|
139
|
+
In preview mode, press `e` to edit the skill content and metadata body.
|
|
115
140
|
|
|
116
|
-
|
|
141
|
+
Use `Ctrl+S` to save.
|
|
117
142
|
|
|
118
143
|

|
|
119
144
|
|
|
120
|
-
|
|
145
|
+
### Rename a skill
|
|
121
146
|
|
|
122
|
-
|
|
147
|
+
In preview mode, press `r` to rename the skill.
|
|
123
148
|
|
|
124
|
-
|
|
149
|
+
This updates both the directory name and the `name` field in frontmatter.
|
|
125
150
|
|
|
126
|
-
|
|
151
|
+

|
|
127
152
|
|
|
128
|
-
###
|
|
153
|
+
### Delete a skill
|
|
129
154
|
|
|
130
|
-
|
|
155
|
+
In browse mode or preview mode, press `Backspace` to delete your own skill.
|
|
131
156
|
|
|
132
|
-
|
|
133
|
-
.pi/skills/<skill-name>/SKILL.md
|
|
134
|
-
```
|
|
157
|
+
A confirmation dialog is shown before removal.
|
|
135
158
|
|
|
136
|
-
|
|
159
|
+

|
|
137
160
|
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
161
|
+
## Where new skills are saved
|
|
162
|
+
|
|
163
|
+
New skills are stored in Pi's standard skill directories depending on the selected visibility.
|
|
141
164
|
|
|
142
|
-
|
|
165
|
+
| Visibility | Path |
|
|
166
|
+
| --- | --- |
|
|
167
|
+
| Project | `.pi/skills/<skill-name>/SKILL.md` |
|
|
168
|
+
| Global | `~/.pi/agent/skills/<skill-name>/SKILL.md` |
|
|
143
169
|
|
|
144
|
-
|
|
170
|
+
Example project skill:
|
|
145
171
|
|
|
146
172
|
```text
|
|
147
|
-
|
|
173
|
+
.pi/skills/react-review/SKILL.md
|
|
148
174
|
```
|
|
149
175
|
|
|
150
176
|
## Local development
|
|
@@ -167,31 +193,29 @@ Run the extension directly from a local checkout:
|
|
|
167
193
|
pi -e ./src/index.ts
|
|
168
194
|
```
|
|
169
195
|
|
|
170
|
-
##
|
|
196
|
+
## Contributing
|
|
171
197
|
|
|
172
|
-
|
|
198
|
+
Contributions are welcome, especially around:
|
|
173
199
|
|
|
174
|
-
-
|
|
175
|
-
-
|
|
176
|
-
-
|
|
177
|
-
-
|
|
178
|
-
-
|
|
179
|
-
- suggest improvements to project structure and Pi package support
|
|
180
|
-
- etc
|
|
200
|
+
- menu UX and navigation
|
|
201
|
+
- skill search and filtering
|
|
202
|
+
- preview and editing flows
|
|
203
|
+
- skill generation quality
|
|
204
|
+
- Pi package compatibility
|
|
181
205
|
|
|
182
|
-
|
|
206
|
+
Typical workflow:
|
|
183
207
|
|
|
184
208
|
1. fork the repository
|
|
185
|
-
2. create a
|
|
209
|
+
2. create a branch
|
|
186
210
|
3. make your changes
|
|
187
|
-
4. verify
|
|
211
|
+
4. verify with:
|
|
188
212
|
|
|
189
213
|
```bash
|
|
190
214
|
npm install
|
|
191
215
|
npm run typecheck
|
|
192
216
|
```
|
|
193
217
|
|
|
194
|
-
5. test locally
|
|
218
|
+
5. test locally:
|
|
195
219
|
|
|
196
220
|
```bash
|
|
197
221
|
pi -e ./src/index.ts
|
package/package.json
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/src/index.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { InteractiveMode, type ExtensionAPI, type ExtensionContext, type InputEventResult } from "@mariozechner/pi-coding-agent";
|
|
2
2
|
import { createSkillFromAnswersWithoutUI } from "./create-skill.js";
|
|
3
3
|
import { deleteSkill } from "./delete-skill.js";
|
|
4
4
|
import { detectExtensionInstallScope } from "./extension-scope.js";
|
|
@@ -15,7 +15,58 @@ const EMPTY_REGISTRY: SkillRegistry = {
|
|
|
15
15
|
byName: new Map(),
|
|
16
16
|
};
|
|
17
17
|
|
|
18
|
+
const HIDE_STARTUP_SKILLS_BLOCK_PATCH = Symbol.for("@kmiyh/pi-skills-menu/hide-startup-skills-block");
|
|
19
|
+
|
|
20
|
+
type InteractiveModePrototype = {
|
|
21
|
+
showLoadedResources?: (...args: unknown[]) => unknown;
|
|
22
|
+
[HIDE_STARTUP_SKILLS_BLOCK_PATCH]?: boolean;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
function patchInteractiveModeStartupSkillsBlock(): void {
|
|
26
|
+
const prototype = InteractiveMode.prototype as unknown as InteractiveModePrototype;
|
|
27
|
+
if (prototype[HIDE_STARTUP_SKILLS_BLOCK_PATCH]) {
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
const originalShowLoadedResources = prototype.showLoadedResources;
|
|
32
|
+
if (typeof originalShowLoadedResources !== "function") {
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
prototype.showLoadedResources = function patchedShowLoadedResources(this: unknown, ...args: unknown[]) {
|
|
37
|
+
const interactiveMode = this as {
|
|
38
|
+
session?: {
|
|
39
|
+
resourceLoader?: {
|
|
40
|
+
getSkills?: () => { skills: unknown[]; diagnostics?: unknown[] };
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
const resourceLoader = interactiveMode.session?.resourceLoader;
|
|
45
|
+
if (!resourceLoader || typeof resourceLoader.getSkills !== "function") {
|
|
46
|
+
return originalShowLoadedResources.apply(this, args);
|
|
47
|
+
}
|
|
48
|
+
const originalGetSkills = resourceLoader.getSkills;
|
|
49
|
+
|
|
50
|
+
resourceLoader.getSkills = () => {
|
|
51
|
+
const result = originalGetSkills.call(resourceLoader);
|
|
52
|
+
return {
|
|
53
|
+
...result,
|
|
54
|
+
skills: [],
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
try {
|
|
59
|
+
return originalShowLoadedResources.apply(this, args);
|
|
60
|
+
} finally {
|
|
61
|
+
resourceLoader.getSkills = originalGetSkills;
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
prototype[HIDE_STARTUP_SKILLS_BLOCK_PATCH] = true;
|
|
66
|
+
}
|
|
67
|
+
|
|
18
68
|
export default function skillsMenuExtension(pi: ExtensionAPI) {
|
|
69
|
+
patchInteractiveModeStartupSkillsBlock();
|
|
19
70
|
let registry: SkillRegistry = EMPTY_REGISTRY;
|
|
20
71
|
let currentCwd: string | undefined;
|
|
21
72
|
let installScope: ExtensionInstallScope | undefined;
|
|
Binary file
|