generate-agent-instructions

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese
Analyze this codebase to generate or update
AGENTS.md
for guiding AI coding agents.
Important: You can completely ignore the CLAUDE.md file, if it exists, as it's a duplicate of AGENTS.md.
Do a full deep dive into the codebase so AI agents always have enough context to prevent them making assumptions and mistakes.
Focus on discovering the essential knowledge that would help an AI agent be immediately productive in this codebase. Consider aspects like:
  • The "big picture" architecture that requires reading multiple files to understand - major components, service boundaries, data flows, and the "why" behind structural decisions
  • Critical developer workflows (builds, tests, debugging) especially commands that aren't obvious from file inspection alone
  • Project-specific conventions and patterns that differ from common practices
  • Integration points, external dependencies, and cross-component communication patterns
Source existing AI conventions from
AGENTS.md
.
Guidelines:
  • If
    AGENTS.md
    exists, merge intelligently - preserve valuable content while updating outdated sections
  • Write concise, actionable instructions (~20-50 lines) using markdown structure
  • Include specific examples from the codebase when describing patterns
  • Avoid generic advice ("write tests", "handle errors") - focus on THIS project's specific approaches
  • Document only discoverable patterns, not aspirational practices
  • Reference key files/directories that exemplify important patterns
Update
AGENTS.md
for the user, then ask for feedback on any unclear or incomplete sections to iterate.
分析当前代码库,生成或更新用于指导AI编码Agent的
AGENTS.md
文件。
注意:如果存在CLAUDE.md文件,你可以完全忽略它,因为它是AGENTS.md的副本。
请深入全面地调研代码库,确保AI Agent总能获得足够的上下文,避免它们做出错误假设和操作失误。
重点挖掘能帮助AI Agent快速上手该代码库开展工作的核心知识,可参考以下维度:
  • 需要跨多个文件梳理才能理解的“全局”架构:核心组件、服务边界、数据流,以及架构决策背后的设计考量
  • 关键的开发者工作流(构建、测试、调试),尤其是仅通过查看文件无法明确得知的命令
  • 和通用实践有差异的项目特有规范与模式
  • 集成点、外部依赖,以及跨组件通信模式
从现有
AGENTS.md
中提取已有的AI相关规范。
编写规范:
  • 如果
    AGENTS.md
    已存在,请智能合并内容:保留有价值的内容,同时更新过时的部分
  • 使用markdown结构编写简洁、可落地的指引(约20-50行)
  • 描述模式时请包含代码库中的具体示例
  • 避免通用建议(比如“编写测试”、“处理错误”),重点突出本项目的特定实现方式
  • 仅记录已实际存在的模式,不要写预期实现但还没做的实践
  • 引用能体现重要模式的关键文件/目录
为用户更新
AGENTS.md
后,可针对任何不明确或不完整的部分询问用户反馈,以便迭代优化。