terminal.lua AGENTS.md

A set of instructions for AI agents working on terminal.lua, a cross-platform Lua library for terminals and text-based user interfaces. It explains the project layout, coding conventions, workflow, and test setup.

In plain words
What is it for?
Use it when changing terminal.lua, running or adding Busted tests, checking Lua style with LuaCheck, or working with its documentation and examples.
Why use it?
It gives coding agents the project context they need to work in the right files and follow the repository’s established practices.

Instructions file for CodexOpenCode

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add instructions/lunarmodules/terminal.lua/agents-md
Clone the repo
git clone --depth 1 https://github.com/lunarmodules/terminal.lua

Made for: Codex, OpenCode.

Per session 1,028 This file is loaded in full into every session.
When invoked 1,028 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.01028 $0.01028
Opus 5 $0.00514 $0.00514
Sonnet 5 $0.00206 $0.00206
Haiku 4.5 $0.00103 $0.00103

Measured 2d ago against content hash a25de4d4b25e, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

terminal.lua AGENTS.md scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

AGENTS.md · 102 lines

How it starts

The opening of the file, as written. The whole thing — 102 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Guidance for AI agents

This file is the main entry point for AI tools working in this repository. It provides project context and points to authoritative sources for conventions.

What this project is

terminal.lua is a cross-platform terminal library for Lua (Windows/Unix/Mac). It provides terminal handling, text handling, and UI building blocks (panels, prompts, etc.).

Project layout

Path Purpose
src/terminal/ Lua source (modules under terminal.*, terminal.cli.*, terminal.ui.*)
spec/ Tests (Busted); mirror source layout where relevant
examples/ Example scripts
doc_topics/ Documentation source (markdown); generated output in docs/
experimental/ Experimental or non-stable code
.luacheckrc LuaCheck lint configuration (authoritative for lint)
.editorconfig Editor/formatting preferences
config.ld ldoc configuration for API docs

Spec files live in a flat spec/ directory and are named by module (e.g. 18-prompt_spec.lua for terminal.cli.prompt).

Conventions and workflow

Details are in CONTRIBUTING.md. Summary:

  • Getting started: Use the Makefile from the repository root; LuaRocks should use the user tree (see CONTRIBUTING).
  • Commits: Atomic commits, conventional-commits format (type + scope, present tense, 50-char header, 72-char body).
  • Testing: make test (Busted), make lint (LuaCheck). Coverage: LuaCov, output in luacov.report.out. Every new feature, function, or component must be accompanied by tests where reasonable and applicable; exceptions are documented (see CONTRIBUTING).
  • Documentation: ldoc; sources in config.ld. Run make docs to generate; do not commit generated docs (make clean will revert generated docs). Update comments and examples during development.

Test isolation

In Busted the test files are ran as Lua files, all describe blocks are executed at load time. All other blocks only at test-runtime. Hence all initialization MUST be in setup and before_each blocks, and NEVER in describe blocks. The variables to hold the setup-stuff can be defined at the describe level (to keep them in scope for all tests within the block), but no values should be assigned to them at that point. The only exception is code that generates tests, like table-tests, etc. since they are designed to run at the describe level.

Read the full file on GitHub · 102 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 102 lines · 1,028 tokens per session scan A a25de4d4b25e

Subscribe to this mod's changes

terminal.lua AGENTS.md is an instructions file published in the GitHub repository lunarmodules/terminal.lua (50 stars, last pushed 18d ago), licensed MIT. It adds 1,028 tokens to every session, about $0.0051 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other instructions, from other repositories

wispterm AGENTS.md

Instructions for xuzhougeng/wispterm, covering agents.md, architecture, ui presentation styles, cohesion and coupling and integration layer vs feature domains.

xuzhougeng/wispterm · 5,997 tokens

nuclear AGENTS.md

AGENTS.md instructions for nukeop/nuclear, covering agents.md, project overview, packages, commands and development.

nukeop/nuclear · 3,328 tokens

nuclear copilot-instructions.md

Copilot instructions for nukeop/nuclear, covering nuclear music player - copilot instructions, project overview, key features, tech stack and packages.

nukeop/nuclear · 1,235 tokens

rmx AGENTS.md

Instructions for braswelljr/rmx, covering agents.md, project overview, architecture at a glance, project structure and development commands.

braswelljr/rmx · 3,116 tokens

termigo AGENTS.md

Instructions for 99apps-id/termigo, a project described as: Termigo is a lightweight open-source, terminal-first AI-native development environment (ADE) built on Tauri 2 + Rust with a React 19 frontend, extended with a Go command-line companion (termi-go) for automation: agent runs, MCP, skills, and project…

99apps-id/termigo · 3 tokens

termigo CLAUDE.md

Instructions for 99apps-id/termigo, a project described as: Termigo is a lightweight open-source, terminal-first AI-native development environment (ADE) built on Tauri 2 + Rust with a React 19 frontend, extended with a Go command-line companion (termi-go) for automation: agent runs, MCP, skills, and project…

99apps-id/termigo · 4 tokens