@xynogen/pix-skills 0.4.17 → 0.5.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.md +16 -4
- package/package.json +1 -1
- package/skills/ask-user.md +1 -0
- package/skills/audit.md +1 -0
- package/skills/bootstrap.md +1 -0
- package/skills/brainstorm.md +1 -0
- package/skills/clone.md +1 -0
- package/skills/command-runner.md +1 -0
- package/skills/commit.md +1 -0
- package/skills/debug.md +1 -0
- package/skills/diff.md +1 -0
- package/skills/environment.md +1 -0
- package/skills/explain.md +1 -0
- package/skills/finish.md +1 -0
- package/skills/graphify.md +1 -0
- package/skills/handoff.md +1 -0
- package/skills/notion.md +1 -0
- package/skills/plan.md +1 -0
- package/skills/readme.md +1 -0
- package/skills/review.md +1 -0
- package/skills/runner.md +1 -0
- package/skills/search.md +1 -0
- package/skills/standup.md +1 -0
- package/skills/subagent.md +1 -0
- package/skills/suggest.md +1 -0
- package/skills/task.md +1 -0
- package/skills/test.md +1 -0
- package/skills/tldr.md +1 -0
- package/skills/toon.md +1 -0
- package/skills/ui.md +1 -0
- package/skills/verify.md +1 -0
- package/src/directive.ts +1 -1
- package/src/index.test.ts +2 -2
- package/src/index.ts +13 -8
- package/src/once.ts +2 -1
- package/src/run.ts +1 -1
package/README.md
CHANGED
|
@@ -7,12 +7,22 @@ Pi coding agent extension — skill loader tool + skills bundle.
|
|
|
7
7
|
| Resource | Type | Description |
|
|
8
8
|
|---|---|---|
|
|
9
9
|
| `read_skills` | tool | Browse and load bundled skills. No args → list all. `name` only → description. `name + full=true` → full instructions. |
|
|
10
|
-
| `skills/` | skills | 29 bundled skills (
|
|
10
|
+
| `skills/` | skills | 29 bundled skills (off-context by default — discovered on demand via `read_skills`) |
|
|
11
11
|
|
|
12
12
|
## How it works
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
Bundled skills are **off-context by default**: every skill carries `disable-model-invocation: true` in
|
|
15
|
+
its frontmatter, so pi does **not** inject its description into the system prompt at startup. This keeps
|
|
16
|
+
the baseline context small regardless of how many skills ship.
|
|
17
|
+
|
|
18
|
+
Discovery and loading go through the `read_skills` tool instead:
|
|
19
|
+
|
|
20
|
+
- `read_skills()` — lists every skill name + description on demand (independent dir scan, not the prompt registry)
|
|
21
|
+
- `read_skills(name=<skill>, full=true)` — loads the full procedure into context
|
|
22
|
+
|
|
23
|
+
A skill can opt back into passive prompt injection by **removing** the `disable-model-invocation: true`
|
|
24
|
+
line (or setting it to `false`) — then pi auto-loads its description on description match. The bundled
|
|
25
|
+
set deliberately leaves it on to favour a lean context.
|
|
16
26
|
|
|
17
27
|
Skills are also discovered from `~/.pi/agent/skills/` (user-level). Bundled skills take precedence on name collision.
|
|
18
28
|
|
|
@@ -24,7 +34,9 @@ Skills are also discovered from `~/.pi/agent/skills/` (user-level). Bundled skil
|
|
|
24
34
|
|
|
25
35
|
## Skills
|
|
26
36
|
|
|
27
|
-
All skills
|
|
37
|
+
All bundled skills ship with `disable-model-invocation: true`, so they stay out of the system prompt
|
|
38
|
+
until the agent loads one explicitly via `read_skills(name=<skill>, full=true)`. They remain invokable
|
|
39
|
+
as `/skill:<name>` slash commands.
|
|
28
40
|
|
|
29
41
|
| Skill | Description |
|
|
30
42
|
|---|---|
|
package/package.json
CHANGED
package/skills/ask-user.md
CHANGED
|
@@ -3,6 +3,7 @@ name: ask-user
|
|
|
3
3
|
description: "MUST use before high-stakes/irreversible decisions or when requirements are ambiguous. Gather context, present 2-5 options via ask_user, get explicit choice, then proceed."
|
|
4
4
|
metadata:
|
|
5
5
|
short-description: Decision gate for ambiguity and high-stakes choices
|
|
6
|
+
disable-model-invocation: true
|
|
6
7
|
---
|
|
7
8
|
|
|
8
9
|
# ask_user decision gate
|
package/skills/audit.md
CHANGED
package/skills/bootstrap.md
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: bootstrap
|
|
3
3
|
description: Project and tool scaffolding using authoritative docs for best practices. Use only on explicit request — "scaffold a project", "set up X", "bootstrap this", "init a new service".
|
|
4
|
+
disable-model-invocation: true
|
|
4
5
|
---
|
|
5
6
|
# Bootstrap & Scaffolding Directive
|
|
6
7
|
|
package/skills/brainstorm.md
CHANGED
package/skills/clone.md
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: clone
|
|
3
3
|
description: Clone any git repository (GitHub/GitLab/Bitbucket URL, SSH, or owner/repo shorthand) into /tmp/clones for read-only code exploration. Use proactively whenever the user provides a git URL, asks to "look at", "explore", "read", "check out", or "analyze" an external repository, or shares a github.com/gitlab.com/bitbucket.org link.
|
|
4
|
+
disable-model-invocation: true
|
|
4
5
|
---
|
|
5
6
|
# Clone Directive
|
|
6
7
|
|
package/skills/command-runner.md
CHANGED
package/skills/commit.md
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: commit
|
|
3
3
|
description: Split, write, and maintain Conventional-Commit-style commits. Use only on explicit request — "commit this", "make a commit", "split these changes", "amend/squash the history".
|
|
4
|
+
disable-model-invocation: true
|
|
4
5
|
---
|
|
5
6
|
# Conventional Commit Management Directive
|
|
6
7
|
|
package/skills/debug.md
CHANGED
package/skills/diff.md
CHANGED
package/skills/environment.md
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: environment
|
|
3
3
|
description: "Establish clean awareness of the user's working environment — OS, distro, kernel, arch, user, and CPU — before running or suggesting commands. Use whenever a request depends on the platform such as installing packages, system services, file paths, downloading arch-specific binaries, or any command whose syntax differs across systems. Load this first so actions match the actual machine instead of a guessed default."
|
|
4
|
+
disable-model-invocation: true
|
|
4
5
|
---
|
|
5
6
|
|
|
6
7
|
# Environment Skill
|
package/skills/explain.md
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: explain
|
|
3
3
|
description: Technical deconstruction and logic tracing. Use when user asks "how does X work", "explain this", "walk me through", "what does this do", or needs to understand existing code/architecture before changing it.
|
|
4
|
+
disable-model-invocation: true
|
|
4
5
|
---
|
|
5
6
|
# Explain Directive
|
|
6
7
|
|
package/skills/finish.md
CHANGED
package/skills/graphify.md
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: graphify
|
|
3
3
|
description: "Use for any question about a codebase, its architecture, file relationships, or project content — especially when graphify-out/ exists, where the question should be treated as a graphify query first. Turns any input (code, docs, papers, images, videos) into a persistent knowledge graph with god nodes, community detection, and query/path/explain tools."
|
|
4
|
+
disable-model-invocation: true
|
|
4
5
|
---
|
|
5
6
|
|
|
6
7
|
# /graphify
|
package/skills/handoff.md
CHANGED
package/skills/notion.md
CHANGED
package/skills/plan.md
CHANGED
package/skills/readme.md
CHANGED
package/skills/review.md
CHANGED
package/skills/runner.md
CHANGED
package/skills/search.md
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: search
|
|
3
3
|
description: Deep logic discovery and project context mapping. Use when user asks "where is X", "find all usages of Y", "how is Z wired up", "what handles this", or location of a behavior is unknown across many files.
|
|
4
|
+
disable-model-invocation: true
|
|
4
5
|
---
|
|
5
6
|
# Deep Context Search Directive
|
|
6
7
|
|
package/skills/standup.md
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: standup
|
|
3
3
|
description: This skill should be used when the user asks to "standup me", "buat standup", "create standup script", "generate standup", "standup hari ini", or any request to prepare a daily standup update. Handles fetching previous context from Notion, prompting the user, generating a script, and saving to Notion.
|
|
4
|
+
disable-model-invocation: true
|
|
4
5
|
---
|
|
5
6
|
|
|
6
7
|
# Standup Script Skill
|
package/skills/subagent.md
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: subagent
|
|
3
3
|
description: Plan a task, break it into small independent units, and fan them out in parallel to cheaper/less-capable subagent models for faster, cheaper, more efficient execution. Use when a task is large enough to split into parts that do not depend on each other and a strong model is overkill for each part.
|
|
4
|
+
disable-model-invocation: true
|
|
4
5
|
---
|
|
5
6
|
|
|
6
7
|
# Parallel Delegate
|
package/skills/suggest.md
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: suggest
|
|
3
3
|
description: Multi-dimensional optimization and improvement recommendations. Use when user asks "how can I improve this", "what would you change", "any suggestions", "make this better", or wants prioritized options rather than a single fix.
|
|
4
|
+
disable-model-invocation: true
|
|
4
5
|
---
|
|
5
6
|
# Suggest Directive
|
|
6
7
|
|
package/skills/task.md
CHANGED
package/skills/test.md
CHANGED
package/skills/tldr.md
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: tldr
|
|
3
3
|
description: Maximum-density technical summary of workflows and purposes. Use when user asks "tldr", "summarize this", "give me the short version", "what's the gist", or needs the essence fast with zero filler.
|
|
4
|
+
disable-model-invocation: true
|
|
4
5
|
---
|
|
5
6
|
# TLDR Directive
|
|
6
7
|
|
package/skills/toon.md
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: toon
|
|
3
3
|
description: Manipulate information-dense JSON efficiently with jq + TOON. Use when fetching/reading large or repetitive JSON (LLM schemas, OpenAPI specs, API responses, datasets, config dumps) into context. Query/reshape with jq, compress to TOON to cut tokens, decode back to JSON only when a strict contract needs it.
|
|
4
|
+
disable-model-invocation: true
|
|
4
5
|
---
|
|
5
6
|
|
|
6
7
|
# TOON + jq: Dense JSON Workflow
|
package/skills/ui.md
CHANGED
package/skills/verify.md
CHANGED
package/src/directive.ts
CHANGED
package/src/index.test.ts
CHANGED
|
@@ -99,8 +99,8 @@ describe("findCommandDirectives", () => {
|
|
|
99
99
|
const md = "x\n!`git status -s`\ny";
|
|
100
100
|
const hits = findCommandDirectives(md);
|
|
101
101
|
expect(hits).toHaveLength(1);
|
|
102
|
-
expect(hits[0]
|
|
103
|
-
expect(md.slice(hits[0]
|
|
102
|
+
expect(hits[0]?.command).toBe("git status -s");
|
|
103
|
+
expect(md.slice(hits[0]?.start, hits[0]?.end)).toBe("!`git status -s`");
|
|
104
104
|
});
|
|
105
105
|
|
|
106
106
|
it("ignores plain inline code `cmd`", () => {
|
package/src/index.ts
CHANGED
|
@@ -5,8 +5,10 @@
|
|
|
5
5
|
* full SKILL.md (or flat .md) by name. This is the safe "agent prompts itself"
|
|
6
6
|
* pattern: the agent calls the tool explicitly; no autonomous injection.
|
|
7
7
|
*
|
|
8
|
-
* Also bundles the skills folder
|
|
9
|
-
*
|
|
8
|
+
* Also bundles the skills folder via resources_discover. Bundled skills carry
|
|
9
|
+
* `disable-model-invocation: true`, so pi keeps their descriptions OUT of the
|
|
10
|
+
* system prompt — the agent finds them by calling read_skills() and loads the
|
|
11
|
+
* body on demand. This keeps baseline context flat as the skill set grows.
|
|
10
12
|
*/
|
|
11
13
|
|
|
12
14
|
import { existsSync, readdirSync, readFileSync } from "node:fs";
|
|
@@ -104,15 +106,15 @@ function discoverSkills(): SkillEntry[] {
|
|
|
104
106
|
export function extractDescription(content: string): string | null {
|
|
105
107
|
const m = content.match(/^---\s*\n([\s\S]*?)\n---/);
|
|
106
108
|
if (!m) return null;
|
|
107
|
-
const dm = m[1]
|
|
108
|
-
return dm ? dm[1]
|
|
109
|
+
const dm = m[1]?.match(/^description\s*:\s*["']?(.+?)["']?\s*$/m);
|
|
110
|
+
return dm ? dm[1]?.trim() : null;
|
|
109
111
|
}
|
|
110
112
|
|
|
111
113
|
export function extractName(content: string): string | null {
|
|
112
114
|
const m = content.match(/^---\s*\n([\s\S]*?)\n---/);
|
|
113
115
|
if (!m) return null;
|
|
114
|
-
const nm = m[1]
|
|
115
|
-
return nm ? nm[1]
|
|
116
|
+
const nm = m[1]?.match(/^name\s*:\s*["']?(.+?)["']?\s*$/m);
|
|
117
|
+
return nm ? nm[1]?.trim() : null;
|
|
116
118
|
}
|
|
117
119
|
|
|
118
120
|
// ─── Command directive interpolation ───────────────────────────────────────────
|
|
@@ -155,7 +157,9 @@ export async function interpolateSkill(
|
|
|
155
157
|
|
|
156
158
|
let out = content;
|
|
157
159
|
for (let i = resolved.length - 1; i >= 0; i--) {
|
|
158
|
-
const
|
|
160
|
+
const entry = resolved[i];
|
|
161
|
+
if (!entry) continue;
|
|
162
|
+
const { d, text, blocked } = entry;
|
|
159
163
|
out = replaceSpan(out, d.start, d.end, blocked ? text : fence(text));
|
|
160
164
|
}
|
|
161
165
|
return out;
|
|
@@ -184,7 +188,7 @@ export function formatSkillSummary(text: string, theme: ThemeLike): string {
|
|
|
184
188
|
.map((line) => {
|
|
185
189
|
const match = line.match(/^(\S+):\s+(.+)$/);
|
|
186
190
|
if (!match) return theme.fg("muted", line);
|
|
187
|
-
return `${theme.fg("accent", theme.bold(match[1]
|
|
191
|
+
return `${theme.fg("accent", theme.bold(match[1] ?? ""))} ${theme.fg("muted", match[2] ?? "")}`;
|
|
188
192
|
})
|
|
189
193
|
.join("\n");
|
|
190
194
|
}
|
|
@@ -215,6 +219,7 @@ function registerSkillLoader(pi: ExtensionAPI): void {
|
|
|
215
219
|
"Browse and load bundled skills. No args → list all skills with descriptions. name only → description for that skill. name + full=true → full instructions.",
|
|
216
220
|
promptSnippet: "Browse and load bundled skill instructions",
|
|
217
221
|
promptGuidelines: [
|
|
222
|
+
"Skills are NOT pre-listed in this prompt. When a task may match a specialized procedure, call read_skills() first to discover what is available.",
|
|
218
223
|
"Call read_skills() with no arguments to list all available skills and their descriptions.",
|
|
219
224
|
"Call read_skills(name=<skill>) to read the description of a specific skill before deciding to load it.",
|
|
220
225
|
"Call read_skills(name=<skill>, full=true) to load the full procedure for a skill before executing it.",
|
package/src/once.ts
CHANGED
|
@@ -14,7 +14,8 @@
|
|
|
14
14
|
*/
|
|
15
15
|
export function once(pi: object, key: string, fn: () => void): void {
|
|
16
16
|
const g = globalThis as { __pixOnce?: WeakMap<object, Set<string>> };
|
|
17
|
-
|
|
17
|
+
if (!g.__pixOnce) g.__pixOnce = new WeakMap<object, Set<string>>();
|
|
18
|
+
const registry = g.__pixOnce;
|
|
18
19
|
let loaded = registry.get(pi);
|
|
19
20
|
if (!loaded) {
|
|
20
21
|
loaded = new Set<string>();
|
package/src/run.ts
CHANGED
|
@@ -34,7 +34,7 @@ export function runArgv(argv: string[], opts: RunOptions): Promise<string> {
|
|
|
34
34
|
|
|
35
35
|
let child: ReturnType<typeof spawn>;
|
|
36
36
|
try {
|
|
37
|
-
child = spawn(argv[0]
|
|
37
|
+
child = spawn(argv[0] as string, argv.slice(1), {
|
|
38
38
|
cwd: opts.cwd,
|
|
39
39
|
stdio: ["ignore", "pipe", "pipe"],
|
|
40
40
|
});
|