Language Agnostic Module Representation A proposal for Language-Agnostic Module Representation (LAMP) introduces an intermediate artifact that captures software modularity before code generation, aiming to improve code structure from AI coding assistants. LAMP defines module boundaries, encapsulation, and contracts through a directory of Markdown files, enabling human review and constraining generation to honor modular intent. A proposal for an intermediate representation that captures software modularity before code is generated. 1. Overview 1.1 Motivation Agentic coding assistants generate code that compiles and passes tests. Depending on the model and context size, the generated code often lacks coherent modular structure and code hygiene. The artifacts that feed generation don't address modularity. - Requirements and tests describe behavior, not decomposition. - Design and tasks describe approach, not module contracts. Language-Agnostic Module rePresentation LAMP fills the gap with a reviewable artifact that commits to modular intent before code exists: what each module encapsulates and exposes, the capability contracts the agent must honor, and a modularity audit that gates generation rather than reviewing it afterward. 1.2 What LAMP is LAMP sits between architectural component-level design and code. It captures a system's modular structure in a form reviewable before any implementation exists. The agent or human generating code is then constrained where it matters module boundaries, encapsulation, observable contracts and free where it doesn't types, languages, data structures, concurrency . It also shrinks the context window, saving token costs. LAMP serves two goals: Module Review: a target for human review and modularity auditing before code changes. Code Generation: a contract the agent honors when producing code and tests. LAMP is part of a software development pipeline: DESIGN → decompose into modules around encapsulated decisions LAMP → generate implementation honoring the contracts CODE LAMP rests on four principles drawn from established modularity practice: Information hiding. Each module is organized around a design decision it encapsulates. Callers depend on the interface. The encapsulated decision can change without disturbing them. Deep abstractions. A module's value is proportional to how much implementation it hides behind how small an interface. Decomposition by change axis. Modules are drawn around what is likely to change, not around data structure or algorithm steps. Stable contracts. A module's interface is more stable than its implementation, and more stable than the requirements that motivated it. 2. Document layout A LAMP artifact is a directory of Markdown files. lamp/ capability.md capability registry modules.md All module manifests A single file is the default because LAMP modules are small. When a system has many modules or capabilities and a single file grows unwieldy, split them across several files. Name a module file with a module prefix e.g., module-