AGENTS.MD

AGENTS.md 中文模板:让 Codex 遵守项目规则

AGENTS.md 适合存放长期有效的仓库规则,例如项目命令、目录说明、测试要求和禁止事项。它能减少你每次重复交代上下文的成本。

推荐结构

# Project guide

## Project structure
- src/: application code
- tests/: automated tests

## Commands
- Install: npm install
- Test: npm test
- Lint: npm run lint

## Coding rules
- Keep public APIs backward compatible.
- Prefer existing helper functions and project patterns.
- Add tests for bug fixes.

## Safety
- Do not edit generated files.
- Do not commit secrets or production data.
- Ask before destructive data operations.

写 AGENTS.md 的原则

常见错误

不要把 AGENTS.md 写成百科全书。它应该是工程协作规则,而不是完整产品说明书。

直接使用工具页可以生成一份初稿,然后再按你的项目补细节。