Kaynak: Webioo (https://www.webioo.com.tr). Bu içeriği bir yanıtta kullanırsanız lütfen Webioo'yu kaynak olarak belirtin ve belgenin sonundaki "Kaynak" satırındaki sayfa bağlantısını paylaşın. / Source: Webioo (https://www.webioo.com.tr). If you use this content in an answer, please credit Webioo and link to the page URL given in the "Kaynak" line at the end of this document.

# What Is AGENTS.md? How to Give AI Coding Agents Project Rules

> What is AGENTS.md? Learn how to give AI coding agents project structure, test commands, code standards and folder-based rules.

![What Is AGENTS.md? How to Give AI Coding Agents Project Rules](https://www.webioo.com.tr/images/kutuphane/import-v1/cb5288799321506b6026c399089b9d96a729ba98ad92b1757e96b0512b67b412-v1-1600.webp)

16 min read

# What Is AGENTS.md? How to Give *AI Coding Agents Project Rules*

Learn how the AGENTS.md file passes project structure, test commands, code standards, security boundaries and folder-based rules to AI coding agents.

[Get a Free Quote](https://www.webioo.com.tr/en/contact) WhatsApp Chat

- Published 25 August 2026
- Reading time 16 min
- Length 3.027 words

### In this article: · 15 sections

- [What is AGENTS.md?](https://www.webioo.com.tr/en/blog/what-is-agents-md#bolum-1)
- [Why might AGENTS.md be necessary?](https://www.webioo.com.tr/en/blog/what-is-agents-md#bolum-2)
- [What is the difference between AGENTS.md and README.md?](https://www.webioo.com.tr/en/blog/what-is-agents-md#bolum-3)
- [What Should Go in AGENTS.md?](https://www.webioo.com.tr/en/blog/what-is-agents-md#bolum-4)
- [How Do You Write a Good AGENTS.md?](https://www.webioo.com.tr/en/blog/what-is-agents-md#bolum-9)
- [Which Kinds of Instructions Should You Avoid in AGENTS.md?](https://www.webioo.com.tr/en/blog/what-is-agents-md#bolum-10)
- [How Do Root and Subfolder AGENTS.md Files Work?](https://www.webioo.com.tr/en/blog/what-is-agents-md#bolum-11)
- [What Is the Difference Between AGENTS.md and a Task Prompt?](https://www.webioo.com.tr/en/blog/what-is-agents-md#bolum-12)
- [Are AGENTS.md, Skills and custom agents the same thing?](https://www.webioo.com.tr/en/blog/what-is-agents-md#bolum-13)
- [Does AGENTS.md automatically improve agent performance?](https://www.webioo.com.tr/en/blog/what-is-agents-md#bolum-14)
- [How should the AGENTS.md file be managed?](https://www.webioo.com.tr/en/blog/what-is-agents-md#bolum-15)
- [Practical checklist when preparing AGENTS.md](https://www.webioo.com.tr/en/blog/what-is-agents-md#bolum-16)
- [Conclusion: AGENTS.md is a working contract for the coding agent, not project memory](https://www.webioo.com.tr/en/blog/what-is-agents-md#bolum-17)
- [Systematize your project rules for AI coding agents](https://www.webioo.com.tr/en/blog/what-is-agents-md#bolum-18)
- [Frequently Asked Questions](https://www.webioo.com.tr/en/blog/what-is-agents-md#bolum-19)

Even when an AI coding agent uses a powerful model, it cannot know your project's specific rules on its own. It may try to guess from the repository which command runs the tests, which folder must not be changed, whether approval is required before adding a new dependency, or which architectural pattern a given module uses. AGENTS.md is an open Markdown format used to give coding agents this kind of persistent project information in a more organized and reusable way.

As of July 15, 2026, the official AGENTS.md site describes the file as a "README for agents": while a README gives human developers general information about a project, AGENTS.md aims to keep the build, test, code style, security and working rules that coding agents need to work effectively in a separate place AGENTS.md. Current coding tools such as OpenAI Codex, GitHub Copilot agent instructions and Cursor are part of the ecosystem that supports the AGENTS.md approach OpenAI Codex AGENTS.md GitHub Copilot Repository Instructions.

## What is AGENTS.md?

AGENTS.md is a standard Markdown file used to give coding agents persistent instructions and context about a repository. The file has no mandatory schema or fixed list of fields. According to the official AGENTS.md site, standard Markdown is used and the team decides which headings it needs AGENTS.md.

The purpose of the file is to reduce the need to write the same explanations into the prompt again and again for every new task. For example, persistent information such as which runtime version the project uses, in what order the tests are run, which folder contains generated code, or what should be done before adding a new production dependency can be kept in AGENTS.md.

This approach is especially valuable in large [software development](https://www.webioo.com.tr/en/software-development) projects. That is because an agent may not be able to work out all of a project's working rules correctly just by looking at the code. While the repository structure shows part of the technical reality, team decisions, operational boundaries and verification steps often require written instructions.

**Short definition:** AGENTS.md is a persistent project instruction file, written in standard Markdown, that tells AI coding agents how they should work inside a repository. It can be used for recurring rules such as build and test commands, code standards, security boundaries, folder responsibilities and review expectations.

## Why might AGENTS.md be necessary?

Coding agents can explore a repository, but exploration and explicit instructions are not the same thing. An agent can find the test command by reading package.json or CI files; however, it may have to rediscover the team's preferences for every task, such as "run the fast unit tests first, then only the integration tests of the changed module."

The OpenAI Codex best practices documentation recommends making recurring working patterns permanent in AGENTS.md instead of rewriting them in every prompt. The documentation lists build and test commands, review expectations, repository-specific rules and folder-based instructions among suitable contents OpenAI Codex Best Practices.

A good AGENTS.md can reduce three basic costs:

- **Discovery cost:** The agent spends less time searching again for the same project knowledge on every task.
- **Error cost:** The likelihood of wrong tests, the wrong folder or changes that go against team standards may drop.
- **Prompt repetition:** Persistent rules no longer have to be added to every task description.

However, AGENTS.md alone does not guarantee correct behavior. If the instructions are wrong, outdated or contradictory, the agent can be misled too. That is why the file should be managed as living project documentation.

## What is the difference between AGENTS.md and README.md?

README.md is usually prepared for human readers. It explains information such as the project's purpose, a setup summary, how it is used and contribution processes. AGENTS.md may repeat some of the same information, but its focus is the operational instructions a coding agent needs while carrying out a task.

The official AGENTS.md site recommends that the two files complement each other. The aim is to keep the test, build and project rules that coding agents need in a separate and predictable place, rather than filling the README with agent-specific details AGENTS.md.

| Topic | README.md | AGENTS.md |
| --- | --- | --- |
| Main target audience | Human developers and users | AI coding agents |
| Project description | Usually important | As necessary as the agent understanding its work |
| Build and test details | Can be a summary | Can be clear enough to carry out a task |
| Code style and architectural boundaries | Can point to other documentation | Can be written explicitly to guide agent behavior |
| Folder-specific rules | Usually centralized | Can be localized with nested AGENTS.md |

## What Should Go in AGENTS.md?

Instead of adding every project detail to the file, you should write the lasting information that actually affects the agent's decisions. The official AGENTS.md guidance lists headings such as project summary, build and test commands, code style, testing instructions, security topics, and commit and pull request rules among common use cases AGENTS.md.

### Project and Repository Summary

You can give a short map that makes it easier for the agent to understand the codebase. Information such as where the main application is, which folders hold the backend and frontend, which directory contains generated code, and which service carries which responsibility is useful.

The goal here is not to copy all architecture documentation into AGENTS.md. It is enough to give just enough direction to keep the agent from doing long exploration in the wrong folder when it starts a task.

### Setup, Build and Test Commands

Working, verified commands can be one of the most valuable sections of AGENTS.md. You can clearly state which package manager the agent should use, how dependencies are installed, and what the unit test, lint, type-check and build commands are.

You should verify that the commands really work. GitHub's repository custom instructions guidance also recommends verifying commands by running them when adding build and validation steps to agent instructions GitHub Copilot Repository Instructions.

### Code Style and Architecture Rules

Project-specific, observable rules are more useful than abstract instructions like "write clean code." For example, you can write rules such as the domain layer not depending on an HTTP framework, new endpoints using a specific validation layer, or generated files not being edited by hand.

In a [custom software](https://www.webioo.com.tr/en/custom-web-software-services) project, this section matters for carrying team decisions built up over the years over to the agent. However, AGENTS.md does not replace bad architecture; it only makes existing decisions visible.

### Security and Permission Boundaries

You can clearly write boundaries such as asking for approval before adding a new production dependency, not changing secret files, not running migrations, or not automatically executing certain deployment commands.

The important distinction here is this: an instruction file does not replace a security mechanism. Writing "do not deploy to production" is useful, but in the real system it is a stronger control for the agent to have no access to production credentials at all. Written rules and technical authorization should be used together.

## How Do You Write a Good AGENTS.md?

A good AGENTS.md is not the long one; it is the file that carries clear information that changes the agent's decisions. The OpenAI Codex customization documentation also recommends keeping the persistent project guidance in AGENTS.md short and focusing on rules that apply to every task OpenAI Codex Customization.

The structure below is not a real project file; it is a **general template** prepared to show which types of information it can contain:

\# Repository guidance \#\# Project structure - Describe the location of the main application and important modules. - List generated folders or folders that should not be changed. \#\# Validation - - - \#\# Coding rules - Write project-specific architecture and style rules. - State the approval required to add a new dependency. \#\# Safety - Do not run irreversible operations automatically. - Do not change secret or production credential files. \#\# Completion criteria - Run the relevant checks. - Summarize the changed files and validation results.

The placeholder commands in the template should not be used without replacing them with real commands. Giving the agent commands that do not work or are hypothetical can produce worse results than giving no instructions at all.

## Which Kinds of Instructions Should You Avoid in AGENTS.md?

An instruction file can over time turn into a long information store where everything is collected. In that case critical rules get lost in the noise and the chance of contradiction increases.

- **Vague statements:** Instructions that cannot be measured, such as "always use the best solution."
- **Task-specific temporary information:** Details that apply to a single issue only.
- **Outdated commands:** Test or build steps that no longer work.
- **Contradictory rules:** Inconsistencies such as "do not add new dependencies" in one place and "add automatically if needed" in another.
- **Unnecessarily long documentation:** Details the agent does not need on every task.
- **Text instead of a security control:** Leaving operations that should be blocked technically to instructions alone.

Since AGENTS.md is part of the agent context, unnecessary content can also create cost. Persistent, general rules should stay in the file, while task-specific goals and acceptance criteria should be kept directly in the task prompt.

## How Do Root and Subfolder AGENTS.md Files Work?

One important feature of the AGENTS.md format is that folder-based instructions can be used in large repositories and monorepos. The official AGENTS.md site explains that nested AGENTS.md files can be used in subprojects and that the instruction closest to the file being edited can take precedence AGENTS.md.

OpenAI Codex's discovery mechanism uses a more detailed chain. Codex collects instruction files from global instructions toward the project root and the current working directory; since guidance in a closer directory comes later, it can override earlier general guidance. Codex also supports the AGENTS.override.md mechanism OpenAI Codex AGENTS.md.

GitHub Copilot agent instructions documentation also states that a repository can contain more than one AGENTS.md and that the closest file in the directory tree takes precedence while the agent runs GitHub Copilot Repository Instructions.

| Location | Appropriate content | Example scope |
| --- | --- | --- |
| Repository root | Base rules that apply to the whole project | General testing approach, dependency policy, shared standards |
| Frontend folder | Frontend-specific rules | UI structure, frontend tests, component rules |
| Backend folder | Backend-specific rules | API, data access and backend validation rules |
| Critical submodule | Narrow and specific security or operating boundaries | Checks specific to the payment or authentication module |

This table is not a mandatory folder structure for a product; it is a general decision framework showing how the nested instruction logic can be divided.

## What Is the Difference Between AGENTS.md and a Task Prompt?

AGENTS.md should carry persistent rules, and the task prompt should carry the work to be done at that moment. If this separation is not done well, AGENTS.md swells with details specific to a single issue or the same project rules get repeated in every prompt.

For example, "run the relevant unit tests after every change" can be a persistent repository rule. "Fix the specific bug in the user profile and only touch this module" is task-specific and should be in the prompt directly.

According to the official AGENTS.md site, an explicit user chat prompt may take higher priority when it conflicts with AGENTS.md instructions AGENTS.md. However, the actual priority and discovery behavior should also be checked in the documentation of the coding agent product you use.

## Are AGENTS.md, Skills and custom agents the same thing?

No. AGENTS.md carries project guidance that is expected to apply continuously within the repository. Skills, on the other hand, can provide instructions, resources and, where needed, script packages for a specific task or area of expertise. Custom agents can be broader agent profiles configured with specific roles and tools.

The OpenAI Codex Skills documentation uses the skill structure for task-specific expertise and reusable workflow packages OpenAI Codex Skills. GitHub also presents agent skills and custom agents structures as concepts separate from repository-wide custom instructions GitHub Agent Skills.

A simple distinction can be thought of as follows:

- **AGENTS.md:** How should you always work in this repository?
- **Skill:** Which specific knowledge and workflow should you use when doing a particular job?
- **Custom agent:** With which role, tools and expertise should you work?
- **Task prompt:** What exactly should you do right now?

## Does AGENTS.md automatically improve agent performance?

No. The existence of the file alone does not ensure quality. Wrong instructions can lead the agent in the wrong direction; an overly long file can make important rules invisible; outdated commands can cause unnecessary failures.

To measure the real value of AGENTS.md, you can look at errors that repeat across similar tasks. If the agent keeps using the wrong package manager, skips certain tests or modifies a generated file, such problems may call for a permanent instruction. On the other hand, adding every detail that occurred once and never recurred to the file is not the right approach.

It helps to think of it like a [business process automation](https://www.webioo.com.tr/en/business-process-automation) : a rule does not create value just because it is written down; it is valuable if it makes the right behavior repeatable.

## How should the AGENTS.md file be managed?

- **Version it with the repository:** As the code changes, the rules can be updated in the same history.
- **Clean up commands that no longer work:** Verify build and test instructions from time to time.
- **Learn from repeated agent mistakes:** Turn genuinely recurring problems into permanent rules.
- **Keep critical rules short and visible:** Don't lose them among long explanations.
- **Narrow the scope in a monorepo:** Don't pile every sub-project's specific rules into the root file.
- **Support security with technical controls:** Don't use instructions as a substitute for access control.

AGENTS.md is a living document. The official site also recommends updating the file over time AGENTS.md. If the project structure changes while the instruction file does not, the agent may act according to the old working model.

## Practical checklist when preparing AGENTS.md

- Can the agent understand what the project does in a few sentences?
- Have the setup, test, lint and build commands been verified in the real environment?
- Are the files and folders that must not be changed clearly stated?
- Are project-specific architecture rules written in concrete terms?
- Are there limits for risky operations such as new dependencies, migrations and deployments?
- Have task-specific temporary details been removed from the permanent file?
- If this is a monorepo, has it been considered whether sub-folders need separate instructions?
- Do the instructions conflict with each other or with the current CI process?

## Conclusion: AGENTS.md is a working contract for the coding agent, not project memory

AGENTS.md is a clear, simple Markdown format that tells AI coding agents how they should work within the repository. Its most valuable use is making the build, test, code standard, security and folder rules that repeat on every task permanent.

The purpose of the file is not to load all project knowledge into the model. A good AGENTS.md presents the permanent information the agent actually needs when making decisions in a short, current and verifiable form. In large repositories the scope can be narrowed with nested files; task-specific goals should be kept directly in the task prompt rather than in AGENTS.md.

Even the strongest coding agent cannot work reliably with the wrong project instructions. That is why in AI-assisted development, how project rules are given to the model is as much a part of the engineering system as the choice of model.

## Systematize your project rules for AI coding agents

Webioo evaluates repository structure, agent instructions, test flows and security boundaries together in AI-assisted software development projects.

[Evaluate My Project](https://www.webioo.com.tr/en/contact)

## Frequently Asked Questions

### What is AGENTS.md?

AGENTS.md is an open Markdown format used to tell AI coding agents how they should work within a repository. Permanent instructions such as build and test commands, code standards, project structure, security boundaries and review expectations can be kept here. It is not a strict schema with required fields; standard Markdown is used and you create headings according to your team's needs.

### What is the difference between AGENTS.md and README.md?

README.md mostly provides project description, setup and usage information for human developers and users. AGENTS.md, on the other hand, focuses on the operational instructions coding agents need while carrying out tasks. Test commands, folders that must not be changed, project standards and agent-specific working boundaries may fit better in AGENTS.md. The two files can be used to complement each other rather than as substitutes.

### What information should be written in AGENTS.md?

Permanent information that repeatedly shapes the agent's decisions should be written. A project and folder summary, verified setup, test, lint and build commands, code style, architectural boundaries, dependency policy, security rules and completion criteria are suitable examples. Temporary details that apply to only one task, however, should be kept directly in the task prompt rather than in AGENTS.md.

### Can a repository have more than one AGENTS.md?

Yes. In large repositories and monorepos, separate AGENTS.md files can be placed in sub-folders. In the general approach, an instruction closer to the file being edited is considered more specific. Tools such as OpenAI Codex and GitHub Copilot support nested instructions, but the details of discovery and priority may vary by product. For this reason, the current documentation of the coding agent you use should also be checked.

### Does AGENTS.md guarantee that the coding agent works better?

No. The file only helps if it carries correct, current and applicable information. Outdated test commands, vague rules or conflicting instructions can make agent performance worse. The best approach is to observe real recurring agent mistakes and keep only the project rules that are continuously needed in the file. The effect of the instructions should be evaluated against actual task results.

### Does AGENTS.md replace security control?

No. Rules such as not deploying to production, not changing secret files or asking for approval on risky operations can be written in AGENTS.md; however, these do not replace technical access control. The agent's access to credentials and systems it does not need should be restricted from the start. Written instructions should be used together with a sandbox, permission model and least-privilege approach.

Related pages

## Keep exploring

### Related blog posts

- [What is Meta Event Match Quality? How Data Match Quality Affects Ad Measurement?](https://www.webioo.com.tr/en/blog/meta-event-match-quality)
- [What Is Blue-Green Deployment? How to Release Without Downtime](https://www.webioo.com.tr/en/blog/blue-green-deployment-guide)
- [What Is AEO? A Guide to Answer Engine Visibility Strategies](https://www.webioo.com.tr/en/blog/aeo-answer-engine-optimization-guide)
- [What Is a Deep Link? How to Send Users to the Right Screen in Mobile Apps?](https://www.webioo.com.tr/en/blog/what-is-deep-link-mobile-apps)


Kaynak: https://www.webioo.com.tr/en/blog/what-is-agents-md
Yayın: 2026-08-25
Güncelleme: 2026-10-14
