Files
mintlify__docs/zh/agent/workflows.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

75 lines
3.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: "工作流程"
description: "在文档编写流程中使用 agent 的示例。"
keywords: ["agent 工作流", "文档工作流", "自动化示例"]
---
agent 可以协助完成多种文档相关任务。以下工作流程展示了几种将 agent 集成到文档工作流程中的方式。选择一种符合你团队当前工作方式的方案,并根据你的具体需求进行调整。
<div id="iterate-on-a-prompt-in-a-slack-thread">
## 在 Slack 线程中迭代优化提示
</div>
先向 agent 发送提示,然后在同一条线程中继续使用 `@mintlify` 提及它,以便改进和迭代它创建的拉取请求(PR;亦称“合并请求”/Merge Request)。
例如:`@mintlify Our quickstart page needs a new section on inviting collaborators`。然后:`@mintlify The new section should be called "Inviting collaborators"`。接着根据需要继续进行其他迭代。
<div id="start-with-the-agent-finish-manually">
## 先让 Agent 着手,再手动完成
</div>
先向 Agent 下指令开始一个项目,然后检出它创建的 branch,在本地环境或网页版编辑器中完成任务。Agent 可以帮助你起步,之后你便可接手完成剩余工作。
例如:`@mintlify Update the quickstart page to include information about inviting collaborators`,然后检出该 branch,并使用你偏好的方式进行额外修改。
<div id="update-docs-when-merging-feature-changes">
## 在合并功能改动时更新文档
</div>
当你合并功能拉取请求(PR)后,将该 PR 链接分享给智能代理(agent),以便更新相关文档。
例如:`@mintlify This PR adds a new authentication method. Update the docs to include the new auth flow: [PR link]`.
<div id="generate-release-notes-from-a-pull-request">
## 从拉取请求生成发布说明
</div>
向 Agent 指定某个拉取请求,根据提交历史生成发布说明或更新日志。
例如:`@mintlify Generate release notes for this PR: [PR link]`。
<div id="generate-code-examples">
## 生成代码示例
</div>
通过向助手发送指令,让其在整个文档或特定页面为功能生成代码示例。
例如:`@mintlify 生成一个代码示例,让认证方法更容易理解`。
<div id="review-existing-content">
## 审核现有内容
</div>
让助手审核现有内容的技术准确性、风格、语法或其他方面的问题。
例如:`@mintlify Review the API rate limiting section. We changed limits last month`.
<div id="respond-to-user-feedback">
## 响应用户反馈
</div>
向智能助手提供用户的反馈,让它对文档进行有针对性的更新。
例如:`@mintlify Users are getting confused by step 3 in the setup guide. What might be making it unclear?`.
<div id="automate-with-the-api">
## 使用 API 实现自动化
</div>
将 agent 集成到你现有的自动化工具中,用于在代码发生变更时自动更新文档、触发文档审阅,或在多个仓库之间同步文档更新。
使用 agent 的端点接口来[创建任务](/zh/api-reference/agent/create-agent-job)、[获取指定任务](/zh/api-reference/agent/get-agent-job)以及[获取所有任务](/zh/api-reference/agent/get-all-jobs)。
通过 API 创建任务时,你可以使用 `asDraft` 参数(默认为 `true`)控制拉取请求是否以草稿模式打开。将 `asDraft: false` 设置为创建非草稿拉取请求,使其在自动化工作流中可以立即进行审阅和合并。
在[代码合并后自动更新文档](/zh/guides/automate-agent)教程中了解如何设置 API 自动化。