Files
nexus/wiki/concepts/AGENTS.md.md
2026-04-22 12:02:55 +08:00

34 lines
1.1 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
title: "AGENTS.md"
type: concept
tags: [opencode, project-context, agent]
sources: [如何在ubuntu上安装opencode并配置vibe-kanban]
last_updated: 2026-04-22
---
## Definition
**AGENTS.md** 是 OpenCode 为项目自动生成的角色定义文件,位于项目根目录,包含项目结构、编码规范、约定俗成等上下文信息,帮助 AI 理解项目的整体背景。
## Generation
运行 `/init` 命令后OpenCode 会自动分析项目结构并生成 `AGENTS.md`
```bash
cd /path/to/project
opencode
/init
```
## Best Practices
- **纳入版本控制**OpenCode 官方建议将 AGENTS.md 提交到 Git以获得一致的跨团队体验
- **持续维护**:随着项目演进,定期更新 AGENTS.md 以反映最新的架构决策
- **具体示例**:提供代码示例和模式说明,帮助 AI 生成符合项目风格的代码
## Related Concepts
- [[OpenCode]] — 生成和使用 AGENTS.md 的核心工具
- [[Plan Mode]] — 利用 AGENTS.md 提供充足上下文以生成精准方案
- [[Vibe Coding]] — AI 辅助编程的工作流理念