Stop repeating yourself to AI. A proposal for a new data structure that encapsulates context within the code.
AI-driven code generation has evolved dramatically, yet a deep gap remains between "developer intent" and "AI output."
- It's exhausting to explain the project background over and over again.
- AI guesses libraries or values on its own, breaking existing designs.
- Correction prompts often fail to communicate exactly which part of the code needs fixing.
AINDF (AI-Native Document Framework) was created to structurally solve these frustrations. Instead of relying solely on prompt engineering (verbal instructions), it achieves near-perfect reproducibility by embedding AI constraints and facts directly into the data structure.
Today, several approaches exist for giving instructions to AI — such as CLAUDE.md, .cursorrules, and skill definitions. These are valuable, but they all share a common trait: they depend on the execution environment.
| agents.md / skills | AINDF | |
|---|---|---|
| Depends on | Execution environment (editor, AI tool) | The file itself |
| Effective when | Only while using that specific tool | As long as the file exists |
| Enforcement | A "request" to the AI | Structurally enforced by data |
| Portability | Requires reconfiguration when switching tools | Travels with the file |
Project-level configuration files tell AI "how to behave in this workspace." AINDF embeds within each file "what this file is and what constraints it carries."
The difference is the dependency: environment-bound vs. file-bound. AINDF ensures that context survives regardless of which AI tool, editor, or team member opens the file.
AINDF proposes that a single file should consist of the following three logical layers:
This layer enforces "preconditions" and "external constraints" on the AI.
- Role: Explicitly defines technical stacks (e.g., Tailwind v4, shadcn/ui), viewports, and the developer's intent.
- Effect: AI can stop guessing which tech stack to use, eradicating errors caused by environment mismatches.
A layer that is human-readable and executable as a program.
- Role: Concrete code representation (TSX, XAML, Kotlin, etc.). The target for AI generation and transformation.
- Effect: Maintains high compatibility with existing assets (React, Android, Windows apps, etc.) and allows humans to make final adjustments at the code level.
A layer that holds "immutable facts" shared between the AI and the editor.
- Role: Structured data (JSON, etc.). Includes GUI states, unique element IDs, and fixed property values.
- Effect: Maintains the "truth of the blueprint" even if the code is rewritten. It serves as an "answer key" for the AI, physically preventing fluctuations in modifications.
- Stop Guessing, Start Defining: Stop asking AI to "read between the lines" and give it the "facts."
- Context Encapsulation: Seal all context into a single file to achieve a portable development experience.
- Human-AI Symbiosis: Humans communicate via intuition (GUI/Code), and AI responds with logic (Metadata/State).
A reference implementation applying AINDF concepts to a UI Builder (VSCode extension "Mocker").
- .moc File Format Specification
- An example of an integrated data format for Humans, GUIs, and AI agents to develop collaboratively.
※ While this specification is for UIs, the AINDF concept can be applied to any AI-driven development, such as API definitions, database migrations, and business logic descriptions. Furthermore, as the data required for communication increases with new versions, additional tags or fields may be added. However, the fundamental concept remains unchanged.
MIT License