@xynogen/pix-skills 0.7.13 → 0.7.15

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xynogen/pix-skills",
3
- "version": "0.7.13",
3
+ "version": "0.7.15",
4
4
  "description": "Pi extension — agent skill loader (skill tool + skills bundle)",
5
5
  "type": "module",
6
6
  "main": "src/index.ts",
@@ -49,6 +49,6 @@
49
49
  "@xynogen/pix-data": "^0.4.3",
50
50
  "@xynogen/pix-gate": "^0.2.6",
51
51
  "@xynogen/pix-pretty": "^1.11.2",
52
- "@xynogen/pix-runtime": "^0.5.3"
52
+ "@xynogen/pix-runtime": "^0.6.0"
53
53
  }
54
54
  }
package/skills/commit.md CHANGED
@@ -36,41 +36,7 @@ time via `\!`cmd`` directives — read them before composing the commit.
36
36
  - **GROUP**: Cluster changes by path/module and by functionality. Each cluster → one self-contained commit.
37
37
  - **GUARD**: Scan diff for secrets, binaries, debug logs, unrelated edits. Halt and report if found.
38
38
 
39
- ### Phase 2: Validate
40
-
41
- #### 2a. Detect runner
42
-
43
- Scan project root for a task runner file in this priority order:
44
-
45
- 1. `justfile` — run `just lint check`, `just format check`, `just test unit`
46
- 2. `mise.toml` / `.mise.toml` — run `mise run lint check`, `mise run format check`, `mise run test unit`
47
- 3. `Makefile` — run `make lint-check`, `make format-check`, `make test-unit`
48
- 4. `Taskfile.yml` — run `task lint:check`, `task format:check`, `task test:unit`
49
- 5. `package.json` — run `npm run lint:check`, `npm run format:check`, `npm run test:unit`
50
- 6. `run.sh` — run `./run.sh lint check`, `./run.sh format check`, `./run.sh test unit`
51
-
52
- #### 2b. Runner or tasks missing
53
-
54
- If **no runner file exists** OR the runner exists but **lacks `lint`, `format`, or `test` tasks**:
55
-
56
- - Ask user:
57
- > Runner / task(s) not found. Options:
58
- > A) **Create runner + tasks now** — invoke the `runner` skill to generate missing tasks, then run them before committing.
59
- > B) **Skip validation** — commit without lint/format/test (risky; recorded in commit body).
60
- > C) **Abort** — stop here; user will set up runner manually.
61
- - If user picks A: invoke runner skill, generate the missing tasks, re-detect, then proceed with 2c.
62
- - If user picks B: proceed to Phase 3. Append `skip-validation: lint format test` to commit body as a reminder.
63
- - If user picks C: halt. Report what's missing and suggest running the `runner` skill manually.
64
-
65
- #### 2c. Run checks (in order)
66
-
67
- 1. **Lint** (`lint check`) — static analysis. Failure → STOP, report issues, do not commit.
68
- 2. **Format** (`format check`) — style check (dry-run). Failure → auto-run `format fix`, show diff, then re-run `format check` to confirm clean. Still failing → STOP.
69
- 3. **Unit tests** (`test unit`) — correctness. Failure → STOP, report failing tests, do not commit.
70
-
71
- All three must be green before proceeding to Phase 3.
72
-
73
- ### Phase 3: Compose
39
+ ### Phase 2: Compose
74
40
 
75
41
  Format: `<type>(<scope>): <subject>`
76
42
 
@@ -84,17 +50,17 @@ fix(parser): handle empty CUDA frame without panic
84
50
  refactor(api): extract response builder from handler
85
51
  ```
86
52
 
87
- ### Phase 4: Split & Stage
53
+ ### Phase 3: Split & Stage
88
54
 
89
55
  - Stage per cluster: `git add <paths>` (or `-p` for partial hunks).
90
56
  - One commit per logical change. Never mix `feat` + unrelated `fix` in one commit.
91
57
 
92
- ### Phase 5: Maintain (when asked)
58
+ ### Phase 4: Maintain (when asked)
93
59
 
94
60
  - Squash/amend/reorder to keep history clean. Remove WIP commits.
95
61
  - Never rewrite pushed history without explicit confirmation (irreversible for collaborators).
96
62
 
97
- ### Phase 6: Offer push
63
+ ### Phase 5: Offer push
98
64
 
99
65
  - After successful commit, ask whether to push now so interaction stays short.
100
66
  - Do **not** push automatically. `git push` is irreversible/shared-state; require explicit confirmation for that exact push.
@@ -110,5 +76,4 @@ refactor(api): extract response builder from handler
110
76
  - Asking "should I commit?" after skill invoked — invocation already answered that.
111
77
  - Secrets, binaries, or `console.log`/`print` debug lines in diff.
112
78
  - One commit bundling unrelated changes.
113
- - Tests/lints not run, or failing.
114
79
  - Rewriting pushed history without confirmation.
package/src/index.test.ts CHANGED
@@ -264,6 +264,34 @@ describe("skill renderer", () => {
264
264
  expect(rendered).not.toContain("search results");
265
265
  });
266
266
 
267
+ it("keeps the call action and target in the collapsed result", () => {
268
+ let registered: Record<string, unknown> = {};
269
+ registerSkills({
270
+ registerTool(tool: unknown) {
271
+ registered = tool as Record<string, unknown>;
272
+ },
273
+ on() {},
274
+ } as never);
275
+ const renderResult = registered.renderResult as (...args: unknown[]) => {
276
+ render: (width: number) => string[];
277
+ };
278
+ const rendered = renderResult(
279
+ {
280
+ content: [{ type: "text", text: "portable guidance" }],
281
+ details: { mode: "instructions", name: "tdd", lines: 84 },
282
+ },
283
+ {},
284
+ tagTheme,
285
+ { expanded: false, isError: false, state: { collapsed: true }, invalidate: () => {} },
286
+ )
287
+ .render(120)
288
+ .join("\n");
289
+
290
+ expect(rendered).toContain("<b>read_skills</b>");
291
+ expect(rendered).toContain("instructions · tdd");
292
+ expect(rendered).toContain("84 lines");
293
+ });
294
+
267
295
  it("restores the normal result when an elapsed card is expanded", () => {
268
296
  let registered: Record<string, unknown> = {};
269
297
  registerSkills({
package/src/index.ts CHANGED
@@ -19,6 +19,7 @@ import { fileURLToPath } from "node:url";
19
19
  import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
20
20
  import { Text } from "@earendil-works/pi-tui";
21
21
  import {
22
+ dotJoin,
22
23
  formatCollapsedToolRow,
23
24
  hideCollapsedToolCall,
24
25
  humanSize,
@@ -292,7 +293,7 @@ export type ThemeLike = {
292
293
  };
293
294
 
294
295
  export function formatSkillList(names: string[]): string {
295
- return `Available skills (${names.length}): ${names.join(" · ")}`;
296
+ return `Available skills (${names.length}): ${dotJoin(names)}`;
296
297
  }
297
298
 
298
299
  function formatInstalls(installs: number): string {
@@ -308,7 +309,7 @@ export function formatRemoteSkillSearch(query: string, results: RemoteSkillSearc
308
309
  `skills.sh matches for "${query}" (${results.length}, installs descending):`,
309
310
  ...ranked.map(
310
311
  (result, index) =>
311
- `${index + 1}. ${result.name} · ${result.source} · ${formatInstalls(result.installs)} installs`,
312
+ `${index + 1}. ${dotJoin([result.name, result.source, `${formatInstalls(result.installs)} installs`])}`,
312
313
  ),
313
314
  ].join("\n");
314
315
  }
@@ -332,15 +333,37 @@ export type SkillResultDetails =
332
333
  | { mode: "copy"; name: string; resource: string; output: string; bytes: number };
333
334
 
334
335
  export function formatSkillCallLabel(args: SkillCallArgs): string {
335
- if (args.search) return `search · ${args.search}`;
336
- if (args.source && args.name) return `remote · ${args.source}@${args.name}`;
336
+ if (args.search) return dotJoin(["search", args.search]);
337
+ if (args.source && args.name) return dotJoin(["remote", `${args.source}@${args.name}`]);
337
338
  if (!args.name) return "list";
338
339
  if (args.resource && args.output) {
339
- return `copy · ${args.name}/${args.resource} → ${args.output}`;
340
+ return dotJoin(["copy", `${args.name}/${args.resource} → ${args.output}`]);
341
+ }
342
+ if (args.resource) return dotJoin(["reference", `${args.name}/${args.resource}`]);
343
+ if (args.full) return dotJoin(["instructions", args.name]);
344
+ return dotJoin(["description", args.name]);
345
+ }
346
+
347
+ /** Collapsed row target/meta for a skill result, in the same action-first order
348
+ * the call label uses (e.g. `instructions tdd · 84 lines`). */
349
+ export function collapsedSkillRow(details: SkillResultDetails): {
350
+ target: string;
351
+ meta: string;
352
+ } {
353
+ switch (details.mode) {
354
+ case "list":
355
+ return { target: "list", meta: `${details.count} skills` };
356
+ case "search":
357
+ return { target: `search “${details.query}”`, meta: `${details.count} matches` };
358
+ case "description":
359
+ return { target: `description · ${details.name}`, meta: "" };
360
+ case "instructions":
361
+ return { target: `instructions · ${details.name}`, meta: `${details.lines} lines` };
362
+ case "reference":
363
+ return { target: `reference · ${details.name}`, meta: humanSize(details.bytes) };
364
+ case "copy":
365
+ return { target: `copy · ${details.output}`, meta: humanSize(details.bytes) };
340
366
  }
341
- if (args.resource) return `reference · ${args.name}/${args.resource}`;
342
- if (args.full) return `instructions · ${args.name}`;
343
- return `description · ${args.name}`;
344
367
  }
345
368
 
346
369
  export function formatCollapsedSkillResult(details: SkillResultDetails): string {
@@ -350,13 +373,13 @@ export function formatCollapsedSkillResult(details: SkillResultDetails): string
350
373
  case "search":
351
374
  return `${details.count} matches for “${details.query}”`;
352
375
  case "description":
353
- return `${details.name} · description`;
376
+ return dotJoin([details.name, "description"]);
354
377
  case "instructions":
355
- return `${details.name} · ${details.lines} instruction lines`;
378
+ return dotJoin([details.name, `${details.lines} instruction lines`]);
356
379
  case "reference":
357
- return `${details.name} · reference · ${humanSize(details.bytes)}`;
380
+ return dotJoin([details.name, "reference", humanSize(details.bytes)]);
358
381
  case "copy":
359
- return `copied · ${details.output} · ${humanSize(details.bytes)}`;
382
+ return dotJoin(["copied", details.output, humanSize(details.bytes)]);
360
383
  }
361
384
  }
362
385
 
@@ -389,16 +412,16 @@ export function formatExpandedSkillResult(details: SkillResultDetails, text: str
389
412
  case "description": {
390
413
  const prefix = `${details.name}:`;
391
414
  const description = text.startsWith(prefix) ? text.slice(prefix.length).trimStart() : text;
392
- return `DESCRIPTION · ${details.name}\n${description}`;
415
+ return `${dotJoin(["DESCRIPTION", details.name])}\n${description}`;
393
416
  }
394
417
  case "instructions": {
395
418
  const preview = text.length > 100 ? `${text.slice(0, 100)}...` : text;
396
- return `INSTRUCTIONS · ${details.name} · ${details.lines} lines\n${preview}`;
419
+ return `${dotJoin(["INSTRUCTIONS", details.name, `${details.lines} lines`])}\n${preview}`;
397
420
  }
398
421
  case "reference":
399
- return `REFERENCE · ${details.name}\n${details.resource} · ${humanSize(details.bytes)}\n${text}`;
422
+ return `${dotJoin(["REFERENCE", details.name])}\n${dotJoin([details.resource, humanSize(details.bytes)])}\n${text}`;
400
423
  case "copy":
401
- return `COPIED · ${details.name}\n${details.resource} → ${details.output} · ${humanSize(details.bytes)}`;
424
+ return `${dotJoin(["COPIED", details.name])}\n${dotJoin([`${details.resource} → ${details.output}`, humanSize(details.bytes)])}`;
402
425
  }
403
426
  }
404
427
 
@@ -653,9 +676,9 @@ function registerSkillLoader(pi: ExtensionAPI): void {
653
676
  if (!renderCtx.isError && details) {
654
677
  const state = renderCtx.state as CollapseState;
655
678
  if (tickCollapse("read_skills", state, renderCtx.invalidate, renderCtx.expanded)) {
656
- const target =
657
- details.mode === "search" ? `“${details.query}”` : formatCollapsedSkillResult(details);
658
- const meta = details.mode === "search" ? `${details.count} matches` : "";
679
+ // Collapsed row mirrors the call label: `<action> <target> · <meta>` so
680
+ // the summary reads the same way the call did (no action/target reorder).
681
+ const { target, meta } = collapsedSkillRow(details);
659
682
  component.setText(formatCollapsedToolRow(theme, "read_skills", target, meta));
660
683
  return component;
661
684
  }