Auto-sync: 2026-04-22 12:02
This commit is contained in:
33
wiki/concepts/AGENTS.md.md
Normal file
33
wiki/concepts/AGENTS.md.md
Normal file
@@ -0,0 +1,33 @@
|
||||
---
|
||||
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 辅助编程的工作流理念
|
||||
Reference in New Issue
Block a user