@howaboua/pi-better-skills-tool 0.0.6 → 0.0.7
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 +6 -0
- package/README.md +4 -22
- package/index.ts +13 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @howaboua/pi-better-skills-tool
|
|
2
2
|
|
|
3
|
+
## 0.0.7
|
|
4
|
+
|
|
5
|
+
- Better Skills now hides the skill catalog from Pi, Code Mode, and Notebook Mode prompts while preserving native `/skill:<name>` commands.
|
|
6
|
+
|
|
7
|
+
Remove `--no-skills` from launch wrappers or aliases. Separate catalog-clearing hooks are no longer needed.
|
|
8
|
+
|
|
3
9
|
## 0.0.6
|
|
4
10
|
|
|
5
11
|
- Requires Pi 1.0.0 or later.
|
package/README.md
CHANGED
|
@@ -8,31 +8,13 @@ Progressive skill discovery for Pi, Code Mode and Notebook Mode. The `skills` to
|
|
|
8
8
|
pi install npm:@howaboua/pi-better-skills-tool
|
|
9
9
|
```
|
|
10
10
|
|
|
11
|
-
Requires Pi 1.0.0 or newer. Install `@howaboua/pi-codex-conversion` 3.0.
|
|
11
|
+
Requires Pi 1.0.0 or newer. Install `@howaboua/pi-codex-conversion` 3.0.43 or newer too for Code Mode and Notebook Mode. The extension remains a normal Pi tool when Codex conversion is absent.
|
|
12
12
|
|
|
13
|
-
## Start Pi
|
|
13
|
+
## Start Pi normally
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
Start Pi without `--no-skills`. Better Skills hides catalog advertising from the system prompt while preserving Pi's native `/skill:<name>` commands. The model discovers and reads the loaded catalog on demand through `skills`.
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
```zsh
|
|
20
|
-
#!/usr/bin/env zsh
|
|
21
|
-
set -euo pipefail
|
|
22
|
-
|
|
23
|
-
real_pi="$HOME/.cache/.bun/bin/pi"
|
|
24
|
-
|
|
25
|
-
case "${1-}" in
|
|
26
|
-
install|remove|uninstall|update|list|config|auth)
|
|
27
|
-
exec "$real_pi" "$@"
|
|
28
|
-
;;
|
|
29
|
-
*)
|
|
30
|
-
exec "$real_pi" --no-skills "$@"
|
|
31
|
-
;;
|
|
32
|
-
esac
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
Put the wrapper earlier on `PATH` than the real Pi executable. Change `real_pi` when Pi was installed somewhere other than Bun's global binary directory. Quoted `"$@"` preserves each argument exactly, including spaces and repeated flags.
|
|
17
|
+
Remove `--no-skills` from an existing wrapper or alias. An additional catalog-clearing `before_agent_start` hook is no longer needed.
|
|
36
18
|
|
|
37
19
|
## Use
|
|
38
20
|
|
package/index.ts
CHANGED
|
@@ -21,7 +21,19 @@ export default async function skillsExtension(pi: ExtensionAPI): Promise<void> {
|
|
|
21
21
|
|
|
22
22
|
let loadedSkills: readonly Skill[] = [];
|
|
23
23
|
pi.on("before_agent_start", (event) => {
|
|
24
|
-
|
|
24
|
+
const options = event.systemPromptOptions;
|
|
25
|
+
loadedSkills = [...options.skills];
|
|
26
|
+
// Native /skill: expansion uses Pi's loader, not these prompt fields.
|
|
27
|
+
options.skills = [];
|
|
28
|
+
delete options.sections["skills"];
|
|
29
|
+
delete options.sections["skill_catalog"];
|
|
30
|
+
if (options.forceSystemPrompt !== undefined) {
|
|
31
|
+
// Full-prompt overrides bypass sections. Preserve text outside catalog containers.
|
|
32
|
+
options.forceSystemPrompt = options.forceSystemPrompt.replace(
|
|
33
|
+
/<(skills|skill_catalog)>[\s\S]*?<\/\1>/g,
|
|
34
|
+
"",
|
|
35
|
+
);
|
|
36
|
+
}
|
|
25
37
|
});
|
|
26
38
|
const tool = createSkillsTool({ getLoadedSkills: () => loadedSkills });
|
|
27
39
|
pi.registerTool(tool);
|