Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions agent/github.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
---
title: "Use the agent on GitHub"
description: "Mention @mintlify in pull request comments to trigger documentation updates directly from GitHub."
keywords: ["GitHub", "pull request", "PR comments", "code review"]
---

Mention `@mintlify` in a pull request comment to trigger a documentation update. The agent reads the PR context—title, description, changed files, and your comment—then makes the appropriate documentation changes.

## Prerequisites

Your repository must have the [Mintlify GitHub App](/deploy/github) installed.

## How it works

Comment `@mintlify` followed by your instructions on any pull request where the GitHub App is installed. The agent reacts with an 👀 emoji while processing, then replies with a summary and a 👍 when finished.

Check warning on line 15 in agent/github.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

agent/github.mdx#L15

In general, use active voice instead of passive voice ('is installed').

The agent handles two scenarios based on whether the PR is in your docs repository or a separate code repository:

- **Same-repo PR** — The agent pushes commits directly to the PR branch. This applies to dedicated docs repos, monorepos where code and docs live together, and any PR in the repository connected to your Mintlify deployment.

Check warning on line 19 in agent/github.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

agent/github.mdx#L19

Don't put a space before or after a dash.

Check warning on line 19 in agent/github.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

agent/github.mdx#L19

Did you really mean 'monorepos'?
- **Cross-repo PR** — When the PR is in a different repository from your docs, the agent creates a new pull request in your docs repository with the relevant documentation updates, using the source PR's diff and description as context.

Check warning on line 20 in agent/github.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

agent/github.mdx#L20

Don't put a space before or after a dash.

## Mention the agent in a PR comment

Leave a comment on a pull request that includes `@mintlify` and your instructions:

```text
@mintlify Document the new /users endpoint added in this PR
```

The agent supports three types of PR comments:

- **Issue comments** — General comments on the PR conversation tab.

Check warning on line 32 in agent/github.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

agent/github.mdx#L32

Don't put a space before or after a dash.
- **Review comments** — Inline comments on specific lines of code. The agent receives the file path, line range, and diff context from your comment.

Check warning on line 33 in agent/github.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

agent/github.mdx#L33

Don't put a space before or after a dash.
- **Review body** — The summary text when you submit a review.

Check warning on line 34 in agent/github.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

agent/github.mdx#L34

Don't put a space before or after a dash.

## Follow up in the same PR

Send additional `@mintlify` comments on the same PR to iterate on the changes. The agent reuses the existing session, so it has context from previous interactions on that PR.

```text
@mintlify Also add a TypeScript code example to the new section
```

## Best practices

- **Be specific**: Tell the agent exactly what documentation to create or update and where it should go.
- **Use inline review comments**: When commenting on a specific code change, leave an inline review comment so the agent gets the file path and diff context.
- **Review pull requests**: Always review the documentation changes the agent creates before merging them.
- **Iterate on the same PR**: Follow-up comments on the same PR reuse the session, preserving context from earlier interactions.
9 changes: 6 additions & 3 deletions agent/index.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: "What is the agent?"
description: "Automate documentation updates with the Mintlify agent. Trigger changes from Slack messages, pull requests, Linear issues, or API calls."
description: "Automate documentation updates with the Mintlify agent. Trigger changes from GitHub PR comments, Slack messages, Linear issues, or API calls."
keywords: ["automation", "automate", "AI", "autoupdate", "maintenance"]
---

Expand All @@ -22,14 +22,14 @@ All changes go through pull requests. The agent never commits directly to your m

Use the agent to:

- Write new content based on your prompts, pull requests, Linear issues, Slack threads, or file attachments.
- Write new content based on your prompts, GitHub PR comments, Slack threads, Linear issues, or file attachments.
- Update existing documentation for new features or API changes.
- Process and include images, diagrams, and other files from Slack attachments.
- Search and revise code examples and API references across your docs.
- Automate documentation maintenance with workflows.
- Answer questions about your docs and technical writing topics.
- Address code review feedback to maintain documentation quality.
- Capture knowledge from Slack conversations and pull requests before it gets lost.
- Capture knowledge from Slack conversations, pull requests, and code reviews before it gets lost.
- Navigate and coordinate changes across multiple files and directories efficiently.

## Connect your GitHub account
Expand All @@ -42,6 +42,9 @@ The agent can only access repositories that you connect through the Mintlify Git

## Next steps

<Card title="Use on GitHub" horizontal icon="github" href="/agent/github">
Mention the agent in pull request comments.
</Card>
<Card title="Connect Slack" horizontal icon="slack" href="/agent/slack">
Add the agent to your Slack workspace.
</Card>
Expand Down
6 changes: 6 additions & 0 deletions agent/use-cases.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ keywords: ["agent workflows", "documentation workflows", "automation examples"]

The agent assists with many different documentation tasks. These examples show some of the ways you can integrate the agent into your documentation process. Try an approach that fits how your team currently works and adapt it to your specific needs.

## Document a pull request from GitHub

Comment `@mintlify` on a pull request to generate or update documentation based on the code changes. The agent reads the PR title, description, and changed files for context.

For example, comment on a PR: `@mintlify Document the new authentication endpoint added in this PR`. Then follow up with: `@mintlify Also add a code example showing the request body`.

## Iterate on a prompt in a Slack thread

Prompt the agent, then continue to mention it with `@mintlify` in the same thread to refine and iterate on the pull request that it creates.
Expand Down
1 change: 1 addition & 0 deletions docs.json
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@
"group": "Agent",
"root": "agent/index",
"pages": [
"agent/github",
"agent/slack",
"agent/linear",
"agent/notion",
Expand Down
Loading