@xynogen/pix-skills 0.7.5 → 0.7.6
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 +1 -1
- package/package.json +1 -1
- package/skills/{toon.md → toon-json.md} +8 -3
- package/src/index.test.ts +12 -0
package/README.md
CHANGED
|
@@ -164,7 +164,7 @@ as `/skill:<name>` slash commands.
|
|
|
164
164
|
| `task` | Task orchestration and ambiguity resolution |
|
|
165
165
|
| `test` | Test execution, analysis, and failure resolution via TDD |
|
|
166
166
|
| `tldr` | Maximum-density technical summary, zero filler |
|
|
167
|
-
| `toon` |
|
|
167
|
+
| `toon-json` | On-demand jq + TOON workflow for information-dense JSON |
|
|
168
168
|
| `ui` | UI/UX design and implementation guidance for frontends |
|
|
169
169
|
| `verify` | Verification before completion — confirm it's actually fixed |
|
|
170
170
|
| `subagent` | Plan, decompose, and fan out independent units to cheaper parallel subagent workers |
|
package/package.json
CHANGED
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
---
|
|
2
|
-
name: toon
|
|
3
|
-
description: Manipulate information-dense JSON efficiently with jq + TOON. Use when fetching
|
|
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");
|