Files
mintlify__docs/zh/agent/customize.mdx
locadex-agent[bot] d7096d55cd docs(locadex): add translations (#2682)
Co-authored-by: locadex-agent[bot] <217277504+locadex-agent[bot]@users.noreply.github.com>
2026-01-14 08:13:45 -08:00

53 lines
2.5 KiB
Plaintext
Raw Permalink 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: "自定义 Agent 行为"
description: "使用 AGENTS.md 配置 Agent 如何处理文档相关任务。"
keywords: ["AGENTS.md", "Agent 配置", "自定义说明", "Agent 自定义"]
---
在你的存储库中创建一个 `AGENTS.md` 文件来自定义 Agent 的行为(`Agents.md` 也同样有效)。Agent 会读取此文件并遵循你提供的所有指令。
Agent 会在两个位置搜索 `AGENTS.md` 文件。它会先检查文档目录,然后检查存储库根目录。如果这两个位置都有 `AGENTS.md` 文件,Agent 将使用文档目录中的那个。
添加你希望 Agent 遵循的任何指令。Agent 会将这些指令追加到它的 system prompt(系统提示词)中,因此这些指令会应用于所有任务,无论你是在控制台中、在 Slack 上,还是通过 API 使用 Agent。
<div id="what-to-include-in-agentsmd">
## 在 AGENTS.md 中应包含的内容
</div>
可以考虑添加以下说明:
- **风格偏好**:与你的文档相关的文风、语气、格式和术语。
- **代码规范**:在示例中使用的编程语言、框架和编码约定。
- **内容要求**:针对不同类型页面应包含哪些部分或信息。
- **项目背景**:与你的产品、架构或用户群体相关的具体细节,用于制定文档相关决策。
<div id="example-agentsmd-file">
## AGENTS.md 文件示例
</div>
```markdown AGENTS.md
# Documentation agent instructions
## Code examples
- Use TypeScript for all code examples. Our users are primarily TypeScript developers.
- Always include error handling in API call examples.
- Show both success and error response examples for all endpoints.
- Include import statements at the top of code examples.
## API documentation standards
- Every endpoint must document: authentication requirements, rate limits, and common error codes.
- Use real-world parameter values in examples (not foo/bar placeholders).
- Include a complete request/response cycle for each endpoint.
## Style and formatting
- Write for developers with 2-5 years of experience. Don't oversimplify, but explain non-obvious concepts.
- Use active voice and second person ("you").
- Date format: ISO 8601 (YYYY-MM-DD).
- When referencing UI elements, use bold: **Settings** button.
## What to include
- Add prerequisite sections to guides when users need API keys, environment setup, or dependencies.
- Include "Next steps" sections linking to related documentation.
- Add troubleshooting sections for common issues we see in support tickets.
```