The Large Language Model Markdown Format (LLMD) is a structured text format designed to facilitate natural language interactions between human users and Large Language Models (LLMs) in programming contexts. This document specifies the structure, components, and usage of LLMD.
An LLMD document consists of the following sections in order:
- Project Header
- Meta Section (including Instructions and Tools)
- Mission Section
- Code Context Section
- Changelog Section
- Conversation Thread Section
The project header is the first line of the document and follows this format:
# Project: [Project Name]
The meta section includes the format identifier, instructions, and available tools:
## Meta: LLMD (Large Language Model Markdown Format)
[Description of LLMD and its purpose]
### Instructions
[List of instructions for using LLMD]
### Tools
[Description of available tools and their usage]
The mission section describes the main goal or purpose of the project:
## Mission
[Project mission statement]
The code context section contains the current state of the project's code files:
## Code Context
### [filename.ext]
```[language]
[File content]
### 2.5 Changelog Section
The changelog section lists changes made to the project:
```markdown
## Changelog
- [Change description]
The conversation thread section contains the dialogue between the human and the LLM:
## Conversation Thread
### Entry [Number]
**Human:** [Human's message]
**Assistant:** [LLM's response]
The SEARCH / REPLACE tool is used for modifying existing code. The filepath must be specified before the SEARCH block:
[filepath]
<<<<<< SEARCH
[Original code]
=======
[Modified code]
>>>>>> REPLACE
The SEARCH_MISSION / REPLACE_MISSION tool is used to update the project's mission statement:
<<<<<< SEARCH_MISSION
[Original mission statement]
=======
[Updated mission statement]
>>>>>> REPLACE_MISSION
The CHANGELOG tool is used to add entries to the project's changelog:
<<<<<< CHANGELOG
[Change description]
>>>>>> CHANGELOG
When modifying code:
- Specify the filepath before the SEARCH block
- Include enough context in the SEARCH block to uniquely identify the code section
- Provide the complete updated code in the REPLACE block
When updating the mission:
- Include the entire current mission statement in the SEARCH_MISSION block
- Provide the complete new mission statement in the REPLACE_MISSION block
When adding to the changelog:
- Provide a concise description of the change
- Each entry will be automatically formatted as a list item
- Maintain clear and concise communication in the conversation thread
- Use code blocks for code snippets or examples within the conversation
- Keep the code context up-to-date with all changes made during the conversation
- Add changelog entries for all significant changes or additions to the project
- Refer to specific line numbers or functions when discussing code to maintain clarity
When implementing LLMD:
- Validate and sanitize all inputs to prevent potential security issues
- Implement appropriate access controls for code modification operations
- If code execution is implemented, ensure it's done in a secure, sandboxed environment