@xynogen/pix-skills 0.4.17 → 0.5.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 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 (auto-loaded by pi at startup — names + descriptions in system prompt) |
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
- Pi loads skill *descriptions* into the system prompt at startup (progressive disclosure). Full content
15
- only enters context when the agent calls `read_skills(name=<skill>, full=true)` — or reads the file via the `read` tool.
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 are model-invocable — pi auto-loads each one on description match. The agent can also load any skill on demand via `read_skills(name=<skill>, full=true)`.
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xynogen/pix-skills",
3
- "version": "0.4.17",
3
+ "version": "0.5.2",
4
4
  "description": "Pi extension — agent skill loader (skill tool + skills bundle)",
5
5
  "type": "module",
6
6
  "main": "src/index.ts",
@@ -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
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  name: audit
3
3
  description: Security audit, integrity check, and health scan. Use only on explicit request — "audit this", "security scan", "check for secrets", "is this safe", "find vulnerabilities".
4
+ disable-model-invocation: true
4
5
  ---
5
6
  # Audit Directive
6
7
 
@@ -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
 
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  name: brainstorm
3
3
  description: Design exploration and spec refinement before any implementation begins
4
+ disable-model-invocation: true
4
5
  ---
5
6
  # Brainstorm Directive
6
7
 
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
 
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  name: command-runner
3
3
  description: Inspect workspace health using pre-populated git context (status + diff).
4
+ disable-model-invocation: true
4
5
  ---
5
6
 
6
7
  # Command Runner Skill
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
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  name: debug
3
3
  description: Root-Cause Analysis and self-annealing procedure for error resolution
4
+ disable-model-invocation: true
4
5
  ---
5
6
  # Debug & Anneal Directive
6
7
 
package/skills/diff.md CHANGED
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  name: diff
3
3
  description: Review the current git changes using pre-populated status, staged, and unstaged diffs.
4
+ disable-model-invocation: true
4
5
  ---
5
6
 
6
7
  # Diff Review Skill
@@ -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
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  name: finish
3
3
  description: Structured branch completion — verify, decide, and clean up when implementation is done
4
+ disable-model-invocation: true
4
5
  ---
5
6
  # Finish Directive
6
7
 
@@ -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
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  name: handoff
3
3
  description: Toggle session handoff — if HANDOFF.md does not exist, write one (giving mode); if it exists, read and delete it (receiving mode)
4
+ disable-model-invocation: true
4
5
  ---
5
6
 
6
7
  # Handoff Directive
package/skills/notion.md CHANGED
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  name: notion
3
3
  description: Efficient Notion workspace retrieval. Use when user asks to fetch, search, or read data from Notion — pages, databases, or project lists.
4
+ disable-model-invocation: true
4
5
  ---
5
6
  # Notion Retrieval Directive
6
7
 
package/skills/plan.md CHANGED
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  name: plan
3
3
  description: Write detailed, bite-sized implementation plans before touching code
4
+ disable-model-invocation: true
4
5
  ---
5
6
  # Plan Directive
6
7
 
package/skills/readme.md CHANGED
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  name: readme
3
3
  description: Create or update a project README in a fixed, deployment-focused style with required sections, env-var tables, and an enforced tone
4
+ disable-model-invocation: true
4
5
  ---
5
6
  # README Directive
6
7
 
package/skills/review.md CHANGED
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  name: review
3
3
  description: Architectural Review and Quality Assurance
4
+ disable-model-invocation: true
4
5
  ---
5
6
  # Review Directive
6
7
 
package/skills/runner.md CHANGED
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  name: runner
3
3
  description: Generate, convert, or update a task runner file (justfile, Makefile, mise tasks, Taskfile.yml, package.json scripts, or run.sh) for any project
4
+ disable-model-invocation: true
4
5
  ---
5
6
  # Task Runner Generation Directive
6
7
 
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
@@ -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
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  name: task
3
3
  description: Task Orchestration and Ambiguity Resolution
4
+ disable-model-invocation: true
4
5
  ---
5
6
  # Task Orchestration Directive
6
7
 
package/skills/test.md CHANGED
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  name: test
3
3
  description: Test execution, analysis, and failure resolution using TDD
4
+ disable-model-invocation: true
4
5
  ---
5
6
  # Test Directive
6
7
 
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
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  name: ui
3
3
  description: UI/UX design and implementation guidance for distinctive, production-grade frontend interfaces
4
+ disable-model-invocation: true
4
5
  ---
5
6
  # UI Design Directive
6
7
 
package/skills/verify.md CHANGED
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  name: verify
3
3
  description: Verification before completion — ensure it's actually fixed before claiming done
4
+ disable-model-invocation: true
4
5
  ---
5
6
  # Verify Directive
6
7
 
package/src/directive.ts CHANGED
@@ -30,7 +30,7 @@ export function findCommandDirectives(content: string): CommandDirective[] {
30
30
  hits.push({
31
31
  start,
32
32
  end: start + m[0].length - lead.length,
33
- command: m[2]!.trim(),
33
+ command: m[2]?.trim() ?? "",
34
34
  });
35
35
  }
36
36
  return hits;
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]!.command).toBe("git status -s");
103
- expect(md.slice(hits[0]!.start, hits[0]!.end)).toBe("!`git status -s`");
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 so pi auto-loads skill descriptions into the
9
- * system prompt at startup (names + descriptions only — full content on demand).
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]!.match(/^description\s*:\s*["']?(.+?)["']?\s*$/m);
108
- return dm ? dm[1]!.trim() : null;
109
+ const dm = m[1]?.match(/^description\s*:\s*["']?(.+?)["']?\s*$/m);
110
+ return dm ? (dm[1]?.trim() ?? null) : 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]!.match(/^name\s*:\s*["']?(.+?)["']?\s*$/m);
115
- return nm ? nm[1]!.trim() : null;
116
+ const nm = m[1]?.match(/^name\s*:\s*["']?(.+?)["']?\s*$/m);
117
+ return nm ? (nm[1]?.trim() ?? null) : 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 { d, text, blocked } = resolved[i]!;
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]!))} ${theme.fg("muted", match[2]!)}`;
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
- const registry = (g.__pixOnce ??= new WeakMap<object, Set<string>>());
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,8 @@ 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]!, argv.slice(1), {
37
+ const cmd = argv[0] ?? "";
38
+ child = spawn(cmd, argv.slice(1), {
38
39
  cwd: opts.cwd,
39
40
  stdio: ["ignore", "pipe", "pipe"],
40
41
  });