AGENTS.md for LynxThe AGENTS.md file is similar to README.md, but it's for agents.
In this document, you'll learn how to add a suitable AGENTS.md for your Lynx project, ensuring your agents can perform at their best within your Lynx project.
We've included AGENTS.md in the initial project template. You can refer to Quick Start to create a new Lynx project. The project's root directory will contain a pre-written AGENTS.md file.
AGENTS.md to an Existing ProjectFor Lynx projects, you can start with this file and then modify it according to your project needs:
AGENTS.mdBelow is an example; please add the "Read in Advance" section to your project's AGENTS.md:
AGENTS.md in a MonorepoIn a monorepo, you can add an AGENTS.md file to each subproject to provide specific guidance and information to agents for each subproject. This helps ensure that agents can optimize and adapt to the needs and characteristics of their respective sub-projects.
However, you can use AGENTS.md in the monorepo root directory as a global guideline file, providing general information and guiding principles.
For example:
In this example, you should place Lynx-specific guidance and information in packages/lynx/AGENTS.md.
For example, when agents process tasks under package-d, they should first refer to packages/lynx/package-d/AGENTS.md, then packages/lynx/AGENTS.md, and finally the AGENTS.md in the root directory.
Organizing the AGENTS.md files in a tree structure avoids repetitive writing of the same information and ensures that agents can access the most relevant and up-to-date guidance. However, developers should ensure that the information in the various AGENTS.md files does not conflict with each other to avoid causing abnormal agent behavior.
llms.txt as AGENTS.mdIf agents are not reading the Lynx documentation as required, consider inlining or overwriting the contents of llms.txt into AGENTS.md.
It is recommended to use this method only for public AGENTS.md files to avoid duplicate content across multiple files and to override customized instructions for specific subprojects.
If you want to keep llms.txt up-to-date, you can add the above command to the prepare script in your package.json (or root package.json for monorepo). Remember to gitignore the generated AGENTS.md file to avoid committing it to version control.
Ensure that the "Read in Advance" section is correctly added to AGENTS.md, explicitly stating that agents must read llms.txt.
If the problem persists, consider inlining the contents of llms.txt directly into AGENTS.md, as shown in the example above.