Skip to content

Experimental: Multi-file and compact llm optimized output.#13

Open
notpeter wants to merge 5 commits intomainfrom
splits
Open

Experimental: Multi-file and compact llm optimized output.#13
notpeter wants to merge 5 commits intomainfrom
splits

Conversation

@notpeter
Copy link
Copy Markdown
Owner

@notpeter notpeter commented Jan 30, 2026

Looking at ways to optimize output for llm consumption without any semantic impact.

Prototypes

Compact Output

Use most compact form of LuaCATS we can with the SDK docs.
Reduced to 66% of the original token size.

cargo run -- --llm > stub-llm.lua
Before (stub.lua) After (stub-llm.lua)
Screenshot 2026-01-29 at 11 52 49 PM Screenshot 2026-01-29 at 11 52 34 PM
Screenshot 2026-01-29 at 11 40 07 PM Screenshot 2026-01-29 at 11 58 08 PM

By comparison, my "luars" DSL: playdate.luars is almost as small and more human readble.

playdate.luars playdate.luars (no indents)
Screenshot 2026-01-30 at 12 49 06 AM Screenshot 2026-01-30 at 12 50 18 AM

Multi file stubs

Split into multiple files.

cargo run multi
tree out
out
├── json.lua
├── other.lua
├── playdate
│   ├── datastore.lua
│   ├── display.lua
│   ├── easingFunctions.lua
...

Index / Multi-file Markdown

Fully annotated stub.lua is too big to just dump into context.

With URLs Without URLs
Screenshot 2026-01-30 at 12 14 47 AM Screenshot 2026-01-30 at 12 19 28 AM

Generate multiple markdown with docs.

cargo run md

Include a compressed index in AGENTS.md
And have the agent retrieve just the docs it needs.
Inspired by: https://vercel.com/blog/agents-md-outperforms-skills-in-our-agent-evals
Like:

[PlaydateSDK Docs Index]|root: ./.playdate-docs
|IMPORTANT: Prefer retrieval-led reasoning over pre-training-led reasoning
|{class.md,json.md,playdate.md,print.md,profiling.md,table.md}
|playdate/{accelerometer.md,datastore.md,device.md,display.md,easingFunctions.md,file.md,frameTimer.md,geometry.md,graphics.md,input.md,inputhandlers.md,keyboard.md,lifecycle.md,math.md,menu.md,mirror.md,network.md,pathfinder.md,profiling.md,scoreboards.md,settings.md,simulator.md,sound.md,string.md,time.md,timer.md,ui.md}
|playdate/geometry/{affineTransform.md,arc.md,lineSegment.md,point.md,polygon.md,rect.md,size.md,vector2D.md}
|playdate/graphics/{animation.md,animator.md,font.md,image.md,imagetable.md,nineSlice.md,perlin.md,qrcode.md,sprite.md,tilemap.md,video.md}
|playdate/sound/{bitcrusher.md,channel.md,controlsignal.md,delayline.md,delaylinetap.md,envelope.md,fileplayer.md,instrument.md,lfo.md,micinput.md,onepolefilter.md,overdrive.md,ringmod.md,sample.md,sampleplayer.md,sequence.md,signal.md,signalvalue.md,synth.md,track.md,twopolefilter.md}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant