@xynogen/pix-skills 0.7.5 → 0.7.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/README.md CHANGED
@@ -7,7 +7,7 @@ Pi coding agent extension — skill loader tool + skills bundle.
7
7
  | Resource | Type | Description |
8
8
  |---|---|---|
9
9
  | `read_skills` | tool | Browse local skills, search Skills.sh, explicitly fetch/cache a selected public GitHub skill, read references, and copy bundled resources. |
10
- | `skills/` | skills | 27 bundled skills (off-context by default — discovered on demand via `read_skills`) |
10
+ | `skills/` | skills | 28 bundled skills (off-context by default — discovered on demand via `read_skills`) |
11
11
 
12
12
  ## New: Skills.sh search and remote skill cache
13
13
 
@@ -155,6 +155,7 @@ as `/skill:<name>` slash commands.
155
155
  | `finish` | Structured branch completion — verify, decide, clean up |
156
156
  | `graphify` | Codebase questions via a persistent knowledge graph |
157
157
  | `handoff` | Toggle session handoff — write or read+delete `HANDOFF.md` |
158
+ | `human` | Audit and rewrite content to remove AI writing patterns ("AI-isms") |
158
159
  | `plan` | Write detailed, bite-sized implementation plans before coding |
159
160
  | `readme` | Create or update a deployment-focused README in a fixed style |
160
161
  | `review` | Architectural review and quality assurance |
@@ -164,7 +165,7 @@ as `/skill:<name>` slash commands.
164
165
  | `task` | Task orchestration and ambiguity resolution |
165
166
  | `test` | Test execution, analysis, and failure resolution via TDD |
166
167
  | `tldr` | Maximum-density technical summary, zero filler |
167
- | `toon` | Handle information-dense JSON with jq + TOON compression |
168
+ | `toon-json` | On-demand jq + TOON workflow for information-dense JSON |
168
169
  | `ui` | UI/UX design and implementation guidance for frontends |
169
170
  | `verify` | Verification before completion — confirm it's actually fixed |
170
171
  | `subagent` | Plan, decompose, and fan out independent units to cheaper parallel subagent workers |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xynogen/pix-skills",
3
- "version": "0.7.5",
3
+ "version": "0.7.7",
4
4
  "description": "Pi extension — agent skill loader (skill tool + skills bundle)",
5
5
  "type": "module",
6
6
  "main": "src/index.ts",
@@ -48,7 +48,7 @@
48
48
  "dependencies": {
49
49
  "@xynogen/pix-data": "^0.4.0",
50
50
  "@xynogen/pix-gate": "^0.2.0",
51
- "@xynogen/pix-pretty": "^1.7.20",
51
+ "@xynogen/pix-pretty": "^1.10.0",
52
52
  "@xynogen/pix-runtime": "^0.4.0"
53
53
  }
54
54
  }
@@ -1,17 +1,18 @@
1
1
  ---
2
- name: toon
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.
2
+ name: toon-json
3
+ description: Manipulate information-dense JSON efficiently with jq + TOON. Use when fetching or reading large, repetitive JSON such as LLM schemas, OpenAPI specs, API responses, datasets, and config dumps. Query and reshape with jq, compress to TOON for context, and decode back only when a strict JSON contract requires it.
4
4
  disable-model-invocation: true
5
5
  ---
6
6
 
7
7
  # TOON + jq: Dense JSON Workflow
8
8
 
9
9
  ## Goal
10
+
10
11
  Carry only the JSON slice you need, in the cheapest encoding. Query with `jq`,
11
12
  compress with `toon`, and round-trip back to JSON **only** when a contract
12
13
  requires strict JSON.
13
14
 
14
- TOON (Token-Oriented Object Notation, https://github.com/toon-format/spec) is a
15
+ TOON (Token-Oriented Object Notation, <https://github.com/toon-format/spec>) is a
15
16
  line-oriented encoding of the JSON data model. Uniform arrays of objects declare
16
17
  their keys once and stream bare rows, so token cost drops sharply on tabular and
17
18
  dense data.
@@ -37,6 +38,7 @@ cat data.toon | toon --decode
37
38
  or `-d` (decode TOON→JSON).
38
39
 
39
40
  ### Useful flags
41
+
40
42
  - `--stats` — print token/byte statistics for the conversion
41
43
  - `--delimiter=,|\t|"|"` — array delimiter (comma default; tab/pipe can tokenize better)
42
44
  - `--keyFolding=safe` — collapse single-key nesting chains
@@ -58,6 +60,7 @@ TOON is not always smaller. Pick based on shape:
58
60
  Rule of thumb: **TOON for reading dense data into context. JSON for contracts.**
59
61
 
60
62
  ## When NOT to use TOON
63
+
61
64
  - Anything sent to or stored by an API that expects JSON.
62
65
  - Data a downstream tool/parser must consume as strict JSON.
63
66
  - Deeply nested config trees or highly irregular structures.
@@ -73,6 +76,7 @@ LLM model list (uniform array → great TOON candidate):
73
76
  ```bash
74
77
  curl -s https://api.example.com/v1/models | jq '.data | map({id, owned_by, context})' | toon
75
78
  ```
79
+
76
80
  ```
77
81
  [3]{id,owned_by,context}:
78
82
  gpt-x,acme,128000
@@ -96,6 +100,7 @@ curl -s -X POST https://api.example.com/ingest -d "$RESHAPED"
96
100
  ```
97
101
 
98
102
  ## Checklist
103
+
99
104
  1. **Query** — narrow with `jq` to the exact slice needed.
100
105
  2. **Decide** — uniform/tabular/shallow → TOON; nested/array-of-arrays/contract → JSON.
101
106
  3. **Compress** — `| toon` (add `--stats` to confirm savings).
package/src/index.test.ts CHANGED
@@ -39,6 +39,18 @@ description: Split, write, and maintain commits.
39
39
  # Commit Directive
40
40
  body...`;
41
41
 
42
+ describe("bundled TOON skill", () => {
43
+ it("is model-discoverable on demand and owns the jq + TOON workflow", async () => {
44
+ const skill = await Bun.file(new URL("../skills/toon-json.md", import.meta.url)).text();
45
+
46
+ expect(extractName(skill)).toBe("toon-json");
47
+ expect(extractDescription(skill)).toContain("information-dense JSON");
48
+ expect(skill).toContain("disable-model-invocation: true");
49
+ expect(skill).toContain("jq '.data'");
50
+ expect(skill).toContain("toon -d");
51
+ });
52
+ });
53
+
42
54
  describe("extractName", () => {
43
55
  it("reads name from YAML frontmatter", () => {
44
56
  expect(extractName(FRONTMATTER)).toBe("commit");
package/src/index.ts CHANGED
@@ -18,7 +18,11 @@ import { dirname, isAbsolute, join, relative, resolve, win32 } from "node:path";
18
18
  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
- import { formatCollapsedToolRow, hideCollapsedToolCall } from "@xynogen/pix-pretty/utils";
21
+ import {
22
+ formatCollapsedToolRow,
23
+ hideCollapsedToolCall,
24
+ humanSize,
25
+ } from "@xynogen/pix-pretty/utils";
22
26
  import { type CollapseState, tickCollapse } from "@xynogen/pix-runtime/collapse";
23
27
  import { ioTimeoutMs } from "@xynogen/pix-runtime/io";
24
28
  import { once } from "@xynogen/pix-runtime/once";
@@ -327,11 +331,6 @@ export type SkillResultDetails =
327
331
  | { mode: "reference"; name: string; resource: string; bytes: number }
328
332
  | { mode: "copy"; name: string; resource: string; output: string; bytes: number };
329
333
 
330
- function formatBytes(bytes: number): string {
331
- if (bytes < 1024) return `${bytes} B`;
332
- return `${(bytes / 1024).toFixed(1)} KiB`;
333
- }
334
-
335
334
  export function formatSkillCallLabel(args: SkillCallArgs): string {
336
335
  if (args.search) return `search · ${args.search}`;
337
336
  if (args.source && args.name) return `remote · ${args.source}@${args.name}`;
@@ -355,9 +354,9 @@ export function formatCollapsedSkillResult(details: SkillResultDetails): string
355
354
  case "instructions":
356
355
  return `${details.name} · ${details.lines} instruction lines`;
357
356
  case "reference":
358
- return `${details.name} · reference · ${formatBytes(details.bytes)}`;
357
+ return `${details.name} · reference · ${humanSize(details.bytes)}`;
359
358
  case "copy":
360
- return `copied · ${details.output} · ${formatBytes(details.bytes)}`;
359
+ return `copied · ${details.output} · ${humanSize(details.bytes)}`;
361
360
  }
362
361
  }
363
362
 
@@ -397,9 +396,9 @@ export function formatExpandedSkillResult(details: SkillResultDetails, text: str
397
396
  return `INSTRUCTIONS · ${details.name} · ${details.lines} lines\n${preview}`;
398
397
  }
399
398
  case "reference":
400
- return `REFERENCE · ${details.name}\n${details.resource} · ${formatBytes(details.bytes)}\n${text}`;
399
+ return `REFERENCE · ${details.name}\n${details.resource} · ${humanSize(details.bytes)}\n${text}`;
401
400
  case "copy":
402
- return `COPIED · ${details.name}\n${details.resource} → ${details.output} · ${formatBytes(details.bytes)}`;
401
+ return `COPIED · ${details.name}\n${details.resource} → ${details.output} · ${humanSize(details.bytes)}`;
403
402
  }
404
403
  }
405
404