Skip to content

Add Lua language and tools support#1894

Open
LK4D4 wants to merge 1 commit into
rtk-ai:developfrom
LK4D4:codex/lua-support
Open

Add Lua language and tools support#1894
LK4D4 wants to merge 1 commit into
rtk-ai:developfrom
LK4D4:codex/lua-support

Conversation

@LK4D4
Copy link
Copy Markdown

@LK4D4 LK4D4 commented May 15, 2026

Summary

This adds Lua support to RTK:

  • Adds first-class rtk luacheck and rtk busted command proxies, with trailing argument forwarding and compact filtered output.
  • Wires Lua commands into CLI parsing, command dispatch, command discovery, README examples, and filter classification.
  • Extends rtk smart / local LLM code summaries for Lua so agents get useful triage signals: module vs function/spec summaries, exports and locals, Busted spec cues, and dependency classification.

Why

Lua-heavy repositories currently fall through more generic handling even though the outputs are very compressible and common in agent workflows. This branch makes the Lua paths explicit so lint/test output and code-summary reads preserve the high-signal parts an agent needs while dropping repetitive noise.

Project-scope RTK evidence from my Lua project:

  • 4,782 tracked commands
  • 3.9M input tokens -> 2.6M output tokens
  • 1.4M tokens saved overall, 36.3% savings
  • rtk luacheck --codes ...: 85 runs, 129.2K tokens saved, 99.4% average savings
  • rtk busted spec: 85 runs, 9.6K tokens saved, 94.4% average savings

I also added some guidance to use rtk read -l minimal and rtk read -l aggressive and seeing some good savings too. rtk smart is not as useful for my project but could be useful for other.

Validation

  • rtk cargo fmt --all --check
  • rtk cargo clippy --all-targets
  • rtk cargo test lua -> 21 passed, 1876 filtered out
  • $env:PATH='C:\Program Files\Git\usr\bin;' + $env:PATH; rtk cargo test --all -> 1891 passed, 6 ignored

Teach rtk read and smart summaries to recognize Lua source files so comment stripping, function extraction, module shape, and import extraction use Lua syntax.

Improve Lua rtk smart output for agent triage: capped function counts are marked explicitly, exported module tables are separated from local implementation tables, public module methods and constructors outrank helper functions, Busted specs summarize describe/it behavior instead of mock helpers, and require dependencies are grouped into internal versus external buckets with stable ordering.

Add compact luacheck and busted handlers, wire them through CLI parsing and command discovery, and cover the Lua filters and smart-summary heuristics with focused routing, savings, and summary tests.

Deliberately skip a lua or luajit interpreter wrapper because raw program output is arbitrary passthrough and does not provide meaningful token savings.
@LK4D4 LK4D4 changed the title Add focused Lua support Add Lua language and tools support May 15, 2026
@LK4D4 LK4D4 marked this pull request as ready for review May 15, 2026 11:32
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