perf(skills): minify diagram example JSONs (~45% smaller)#148
Open
ivanmkc wants to merge 1 commit into
Open
Conversation
The diagram-recipes examples are loaded verbatim into agent context when an example is adapted. Pretty-printed, they were ~298 KB (the two *-matrix trees alone ~89 KB across ~2,800 lines). Minifying to compact JSON is byte-for-byte the same data but ~45% fewer bytes (305,190 -> 167,886), cutting tokens an agent spends to load an example. Still valid JSON; flow-geometry.test.ts JSON.parses them so it is unaffected. Fix T1 from the latency/token experiment plan. Refs #142.
This was referenced Jun 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The
plugin/skills/diagram-recipes/examples/*.jsonfiles are loaded verbatim into an agent's context when it adapts an example. Pretty-printed they totaled ~298 KB; the two*-matrix.component.jsontrees alone were ~89 KB (~2,800 lines).Minifying to compact JSON is byte-for-byte the same data but 45% fewer bytes (305,190 → 167,886), directly cutting the tokens an agent spends to load an example.
This is fix T1 from the latency/token experiment plan. Refs #142.
Safety
packages/viewer/test/flow-geometry.test.tsconsumes them viaJSON.parse(readFileSync(...)), so it's unaffected (no formatting assertions).Notable
raci-matrix.component.json45,731 → 13,749 bytesrisk-matrix.component.json43,226 → 13,284 bytes