agents-md

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Maintaining AGENTS.md

维护AGENTS.md

AGENTS.md is the canonical agent-facing documentation. Keep it minimal—agents are capable and don't need hand-holding.
AGENTS.md是面向Agent的规范文档。请保持极简风格——Agent具备相应能力,无需手把手指导。

File Setup

文件设置

  1. Create
    AGENTS.md
    at project root
  2. Create symlink:
    ln -s AGENTS.md CLAUDE.md
  1. 在项目根目录创建
    AGENTS.md
  2. 创建符号链接:
    ln -s AGENTS.md CLAUDE.md

Before Writing

编写前准备

Discover local skills to reference:
bash
find .claude/skills -name "SKILL.md" 2>/dev/null
ls plugins/*/skills/*/SKILL.md 2>/dev/null
Read each skill's frontmatter to understand when to reference it.
发现本地技能以供参考:
bash
find .claude/skills -name "SKILL.md" 2>/dev/null
ls plugins/*/skills/*/SKILL.md 2>/dev/null
阅读每个Skill的前置内容,了解何时引用它。

Writing Rules

编写规则

  • Headers + bullets - No paragraphs
  • Code blocks - For commands and templates
  • Reference, don't duplicate - Point to skills: "Use
    db-migrate
    skill. See
    .claude/skills/db-migrate/SKILL.md
    "
  • No filler - No intros, conclusions, or pleasantries
  • Trust capabilities - Omit obvious context
  • 标题+项目符号 - 不要使用段落
  • 代码块 - 用于命令和模板
  • 引用而非重复 - 指向技能:“使用
    db-migrate
    Skill。参见
    .claude/skills/db-migrate/SKILL.md
  • 无冗余内容 - 不要添加引言、结论或客套话
  • 信任Agent能力 - 省略明显的上下文信息

Required Sections

必填部分

Package Manager

包管理器

Which tool and key commands only:
markdown
undefined
仅注明工具和关键命令:
markdown
undefined

Package Manager

包管理器

Use pnpm:
pnpm install
,
pnpm dev
,
pnpm test
undefined
使用pnpm
pnpm install
,
pnpm dev
,
pnpm test
undefined

Commit Attribution

提交署名

Always include this section. Agents should use their own identity:
markdown
undefined
必须包含此部分。Agent应使用自身身份:
markdown
undefined

Commit Attribution

提交署名

AI commits MUST include:
Co-Authored-By: (the agent model's name and attribution byline)
Example:
Co-Authored-By: Claude Sonnet 4 <noreply@example.com>
undefined
AI提交必须包含:
Co-Authored-By: (Agent模型的名称和署名信息)
示例:
Co-Authored-By: Claude Sonnet 4 <noreply@example.com>
undefined

Key Conventions

关键约定

Project-specific patterns agents must follow. Keep brief.
Agent必须遵循的项目特定模式。保持简洁。

Local Skills

本地技能

Reference each discovered skill:
markdown
undefined
引用每个发现的技能:
markdown
undefined

Database

数据库

Use
db-migrate
skill for schema changes. See
.claude/skills/db-migrate/SKILL.md
使用
db-migrate
Skill进行架构变更。参见
.claude/skills/db-migrate/SKILL.md

Testing

测试

Use
write-tests
skill. See
.claude/skills/write-tests/SKILL.md
undefined
使用
write-tests
Skill。参见
.claude/skills/write-tests/SKILL.md
undefined

Optional Sections

可选部分

Add only if truly needed:
  • API route patterns (show template, not explanation)
  • CLI commands (table format)
  • File naming conventions
仅在真正需要时添加:
  • API路由模式(展示模板,不做解释)
  • CLI命令(表格格式)
  • 文件命名约定

Anti-Patterns

反模式

Omit these:
  • "Welcome to..." or "This document explains..."
  • "You should..." or "Remember to..."
  • Content duplicated from skills (reference instead)
  • Obvious instructions ("run tests", "write clean code")
  • Explanations of why (just say what)
  • Long prose paragraphs
需省略以下内容:
  • “欢迎来到...”或“本文档解释...”
  • “你应该...”或“记住要...”
  • 从技能中重复的内容(改为引用)
  • 显而易见的指令(如“运行测试”“编写整洁代码”)
  • 解释原因(只需说明做什么)
  • 冗长的段落

Example Structure

示例结构

markdown
undefined
markdown
undefined

Agent Instructions

Agent使用说明

Package Manager

包管理器

Use pnpm:
pnpm install
,
pnpm dev
使用pnpm
pnpm install
,
pnpm dev

Commit Attribution

提交署名

AI commits MUST include:
Co-Authored-By: (the agent model's name and attribution byline)
AI提交必须包含:
Co-Authored-By: (Agent模型的名称和署名信息)

API Routes

API路由

[Template code block]
[模板代码块]

Database

数据库

Use
db-migrate
skill. See
.claude/skills/db-migrate/SKILL.md
使用
db-migrate
Skill进行架构变更。参见
.claude/skills/db-migrate/SKILL.md

Testing

测试

Use
write-tests
skill. See
.claude/skills/write-tests/SKILL.md
使用
write-tests
Skill。参见
.claude/skills/write-tests/SKILL.md

CLI

CLI

CommandDescription
pnpm cli sync
Sync data
undefined
命令描述
pnpm cli sync
同步数据
undefined