# AGENTS.md — Open Format for Coding Agent Instructions > AGENTS.md defines a predictable instruction file for coding agents: dev env tips, tests, PR rules, and repo context. Drop it at repo root. ## Install Save in your project root: ## Quick Use 1. Install / run: ```bash cat > AGENTS.md <<'MD' # Project AGENTS.md ## Dev environment tips - Prefer the project package manager (pnpm/uv/poetry) and keep commands reproducible. - Run the smallest test suite first, then full CI before merging. ## Testing instructions - Find the CI plan under `.github/workflows/`. - Run unit tests locally before pushing. ## PR instructions - Keep PRs small and link to the issue/task. - Never merge red CI. MD ``` 2. Start / smoke test: ```bash sed -n '1,200p' AGENTS.md ``` 3. Verify: - Ask your coding agent to follow only the instructions in `AGENTS.md` for one small change (run tests + lint + PR notes). ## Intro AGENTS.md defines a predictable instruction file for coding agents: dev env tips, tests, PR rules, and repo context. Drop it at repo root. - **Best for:** Repos that want a single, stable place to tell any coding agent how to build, test, lint, and submit PRs - **Works with:** Any coding agent as long as you point it to a repo-root instruction file (AGENTS.md) - **Setup time:** 10 minutes ## How to Use It Well - Setup time ~10 minutes (write a minimal AGENTS.md and iterate) - One file, repo-root convention: reduces repeated “how do I run tests here?” prompts across tasks - GitHub stars + forks (verified): see Source & Thanks The point is predictability. A coding agent can only be reliable if it knows your exact build/test steps and how you expect PRs to look. Write those once, keep them versioned, and require agents to follow them. ### FAQ **Q: Is AGENTS.md required?** A: No. It’s an open convention. Use it when you want consistent, tool-agnostic agent guidance. **Q: What should I put in it first?** A: Start with install/test/lint commands and any repo-specific gotchas (monorepo filters, env vars). **Q: Does it replace README?** A: No. Treat it as an agent-focused companion: tighter, action-oriented, and focused on dev workflows. ## Source & Thanks > Source: https://github.com/agentsmd/agents.md > License: MIT > GitHub stars: 21,215 · forks: 1,554 --- ## 快速使用 1. 安装 / 运行: ```bash cat > AGENTS.md <<'MD' # Project AGENTS.md ## Dev environment tips - Prefer the project package manager (pnpm/uv/poetry) and keep commands reproducible. - Run the smallest test suite first, then full CI before merging. ## Testing instructions - Find the CI plan under `.github/workflows/`. - Run unit tests locally before pushing. ## PR instructions - Keep PRs small and link to the issue/task. - Never merge red CI. MD ``` 2. 启动 / 冒烟测试: ```bash sed -n '1,200p' AGENTS.md ``` 3. 验证: - Ask your coding agent to follow only the instructions in `AGENTS.md` for one small change (run tests + lint + PR notes). ## 简介 AGENTS.md 是面向 coding agent 的统一说明文件:放在仓库根目录,集中写清开发环境、测试命令、PR 规则与 repo 结构。把“项目怎么做事”写一次,后续任务复用,显著减少重复解释与幻觉。 - **适合谁:** 希望用一份稳定文档告诉任何 coding agent:怎么装依赖、跑测试、修 lint、提 PR 的项目 - **可搭配:** 只要你的 coding agent 能读取仓库根目录指令文件(AGENTS.md)即可 - **准备时间:** 10 分钟 ## 实战建议 - 配置约 10 分钟(先写最小版 AGENTS.md,再逐步补全) - 一个文件统一约定:减少每次任务重复问“怎么跑测试/怎么提 PR” - GitHub stars + forks(已核验):见「来源与感谢」 核心是可预测性。coding agent 想稳定,就必须知道你仓库的真实构建/测试步骤,以及你期望的 PR 规范。把这些写一次、跟代码一起版本化,并要求代理严格遵守。 ### FAQ **AGENTS.md 是强制要求吗?** A: 不是。它是开放约定:当你希望“任何 agent 都能按同一套规则做事”时很有用。 **第一版应该先写什么?** A: 先写安装依赖、跑测试、跑 lint 的命令,以及仓库特有的坑(monorepo 过滤、环境变量)。 **它会取代 README 吗?** A: 不会。更像面向 agent 的“行动版 README”:更短、更具体、更偏开发流程。 ## 来源与感谢 > Source: https://github.com/agentsmd/agents.md > License: MIT > GitHub stars: 21,215 · forks: 1,554 --- Source: https://tokrepo.com/en/workflows/agents-md-open-format-for-coding-agent-instructions Author: Prompt Lab